MOM6
|
Convenience functions for safely allocating memory without accidentally reallocating pointer and causing memory leaks.
Data Types | |
interface | safe_alloc_alloc |
Allocate a 2-d or 3-d allocatable array. More... | |
interface | safe_alloc_ptr |
Allocate a pointer to a 1-d, 2-d or 3-d array. More... | |
Functions/Subroutines | |
subroutine | safe_alloc_ptr_1d (ptr, i1, i2) |
Allocate a pointer to a 1-d array. More... | |
subroutine | safe_alloc_ptr_2d_2arg (ptr, ni, nj) |
Allocate a pointer to a 2-d array based on its dimension sizes. More... | |
subroutine | safe_alloc_ptr_3d_3arg (ptr, ni, nj, nk) |
Allocate a pointer to a 3-d array based on its dimension sizes. More... | |
subroutine | safe_alloc_ptr_2d (ptr, is, ie, js, je) |
Allocate a pointer to a 2-d array based on its index starting and ending values. More... | |
subroutine | safe_alloc_ptr_3d (ptr, is, ie, js, je, nk) |
Allocate a pointer to a 3-d array based on its index starting and ending values. More... | |
subroutine | safe_alloc_ptr_3d_6arg (ptr, is, ie, js, je, ks, ke) |
Allocate a pointer to a 3-d array based on its index starting and ending values. More... | |
subroutine | safe_alloc_allocatable_2d (ptr, is, ie, js, je) |
Allocate a 2-d allocatable array based on its index starting and ending values. More... | |
subroutine | safe_alloc_allocatable_3d (ptr, is, ie, js, je, nk) |
Allocate a 3-d allocatable array based on its index starting and ending values and k-index size. More... | |
subroutine | safe_alloc_allocatable_3d_6arg (ptr, is, ie, js, je, ks, ke) |
Allocate a 3-d allocatable array based on its 6 index starting and ending values. More... | |
|
private |
Allocate a 2-d allocatable array based on its index starting and ending values.
ptr | An allocatable array to allocate | |
[in] | is | The start index to allocate for the 1st dimension |
[in] | ie | The end index to allocate for the 1st dimension |
[in] | js | The start index to allocate for the 2nd dimension |
[in] | je | The end index to allocate for the 2nd dimension |
Definition at line 117 of file MOM_safe_alloc.F90.
|
private |
Allocate a 3-d allocatable array based on its index starting and ending values and k-index size.
ptr | An allocatable array to allocate | |
[in] | is | The start index to allocate for the 1st dimension |
[in] | ie | The end index to allocate for the 1st dimension |
[in] | js | The start index to allocate for the 2nd dimension |
[in] | je | The end index to allocate for the 2nd dimension |
[in] | nk | The size to allocate for the 3rd dimension |
Definition at line 131 of file MOM_safe_alloc.F90.
|
private |
Allocate a 3-d allocatable array based on its 6 index starting and ending values.
ptr | An allocatable array to allocate | |
[in] | is | The start index to allocate for the 1st dimension |
[in] | ie | The end index to allocate for the 1st dimension |
[in] | js | The start index to allocate for the 2nd dimension |
[in] | je | The end index to allocate for the 2nd dimension |
[in] | ks | The start index to allocate for the 3rd dimension |
[in] | ke | The end index to allocate for the 3rd dimension |
Definition at line 145 of file MOM_safe_alloc.F90.
|
private |
Allocate a pointer to a 1-d array.
ptr | A pointer to allocate | |
[in] | i1 | The size of the array, or its starting index if i2 is present |
[in] | i2 | The ending index of the array |
Definition at line 36 of file MOM_safe_alloc.F90.
|
private |
Allocate a pointer to a 2-d array based on its index starting and ending values.
ptr | A pointer to allocate | |
[in] | is | The start index to allocate for the 1st dimension |
[in] | ie | The end index to allocate for the 1st dimension |
[in] | js | The start index to allocate for the 2nd dimension |
[in] | je | The end index to allocate for the 2nd dimension |
Definition at line 74 of file MOM_safe_alloc.F90.
|
private |
Allocate a pointer to a 2-d array based on its dimension sizes.
ptr | A pointer to allocate | |
[in] | ni | The size of the 1st dimension of the array |
[in] | nj | The size of the 2nd dimension of the array |
Definition at line 51 of file MOM_safe_alloc.F90.
|
private |
Allocate a pointer to a 3-d array based on its index starting and ending values.
ptr | A pointer to allocate | |
[in] | is | The start index to allocate for the 1st dimension |
[in] | ie | The end index to allocate for the 1st dimension |
[in] | js | The start index to allocate for the 2nd dimension |
[in] | je | The end index to allocate for the 2nd dimension |
[in] | nk | The size to allocate for the 3rd dimension |
Definition at line 87 of file MOM_safe_alloc.F90.
|
private |
Allocate a pointer to a 3-d array based on its dimension sizes.
ptr | A pointer to allocate | |
[in] | ni | The size of the 1st dimension of the array |
[in] | nj | The size of the 2nd dimension of the array |
[in] | nk | The size of the 3rd dimension of the array |
Definition at line 62 of file MOM_safe_alloc.F90.
|
private |
Allocate a pointer to a 3-d array based on its index starting and ending values.
ptr | A pointer to allocate | |
[in] | is | The start index to allocate for the 1st dimension |
[in] | ie | The end index to allocate for the 1st dimension |
[in] | js | The start index to allocate for the 2nd dimension |
[in] | je | The end index to allocate for the 2nd dimension |
[in] | ks | The start index to allocate for the 3rd dimension |
[in] | ke | The end index to allocate for the 3rd dimension |
Definition at line 101 of file MOM_safe_alloc.F90.