56 integer(I4B),
dimension(:),
pointer,
contiguous :: mshape => null()
61 character(len=LINELENGTH) :: filename
62 character(len=LINELENGTH),
dimension(:),
allocatable :: block_tags
63 logical(LGP) :: ts_active
64 logical(LGP) :: export
65 logical(LGP) :: readasarrays
66 logical(LGP) :: readarraygrid
67 integer(I4B) :: inamedbound
68 integer(I4B) :: iauxiliary
96 subroutine load(this, parser, mf6_input, nc_vars, filename, iout)
101 character(len=*),
intent(in) :: filename
102 integer(I4B),
intent(in) :: iout
106 call this%init(parser, mf6_input, filename, iout)
109 this%nc_vars => nc_vars
112 do iblk = 1,
size(this%mf6_input%block_dfns)
114 if (this%mf6_input%block_dfns(iblk)%blockname ==
'PERIOD')
exit
116 call this%load_block(iblk)
128 subroutine init(this, parser, mf6_input, filename, iout)
132 character(len=*),
intent(in) :: filename
133 integer(I4B),
intent(in) :: iout
134 integer(I4B) :: isize
136 this%parser => parser
137 this%mf6_input = mf6_input
138 this%filename = filename
139 this%ts_active = .false.
140 this%export = .false.
141 this%readasarrays = .false.
142 this%readarraygrid = .false.
147 call get_isize(
'MODEL_SHAPE', mf6_input%component_mempath, isize)
149 call mem_setptr(this%mshape,
'MODEL_SHAPE', mf6_input%component_mempath)
153 allocate (this%ts_sas(0))
157 this%mf6_input%subcomponent_name, this%iout)
171 integer(I4B),
intent(in) :: iblk
174 if (
associated(this%structarray))
then
179 allocate (this%block_tags(0))
181 call this%parse_block(iblk, .false.)
183 call this%block_post_process(iblk)
185 deallocate (this%block_tags)
197 if (
associated(this%structarray))
then
203 this%mf6_input%subcomponent_name, this%iout)
212 integer(I4B),
intent(in) :: iblk
214 integer(I4B) :: iparam
215 integer(I4B),
pointer :: intptr
218 do iparam = 1,
size(this%block_tags)
219 select case (this%mf6_input%block_dfns(iblk)%blockname)
221 if (this%block_tags(iparam) ==
'AUXILIARY')
then
223 else if (this%block_tags(iparam) ==
'BOUNDNAMES')
then
225 else if (this%block_tags(iparam) ==
'READASARRAYS')
then
226 this%readasarrays = .true.
227 else if (this%block_tags(iparam) ==
'READARRAYGRID')
then
228 this%readarraygrid = .true.
229 else if (this%block_tags(iparam) ==
'TS6_FILENAME')
then
230 this%ts_active = .true.
231 else if (this%block_tags(iparam) ==
'EXPORT_ARRAY_ASCII')
then
239 select case (this%mf6_input%block_dfns(iblk)%blockname)
242 do iparam = 1,
size(this%mf6_input%param_dfns)
243 idt => this%mf6_input%param_dfns(iparam)
244 if (idt%blockname ==
'OPTIONS' .and. &
245 idt%tagname ==
'AUXILIARY')
then
246 if (this%iauxiliary == 0)
then
247 call mem_allocate(intptr,
'NAUX', this%mf6_input%mempath)
255 if (this%mf6_input%pkgtype(1:3) ==
'DIS')
then
257 this%mf6_input%component_mempath, &
258 this%mf6_input%mempath, this%mshape)
271 integer(I4B),
intent(in) :: iblk
272 logical(LGP),
intent(in) :: recursive_call
273 logical(LGP) :: isblockfound
274 logical(LGP) :: endofblock
275 logical(LGP) :: supportopenclose
277 logical(LGP) :: found, required
279 character(len=LINELENGTH) :: tag
283 if (this%mf6_input%pkgtype ==
'DISU6' .or. &
284 this%mf6_input%pkgtype ==
'DISV1D6' .or. &
285 this%mf6_input%pkgtype ==
'DISV2D6')
then
286 if (this%mf6_input%block_dfns(iblk)%blockname ==
'VERTICES' .or. &
287 this%mf6_input%block_dfns(iblk)%blockname ==
'CELL2D')
then
290 if (.not. found)
return
291 if (mt%intsclr == 0)
return
296 supportopenclose = (this%mf6_input%block_dfns(iblk)%blockname /=
'GRIDDATA')
299 required = this%mf6_input%block_dfns(iblk)%required .and. .not. recursive_call
300 call this%parser%GetBlock(this%mf6_input%block_dfns(iblk)%blockname, &
301 isblockfound, ierr, &
302 supportopenclose=supportopenclose, &
303 blockrequired=required)
305 if (isblockfound)
then
306 if (this%mf6_input%block_dfns(iblk)%aggregate)
then
308 call this%parse_structarray_block(iblk)
312 call this%parser%GetNextLine(endofblock)
315 call this%parser%GetStringCaps(tag)
317 this%mf6_input%param_dfns, &
318 this%mf6_input%component_type, &
319 this%mf6_input%subcomponent_type, &
320 this%mf6_input%block_dfns(iblk)%blockname, &
322 if (idt%in_record)
then
323 call this%parse_record_tag(iblk, idt, .false.)
325 call this%load_tag(iblk, idt)
332 if (this%mf6_input%block_dfns(iblk)%block_variable)
then
333 if (isblockfound)
then
334 call this%parse_block(iblk, .true.)
342 integer(I4B),
intent(in) :: iblk
343 character(len=*),
intent(in) :: pkgtype
344 character(len=*),
intent(in) :: which
345 character(len=*),
intent(in) :: tag
350 this%mf6_input%component_type, &
351 this%mf6_input%subcomponent_type, &
352 this%mf6_input%block_dfns(iblk)%blockname, &
355 call load_io_tag(this%parser, idt, this%mf6_input%mempath, which, this%iout)
357 this%block_tags(
size(this%block_tags)) = trim(idt%tagname)
365 integer(I4B),
intent(in) :: iblk
367 logical(LGP),
intent(in) :: recursive_call
369 character(len=40),
dimension(:),
allocatable :: words
370 integer(I4B) :: n, istart, nwords
371 character(len=LINELENGTH) :: tag
376 if (recursive_call)
then
378 this%mf6_input%component_type, &
379 this%mf6_input%subcomponent_type, &
380 inidt%tagname, nwords, words)
381 call this%load_tag(iblk, inidt)
384 call this%parser%GetStringCaps(tag)
387 this%mf6_input%component_type, &
388 this%mf6_input%subcomponent_type, &
389 inidt%tagname, tag, nwords, words)
390 if (nwords == 4 .and. &
391 (tag ==
'FILEIN' .or. &
392 tag ==
'FILEOUT'))
then
393 call this%parse_io_tag(iblk, words(2), words(3), words(4))
396 idt => get_param_definition_type( &
397 this%mf6_input%param_dfns, &
398 this%mf6_input%component_type, &
399 this%mf6_input%subcomponent_type, &
400 this%mf6_input%block_dfns(iblk)%blockname, &
403 if (tag /=
'PRINT_FORMAT')
call this%load_tag(iblk, inidt)
404 call this%load_tag(iblk, idt)
408 call this%load_tag(iblk, inidt)
413 if (istart > 1 .and. nwords == 0)
then
415 '"', trim(this%mf6_input%block_dfns(iblk)%blockname), &
416 '" block input record that includes keyword "', trim(inidt%tagname), &
417 '" is not properly formed.'
419 call this%parser%StoreErrorUnit()
422 do n = istart, nwords
423 idt => get_param_definition_type( &
424 this%mf6_input%param_dfns, &
425 this%mf6_input%component_type, &
426 this%mf6_input%subcomponent_type, &
427 this%mf6_input%block_dfns(iblk)%blockname, &
428 words(n), this%filename)
430 call this%parser%GetStringCaps(tag)
431 idt => get_param_definition_type( &
432 this%mf6_input%param_dfns, &
433 this%mf6_input%component_type, &
434 this%mf6_input%subcomponent_type, &
435 this%mf6_input%block_dfns(iblk)%blockname, &
437 call this%parse_record_tag(iblk, idt, .true.)
440 if (idt%tagname /=
'FORMAT')
then
441 call this%parser%GetStringCaps(tag)
444 else if (idt%tagname /= tag)
then
445 write (
errmsg,
'(5a)')
'Expecting record input tag "', &
446 trim(idt%tagname),
'" but instead found "', trim(tag),
'".'
448 call this%parser%StoreErrorUnit()
451 call this%load_tag(iblk, idt)
455 if (
allocated(words))
deallocate (words)
465 integer(I4B),
intent(in) :: iblk
467 character(len=LINELENGTH) :: dev_msg
470 if (idt%developmode)
then
471 dev_msg =
'Input tag "'//trim(idt%tagname)// &
472 &
'" read from file "'//trim(this%filename)// &
473 &
'" is still under development. Install the &
474 &nightly build or compile from source with IDEVELOPMODE = 1.'
479 select case (idt%datatype)
483 if (idt%tagname(1:4) ==
'DEV_' .and. &
484 this%mf6_input%block_dfns(iblk)%blockname ==
'OPTIONS')
then
485 call this%parser%DevOpt()
488 if (idt%shape ==
'NAUX')
then
498 this%export, this%nc_vars, this%filename, &
502 this%export, this%nc_vars, this%filename, &
506 this%export, this%nc_vars, this%filename, &
512 this%export, this%nc_vars, this%filename, this%iout)
515 this%export, this%nc_vars, this%filename, this%iout)
518 this%export, this%nc_vars, this%filename, this%iout)
520 write (
errmsg,
'(a,a)')
'Failure reading data for tag: ', trim(idt%tagname)
522 call this%parser%StoreErrorUnit()
526 this%block_tags(
size(this%block_tags)) = trim(idt%tagname)
531 integer(I4B),
intent(in) :: iblk
533 character(len=LENVARNAME) :: varname
535 character(len=3) :: block_suffix =
'NUM'
538 ilen = len_trim(this%mf6_input%block_dfns(iblk)%blockname)
540 if (ilen > (
lenvarname - len(block_suffix)))
then
542 this%mf6_input%block_dfns(iblk)% &
543 blockname(1:(
lenvarname - len(block_suffix)))//block_suffix
545 varname = trim(this%mf6_input%block_dfns(iblk)%blockname)//block_suffix
548 idt%component_type = trim(this%mf6_input%component_type)
549 idt%subcomponent_type = trim(this%mf6_input%subcomponent_type)
550 idt%blockname = trim(this%mf6_input%block_dfns(iblk)%blockname)
551 idt%tagname = varname
552 idt%mf6varname = varname
553 idt%datatype =
'INTEGER'
568 integer(I4B),
intent(in) :: iblk
570 character(len=LINELENGTH),
dimension(:),
allocatable :: param_names
574 integer(I4B) :: blocknum
575 integer(I4B),
pointer :: nrow
576 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
577 integer(I4B) :: nrows, nrowsread
578 integer(I4B) :: mem_rank, isize
579 integer(I4B) :: ibinary, oc_inunit
580 integer(I4B) :: icol, iparam
581 integer(I4B) :: ncol, nparam
582 logical(LGP) :: shape_found
583 integer(I4B),
pointer :: pkgdata_maxbound
589 call ctx%init(this%mf6_input, blockname= &
590 this%mf6_input%block_dfns(iblk)%blockname)
592 param_names = ctx%params
593 nparam =
size(ctx%params)
594 call ctx%check_developmode(this%filename)
598 this%mf6_input%component_type, &
599 this%mf6_input%subcomponent_type, &
600 this%mf6_input%block_dfns(iblk)%blockname)
602 if (this%mf6_input%block_dfns(iblk)%block_variable)
then
603 blocknum = this%parser%GetInteger()
611 if (blocknum > 0) ncol = ncol + 1
613 if (idt%shape /=
'')
then
616 this%mf6_input%component_type, &
617 this%mf6_input%subcomponent_type, &
618 'DIMENSIONS', idt%shape, this%filename, &
620 if (.not. shape_found)
then
624 this%mf6_input%component_type, &
625 this%mf6_input%subcomponent_type, &
626 'PACKAGEDATA', idt%shape, this%filename, &
629 if (shape_found)
then
630 call get_isize(shape_idt%mf6varname, this%mf6_input%mempath, isize)
632 if (shape_idt%required)
then
633 write (
errmsg,
'(3a)')
'Required dimension "', &
634 trim(idt%shape),
'" not found.'
636 call this%parser%StoreErrorUnit()
639 call get_mem_rank(shape_idt%mf6varname, this%mf6_input%mempath, &
643 if (mem_rank == 0)
then
645 call mem_setptr(nrow, shape_idt%mf6varname, this%mf6_input%mempath)
647 else if (mem_rank == 1)
then
650 call mem_setptr(int1d, shape_idt%mf6varname, this%mf6_input%mempath)
662 blocknum, this%mf6_input%mempath, &
663 this%mf6_input%component_mempath, &
667 blocknum, this%mf6_input%mempath, &
668 this%mf6_input%component_mempath)
673 if (blocknum > 0)
then
675 blockvar_idt = this%block_index_dfn(iblk)
677 call this%structarray%mem_create_vector(icol, idt)
690 this%mf6_input%component_type, &
691 this%mf6_input%subcomponent_type, &
692 this%mf6_input%block_dfns(iblk)%blockname, &
693 param_names(iparam), this%filename)
695 call this%structarray%mem_create_vector(icol, idt)
699 call ctx%allocate_arrays()
704 if (ibinary == 1)
then
706 nrowsread = this%structarray%read_from_binary(oc_inunit, this%iout)
707 call this%parser%terminateblock()
711 nrowsread = this%structarray%read_from_parser(this%parser, this%ts_active, &
712 this%iout, this%filename)
714 if (this%ts_active)
call this%save_ts_sa()
719 if (this%mf6_input%block_dfns(iblk)%blockname ==
'PACKAGEDATA' .and. &
721 call get_isize(
'MAXBOUND', this%mf6_input%mempath, isize)
723 call mem_allocate(pkgdata_maxbound,
'MAXBOUND', this%mf6_input%mempath)
724 pkgdata_maxbound = nrowsread
737 n =
size(this%ts_sas)
744 integer(I4B),
intent(in) :: n
746 sa => this%ts_sas(n)%sa
754 character(len=*),
intent(in) :: memoryPath
755 integer(I4B),
intent(in) :: iout
756 integer(I4B),
pointer :: intvar
759 call idm_log_var(intvar, idt%tagname, memorypath, idt%datatype, iout)
768 character(len=*),
intent(in) :: memoryPath
769 integer(I4B),
intent(in) :: iout
770 character(len=LINELENGTH),
pointer :: cstr
771 character(len=LENBIGLINE),
pointer :: bigcstr
773 select case (idt%shape)
776 call mem_allocate(bigcstr, ilen, idt%mf6varname, memorypath)
777 call parser%GetString(bigcstr, (.not. idt%preserve_case))
778 call idm_log_var(bigcstr, idt%tagname, memorypath, iout)
781 call mem_allocate(cstr, ilen, idt%mf6varname, memorypath)
782 call parser%GetString(cstr, (.not. idt%preserve_case))
783 call idm_log_var(cstr, idt%tagname, memorypath, iout)
794 character(len=*),
intent(in) :: memoryPath
795 character(len=*),
intent(in) :: which
796 integer(I4B),
intent(in) :: iout
797 character(len=LINELENGTH) :: cstr
799 integer(I4B) :: ilen, isize, idx
801 if (which ==
'FILEIN')
then
802 call get_isize(idt%mf6varname, memorypath, isize)
804 call mem_allocate(charstr1d, ilen, 1, idt%mf6varname, memorypath)
807 call mem_setptr(charstr1d, idt%mf6varname, memorypath)
812 call parser%GetString(cstr, (.not. idt%preserve_case))
813 charstr1d(idx) = cstr
814 else if (which ==
'FILEOUT')
then
828 character(len=*),
intent(in) :: memoryPath
829 integer(I4B),
intent(in) :: iout
830 character(len=:),
allocatable :: line
831 character(len=LENAUXNAME),
dimension(:),
allocatable :: caux
833 integer(I4B) :: istart
834 integer(I4B) :: istop
836 character(len=LENPACKAGENAME) :: text =
''
837 integer(I4B),
pointer :: intvar
839 pointer,
contiguous :: acharstr1d
842 call parser%GetRemainingLine(line)
844 call urdaux(intvar, parser%iuactive, iout, lloc, &
845 istart, istop, caux, line, text)
848 acharstr1d(i) = caux(i)
859 character(len=*),
intent(in) :: memoryPath
860 integer(I4B),
intent(in) :: iout
861 integer(I4B),
pointer :: intvar
863 intvar = parser%GetInteger()
864 call idm_log_var(intvar, idt%tagname, memorypath, idt%datatype, iout)
870 nc_vars, input_fname, iout)
876 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
877 logical(LGP),
intent(in) :: export
879 character(len=*),
intent(in) :: input_fname
880 integer(I4B),
intent(in) :: iout
881 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
883 integer(I4B) :: nvals
884 integer(I4B),
dimension(:),
allocatable :: array_shape
885 integer(I4B),
dimension(:),
allocatable :: layer_shape
886 character(len=LINELENGTH) :: keyword
890 if (idt%shape ==
'NODES')
then
891 nvals = product(mshape)
894 nvals = array_shape(1)
898 call mem_allocate(int1d, nvals, idt%mf6varname, mf6_input%mempath)
902 call parser%GetStringCaps(keyword)
905 if (keyword ==
'NETCDF')
then
908 else if (keyword ==
'LAYERED' .and. idt%layered)
then
912 call read_int1d(parser, int1d, idt%mf6varname)
916 call idm_log_var(int1d, idt%tagname, mf6_input%mempath, iout)
920 if (idt%blockname ==
'GRIDDATA')
then
921 call idm_export(int1d, idt%tagname, mf6_input%mempath, idt%shape, iout)
929 nc_vars, input_fname, iout)
935 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
936 logical(LGP),
intent(in) :: export
938 character(len=*),
intent(in) :: input_fname
939 integer(I4B),
intent(in) :: iout
940 integer(I4B),
dimension(:, :),
pointer,
contiguous :: int2d
942 integer(I4B) :: nsize1, nsize2
943 integer(I4B),
dimension(:),
allocatable :: array_shape
944 integer(I4B),
dimension(:),
allocatable :: layer_shape
945 character(len=LINELENGTH) :: keyword
950 nsize1 = array_shape(1)
951 nsize2 = array_shape(2)
954 call mem_allocate(int2d, nsize1, nsize2, idt%mf6varname, mf6_input%mempath)
958 call parser%GetStringCaps(keyword)
961 if (keyword ==
'NETCDF')
then
964 else if (keyword ==
'LAYERED' .and. idt%layered)
then
968 call read_int2d(parser, int2d, idt%mf6varname)
972 call idm_log_var(int2d, idt%tagname, mf6_input%mempath, iout)
976 if (idt%blockname ==
'GRIDDATA')
then
977 call idm_export(int2d, idt%tagname, mf6_input%mempath, idt%shape, iout)
985 nc_vars, input_fname, iout)
991 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
992 logical(LGP),
intent(in) :: export
994 character(len=*),
intent(in) :: input_fname
995 integer(I4B),
intent(in) :: iout
996 integer(I4B),
dimension(:, :, :),
pointer,
contiguous :: int3d
998 integer(I4B) :: nsize1, nsize2, nsize3
999 integer(I4B),
dimension(:),
allocatable :: array_shape
1000 integer(I4B),
dimension(:),
allocatable :: layer_shape
1001 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d_ptr
1002 character(len=LINELENGTH) :: keyword
1007 nsize1 = array_shape(1)
1008 nsize2 = array_shape(2)
1009 nsize3 = array_shape(3)
1012 call mem_allocate(int3d, nsize1, nsize2, nsize3, idt%mf6varname, &
1017 call parser%GetStringCaps(keyword)
1020 if (keyword ==
'NETCDF')
then
1023 else if (keyword ==
'LAYERED' .and. idt%layered)
then
1028 int1d_ptr(1:nsize1 * nsize2 * nsize3) => int3d(:, :, :)
1029 call read_int1d(parser, int1d_ptr, idt%mf6varname)
1033 call idm_log_var(int3d, idt%tagname, mf6_input%mempath, iout)
1037 if (idt%blockname ==
'GRIDDATA')
then
1038 call idm_export(int3d, idt%tagname, mf6_input%mempath, idt%shape, iout)
1048 character(len=*),
intent(in) :: memoryPath
1049 integer(I4B),
intent(in) :: iout
1050 real(DP),
pointer :: dblvar
1052 dblvar = parser%GetDouble()
1053 call idm_log_var(dblvar, idt%tagname, memorypath, iout)
1059 nc_vars, input_fname, iout)
1065 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
1066 logical(LGP),
intent(in) :: export
1068 character(len=*),
intent(in) :: input_fname
1069 integer(I4B),
intent(in) :: iout
1070 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
1071 integer(I4B) :: nlay
1072 integer(I4B) :: nvals
1073 integer(I4B),
dimension(:),
allocatable :: array_shape
1074 integer(I4B),
dimension(:),
allocatable :: layer_shape
1075 character(len=LINELENGTH) :: keyword
1078 if (idt%shape ==
'NODES')
then
1079 nvals = product(mshape)
1082 nvals = array_shape(1)
1086 call mem_allocate(dbl1d, nvals, idt%mf6varname, mf6_input%mempath)
1090 call parser%GetStringCaps(keyword)
1093 if (keyword ==
'NETCDF')
then
1096 else if (keyword ==
'LAYERED' .and. idt%layered)
then
1100 call read_dbl1d(parser, dbl1d, idt%mf6varname)
1104 call idm_log_var(dbl1d, idt%tagname, mf6_input%mempath, iout)
1108 if (idt%blockname ==
'GRIDDATA')
then
1109 call idm_export(dbl1d, idt%tagname, mf6_input%mempath, idt%shape, iout)
1117 nc_vars, input_fname, iout)
1123 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
1124 logical(LGP),
intent(in) :: export
1126 character(len=*),
intent(in) :: input_fname
1127 integer(I4B),
intent(in) :: iout
1128 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
1129 integer(I4B) :: nlay
1130 integer(I4B) :: nsize1, nsize2
1131 integer(I4B),
dimension(:),
allocatable :: array_shape
1132 integer(I4B),
dimension(:),
allocatable :: layer_shape
1133 character(len=LINELENGTH) :: keyword
1138 nsize1 = array_shape(1)
1139 nsize2 = array_shape(2)
1142 call mem_allocate(dbl2d, nsize1, nsize2, idt%mf6varname, mf6_input%mempath)
1146 call parser%GetStringCaps(keyword)
1149 if (keyword ==
'NETCDF')
then
1152 else if (keyword ==
'LAYERED' .and. idt%layered)
then
1156 call read_dbl2d(parser, dbl2d, idt%mf6varname)
1160 call idm_log_var(dbl2d, idt%tagname, mf6_input%mempath, iout)
1164 if (idt%blockname ==
'GRIDDATA')
then
1165 call idm_export(dbl2d, idt%tagname, mf6_input%mempath, idt%shape, iout)
1173 nc_vars, input_fname, iout)
1179 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
1180 logical(LGP),
intent(in) :: export
1182 character(len=*),
intent(in) :: input_fname
1183 integer(I4B),
intent(in) :: iout
1184 real(DP),
dimension(:, :, :),
pointer,
contiguous :: dbl3d
1185 integer(I4B) :: nlay
1186 integer(I4B) :: nsize1, nsize2, nsize3
1187 integer(I4B),
dimension(:),
allocatable :: array_shape
1188 integer(I4B),
dimension(:),
allocatable :: layer_shape
1189 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d_ptr
1190 character(len=LINELENGTH) :: keyword
1195 nsize1 = array_shape(1)
1196 nsize2 = array_shape(2)
1197 nsize3 = array_shape(3)
1200 call mem_allocate(dbl3d, nsize1, nsize2, nsize3, idt%mf6varname, &
1205 call parser%GetStringCaps(keyword)
1208 if (keyword ==
'NETCDF')
then
1211 else if (keyword ==
'LAYERED' .and. idt%layered)
then
1216 dbl1d_ptr(1:nsize1 * nsize2 * nsize3) => dbl3d(:, :, :)
1217 call read_dbl1d(parser, dbl1d_ptr, idt%mf6varname)
1221 call idm_log_var(dbl3d, idt%tagname, mf6_input%mempath, iout)
1225 if (idt%blockname ==
'GRIDDATA')
then
1226 call idm_export(dbl3d, idt%tagname, mf6_input%mempath, idt%shape, iout)
1239 integer(I4B),
intent(inout) :: oc_inunit
1240 integer(I4B),
intent(in) :: iout
1241 integer(I4B) :: ibinary
1242 integer(I4B) :: lloc, istart, istop, idum, inunit, itmp, ierr
1243 integer(I4B) :: nunopn = 99
1244 character(len=:),
allocatable :: line
1245 character(len=LINELENGTH) :: fname
1246 logical(LGP) :: exists
1248 character(len=*),
parameter :: fmtocne = &
1249 &
"('Specified OPEN/CLOSE file ',(A),' does not exist')"
1250 character(len=*),
parameter :: fmtobf = &
1251 &
"(1X,/1X,'OPENING BINARY FILE ON UNIT ',I0,':',/1X,A)"
1256 inunit = parser%getunit()
1260 call parser%line_reader%rdcom(inunit, iout, line, ierr)
1261 call urword(line, lloc, istart, istop, 1, idum, r, iout, inunit)
1263 if (line(istart:istop) ==
'OPEN/CLOSE')
then
1265 call urword(line, lloc, istart, istop, 0, idum, r, &
1267 fname = line(istart:istop)
1269 inquire (file=fname, exist=exists)
1270 if (.not. exists)
then
1271 write (
errmsg, fmtocne) line(istart:istop)
1273 call store_error(
'Specified OPEN/CLOSE file does not exist')
1278 call urword(line, lloc, istart, istop, 1, idum, r, &
1281 if (line(istart:istop) ==
'(BINARY)') ibinary = 1
1283 if (ibinary == 1)
then
1288 write (iout, fmtobf) oc_inunit, trim(adjustl(fname))
1290 call openfile(oc_inunit, itmp, fname,
'OPEN/CLOSE', &
1295 if (ibinary == 0)
then
1296 call parser%line_reader%bkspc(parser%getunit())
1309 logical(LGP) :: has_ts
1310 integer(I4B) :: m, n
1314 do m = 1, this%structarray%count()
1315 svect => this%structarray%get(m)
1316 if (svect%idt%timeseries .and. svect%ts_strlocs%count() > 0)
then
1323 n =
size(this%ts_sas)
1324 allocate (tmp(n + 1))
1325 tmp(1:n) = this%ts_sas
1326 tmp(n + 1)%sa => this%structarray
1327 call move_alloc(tmp, this%ts_sas)
1329 nullify (this%structarray)
1341 do n = 1,
size(this%ts_sas)
1342 if (
associated(this%ts_sas(n)%sa))
then
1344 nullify (this%ts_sas(n)%sa)
1347 deallocate (this%ts_sas)
This module contains block parser methods.
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
integer(i4b), parameter lenpackagename
maximum length of the package name
integer(i4b), parameter lenbigline
maximum length of a big line
integer(i4b), parameter lenvarname
maximum length of a variable name
integer(i4b), parameter lenauxname
maximum length of a aux variable
This module contains the DefinitionSelectModule.
subroutine, public split_record_dfn_tag1(input_definition_types, component_type, subcomponent_type, tagname, nwords, words)
Return aggregate definition.
type(inputparamdefinitiontype) function, pointer, public get_aggregate_definition_type(input_definition_types, component_type, subcomponent_type, blockname)
Return aggregate definition.
subroutine, public split_record_dfn_tag2(input_definition_types, component_type, subcomponent_type, tagname, tag2, nwords, words)
Return aggregate definition.
character(len=linelength) function, public idt_datatype(idt)
return input definition type datatype
type(inputparamdefinitiontype) function, pointer, public get_param_definition_type(input_definition_types, component_type, subcomponent_type, blockname, tagname, filename, found)
Return parameter definition.
subroutine, public read_dbl1d(parser, dbl1d, aname)
subroutine, public read_dbl2d(parser, dbl2d, aname)
Disable development features in release mode.
subroutine, public developmode(errmsg, iunit)
Terminate if in release mode (guard development features)
This module contains the Input Data Model Logger Module.
subroutine, public idm_log_close(component, subcomponent, iout)
@ brief log the closing message
subroutine, public idm_log_header(component, subcomponent, iout)
@ brief log a header message
subroutine, public read_int1d(parser, int1d, aname)
subroutine, public read_int2d(parser, int2d, aname)
This module defines variable data types.
subroutine, public read_int1d_layered(parser, int1d, aname, nlay, layer_shape)
subroutine, public read_dbl1d_layered(parser, dbl1d, aname, nlay, layer_shape)
subroutine, public read_dbl2d_layered(parser, dbl2d, aname, nlay, layer_shape)
subroutine, public read_int3d_layered(parser, int3d, aname, nlay, layer_shape)
subroutine, public read_dbl3d_layered(parser, dbl3d, aname, nlay, layer_shape)
subroutine, public read_int2d_layered(parser, int2d, aname, nlay, layer_shape)
Load context for IDM generic dynamic loaders.
logical(lgp) function, public is_feature_keystring(mf6_input)
.true. if mf6_input's PERIOD block is feature-addressed (see is_feature_tag). Block-independent,...
This module contains the LoadMf6FileModule.
subroutine cleanup(this)
Clean up saved static structarrays.
type(inputparamdefinitiontype) function block_index_dfn(this, iblk)
subroutine load_integer1d_type(parser, idt, mf6_input, mshape, export, nc_vars, input_fname, iout)
load type 1d integer
subroutine load_io_tag(parser, idt, memoryPath, which, iout)
load io tag
subroutine load_double3d_type(parser, idt, mf6_input, mshape, export, nc_vars, input_fname, iout)
load type 3d double
subroutine load_string_type(parser, idt, memoryPath, iout)
load type string
type(structarraytype) function, pointer get_ts_sa(this, n)
Return the n-th saved static StructArray pointer.
subroutine load_keyword_type(parser, idt, memoryPath, iout)
load type keyword
subroutine load_auxvar_names(parser, idt, memoryPath, iout)
load aux variable names
subroutine load_double1d_type(parser, idt, mf6_input, mshape, export, nc_vars, input_fname, iout)
load type 1d double
subroutine load_block(this, iblk)
load a single block
subroutine parse_io_tag(this, iblk, pkgtype, which, tag)
subroutine save_ts_sa(this)
Save structarray pointer for deferred TS linking.
subroutine load_double2d_type(parser, idt, mf6_input, mshape, export, nc_vars, input_fname, iout)
load type 2d double
subroutine load_integer_type(parser, idt, memoryPath, iout)
load type integer
recursive subroutine parse_block(this, iblk, recursive_call)
parse block
subroutine load_integer3d_type(parser, idt, mf6_input, mshape, export, nc_vars, input_fname, iout)
load type 3d integer
subroutine block_post_process(this, iblk)
Post parse block handling.
integer(i4b) function ts_sa_count(this)
Return number of saved static StructArrays with deferred TS strlocs.
subroutine finalize(this)
finalize
subroutine load_tag(this, iblk, idt)
load input keyword Load input associated with tag key into the memory manager.
subroutine load_double_type(parser, idt, memoryPath, iout)
load type double
subroutine load_integer2d_type(parser, idt, mf6_input, mshape, export, nc_vars, input_fname, iout)
load type 2d integer
subroutine parse_structarray_block(this, iblk)
parse a structured array record into memory manager
subroutine load(this, parser, mf6_input, nc_vars, filename, iout)
load all static input blocks
integer(i4b) function, public read_control_record(parser, oc_inunit, iout)
recursive subroutine parse_record_tag(this, iblk, inidt, recursive_call)
subroutine, public get_from_memorystore(name, mem_path, mt, found, check)
@ brief Get a memory type entry from the memory list
subroutine, public get_isize(name, mem_path, isize)
@ brief Get the number of elements for this variable
subroutine, public get_mem_rank(name, mem_path, rank)
@ brief Get the variable rank
This module contains the NCFileVarsModule.
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
subroutine, public store_error_unit(iunit, terminate)
Store the file unit number.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
This module contains the SourceCommonModule.
subroutine, public get_layered_shape(mshape, nlay, layer_shape)
subroutine, public get_shape_from_string(shape_string, array_shape, memoryPath)
subroutine, public set_model_shape(ftype, fname, model_mempath, dis_mempath, model_shape)
routine for setting the model shape
This module contains the StructArrayModule.
subroutine, public destructstructarray(struct_array)
destructor for a struct_array
type(structarraytype) function, pointer, public constructstructarray(mf6_input, ncol, nrow, blocknum, mempath, component_mempath, size_init)
constructor for a struct_array
This module contains the StructVectorModule.
This class is used to store a single deferred-length character string. It was designed to work in an ...
Input load context for generic dynamic loaders and StructArray based static loads....
Static parser based input loader.
Fortran workaround for allocatable arrays of pointers; wraps a StructArray pointer for deferred TS li...
Type describing input variables for a package in NetCDF file.
type for structured array
derived type for generic vector