30 character(len=*),
intent(in) :: component
31 character(len=*),
intent(in),
optional :: subcomponent
32 character(len=*),
intent(in),
optional :: context
33 character(len=LENMEMPATH) :: memory_path
36 logical(LGP) :: removed
44 do while (itr%has_next())
47 if (mt%path == memory_path .and. mt%mt_associated())
then
48 call mt%mt_deallocate()
60 logical(LGP),
pointer,
intent(inout) :: p_mem
61 character(len=*),
intent(in) :: varname
62 character(len=*),
intent(in) :: memory_path
63 logical(LGP),
intent(inout) :: found
65 logical(LGP) :: checkfail = .false.
68 if (.not. found)
return
69 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'INTEGER')
then
70 if (mt%intsclr == 0)
then
81 integer(I4B),
pointer,
intent(inout) :: p_mem
82 character(len=*),
intent(in) :: varname
83 character(len=*),
intent(in) :: memory_path
84 logical(LGP),
intent(inout) :: found
86 logical(LGP) :: checkfail = .false.
89 if (.not. found)
return
90 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'INTEGER')
then
96 integer(I4B),
pointer,
intent(inout) :: p_mem
97 character(len=*),
intent(in) :: varname
98 character(len=*),
intent(in) :: memory_path
99 integer(I4B),
intent(in) :: setval
100 logical(LGP),
intent(inout) :: found
102 logical(LGP) :: checkfail = .false.
105 if (.not. found)
return
113 integer(I4B),
pointer,
intent(inout) :: p_mem
114 character(len=*),
intent(in) :: varname
115 character(len=*),
intent(in) :: memory_path
116 character(len=*),
dimension(:),
intent(in) :: str_list
117 logical(LGP),
intent(inout) :: found
119 logical(LGP) :: checkfail = .false.
123 if (.not. found)
return
124 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'STRING')
then
125 do i = 1,
size(str_list)
126 if (mt%strsclr == str_list(i))
then
136 logical(LGP),
dimension(:),
pointer,
contiguous,
intent(inout) :: p_mem
137 character(len=*),
intent(in) :: varname
138 character(len=*),
intent(in) :: memory_path
139 logical(LGP),
intent(inout) :: found
141 logical(LGP) :: checkfail = .false.
145 if (.not. found)
return
146 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'LOGICAL')
then
147 if (
size(mt%alogical1d) /=
size(p_mem))
then
148 call store_error(
'mem_set_value() size mismatch logical1d, varname='//&
149 &trim(varname), terminate=.true.)
151 do n = 1,
size(mt%alogical1d)
152 p_mem(n) = mt%alogical1d(n)
161 logical(LGP),
dimension(:),
pointer,
contiguous,
intent(inout) :: p_mem
162 character(len=*),
intent(in) :: varname
163 character(len=*),
intent(in) :: memory_path
164 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: map
165 logical(LGP),
intent(inout) :: found
167 logical(LGP) :: checkfail = .false.
171 if (.not. found)
return
172 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'LOGICAL')
then
173 if (
associated(map))
then
174 do n = 1,
size(p_mem)
175 p_mem(n) = mt%alogical1d(map(n))
178 if (
size(mt%alogical1d) /=
size(p_mem))
then
179 call store_error(
'mem_set_value() size mismatch logical1d, varname='//&
180 &trim(varname), terminate=.true.)
182 do n = 1,
size(mt%alogical1d)
183 p_mem(n) = mt%alogical1d(n)
192 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: p_mem
193 character(len=*),
intent(in) :: varname
194 character(len=*),
intent(in) :: memory_path
195 logical(LGP),
intent(inout) :: found
197 logical(LGP) :: checkfail = .false.
201 if (.not. found)
return
202 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'INTEGER')
then
203 if (
size(mt%aint1d) /=
size(p_mem))
then
204 call store_error(
'mem_set_value() size mismatch int1d, varname='//&
205 &trim(varname), terminate=.true.)
207 do n = 1,
size(mt%aint1d)
208 p_mem(n) = mt%aint1d(n)
217 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: p_mem
218 character(len=*),
intent(in) :: varname
219 character(len=*),
intent(in) :: memory_path
220 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: map
221 logical(LGP),
intent(inout) :: found
223 logical(LGP) :: checkfail = .false.
227 if (.not. found)
return
228 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'INTEGER')
then
229 if (
associated(map))
then
230 do n = 1,
size(p_mem)
231 p_mem(n) = mt%aint1d(map(n))
234 if (
size(mt%aint1d) /=
size(p_mem))
then
235 call store_error(
'mem_set_value() size mismatch int1d, varname='//&
236 &trim(varname), terminate=.true.)
238 do n = 1,
size(mt%aint1d)
239 p_mem(n) = mt%aint1d(n)
248 integer(I4B),
dimension(:, :),
pointer,
contiguous,
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.
257 if (.not. found)
return
258 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'INTEGER')
then
259 if (
size(mt%aint2d, dim=1) /=
size(p_mem, dim=1) .or. &
260 size(mt%aint2d, dim=2) /=
size(p_mem, dim=2))
then
261 call store_error(
'mem_set_value() size mismatch int2d, varname='//&
262 &trim(varname), terminate=.true.)
264 do j = 1,
size(mt%aint2d, dim=2)
265 do i = 1,
size(mt%aint2d, dim=1)
266 p_mem(i, j) = mt%aint2d(i, j)
275 integer(I4B),
dimension(:, :, :),
pointer,
contiguous,
intent(inout) :: p_mem
276 character(len=*),
intent(in) :: varname
277 character(len=*),
intent(in) :: memory_path
278 logical(LGP),
intent(inout) :: found
280 logical(LGP) :: checkfail = .false.
281 integer(I4B) :: i, j, k
284 if (.not. found)
return
285 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'INTEGER')
then
286 if (
size(mt%aint3d, dim=1) /=
size(p_mem, dim=1) .or. &
287 size(mt%aint3d, dim=2) /=
size(p_mem, dim=2) .or. &
288 size(mt%aint3d, dim=3) /=
size(p_mem, dim=3))
then
289 call store_error(
'mem_set_value() size mismatch int3d, varname='//&
290 &trim(varname), terminate=.true.)
292 do k = 1,
size(mt%aint3d, dim=3)
293 do j = 1,
size(mt%aint3d, dim=2)
294 do i = 1,
size(mt%aint3d, dim=1)
295 p_mem(i, j, k) = mt%aint3d(i, j, k)
305 real(DP),
pointer,
intent(inout) :: p_mem
306 character(len=*),
intent(in) :: varname
307 character(len=*),
intent(in) :: memory_path
308 logical(LGP),
intent(inout) :: found
310 logical(LGP) :: checkfail = .false.
313 if (.not. found)
return
314 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'DOUBLE')
then
322 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: p_mem
323 character(len=*),
intent(in) :: varname
324 character(len=*),
intent(in) :: memory_path
325 logical(LGP),
intent(inout) :: found
327 logical(LGP) :: checkfail = .false.
331 if (.not. found)
return
332 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'DOUBLE')
then
333 if (
size(mt%adbl1d) /=
size(p_mem))
then
334 call store_error(
'mem_set_value() size mismatch dbl1d, varname='//&
335 &trim(varname), terminate=.true.)
337 do n = 1,
size(mt%adbl1d)
338 p_mem(n) = mt%adbl1d(n)
347 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: p_mem
348 character(len=*),
intent(in) :: varname
349 character(len=*),
intent(in) :: memory_path
350 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: map
351 logical(LGP),
intent(inout) :: found
353 logical(LGP) :: checkfail = .false.
357 if (.not. found)
return
358 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'DOUBLE')
then
359 if (
associated(map))
then
360 do n = 1,
size(p_mem)
361 p_mem(n) = mt%adbl1d(map(n))
364 if (
size(mt%adbl1d) /=
size(p_mem))
then
365 call store_error(
'mem_set_value() size mismatch dbl1d, varname='//&
366 &trim(varname), terminate=.true.)
368 do n = 1,
size(mt%adbl1d)
369 p_mem(n) = mt%adbl1d(n)
378 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: p_mem
379 character(len=*),
intent(in) :: varname
380 character(len=*),
intent(in) :: memory_path
381 logical(LGP),
intent(inout) :: found
383 logical(LGP) :: checkfail = .false.
387 if (.not. found)
return
388 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'DOUBLE')
then
389 if (
size(mt%adbl2d, dim=1) /=
size(p_mem, dim=1) .or. &
390 size(mt%adbl2d, dim=2) /=
size(p_mem, dim=2))
then
391 call store_error(
'mem_set_value() size mismatch dbl2d, varname='//&
392 &trim(varname), terminate=.true.)
394 do j = 1,
size(mt%adbl2d, dim=2)
395 do i = 1,
size(mt%adbl2d, dim=1)
396 p_mem(i, j) = mt%adbl2d(i, j)
405 real(DP),
dimension(:, :, :),
pointer,
contiguous,
intent(inout) :: p_mem
406 character(len=*),
intent(in) :: varname
407 character(len=*),
intent(in) :: memory_path
408 logical(LGP),
intent(inout) :: found
410 logical(LGP) :: checkfail = .false.
411 integer(I4B) :: i, j, k
414 if (.not. found)
return
415 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'DOUBLE')
then
416 if (
size(mt%adbl3d, dim=1) /=
size(p_mem, dim=1) .or. &
417 size(mt%adbl3d, dim=2) /=
size(p_mem, dim=2) .or. &
418 size(mt%adbl3d, dim=3) /=
size(p_mem, dim=3))
then
419 call store_error(
'mem_set_value() size mismatch dbl3d, varname='//&
420 &trim(varname), terminate=.true.)
422 do k = 1,
size(mt%adbl3d, dim=3)
423 do j = 1,
size(mt%adbl3d, dim=2)
424 do i = 1,
size(mt%adbl3d, dim=1)
425 p_mem(i, j, k) = mt%adbl3d(i, j, k)
433 character(len=*),
intent(inout) :: p_mem
434 character(len=*),
intent(in) :: varname
435 character(len=*),
intent(in) :: memory_path
436 logical(LGP),
intent(inout) :: found
438 logical(LGP) :: checkfail = .false.
441 if (.not. found)
return
442 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'STRING')
then
450 pointer,
contiguous,
intent(inout) :: p_mem
451 character(len=*),
intent(in) :: varname
452 character(len=*),
intent(in) :: memory_path
453 logical(LGP),
intent(inout) :: found
455 logical(LGP) :: checkfail = .false.
459 if (.not. found)
return
460 if (mt%memtype(1:index(mt%memtype,
' ')) ==
'STRING')
then
461 do n = 1,
size(mt%acharstr1d)
462 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_logical1d_mapped(p_mem, varname, memory_path, map, found)
Set pointer to value of memory list 1d logical array variable with mapping.
subroutine mem_set_value_logical1d(p_mem, varname, memory_path, found)
Set pointer to value of memory list 1d logical 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.