Go to the documentation of this file.
7 implicit none ;
private
36 real,
dimension(:),
pointer :: ptr
37 integer,
intent(in) :: i1
38 integer,
optional,
intent(in) :: i2
39 if (.not.
associated(ptr))
then
51 real,
dimension(:,:),
pointer :: ptr
52 integer,
intent(in) :: ni
53 integer,
intent(in) :: nj
54 if (.not.
associated(ptr))
then
62 real,
dimension(:,:,:),
pointer :: ptr
63 integer,
intent(in) :: ni
64 integer,
intent(in) :: nj
65 integer,
intent(in) :: nk
66 if (.not.
associated(ptr))
then
67 allocate(ptr(ni,nj,nk))
74 real,
dimension(:,:),
pointer :: ptr
75 integer,
intent(in) :: is
76 integer,
intent(in) :: ie
77 integer,
intent(in) :: js
78 integer,
intent(in) :: je
79 if (.not.
associated(ptr))
then
80 allocate(ptr(is:ie,js:je))
87 real,
dimension(:,:,:),
pointer :: ptr
88 integer,
intent(in) :: is
89 integer,
intent(in) :: ie
90 integer,
intent(in) :: js
91 integer,
intent(in) :: je
92 integer,
intent(in) :: nk
93 if (.not.
associated(ptr))
then
94 allocate(ptr(is:ie,js:je,nk))
101 real,
dimension(:,:,:),
pointer :: ptr
102 integer,
intent(in) :: is
103 integer,
intent(in) :: ie
104 integer,
intent(in) :: js
105 integer,
intent(in) :: je
106 integer,
intent(in) :: ks
107 integer,
intent(in) :: ke
108 if (.not.
associated(ptr))
then
109 allocate(ptr(is:ie,js:je,ks:ke))
117 real,
dimension(:,:),
allocatable :: ptr
118 integer,
intent(in) :: is
119 integer,
intent(in) :: ie
120 integer,
intent(in) :: js
121 integer,
intent(in) :: je
122 if (.not.
allocated(ptr))
then
123 allocate(ptr(is:ie,js:je))
131 real,
dimension(:,:,:),
allocatable :: ptr
132 integer,
intent(in) :: is
133 integer,
intent(in) :: ie
134 integer,
intent(in) :: js
135 integer,
intent(in) :: je
136 integer,
intent(in) :: nk
137 if (.not.
allocated(ptr))
then
138 allocate(ptr(is:ie,js:je,nk))
145 real,
dimension(:,:,:),
allocatable :: ptr
146 integer,
intent(in) :: is
147 integer,
intent(in) :: ie
148 integer,
intent(in) :: js
149 integer,
intent(in) :: je
150 integer,
intent(in) :: ks
151 integer,
intent(in) :: ke
152 if (.not.
allocated(ptr))
then
153 allocate(ptr(is:ie,js:je,ks:ke))
Convenience functions for safely allocating memory without accidentally reallocating pointer and caus...
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.
subroutine safe_alloc_ptr_3d_3arg(ptr, ni, nj, nk)
Allocate a pointer to a 3-d array based on its dimension sizes.
subroutine safe_alloc_ptr_1d(ptr, i1, i2)
Allocate a pointer to a 1-d array.
subroutine safe_alloc_ptr_2d_2arg(ptr, ni, nj)
Allocate a pointer to a 2-d array based on its dimension sizes.
subroutine safe_alloc_allocatable_2d(ptr, is, ie, js, je)
Allocate a 2-d allocatable array based on its index starting and ending values.
Allocate a 2-d or 3-d allocatable array.
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.
Allocate a pointer to a 1-d, 2-d or 3-d array.
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.
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.
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.