44 character(len=*),
intent(in) :: component
45 character(len=*),
intent(in) :: subcomponent
46 integer(I4B),
intent(in) ::
iout
48 write (
iout,
'(1x,a)')
'Loading input for '//trim(component)//&
49 &
'/'//trim(subcomponent)
56 character(len=*),
intent(in) :: component
57 character(len=*),
intent(in) :: subcomponent
58 integer(I4B),
intent(in) ::
iout
60 write (
iout,
'(1x,a)')
'Loading input complete...'
68 character(len=*),
intent(in) :: component
69 integer(I4B),
intent(in) ::
iout
71 write (
iout,
'(/1x,a,i0,a)')
'IDP PERIOD ',
kper, &
72 ' load for component: '//trim(component)
80 integer(I4B),
intent(in) ::
iout
83 write (
iout,
'(1x,a,/)')
'IDP component dynamic load complete...'
90 character(len=*),
intent(in) :: varname
91 character(len=*),
intent(in) :: mempath
92 integer(I4B),
intent(in) :: iout
93 logical(LGP),
intent(in) :: is_tas
94 character(len=*),
intent(in),
optional :: detail
97 if (
present(detail))
then
98 write (iout,
'(3x, a, ": ", a, " (", a, ")")') &
99 'Time-array-series controlled dynamic variable detected', &
100 trim(varname), trim(detail)
102 write (iout,
'(3x, a, ": ", a)') &
103 'Time-array-series controlled dynamic variable detected', &
107 if (
present(detail))
then
108 write (iout,
'(3x, a, ": ", a, " (", a, ")")') &
109 'Time-series controlled dynamic variable detected', &
110 trim(varname), trim(detail)
112 write (iout,
'(3x, a, ": ", a)') &
113 'Time-series controlled dynamic variable detected', trim(varname)
122 logical(LGP),
intent(in) :: p_mem
123 character(len=*),
intent(in) :: varname
124 character(len=*),
intent(in) :: mempath
125 integer(I4B),
intent(in) :: iout
126 character(len=LINELENGTH) :: description
128 description =
'Logical detected'
129 write (iout,
'(3x, a, ": ", a, " = ", l1)') &
130 trim(description), trim(varname), p_mem
137 integer(I4B),
intent(in) :: p_mem
138 character(len=*),
intent(in) :: varname
139 character(len=*),
intent(in) :: mempath
140 character(len=*),
intent(in) :: datatype
141 integer(I4B),
intent(in) :: iout
142 character(len=LINELENGTH) :: description
144 if (datatype ==
'KEYWORD')
then
145 description =
'Keyword detected'
146 write (iout,
'(3x, a, ": ", a)') trim(description), trim(varname)
148 description =
'Integer detected'
149 write (iout,
'(3x, a, ": ", a, " = ", i0)') &
150 trim(description), trim(varname), p_mem
158 integer(I4B),
dimension(:),
contiguous,
intent(in) :: p_mem
159 character(len=*),
intent(in) :: varname
160 character(len=*),
intent(in) :: mempath
161 integer(I4B),
intent(in) :: iout
162 integer(I4B) :: min_val, max_val
163 character(len=LINELENGTH) :: description
165 min_val = minval(p_mem)
166 max_val = maxval(p_mem)
167 if (min_val == max_val)
then
168 description =
'Integer 1D constant array detected'
169 write (iout,
'(3x, a, ": ", a, " = ", i0)') &
170 trim(description), trim(varname), min_val
172 description =
'Integer 1D array detected'
173 write (iout,
'(3x, a, ": ", a, a, i0, a, i0)') &
174 trim(description), trim(varname), &
175 ' ranges from ', min_val,
' to ', max_val
183 integer(I4B),
dimension(:, :),
contiguous,
intent(in) :: p_mem
184 character(len=*),
intent(in) :: varname
185 character(len=*),
intent(in) :: mempath
186 integer(I4B),
intent(in) :: iout
187 integer(I4B) :: min_val, max_val
188 character(len=LINELENGTH) :: description
190 min_val = minval(p_mem)
191 max_val = maxval(p_mem)
192 if (min_val == max_val)
then
193 description =
'Integer 2D constant array detected'
194 write (iout,
'(3x, a, ": ", a, " = ", i0)') &
195 trim(description), trim(varname), min_val
197 description =
'Integer 2D array detected'
198 write (iout,
'(3x, a, ": ", a, a, i0, a, i0)') &
199 trim(description), trim(varname), &
200 ' ranges from ', min_val,
' to ', max_val
208 integer(I4B),
dimension(:, :, :),
contiguous,
intent(in) :: p_mem
209 character(len=*),
intent(in) :: varname
210 character(len=*),
intent(in) :: mempath
211 integer(I4B),
intent(in) :: iout
212 integer(I4B) :: min_val, max_val
213 character(len=LINELENGTH) :: description
215 min_val = minval(p_mem)
216 max_val = maxval(p_mem)
217 if (min_val == max_val)
then
218 description =
'Integer 3D constant array detected'
219 write (iout,
'(3x, a, ": ", a, " = ", i0)') &
220 trim(description), trim(varname), min_val
222 description =
'Integer 3D array detected'
223 write (iout,
'(3x, a, ": ", a, a, i0, a, i0)') &
224 trim(description), trim(varname), &
225 ' ranges from ', min_val,
' to ', max_val
233 real(DP),
intent(in) :: p_mem
234 character(len=*),
intent(in) :: varname
235 character(len=*),
intent(in) :: mempath
236 integer(I4B),
intent(in) :: iout
237 character(len=LINELENGTH) :: description
239 description =
'Double detected'
240 write (iout,
'(3x, a, ": ", a, " = ", G0)') &
241 trim(description), trim(varname), p_mem
248 real(DP),
dimension(:),
contiguous,
intent(in) :: p_mem
249 character(len=*),
intent(in) :: varname
250 character(len=*),
intent(in) :: mempath
251 integer(I4B),
intent(in) :: iout
252 real(DP) :: min_val, max_val
253 character(len=LINELENGTH) :: description
255 min_val = minval(p_mem)
256 max_val = maxval(p_mem)
257 if (min_val == max_val)
then
258 description =
'Double precision 1D constant array detected'
259 write (iout,
'(3x, a, ": ", a, " = ", G0)') &
260 trim(description), trim(varname), min_val
262 description =
'Double precision 1D array detected'
263 write (iout,
'(3x, a, ": ", a, a, G0, a, G0)') &
264 trim(description), trim(varname), &
265 ' ranges from ', min_val,
' to ', max_val
273 real(DP),
dimension(:, :),
contiguous,
intent(in) :: p_mem
274 character(len=*),
intent(in) :: varname
275 character(len=*),
intent(in) :: mempath
276 integer(I4B),
intent(in) :: iout
277 real(DP) :: min_val, max_val
278 character(len=LINELENGTH) :: description
280 min_val = minval(p_mem)
281 max_val = maxval(p_mem)
282 if (min_val == max_val)
then
283 description =
'Double precision 2D constant array detected'
284 write (iout,
'(3x, a, ": ", a, " = ", G0)') &
285 trim(description), trim(varname), min_val
287 description =
'Double precision 2D array detected'
288 write (iout,
'(3x, a, ": ", a, a, G0, a, G0)') &
289 trim(description), trim(varname), &
290 ' ranges from ', min_val,
' to ', max_val
298 real(DP),
dimension(:, :, :),
contiguous,
intent(in) :: p_mem
299 character(len=*),
intent(in) :: varname
300 character(len=*),
intent(in) :: mempath
301 integer(I4B),
intent(in) :: iout
302 real(DP) :: min_val, max_val
303 character(len=LINELENGTH) :: description
305 min_val = minval(p_mem)
306 max_val = maxval(p_mem)
307 if (min_val == max_val)
then
308 description =
'Double precision 3D constant array detected'
309 write (iout,
'(3x, a, ": ", a, " = ", G0)') &
310 trim(description), trim(varname), min_val
312 description =
'Double precision 3D array detected'
313 write (iout,
'(3x, a, ": ", a, a, G0, a, G0)') &
314 trim(description), trim(varname), &
315 ' ranges from ', min_val,
' to ', max_val
323 character(len=*),
intent(in) :: p_mem
324 character(len=*),
intent(in) :: varname
325 character(len=*),
intent(in) :: mempath
326 integer(I4B),
intent(in) :: iout
327 character(len=LINELENGTH) :: description
329 description =
'String detected'
330 write (iout,
'(3x, a, ": ", a, " = ", a)') &
331 trim(description), trim(varname), trim(p_mem)
343 integer(I4B),
dimension(:),
contiguous,
intent(in) :: p_mem
344 character(len=*),
intent(in) :: varname
345 character(len=*),
intent(in) :: mempath
346 character(len=*),
intent(in) :: shapestr
347 integer(I4B),
intent(in) :: iout
348 integer(I4B),
dimension(:),
pointer,
contiguous :: model_shape
349 integer(I4B),
dimension(:, :, :),
pointer,
contiguous :: int3d
350 integer(I4B),
dimension(:, :),
pointer,
contiguous :: int2d
351 integer(I4B),
dimension(3) :: dis3d_shape
352 integer(I4B),
dimension(2) :: dis2d_shape
353 integer(I4B),
pointer :: distype
354 character(LENMEMPATH) :: input_mempath
355 character(LENCOMPONENTNAME) :: comp, subcomp
356 integer(I4B) :: i, j, k, inunit, export_dim
357 logical(LGP) :: is_layered
362 call mem_setptr(distype,
'DISENUM', input_mempath)
363 call mem_setptr(model_shape,
'MODEL_SHAPE', input_mempath)
369 select case (export_dim)
372 dis3d_shape(1) = model_shape(3)
373 dis3d_shape(2) = model_shape(2)
374 dis3d_shape(3) = model_shape(1)
376 allocate (int3d(dis3d_shape(1), dis3d_shape(2), dis3d_shape(3)))
377 int3d = reshape(p_mem, dis3d_shape)
379 do k = 1, dis3d_shape(3)
381 do i = 1, model_shape(2)
382 write (inunit,
'(*(i0, " "))') (int3d(j, i, k), j=1, &
391 dis2d_shape(1) = model_shape(2)
392 dis2d_shape(2) = model_shape(1)
394 allocate (int2d(dis2d_shape(1), dis2d_shape(2)))
395 int2d = reshape(p_mem, dis2d_shape)
398 do i = 1, dis2d_shape(2)
400 write (inunit,
'(*(i0, " "))') (int2d(j, i), j=1, dis2d_shape(1))
406 do i = 1, dis2d_shape(2)
407 write (inunit,
'(*(i0, " "))') (int2d(j, i), j=1, dis2d_shape(1))
416 write (inunit,
'(*(i0, " "))') p_mem
419 write (
errmsg,
'(a,i0)')
'EXPORT unsupported int1d export_dim=', &
430 integer(I4B),
dimension(:, :),
contiguous,
intent(in) :: p_mem
431 character(len=*),
intent(in) :: varname
432 character(len=*),
intent(in) :: mempath
433 character(len=*),
intent(in) :: shapestr
434 integer(I4B),
intent(in) :: iout
435 integer(I4B),
dimension(:),
pointer,
contiguous :: model_shape
436 integer(I4B),
pointer :: distype
437 character(LENMEMPATH) :: input_mempath
438 character(LENCOMPONENTNAME) :: comp, subcomp
439 integer(I4B) :: i, j, inunit, export_dim
440 logical(LGP) :: is_layered
445 call mem_setptr(distype,
'DISENUM', input_mempath)
446 call mem_setptr(model_shape,
'MODEL_SHAPE', input_mempath)
451 select case (export_dim)
455 do i = 1,
size(p_mem, dim=2)
456 write (inunit,
'(*(i0, " "))') (p_mem(j, i), j=1,
size(p_mem, dim=1))
462 do i = 1,
size(p_mem, dim=2)
464 write (inunit,
'(*(i0, " "))') (p_mem(j, i), j=1,
size(p_mem, dim=1))
470 do i = 1,
size(p_mem, dim=2)
471 write (inunit,
'(*(i0, " "))') (p_mem(j, i), j=1,
size(p_mem, dim=1))
476 write (
errmsg,
'(a,i0)')
'EXPORT unsupported int2d export_dim=', &
487 integer(I4B),
dimension(:, :, :),
contiguous,
intent(in) :: p_mem
488 character(len=*),
intent(in) :: varname
489 character(len=*),
intent(in) :: mempath
490 character(len=*),
intent(in) :: shapestr
491 integer(I4B),
intent(in) :: iout
492 integer(I4B),
dimension(:),
pointer,
contiguous :: model_shape
493 integer(I4B),
pointer :: distype
494 character(LENMEMPATH) :: input_mempath
495 character(LENCOMPONENTNAME) :: comp, subcomp
496 integer(I4B) :: i, j, k, inunit, export_dim
497 logical(LGP) :: is_layered
502 call mem_setptr(distype,
'DISENUM', input_mempath)
503 call mem_setptr(model_shape,
'MODEL_SHAPE', input_mempath)
508 select case (export_dim)
511 do k = 1,
size(p_mem, dim=3)
513 do i = 1,
size(p_mem, dim=2)
514 write (inunit,
'(*(i0, " "))') (p_mem(j, i, k), j=1,
size(p_mem, dim=1))
519 write (
errmsg,
'(a,i0)')
'EXPORT unsupported int3d export_dim=', &
533 real(DP),
dimension(:),
contiguous,
intent(in) :: p_mem
534 character(len=*),
intent(in) :: varname
535 character(len=*),
intent(in) :: mempath
536 character(len=*),
intent(in) :: shapestr
537 integer(I4B),
intent(in) :: iout
538 integer(I4B),
dimension(:),
pointer,
contiguous :: model_shape
539 real(DP),
dimension(:, :, :),
pointer,
contiguous :: dbl3d
540 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
541 integer(I4B),
dimension(3) :: dis3d_shape
542 integer(I4B),
dimension(2) :: dis2d_shape
543 integer(I4B),
pointer :: distype
544 character(LENMEMPATH) :: input_mempath
545 character(LENCOMPONENTNAME) :: comp, subcomp
546 integer(I4B) :: i, j, k, inunit, export_dim
547 logical(LGP) :: is_layered
552 call mem_setptr(distype,
'DISENUM', input_mempath)
553 call mem_setptr(model_shape,
'MODEL_SHAPE', input_mempath)
559 select case (export_dim)
562 dis3d_shape(1) = model_shape(3)
563 dis3d_shape(2) = model_shape(2)
565 dis3d_shape(3) = model_shape(1)
566 allocate (dbl3d(dis3d_shape(1), dis3d_shape(2), dis3d_shape(3)))
567 dbl3d = reshape(p_mem, dis3d_shape)
568 do k = 1, dis3d_shape(3)
571 do i = 1, model_shape(2)
572 write (inunit,
'(*(G0.10, " "))') (dbl3d(j, i, k), j=1, &
581 dis2d_shape(1) = model_shape(2)
582 dis2d_shape(2) = model_shape(1)
584 allocate (dbl2d(dis2d_shape(1), dis2d_shape(2)))
585 dbl2d = reshape(p_mem, dis2d_shape)
588 do i = 1, dis2d_shape(2)
590 write (inunit,
'(*(G0.10, " "))') (dbl2d(j, i), j=1, dis2d_shape(1))
596 do i = 1, dis2d_shape(2)
597 write (inunit,
'(*(G0.10, " "))') (dbl2d(j, i), j=1, dis2d_shape(1))
606 write (inunit,
'(*(G0.10, " "))') p_mem
609 write (
errmsg,
'(a,i0)')
'EXPORT unsupported dbl1d export_dim=', &
620 real(DP),
dimension(:, :),
contiguous,
intent(in) :: p_mem
621 character(len=*),
intent(in) :: varname
622 character(len=*),
intent(in) :: mempath
623 character(len=*),
intent(in) :: shapestr
624 integer(I4B),
intent(in) :: iout
625 integer(I4B),
dimension(:),
pointer,
contiguous :: model_shape
626 integer(I4B),
pointer :: distype
627 character(LENMEMPATH) :: input_mempath
628 character(LENCOMPONENTNAME) :: comp, subcomp
629 integer(I4B) :: i, j, inunit, export_dim
630 logical(LGP) :: is_layered
635 call mem_setptr(distype,
'DISENUM', input_mempath)
636 call mem_setptr(model_shape,
'MODEL_SHAPE', input_mempath)
641 select case (export_dim)
645 do i = 1,
size(p_mem, dim=2)
646 write (inunit,
'(*(G0.10, " "))') (p_mem(j, i), j=1,
size(p_mem, dim=1))
652 do i = 1,
size(p_mem, dim=2)
654 write (inunit,
'(*(G0.10, " "))') (p_mem(j, i), j=1,
size(p_mem, dim=1))
660 do i = 1,
size(p_mem, dim=2)
661 write (inunit,
'(*(G0.10, " "))') (p_mem(j, i), j=1,
size(p_mem, dim=1))
666 write (
errmsg,
'(a,i0)')
'EXPORT unsupported dbl2d export_dim=', &
677 real(DP),
dimension(:, :, :),
contiguous,
intent(in) :: p_mem
678 character(len=*),
intent(in) :: varname
679 character(len=*),
intent(in) :: mempath
680 character(len=*),
intent(in) :: shapestr
681 integer(I4B),
intent(in) :: iout
682 integer(I4B),
dimension(:),
pointer,
contiguous :: model_shape
683 integer(I4B),
pointer :: distype
684 character(LENMEMPATH) :: input_mempath
685 character(LENCOMPONENTNAME) :: comp, subcomp
686 integer(I4B) :: i, j, k, inunit, export_dim
687 logical(LGP) :: is_layered
692 call mem_setptr(distype,
'DISENUM', input_mempath)
693 call mem_setptr(model_shape,
'MODEL_SHAPE', input_mempath)
698 select case (export_dim)
701 do k = 1,
size(p_mem, dim=3)
703 do i = 1,
size(p_mem, dim=2)
704 write (inunit,
'(*(G0.10, " "))') (p_mem(j, i, k), j=1, &
710 write (
errmsg,
'(a,i0)')
'EXPORT unsupported dbl3d export_dim=', &
722 integer(I4B),
pointer,
intent(in) :: distype
723 character(len=*),
intent(in) :: shapestr
724 logical(LGP),
intent(inout) :: is_layered
725 integer(I4B) :: export_dim
730 select case (distype)
732 if (shapestr ==
'NODES')
then
735 else if (shapestr ==
'NCOL NROW NLAY')
then
742 if (shapestr ==
'NODES')
then
745 else if (shapestr ==
'NCPL NLAY')
then
752 if (shapestr ==
'NODES')
then
754 else if (shapestr ==
'NCOL NROW')
then
780 character(len=*),
intent(in) :: varname
781 character(len=*),
intent(in) :: mempath
782 integer(I4B),
intent(in) :: layer
783 integer(I4B),
intent(in) ::
iout
784 integer(I4B) :: inunit
785 character(len=LENCOMPONENTNAME) :: comp, subcomp
786 character(len=LINELENGTH) :: filename, suffix
797 write (suffix,
'(a,i0)') trim(suffix)//
'.l', layer
799 suffix = trim(suffix)//
'.txt'
802 filename = trim(comp)//
'-'//trim(subcomp)//
'.'//trim(suffix)
806 call openfile(inunit, 0, filename,
'EXPORT', filstat_opt=
'REPLACE')
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
integer(i4b), parameter lencomponentname
maximum length of a component name
@ disu
DISV6 discretization.
@ dis
DIS6 discretization.
@ disv1d
DISV1D6 discretization.
@ dis2d
DIS2D6 discretization.
@ disv
DISU6 discretization.
@ disundef
undefined discretization
integer(i4b), parameter lenvarname
maximum length of a variable name
integer(i4b), parameter lenmempath
maximum length of the memory path
This module contains the Input Data Model Logger Module.
subroutine idm_log_var_str(p_mem, varname, mempath, iout)
Log type specific information str.
integer(i4b) function create_export_file(varname, mempath, layer, iout)
Create export file.
subroutine idm_log_var_int(p_mem, varname, mempath, datatype, iout)
Log type specific information integer.
integer(i4b) function distype_export_dim(distype, shapestr, is_layered)
Set dis type export_dim.
subroutine idm_export_int2d(p_mem, varname, mempath, shapestr, iout)
Create export file int2d.
subroutine, public idm_log_close(component, subcomponent, iout)
log the closing message
subroutine idm_export_dbl2d(p_mem, varname, mempath, shapestr, iout)
Create export file dbl2d.
subroutine, public idm_log_period_header(component, iout)
log a dynamic header message
subroutine idm_log_var_dbl3d(p_mem, varname, mempath, iout)
Log type specific information dbl3d.
subroutine idm_export_int3d(p_mem, varname, mempath, shapestr, iout)
Create export file int3d.
subroutine, public idm_log_header(component, subcomponent, iout)
log a header message
subroutine idm_log_var_dbl2d(p_mem, varname, mempath, iout)
Log type specific information dbl2d.
subroutine idm_export_dbl3d(p_mem, varname, mempath, shapestr, iout)
Create export file dbl3d.
subroutine idm_log_var_int1d(p_mem, varname, mempath, iout)
Log type specific information int1d.
subroutine idm_log_var_ts(varname, mempath, iout, is_tas, detail)
log the period closing message
subroutine, public idm_log_period_close(iout)
log the period closing message
subroutine idm_log_var_dbl(p_mem, varname, mempath, iout)
Log type specific information double.
subroutine idm_log_var_dbl1d(p_mem, varname, mempath, iout)
Log type specific information dbl1d.
subroutine idm_log_var_int2d(p_mem, varname, mempath, iout)
Log type specific information int2d.
subroutine idm_log_var_int3d(p_mem, varname, mempath, iout)
Log type specific information int3d.
subroutine idm_log_var_logical(p_mem, varname, mempath, iout)
Log type specific information logical.
subroutine idm_export_dbl1d(p_mem, varname, mempath, shapestr, iout)
Create export file dbl1d.
subroutine idm_export_int1d(p_mem, varname, mempath, shapestr, iout)
Create export file int1d.
This module defines variable data types.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
subroutine split_mem_path(mem_path, component, subcomponent)
Split the memory path into component(s).
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
character(len=linelength) idm_context
integer(i4b) iout
file unit number for simulation output
integer(i4b) iparamlog
input (idm) parameter logging to simulation listing file
integer(i4b), pointer, public kstp
current time step number
integer(i4b), pointer, public kper
current stress period number