29 character(len=*),
intent(in) :: component
30 character(len=*),
intent(in),
optional :: subcomponent
31 character(len=*),
intent(in),
optional :: context
32 character(len=LENMEMPATH) :: memory_path
35 logical(LGP) :: removed
43 do while (itr%has_next())
46 if (mt%path == memory_path .and. mt%mt_associated())
then
47 call mt%mt_deallocate()
59 logical(LGP),
pointer,
intent(inout) :: p_mem
60 character(len=*),
intent(in) :: varname
61 character(len=*),
intent(in) :: memory_path
62 logical(LGP),
intent(inout) :: found
64 logical(LGP) :: checkfail = .false.
67 if (.not. found)
return
68 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'INTEGER')
then
69 if (mt%intsclr == 0)
then
80 integer(I4B),
pointer,
intent(inout) :: p_mem
81 character(len=*),
intent(in) :: varname
82 character(len=*),
intent(in) :: memory_path
83 logical(LGP),
intent(inout) :: found
85 logical(LGP) :: checkfail = .false.
88 if (.not. found)
return
89 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'INTEGER')
then
95 integer(I4B),
pointer,
intent(inout) :: p_mem
96 character(len=*),
intent(in) :: varname
97 character(len=*),
intent(in) :: memory_path
98 integer(I4B),
intent(in) :: setval
99 logical(LGP),
intent(inout) :: found
101 logical(LGP) :: checkfail = .false.
104 if (.not. found)
return
112 integer(I4B),
pointer,
intent(inout) :: p_mem
113 character(len=*),
intent(in) :: varname
114 character(len=*),
intent(in) :: memory_path
115 character(len=*),
dimension(:),
intent(in) :: str_list
116 logical(LGP),
intent(inout) :: found
118 logical(LGP) :: checkfail = .false.
122 if (.not. found)
return
123 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'STRING')
then
124 do i = 1,
size(str_list)
125 if (mt%strsclr == str_list(i))
then
135 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: p_mem
136 character(len=*),
intent(in) :: varname
137 character(len=*),
intent(in) :: memory_path
138 logical(LGP),
intent(inout) :: found
140 logical(LGP) :: checkfail = .false.
144 if (.not. found)
return
145 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'INTEGER')
then
146 if (
size(mt%aint1d) /=
size(p_mem))
then
147 call store_error(
'mem_set_value() size mismatch int1d, varname='//&
148 &trim(varname), terminate=.true.)
150 do n = 1,
size(mt%aint1d)
151 p_mem(n) = mt%aint1d(n)
160 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: p_mem
161 character(len=*),
intent(in) :: varname
162 character(len=*),
intent(in) :: memory_path
163 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: map
164 logical(LGP),
intent(inout) :: found
166 logical(LGP) :: checkfail = .false.
170 if (.not. found)
return
171 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'INTEGER')
then
172 if (
associated(map))
then
173 do n = 1,
size(p_mem)
174 p_mem(n) = mt%aint1d(map(n))
177 if (
size(mt%aint1d) /=
size(p_mem))
then
178 call store_error(
'mem_set_value() size mismatch int1d, varname='//&
179 &trim(varname), terminate=.true.)
181 do n = 1,
size(mt%aint1d)
182 p_mem(n) = mt%aint1d(n)
191 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: p_mem
192 character(len=*),
intent(in) :: varname
193 character(len=*),
intent(in) :: memory_path
194 logical(LGP),
intent(inout) :: found
196 logical(LGP) :: checkfail = .false.
200 if (.not. found)
return
201 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'INTEGER')
then
202 if (
size(mt%aint2d, dim=1) /=
size(p_mem, dim=1) .or. &
203 size(mt%aint2d, dim=2) /=
size(p_mem, dim=2))
then
204 call store_error(
'mem_set_value() size mismatch int2d, varname='//&
205 &trim(varname), terminate=.true.)
207 do j = 1,
size(mt%aint2d, dim=2)
208 do i = 1,
size(mt%aint2d, dim=1)
209 p_mem(i, j) = mt%aint2d(i, j)
218 integer(I4B),
dimension(:, :, :),
pointer,
contiguous,
intent(inout) :: p_mem
219 character(len=*),
intent(in) :: varname
220 character(len=*),
intent(in) :: memory_path
221 logical(LGP),
intent(inout) :: found
223 logical(LGP) :: checkfail = .false.
224 integer(I4B) :: i, j, k
227 if (.not. found)
return
228 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'INTEGER')
then
229 if (
size(mt%aint3d, dim=1) /=
size(p_mem, dim=1) .or. &
230 size(mt%aint3d, dim=2) /=
size(p_mem, dim=2) .or. &
231 size(mt%aint3d, dim=3) /=
size(p_mem, dim=3))
then
232 call store_error(
'mem_set_value() size mismatch int3d, varname='//&
233 &trim(varname), terminate=.true.)
235 do k = 1,
size(mt%aint3d, dim=3)
236 do j = 1,
size(mt%aint3d, dim=2)
237 do i = 1,
size(mt%aint3d, dim=1)
238 p_mem(i, j, k) = mt%aint3d(i, j, k)
248 real(DP),
pointer,
intent(inout) :: p_mem
249 character(len=*),
intent(in) :: varname
250 character(len=*),
intent(in) :: memory_path
251 logical(LGP),
intent(inout) :: found
253 logical(LGP) :: checkfail = .false.
256 if (.not. found)
return
257 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'DOUBLE')
then
265 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: p_mem
266 character(len=*),
intent(in) :: varname
267 character(len=*),
intent(in) :: memory_path
268 logical(LGP),
intent(inout) :: found
270 logical(LGP) :: checkfail = .false.
274 if (.not. found)
return
275 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'DOUBLE')
then
276 if (
size(mt%adbl1d) /=
size(p_mem))
then
277 call store_error(
'mem_set_value() size mismatch dbl1d, varname='//&
278 &trim(varname), terminate=.true.)
280 do n = 1,
size(mt%adbl1d)
281 p_mem(n) = mt%adbl1d(n)
290 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: p_mem
291 character(len=*),
intent(in) :: varname
292 character(len=*),
intent(in) :: memory_path
293 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: map
294 logical(LGP),
intent(inout) :: found
296 logical(LGP) :: checkfail = .false.
300 if (.not. found)
return
301 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'DOUBLE')
then
302 if (
associated(map))
then
303 do n = 1,
size(p_mem)
304 p_mem(n) = mt%adbl1d(map(n))
307 if (
size(mt%adbl1d) /=
size(p_mem))
then
308 call store_error(
'mem_set_value() size mismatch dbl1d, varname='//&
309 &trim(varname), terminate=.true.)
311 do n = 1,
size(mt%adbl1d)
312 p_mem(n) = mt%adbl1d(n)
321 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: p_mem
322 character(len=*),
intent(in) :: varname
323 character(len=*),
intent(in) :: memory_path
324 logical(LGP),
intent(inout) :: found
326 logical(LGP) :: checkfail = .false.
330 if (.not. found)
return
331 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'DOUBLE')
then
332 if (
size(mt%adbl2d, dim=1) /=
size(p_mem, dim=1) .or. &
333 size(mt%adbl2d, dim=2) /=
size(p_mem, dim=2))
then
334 call store_error(
'mem_set_value() size mismatch dbl2d, varname='//&
335 &trim(varname), terminate=.true.)
337 do j = 1,
size(mt%adbl2d, dim=2)
338 do i = 1,
size(mt%adbl2d, dim=1)
339 p_mem(i, j) = mt%adbl2d(i, j)
348 real(DP),
dimension(:, :, :),
pointer,
contiguous,
intent(inout) :: p_mem
349 character(len=*),
intent(in) :: varname
350 character(len=*),
intent(in) :: memory_path
351 logical(LGP),
intent(inout) :: found
353 logical(LGP) :: checkfail = .false.
354 integer(I4B) :: i, j, k
357 if (.not. found)
return
358 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'DOUBLE')
then
359 if (
size(mt%adbl3d, dim=1) /=
size(p_mem, dim=1) .or. &
360 size(mt%adbl3d, dim=2) /=
size(p_mem, dim=2) .or. &
361 size(mt%adbl3d, dim=3) /=
size(p_mem, dim=3))
then
362 call store_error(
'mem_set_value() size mismatch dbl3d, varname='//&
363 &trim(varname), terminate=.true.)
365 do k = 1,
size(mt%adbl3d, dim=3)
366 do j = 1,
size(mt%adbl3d, dim=2)
367 do i = 1,
size(mt%adbl3d, dim=1)
368 p_mem(i, j, k) = mt%adbl3d(i, j, k)
376 character(len=*),
intent(inout) :: p_mem
377 character(len=*),
intent(in) :: varname
378 character(len=*),
intent(in) :: memory_path
379 logical(LGP),
intent(inout) :: found
381 logical(LGP) :: checkfail = .false.
384 if (.not. found)
return
385 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'STRING')
then
393 pointer,
contiguous,
intent(inout) :: p_mem
394 character(len=*),
intent(in) :: varname
395 character(len=*),
intent(in) :: memory_path
396 logical(LGP),
intent(inout) :: found
398 logical(LGP) :: checkfail = .false.
402 if (.not. found)
return
403 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'STRING')
then
404 do n = 1,
size(mt%acharstr1d)
405 p_mem(n) = mt%acharstr1d(n)
This module contains simulation constants.
integer(i4b), parameter lenmempath
maximum length of the memory path
This module defines variable data types.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
subroutine mem_set_value_logical(p_mem, varname, memory_path, found)
Set pointer to value of memory list logical variable.
subroutine, public memorystore_remove(component, subcomponent, context)
subroutine mem_set_value_dbl3d(p_mem, varname, memory_path, found)
Set pointer to value of memory list 3d dbl array variable.
subroutine mem_set_value_dbl(p_mem, varname, memory_path, found)
Set pointer to value of memory list double variable.
subroutine mem_set_value_int(p_mem, varname, memory_path, found)
Set pointer to value of memory list int variable.
subroutine mem_set_value_charstr1d(p_mem, varname, memory_path, found)
subroutine mem_set_value_str_mapped_int(p_mem, varname, memory_path, str_list, found)
subroutine mem_set_value_int_setval(p_mem, varname, memory_path, setval, found)
subroutine mem_set_value_int2d(p_mem, varname, memory_path, found)
Set pointer to value of memory list 2d int array variable.
subroutine mem_set_value_int3d(p_mem, varname, memory_path, found)
Set pointer to value of memory list 3d int array variable.
subroutine mem_set_value_str(p_mem, varname, memory_path, found)
subroutine mem_set_value_int1d_mapped(p_mem, varname, memory_path, map, found)
Set pointer to value of memory list 1d int array variable with mapping.
subroutine mem_set_value_dbl2d(p_mem, varname, memory_path, found)
Set pointer to value of memory list 2d dbl array variable.
subroutine mem_set_value_dbl1d(p_mem, varname, memory_path, found)
Set pointer to value of memory list 1d dbl array variable.
subroutine mem_set_value_int1d(p_mem, varname, memory_path, found)
Set pointer to value of memory list 1d int array variable.
subroutine mem_set_value_dbl1d_mapped(p_mem, varname, memory_path, map, found)
Set pointer to value of memory list 1d dbl array variable with mapping.
type(memorystoretype), public memorystore
subroutine, public get_from_memorystore(name, mem_path, mt, found, check)
@ brief Get a memory type entry from the memory list
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
This class is used to store a single deferred-length character string. It was designed to work in an ...
An iterator used to iterate through a MemoryContainer.