17 character(len=LENVARNAME) :: name
18 character(len=LENVARNAME) :: mastername =
'none'
19 character(len=LENMEMPATH) :: path
20 character(len=LENMEMPATH) :: masterpath =
'none'
21 character(len=LENMEMTYPE) :: memtype
23 integer(I4B) :: nrealloc = 0
24 integer(I4B) :: isize = -1
25 integer(I4B) :: element_size = 0
26 integer(I4B) :: set_handler_idx = 0
27 logical(LGP) :: master = .true.
28 character(len=:),
pointer :: strsclr => null()
29 logical(LGP),
pointer :: logicalsclr => null()
30 integer(I4B),
pointer :: intsclr => null()
31 real(dp),
pointer :: dblsclr => null()
35 class(*),
dimension(:),
pointer,
contiguous :: astr1d => null()
36 logical(LGP),
dimension(:),
pointer,
contiguous :: alogical1d => null()
37 integer(I4B),
dimension(:),
pointer,
contiguous :: aint1d => null()
38 integer(I4B),
dimension(:, :),
pointer,
contiguous :: aint2d => null()
39 integer(I4B),
dimension(:, :, :),
pointer,
contiguous :: aint3d => null()
40 real(dp),
dimension(:),
pointer,
contiguous :: adbl1d => null()
41 real(dp),
dimension(:, :),
pointer,
contiguous :: adbl2d => null()
42 real(dp),
dimension(:, :, :),
pointer,
contiguous :: adbl3d => null()
58 character(len=16) :: cmem
59 character(len=LENMEMADDRESS) :: cptr
64 ipos = index(this%memtype,
' (')
68 ipos = min(16, ipos - 1)
70 cmem = this%memtype(1:ipos)
74 if (.not. this%master)
then
79 call memtab%add_term(this%path)
80 call memtab%add_term(this%name)
81 call memtab%add_term(cmem)
82 call memtab%add_term(this%isize)
83 call memtab%add_term(cptr)
90 if (
associated(this%strsclr)) al = .true.
91 if (
associated(this%logicalsclr)) al = .true.
92 if (
associated(this%intsclr)) al = .true.
93 if (
associated(this%dblsclr)) al = .true.
94 if (
associated(this%alogical1d)) al = .true.
95 if (
associated(this%astr1d)) al = .true.
96 if (
associated(this%aint1d)) al = .true.
97 if (
associated(this%aint2d)) al = .true.
98 if (
associated(this%aint3d)) al = .true.
99 if (
associated(this%adbl1d)) al = .true.
100 if (
associated(this%adbl2d)) al = .true.
101 if (
associated(this%adbl3d)) al = .true.
102 if (
associated(this%acharstr1d)) al = .true.
106 use iso_c_binding,
only: c_loc, c_ptr, c_null_ptr, c_f_pointer
111 character(len=1),
dimension(:),
pointer :: astr1d
113 if (
associated(this%strsclr))
then
114 if (this%master)
deallocate (this%strsclr)
115 nullify (this%strsclr)
118 if (
associated(this%logicalsclr))
then
119 if (this%master)
deallocate (this%logicalsclr)
120 nullify (this%logicalsclr)
123 if (
associated(this%intsclr))
then
124 if (this%master)
deallocate (this%intsclr)
125 nullify (this%intsclr)
128 if (
associated(this%dblsclr))
then
129 if (this%master)
deallocate (this%dblsclr)
130 nullify (this%dblsclr)
141 if (
associated(this%astr1d))
then
142 select type (item => this%astr1d)
143 type is (
character(*))
149 call c_f_pointer(cptr, astr1d, [this%isize * this%element_size])
151 #if __GFORTRAN__ && ((__GNUC__ < 13) || (__GNUC__ == 13 && __GNUC_MINOR__ < 3))
152 if (this%master)
deallocate (astr1d)
154 if (this%master)
deallocate (this%astr1d)
157 nullify (this%astr1d)
160 if (
associated(this%alogical1d))
then
161 if (this%master)
deallocate (this%alogical1d)
162 nullify (this%alogical1d)
165 if (
associated(this%aint1d))
then
166 if (this%master)
deallocate (this%aint1d)
167 nullify (this%aint1d)
170 if (
associated(this%aint2d))
then
171 if (this%master)
deallocate (this%aint2d)
172 nullify (this%aint2d)
175 if (
associated(this%aint3d))
then
176 if (this%master)
deallocate (this%aint3d)
177 nullify (this%aint3d)
180 if (
associated(this%adbl1d))
then
181 if (this%master)
deallocate (this%adbl1d)
182 nullify (this%adbl1d)
185 if (
associated(this%adbl2d))
then
186 if (this%master)
deallocate (this%adbl2d)
187 nullify (this%adbl2d)
190 if (
associated(this%adbl3d))
then
191 if (this%master)
deallocate (this%adbl3d)
192 nullify (this%adbl3d)
195 if (
associated(this%acharstr1d))
then
196 if (this%master)
then
197 do n = 1,
size(this%acharstr1d)
198 call this%acharstr1d(n)%destroy()
200 deallocate (this%acharstr1d)
202 nullify (this%acharstr1d)
This module contains simulation constants.
@ tabcenter
centered table column
@ tabright
right justified table column
@ tableft
left justified table column
integer(i4b), parameter lenmemaddress
maximum length of the full memory address, including variable name
@ tabstring
string table data
@ tabinteger
integer table data
integer(i4b), parameter lentimeseriesname
maximum length of a time series name
integer(i4b), parameter lenvarname
maximum length of a variable name
integer(i4b), parameter, public maxmemrank
maximum memory manager length (up to 3-dimensional arrays)
integer(i4b), parameter, public lenmemtype
maximum length of a memory manager type
integer(i4b), parameter lenmempath
maximum length of the memory path
This module defines variable data types.
character(len=lenmemaddress) function create_mem_address(mem_path, var_name)
returns the address string of the memory object
subroutine mt_deallocate(this)
subroutine table_entry(this, memtab)
logical function mt_associated(this)
This class is used to store a single deferred-length character string. It was designed to work in an ...