mom_safe_alloc module reference
Convenience functions for safely allocating memory without accidentally reallocating pointer and causing memory leaks.
Functions/Subroutines
Allocate a pointer to a 1-d array. |
|
Allocate a pointer to a 2-d array based on its dimension sizes. |
|
Allocate a pointer to a 3-d array based on its dimension sizes. |
|
Allocate a pointer to a 2-d array based on its index starting and ending values. |
|
Allocate a pointer to a 3-d array based on its index starting and ending values. |
|
Allocate a pointer to a 3-d array based on its index starting and ending values. |
|
Allocate a 2-d allocatable array based on its index starting and ending values. |
|
Allocate a 3-d allocatable array based on its index starting and ending values and k-index size. |
|
Allocate a 3-d allocatable array based on its 6 index starting and ending values. |
Detailed Description
Convenience functions for safely allocating memory without accidentally reallocating pointer and causing memory leaks.
Function/Subroutine Documentation
- subroutine mom_safe_alloc/safe_alloc_ptr_1d(ptr, i1, i2)
Allocate a pointer to a 1-d array.
- Parameters:
ptr ::
ptrA pointer to allocatei1 ::
i1[in] The size of the array, or its starting index if i2 is presenti2 ::
i2[in] The ending index of the array
- subroutine mom_safe_alloc/safe_alloc_ptr_2d_2arg(ptr, ni, nj)
Allocate a pointer to a 2-d array based on its dimension sizes.
- Parameters:
ptr ::
ptrA pointer to allocateni ::
ni[in] The size of the 1st dimension of the arraynj ::
nj[in] The size of the 2nd dimension of the array
- subroutine mom_safe_alloc/safe_alloc_ptr_3d_3arg(ptr, ni, nj, nk)
Allocate a pointer to a 3-d array based on its dimension sizes.
- Parameters:
ptr ::
ptrA pointer to allocateni ::
ni[in] The size of the 1st dimension of the arraynj ::
nj[in] The size of the 2nd dimension of the arraynk ::
nk[in] The size of the 3rd dimension of the array
- subroutine mom_safe_alloc/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.
- Parameters:
ptr ::
ptrA pointer to allocateis ::
is[in] The start index to allocate for the 1st dimensionie ::
ie[in] The end index to allocate for the 1st dimensionjs ::
js[in] The start index to allocate for the 2nd dimensionje ::
je[in] The end index to allocate for the 2nd dimension
- subroutine mom_safe_alloc/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.
- Parameters:
ptr ::
ptrA pointer to allocateis ::
is[in] The start index to allocate for the 1st dimensionie ::
ie[in] The end index to allocate for the 1st dimensionjs ::
js[in] The start index to allocate for the 2nd dimensionje ::
je[in] The end index to allocate for the 2nd dimensionnk ::
nk[in] The size to allocate for the 3rd dimension
- subroutine mom_safe_alloc/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.
- Parameters:
ptr ::
ptrA pointer to allocateis ::
is[in] The start index to allocate for the 1st dimensionie ::
ie[in] The end index to allocate for the 1st dimensionjs ::
js[in] The start index to allocate for the 2nd dimensionje ::
je[in] The end index to allocate for the 2nd dimensionks ::
ks[in] The start index to allocate for the 3rd dimensionke ::
ke[in] The end index to allocate for the 3rd dimension
- subroutine mom_safe_alloc/safe_alloc_allocatable_2d(ptr, is, ie, js, je)
Allocate a 2-d allocatable array based on its index starting and ending values.
- Parameters:
ptr ::
ptrAn allocatable array to allocateis ::
is[in] The start index to allocate for the 1st dimensionie ::
ie[in] The end index to allocate for the 1st dimensionjs ::
js[in] The start index to allocate for the 2nd dimensionje ::
je[in] The end index to allocate for the 2nd dimension
- subroutine mom_safe_alloc/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.
- Parameters:
ptr ::
ptrAn allocatable array to allocateis ::
is[in] The start index to allocate for the 1st dimensionie ::
ie[in] The end index to allocate for the 1st dimensionjs ::
js[in] The start index to allocate for the 2nd dimensionje ::
je[in] The end index to allocate for the 2nd dimensionnk ::
nk[in] The size to allocate for the 3rd dimension
- subroutine mom_safe_alloc/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.
- Parameters:
ptr ::
ptrAn allocatable array to allocateis ::
is[in] The start index to allocate for the 1st dimensionie ::
ie[in] The end index to allocate for the 1st dimensionjs ::
js[in] The start index to allocate for the 2nd dimensionje ::
je[in] The end index to allocate for the 2nd dimensionks ::
ks[in] The start index to allocate for the 3rd dimensionke ::
ke[in] The end index to allocate for the 3rd dimension