MOM6
mom_safe_alloc::safe_alloc_alloc Interface Reference

Detailed Description

Allocate a 2-d or 3-d allocatable array.

Definition at line 18 of file MOM_safe_alloc.F90.

Private functions

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_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_6arg (ptr, is, ie, js, je, ks, ke)
 Allocate a 3-d allocatable array based on its 6 index starting and ending values. More...
 

Functions and subroutines

◆ safe_alloc_allocatable_2d()

subroutine mom_safe_alloc::safe_alloc_alloc::safe_alloc_allocatable_2d ( real, dimension(:,:), allocatable  ptr,
integer, intent(in)  is,
integer, intent(in)  ie,
integer, intent(in)  js,
integer, intent(in)  je 
)
private

Allocate a 2-d allocatable array based on its index starting and ending values.

Parameters
ptrAn allocatable array to allocate
[in]isThe start index to allocate for the 1st dimension
[in]ieThe end index to allocate for the 1st dimension
[in]jsThe start index to allocate for the 2nd dimension
[in]jeThe end index to allocate for the 2nd dimension

Definition at line 117 of file MOM_safe_alloc.F90.

117  real, dimension(:,:), allocatable :: ptr !< An allocatable array to allocate
118  integer, intent(in) :: is !< The start index to allocate for the 1st dimension
119  integer, intent(in) :: ie !< The end index to allocate for the 1st dimension
120  integer, intent(in) :: js !< The start index to allocate for the 2nd dimension
121  integer, intent(in) :: je !< The end index to allocate for the 2nd dimension
122  if (.not.allocated(ptr)) then
123  allocate(ptr(is:ie,js:je))
124  ptr(:,:) = 0.0
125  endif

◆ safe_alloc_allocatable_3d()

subroutine mom_safe_alloc::safe_alloc_alloc::safe_alloc_allocatable_3d ( real, dimension(:,:,:), allocatable  ptr,
integer, intent(in)  is,
integer, intent(in)  ie,
integer, intent(in)  js,
integer, intent(in)  je,
integer, intent(in)  nk 
)
private

Allocate a 3-d allocatable array based on its index starting and ending values and k-index size.

Parameters
ptrAn allocatable array to allocate
[in]isThe start index to allocate for the 1st dimension
[in]ieThe end index to allocate for the 1st dimension
[in]jsThe start index to allocate for the 2nd dimension
[in]jeThe end index to allocate for the 2nd dimension
[in]nkThe size to allocate for the 3rd dimension

Definition at line 131 of file MOM_safe_alloc.F90.

131  real, dimension(:,:,:), allocatable :: ptr !< An allocatable array to allocate
132  integer, intent(in) :: is !< The start index to allocate for the 1st dimension
133  integer, intent(in) :: ie !< The end index to allocate for the 1st dimension
134  integer, intent(in) :: js !< The start index to allocate for the 2nd dimension
135  integer, intent(in) :: je !< The end index to allocate for the 2nd dimension
136  integer, intent(in) :: nk !< The size to allocate for the 3rd dimension
137  if (.not.allocated(ptr)) then
138  allocate(ptr(is:ie,js:je,nk))
139  ptr(:,:,:) = 0.0
140  endif

◆ safe_alloc_allocatable_3d_6arg()

subroutine mom_safe_alloc::safe_alloc_alloc::safe_alloc_allocatable_3d_6arg ( real, dimension(:,:,:), allocatable  ptr,
integer, intent(in)  is,
integer, intent(in)  ie,
integer, intent(in)  js,
integer, intent(in)  je,
integer, intent(in)  ks,
integer, intent(in)  ke 
)
private

Allocate a 3-d allocatable array based on its 6 index starting and ending values.

Parameters
ptrAn allocatable array to allocate
[in]isThe start index to allocate for the 1st dimension
[in]ieThe end index to allocate for the 1st dimension
[in]jsThe start index to allocate for the 2nd dimension
[in]jeThe end index to allocate for the 2nd dimension
[in]ksThe start index to allocate for the 3rd dimension
[in]keThe end index to allocate for the 3rd dimension

Definition at line 145 of file MOM_safe_alloc.F90.

145  real, dimension(:,:,:), allocatable :: ptr !< An allocatable array to allocate
146  integer, intent(in) :: is !< The start index to allocate for the 1st dimension
147  integer, intent(in) :: ie !< The end index to allocate for the 1st dimension
148  integer, intent(in) :: js !< The start index to allocate for the 2nd dimension
149  integer, intent(in) :: je !< The end index to allocate for the 2nd dimension
150  integer, intent(in) :: ks !< The start index to allocate for the 3rd dimension
151  integer, intent(in) :: ke !< The end index to allocate for the 3rd dimension
152  if (.not.allocated(ptr)) then
153  allocate(ptr(is:ie,js:je,ks:ke))
154  ptr(:,:,:) = 0.0
155  endif

The documentation for this interface was generated from the following file: