MOM_safe_alloc module reference
Convenience functions for safely allocating memory without accidentally reallocating pointer and causing memory leaks.
Generic Interfaces
Allocate a pointer to a 1-d, 2-d or 3-d array |
|
Allocate a 2-d or 3-d allocatable array |
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 |
Generic Interface Documentation
- interface safe_alloc_ptr
Allocate a pointer to a 1-d, 2-d or 3-d array
Callers call graph
Text view
bfb_surface_forcing::bfb_buoyancy_forcing → mom_safe_alloc::interface::safe_alloc_ptr
dumbbell_surface_forcing::dumbbell_buoyancy_forcing → mom_safe_alloc::interface::safe_alloc_ptr
dumbbell_surface_forcing::dumbbell_dynamic_forcing → mom_safe_alloc::interface::safe_alloc_ptr
meso_surface_forcing::meso_buoyancy_forcing → mom_safe_alloc::interface::safe_alloc_ptr
mom::initialize_mom → mom_safe_alloc::interface::safe_alloc_ptr
mom_coriolisadv::coriolisadv_init → mom_safe_alloc::interface::safe_alloc_ptr
mom_diabatic_driver::diabatic_driver_init → mom_safe_alloc::interface::safe_alloc_ptr
mom_diagnostics::set_dependent_diagnostics → mom_safe_alloc::interface::safe_alloc_ptr
mom_dynamics_split_rk2::initialize_dyn_split_rk2 → mom_safe_alloc::interface::safe_alloc_ptr
mom_dynamics_split_rk2::step_mom_dyn_split_rk2 → mom_safe_alloc::interface::safe_alloc_ptr
mom_dynamics_split_rk2b::initialize_dyn_split_rk2b → mom_safe_alloc::interface::safe_alloc_ptr
mom_dynamics_split_rk2b::step_mom_dyn_split_rk2b → mom_safe_alloc::interface::safe_alloc_ptr
mom_dynamics_unsplit::step_mom_dyn_unsplit → mom_safe_alloc::interface::safe_alloc_ptr
mom_dynamics_unsplit_rk2::step_mom_dyn_unsplit_rk2 → mom_safe_alloc::interface::safe_alloc_ptr
mom_hor_visc::hor_visc_init → mom_safe_alloc::interface::safe_alloc_ptr
mom_ice_shelf::initialize_ice_shelf → mom_safe_alloc::interface::safe_alloc_ptr
mom_pressureforce_fv::pressureforce_fv_init → mom_safe_alloc::interface::safe_alloc_ptr
mom_set_visc::set_visc_register_restarts → mom_safe_alloc::interface::safe_alloc_ptr
mom_surface_forcing::set_forcing → mom_safe_alloc::interface::safe_alloc_ptr
mom_surface_forcing::surface_forcing_init → mom_safe_alloc::interface::safe_alloc_ptr
mom_thickness_diffuse::thickness_diffuse_init → mom_safe_alloc::interface::safe_alloc_ptr
mom_tracer_registry::register_tracer_diagnostics → mom_safe_alloc::interface::safe_alloc_ptr
mom_vert_friction::vertvisc_init → mom_safe_alloc::interface::safe_alloc_ptr
user_surface_forcing::user_buoyancy_forcing → mom_safe_alloc::interface::safe_alloc_ptr
- interface safe_alloc_alloc
Allocate a 2-d or 3-d allocatable array
Functions/Subroutine Documentation
- subroutine safe_alloc_ptr_1d(ptr, i1, i2)
Allocate a pointer to a 1-d array
- Parameters
ptr
A pointer to allocate
i1 [in]
The size of the array, or its starting index if i2 is present
i2 [in]
The ending index of the array
- subroutine safe_alloc_ptr_2d_2arg(ptr, ni, nj)
Allocate a pointer to a 2-d array based on its dimension sizes
- Parameters
ptr
A pointer to allocate
ni [in]
The size of the 1st dimension of the array
nj [in]
The size of the 2nd dimension of the array
- subroutine safe_alloc_ptr_3d_3arg(ptr, ni, nj, nk)
Allocate a pointer to a 3-d array based on its dimension sizes
- Parameters
ptr
A pointer to allocate
ni [in]
The size of the 1st dimension of the array
nj [in]
The size of the 2nd dimension of the array
nk [in]
The size of the 3rd dimension of the array
- 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
- Parameters
ptr
A pointer to allocate
is [in]
The start index to allocate for the 1st dimension
ie [in]
The end index to allocate for the 1st dimension
js [in]
The start index to allocate for the 2nd dimension
je [in]
The end index to allocate for the 2nd dimension
- 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
- Parameters
ptr
A pointer to allocate
is [in]
The start index to allocate for the 1st dimension
ie [in]
The end index to allocate for the 1st dimension
js [in]
The start index to allocate for the 2nd dimension
je [in]
The end index to allocate for the 2nd dimension
nk [in]
The size to allocate for the 3rd dimension
- 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
- Parameters
ptr
A pointer to allocate
is [in]
The start index to allocate for the 1st dimension
ie [in]
The end index to allocate for the 1st dimension
js [in]
The start index to allocate for the 2nd dimension
je [in]
The end index to allocate for the 2nd dimension
ks [in]
The start index to allocate for the 3rd dimension
ke [in]
The end index to allocate for the 3rd dimension
- subroutine 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
An allocatable array to allocate
is [in]
The start index to allocate for the 1st dimension
ie [in]
The end index to allocate for the 1st dimension
js [in]
The start index to allocate for the 2nd dimension
je [in]
The end index to allocate for the 2nd dimension
- 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
- Parameters
ptr
An allocatable array to allocate
is [in]
The start index to allocate for the 1st dimension
ie [in]
The end index to allocate for the 1st dimension
js [in]
The start index to allocate for the 2nd dimension
je [in]
The end index to allocate for the 2nd dimension
nk [in]
The size to allocate for the 3rd dimension
- 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
- Parameters
ptr
An allocatable array to allocate
is [in]
The start index to allocate for the 1st dimension
ie [in]
The end index to allocate for the 1st dimension
js [in]
The start index to allocate for the 2nd dimension
je [in]
The end index to allocate for the 2nd dimension
ks [in]
The start index to allocate for the 3rd dimension
ke [in]
The end index to allocate for the 3rd dimension