MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
LoadMf6File.f90
Go to the documentation of this file.
1 !> @brief This module contains the LoadMf6FileModule
2 !!
3 !! This module contains the input data model routines for
4 !! loading static data from a MODFLOW 6 input file using the
5 !! block parser.
6 !!
7 !<
9 
10  use kindmodule, only: dp, i4b, lgp
11  use simvariablesmodule, only: errmsg
12  use simmodule, only: store_error
25  use inputoutputmodule, only: parseline
36 
37  implicit none
38  private
39  public :: loadmf6filetype
40  public :: read_control_record
41 
42  !> @brief Static parser based input loader
43  !!
44  !! This type defines a static input context loader
45  !! for traditional mf6 ascii input files.
46  !!
47  !<
49  type(blockparsertype), pointer :: parser !< ascii block parser
50  integer(I4B), dimension(:), pointer, contiguous :: mshape => null() !< model shape
51  type(structarraytype), pointer :: structarray => null() !< structarray for loading list input
52  type(modflowinputtype) :: mf6_input !< description of input
53  type(ncpackagevarstype), pointer :: nc_vars => null()
54  character(len=LINELENGTH) :: filename !< name of ascii input file
55  character(len=LINELENGTH), dimension(:), allocatable :: block_tags !< read block tags
56  logical(LGP) :: ts_active !< is timeseries active
57  logical(LGP) :: export !< is array export active
58  logical(LGP) :: readasarrays
59  integer(I4B) :: inamedbound
60  integer(I4B) :: iauxiliary
61  integer(I4B) :: iout !< inunit for list log
62  contains
63  procedure :: load
64  procedure :: init
65  procedure :: load_block
66  procedure :: finalize
67  procedure :: parse_block
68  procedure :: block_post_process
69  procedure :: parse_io_tag
70  procedure :: parse_keyword_tag
71  procedure :: parse_tag
72  procedure :: block_index_dfn
74  end type loadmf6filetype
75 
76 contains
77 
78  !> @brief load all static input blocks
79  !!
80  !! Invoke this routine to load all static input blocks
81  !! in single call.
82  !!
83  !<
84  subroutine load(this, parser, mf6_input, nc_vars, filename, iout)
86  class(loadmf6filetype) :: this
87  type(blockparsertype), target, intent(inout) :: parser
88  type(modflowinputtype), intent(in) :: mf6_input
89  type(ncpackagevarstype), pointer, intent(in) :: nc_vars
90  character(len=*), intent(in) :: filename
91  integer(I4B), intent(in) :: iout
92  integer(I4B) :: iblk
93 
94  ! initialize static load
95  call this%init(parser, mf6_input, filename, iout)
96 
97  ! set netcdf vars
98  this%nc_vars => nc_vars
99 
100  ! process blocks
101  do iblk = 1, size(this%mf6_input%block_dfns)
102  ! don't load dynamic input data
103  if (this%mf6_input%block_dfns(iblk)%blockname == 'PERIOD') exit
104  ! load the block
105  call this%load_block(iblk)
106  end do
107 
108  ! finalize static load
109  call this%finalize()
110  end subroutine load
111 
112  !> @brief init
113  !!
114  !! init / finalize are only used when load_block() will be called
115  !!
116  !<
117  subroutine init(this, parser, mf6_input, filename, iout)
118  use memorymanagermodule, only: get_isize
119  class(loadmf6filetype) :: this
120  type(blockparsertype), target, intent(inout) :: parser
121  type(modflowinputtype), intent(in) :: mf6_input
122  character(len=*), intent(in) :: filename
123  integer(I4B), intent(in) :: iout
124  integer(I4B) :: isize
125 
126  this%parser => parser
127  this%mf6_input = mf6_input
128  this%filename = filename
129  this%ts_active = .false.
130  this%export = .false.
131  this%readasarrays = .false.
132  this%inamedbound = 0
133  this%iauxiliary = 0
134  this%iout = iout
135 
136  call get_isize('MODEL_SHAPE', mf6_input%component_mempath, isize)
137  if (isize > 0) then
138  call mem_setptr(this%mshape, 'MODEL_SHAPE', mf6_input%component_mempath)
139  end if
140 
141  ! log lst file header
142  call idm_log_header(this%mf6_input%component_name, &
143  this%mf6_input%subcomponent_name, this%iout)
144  end subroutine init
145 
146  !> @brief load a single block
147  !!
148  !! Assumed in order load of single (next) block. If a
149  !! StructArray object is allocated to load this block
150  !! it persists until this routine (or finalize) is
151  !! called again.
152  !!
153  !<
154  subroutine load_block(this, iblk)
156  class(loadmf6filetype) :: this
157  integer(I4B), intent(in) :: iblk
158 
159  ! reset structarray if it was created for previous block
160  if (associated(this%structarray)) then
161  ! destroy the structured array reader
162  call destructstructarray(this%structarray)
163  end if
164 
165  allocate (this%block_tags(0))
166  ! load the block
167  call this%parse_block(iblk, .false.)
168  ! post process block
169  call this%block_post_process(iblk)
170  ! cleanup
171  deallocate (this%block_tags)
172  end subroutine load_block
173 
174  !> @brief finalize
175  !!
176  !! init / finalize are only used when load_block() will be called
177  !!
178  !<
179  subroutine finalize(this)
181  class(loadmf6filetype) :: this
182  ! cleanup
183  if (associated(this%structarray)) then
184  ! destroy the structured array reader
185  call destructstructarray(this%structarray)
186  end if
187  ! close logging block
188  call idm_log_close(this%mf6_input%component_name, &
189  this%mf6_input%subcomponent_name, this%iout)
190  end subroutine finalize
191 
192  !> @brief Post parse block handling
193  !!
194  !<
195  subroutine block_post_process(this, iblk)
196  use constantsmodule, only: lenboundname
199  class(loadmf6filetype) :: this
200  integer(I4B), intent(in) :: iblk
201  type(inputparamdefinitiontype), pointer :: idt
202  integer(I4B) :: iparam
203  integer(I4B), pointer :: intptr
204 
205  ! update state based on read tags
206  do iparam = 1, size(this%block_tags)
207  select case (this%mf6_input%block_dfns(iblk)%blockname)
208  case ('OPTIONS')
209  if (this%block_tags(iparam) == 'AUXILIARY') then
210  this%iauxiliary = 1
211  else if (this%block_tags(iparam) == 'BOUNDNAMES') then
212  this%inamedbound = 1
213  else if (this%block_tags(iparam) == 'READASARRAYS') then
214  this%readasarrays = .true.
215  else if (this%block_tags(iparam) == 'TS6') then
216  this%ts_active = .true.
217  else if (this%block_tags(iparam) == 'EXPORT_ARRAY_ASCII') then
218  this%export = .true.
219  end if
220  case default
221  end select
222  end do
223 
224  ! update input context allocations based on dfn set and input
225  select case (this%mf6_input%block_dfns(iblk)%blockname)
226  case ('OPTIONS')
227  ! allocate naux and set to 0 if not allocated
228  do iparam = 1, size(this%mf6_input%param_dfns)
229  idt => this%mf6_input%param_dfns(iparam)
230  if (idt%blockname == 'OPTIONS' .and. &
231  idt%tagname == 'AUXILIARY') then
232  if (this%iauxiliary == 0) then
233  call mem_allocate(intptr, 'NAUX', this%mf6_input%mempath)
234  intptr = 0
235  end if
236  exit
237  end if
238  end do
239  case ('DIMENSIONS')
240  ! set model shape if discretization dimensions have been read
241  if (this%mf6_input%pkgtype(1:3) == 'DIS') then
242  call set_model_shape(this%mf6_input%pkgtype, this%filename, &
243  this%mf6_input%component_mempath, &
244  this%mf6_input%mempath, this%mshape)
245  end if
246  case default
247  end select
248  end subroutine block_post_process
249 
250  !> @brief parse block
251  !!
252  !<
253  recursive subroutine parse_block(this, iblk, recursive_call)
254  use memorytypemodule, only: memorytype
256  class(loadmf6filetype) :: this
257  integer(I4B), intent(in) :: iblk
258  logical(LGP), intent(in) :: recursive_call !< true if recursive call
259  logical(LGP) :: isblockfound
260  logical(LGP) :: endofblock
261  logical(LGP) :: supportopenclose
262  integer(I4B) :: ierr
263  logical(LGP) :: found, required
264  type(memorytype), pointer :: mt
265 
266  ! disu vertices/cell2d blocks are contingent on NVERT dimension
267  if (this%mf6_input%pkgtype == 'DISU6' .or. &
268  this%mf6_input%pkgtype == 'DISV1D6' .or. &
269  this%mf6_input%pkgtype == 'DISV2D6') then
270  if (this%mf6_input%block_dfns(iblk)%blockname == 'VERTICES' .or. &
271  this%mf6_input%block_dfns(iblk)%blockname == 'CELL2D') then
272  call get_from_memorystore('NVERT', this%mf6_input%mempath, mt, found, &
273  .false.)
274  if (.not. found) return
275  if (mt%intsclr == 0) return
276  end if
277  end if
278 
279  ! block open/close support
280  supportopenclose = (this%mf6_input%block_dfns(iblk)%blockname /= 'GRIDDATA')
281 
282  ! parser search for block
283  required = this%mf6_input%block_dfns(iblk)%required .and. .not. recursive_call
284  call this%parser%GetBlock(this%mf6_input%block_dfns(iblk)%blockname, &
285  isblockfound, ierr, &
286  supportopenclose=supportopenclose, &
287  blockrequired=required)
288  ! process block
289  if (isblockfound) then
290  if (this%mf6_input%block_dfns(iblk)%aggregate) then
291  ! process block recarray type, set of variable 1d/2d types
292  call this%parse_structarray_block(iblk)
293  else
294  do
295  ! process each line in block
296  call this%parser%GetNextLine(endofblock)
297  if (endofblock) exit
298  ! process line as tag(s)
299  call this%parse_tag(iblk, .false.)
300  end do
301  end if
302  end if
303 
304  ! recurse if block is reloadable and was just read
305  if (this%mf6_input%block_dfns(iblk)%block_variable) then
306  if (isblockfound) then
307  call this%parse_block(iblk, .true.)
308  end if
309  end if
310  end subroutine parse_block
311 
312  subroutine parse_io_tag(this, iblk, pkgtype, which, tag)
313  class(loadmf6filetype) :: this
314  integer(I4B), intent(in) :: iblk
315  character(len=*), intent(in) :: pkgtype
316  character(len=*), intent(in) :: which
317  character(len=*), intent(in) :: tag
318  type(inputparamdefinitiontype), pointer :: idt !< input data type object describing this record
319  ! matches, read and load file name
320  idt => &
321  get_param_definition_type(this%mf6_input%param_dfns, &
322  this%mf6_input%component_type, &
323  this%mf6_input%subcomponent_type, &
324  this%mf6_input%block_dfns(iblk)%blockname, &
325  tag, this%filename)
326  ! load io tag
327  call load_io_tag(this%parser, idt, this%mf6_input%mempath, which, this%iout)
328  end subroutine parse_io_tag
329 
330  subroutine parse_keyword_tag(this, iblk, tag, idt)
332  class(loadmf6filetype) :: this
333  integer(I4B), intent(in) :: iblk
334  character(len=LINELENGTH), intent(in) :: tag
335  type(inputparamdefinitiontype), pointer, intent(in) :: idt
336  character(len=40), dimension(:), allocatable :: words
337  integer(I4B) :: nwords
338  character(len=LINELENGTH) :: io_tag
339  logical(LGP) :: found
340 
341  ! initialization
342  found = .false.
343 
344  ! if in record tag check and load if input/output file
345  if (idt%in_record) then
346  ! get tokens in matching definition
347  call split_record_definition(this%mf6_input%param_dfns, &
348  this%mf6_input%component_type, &
349  this%mf6_input%subcomponent_type, &
350  tag, nwords, words)
351  ! a filein/fileout record tag definition has 4 tokens
352  if (nwords == 4) then
353  ! verify third definition token is FILEIN/FILEOUT
354  if (words(3) == 'FILEIN' .or. words(3) == 'FILEOUT') then
355  ! read 3rd token
356  call this%parser%GetStringCaps(io_tag)
357  ! check if 3rd token matches definition
358  if (io_tag == words(3)) then
359  call this%parse_io_tag(iblk, words(2), words(3), words(4))
360  found = .true.
361  else
362  errmsg = 'Expected "'//trim(words(3))//'" following keyword "'// &
363  trim(tag)//'" but instead found "'//trim(io_tag)//'"'
364  call store_error(errmsg)
365  call this%parser%StoreErrorUnit()
366  end if
367  end if
368  end if
369 
370  ! deallocate words
371  if (allocated(words)) deallocate (words)
372  end if
373 
374  if (.not. found) then
375  ! load standard keyword tag
376  call load_keyword_type(this%parser, idt, this%mf6_input%mempath, this%iout)
377  ! check/set as dev option
378  if (idt%tagname(1:4) == 'DEV_' .and. &
379  this%mf6_input%block_dfns(iblk)%blockname == 'OPTIONS') then
380  call this%parser%DevOpt()
381  end if
382  end if
383  end subroutine parse_keyword_tag
384 
385  !> @brief load an individual input record into memory
386  !!
387  !! Load an individual input record into the memory
388  !! manager. Allow for recursive calls in the case that multiple
389  !! tags are on a single line.
390  !!
391  !<
392  recursive subroutine parse_tag(this, iblk, recursive_call)
394  class(loadmf6filetype) :: this
395  integer(I4B), intent(in) :: iblk
396  logical(LGP), intent(in) :: recursive_call !< true if recursive call
397  character(len=LINELENGTH) :: tag
398  type(inputparamdefinitiontype), pointer :: idt !< input data type object describing this record
399 
400  ! read tag name
401  call this%parser%GetStringCaps(tag)
402  if (recursive_call) then
403  if (tag == '') then
404  ! no data on line so return
405  return
406  end if
407  end if
408 
409  ! find keyword in input definition
410  idt => get_param_definition_type(this%mf6_input%param_dfns, &
411  this%mf6_input%component_type, &
412  this%mf6_input%subcomponent_type, &
413  this%mf6_input%block_dfns(iblk)%blockname, &
414  tag, this%filename)
415 
416  ! allocate and load data type
417  select case (idt%datatype)
418  case ('KEYWORD')
419  call this%parse_keyword_tag(iblk, tag, idt)
420  case ('STRING')
421  if (idt%shape == 'NAUX') then
422  call load_auxvar_names(this%parser, idt, this%mf6_input%mempath, &
423  this%iout)
424  else
425  call load_string_type(this%parser, idt, this%mf6_input%mempath, this%iout)
426  end if
427  case ('INTEGER')
428  call load_integer_type(this%parser, idt, this%mf6_input%mempath, this%iout)
429  case ('INTEGER1D')
430  call load_integer1d_type(this%parser, idt, this%mf6_input, this%mshape, &
431  this%export, this%nc_vars, this%filename, &
432  this%iout)
433  case ('INTEGER2D')
434  call load_integer2d_type(this%parser, idt, this%mf6_input, this%mshape, &
435  this%export, this%nc_vars, this%filename, &
436  this%iout)
437  case ('INTEGER3D')
438  call load_integer3d_type(this%parser, idt, this%mf6_input, this%mshape, &
439  this%export, this%nc_vars, this%filename, &
440  this%iout)
441  case ('DOUBLE')
442  call load_double_type(this%parser, idt, this%mf6_input%mempath, this%iout)
443  case ('DOUBLE1D')
444  call load_double1d_type(this%parser, idt, this%mf6_input, this%mshape, &
445  this%export, this%nc_vars, this%filename, this%iout)
446  case ('DOUBLE2D')
447  call load_double2d_type(this%parser, idt, this%mf6_input, this%mshape, &
448  this%export, this%nc_vars, this%filename, this%iout)
449  case ('DOUBLE3D')
450  call load_double3d_type(this%parser, idt, this%mf6_input, this%mshape, &
451  this%export, this%nc_vars, this%filename, this%iout)
452  case default
453  write (errmsg, '(a,a)') 'Failure reading data for tag: ', trim(tag)
454  call store_error(errmsg)
455  call this%parser%StoreErrorUnit()
456  end select
457 
458  ! continue line if in same record
459  if (idt%in_record) then
460  ! recursively call parse tag again to read rest of line
461  call this%parse_tag(iblk, .true.)
462  end if
463 
464  call expandarray(this%block_tags)
465  this%block_tags(size(this%block_tags)) = trim(idt%tagname)
466  end subroutine parse_tag
467 
468  function block_index_dfn(this, iblk) result(idt)
469  class(loadmf6filetype) :: this
470  integer(I4B), intent(in) :: iblk
471  type(inputparamdefinitiontype) :: idt !< input data type object describing this record
472  character(len=LENVARNAME) :: varname
473  integer(I4B) :: ilen
474  character(len=3) :: block_suffix = 'NUM'
475 
476  ! assign first column as the block number
477  ilen = len_trim(this%mf6_input%block_dfns(iblk)%blockname)
478 
479  if (ilen > (lenvarname - len(block_suffix))) then
480  varname = &
481  this%mf6_input%block_dfns(iblk)% &
482  blockname(1:(lenvarname - len(block_suffix)))//block_suffix
483  else
484  varname = trim(this%mf6_input%block_dfns(iblk)%blockname)//block_suffix
485  end if
486 
487  idt%component_type = trim(this%mf6_input%component_type)
488  idt%subcomponent_type = trim(this%mf6_input%subcomponent_type)
489  idt%blockname = trim(this%mf6_input%block_dfns(iblk)%blockname)
490  idt%tagname = varname
491  idt%mf6varname = varname
492  idt%datatype = 'INTEGER'
493  end function block_index_dfn
494 
495  !> @brief parse a structured array record into memory manager
496  !!
497  !! A structarray is similar to a numpy recarray. It it used to
498  !! load a list of data in which each column in the list may be a
499  !! different type. Each column in the list is stored as a 1d
500  !! vector.
501  !!
502  !<
503  subroutine parse_structarray_block(this, iblk)
506  class(loadmf6filetype) :: this
507  integer(I4B), intent(in) :: iblk
508  type(dynamicpackageparamstype) :: block_params
509  type(inputparamdefinitiontype), pointer :: idt !< input data type object describing this record
510  type(inputparamdefinitiontype), target :: blockvar_idt
511  integer(I4B) :: blocknum
512  integer(I4B), pointer :: nrow
513  integer(I4B) :: nrows, nrowsread
514  integer(I4B) :: ibinary, oc_inunit
515  integer(I4B) :: icol, iparam
516  integer(I4B) :: ncol
517 
518  ! initialize package params object
519  call block_params%init(this%mf6_input, &
520  this%mf6_input%block_dfns(iblk)%blockname, &
521  this%readasarrays, this%iauxiliary, this%inamedbound)
522  ! set input definition for this block
523  idt => &
524  get_aggregate_definition_type(this%mf6_input%aggregate_dfns, &
525  this%mf6_input%component_type, &
526  this%mf6_input%subcomponent_type, &
527  this%mf6_input%block_dfns(iblk)%blockname)
528  ! if block is reloadable read the block number
529  if (this%mf6_input%block_dfns(iblk)%block_variable) then
530  blocknum = this%parser%GetInteger()
531  else
532  blocknum = 0
533  end if
534 
535  ! set ncol
536  ncol = block_params%nparam
537  ! add col if block is reloadable
538  if (blocknum > 0) ncol = ncol + 1
539  ! use shape to set the max num of rows
540  if (idt%shape /= '') then
541  call mem_setptr(nrow, idt%shape, this%mf6_input%mempath)
542  nrows = nrow
543  else
544  nrows = -1
545  end if
546 
547  ! create a structured array
548  this%structarray => constructstructarray(this%mf6_input, ncol, nrows, &
549  blocknum, this%mf6_input%mempath, &
550  this%mf6_input%component_mempath)
551  ! create structarray vectors for each column
552  do icol = 1, ncol
553  ! if block is reloadable, block number is first column
554  if (blocknum > 0) then
555  if (icol == 1) then
556  blockvar_idt = this%block_index_dfn(iblk)
557  idt => blockvar_idt
558  call this%structarray%mem_create_vector(icol, idt)
559  ! continue as this column managed by internally SA object
560  cycle
561  end if
562  ! set indexes (where first column is blocknum)
563  iparam = icol - 1
564  else
565  ! set indexes (no blocknum column)
566  iparam = icol
567  end if
568  ! set pointer to input definition for this 1d vector
569  idt => &
570  get_param_definition_type(this%mf6_input%param_dfns, &
571  this%mf6_input%component_type, &
572  this%mf6_input%subcomponent_type, &
573  this%mf6_input%block_dfns(iblk)%blockname, &
574  block_params%params(iparam), this%filename)
575  ! allocate variable in memory manager
576  call this%structarray%mem_create_vector(icol, idt)
577  end do
578 
579  ! read the block control record
580  ibinary = read_control_record(this%parser, oc_inunit, this%iout)
581 
582  if (ibinary == 1) then
583  ! read from binary
584  nrowsread = this%structarray%read_from_binary(oc_inunit, this%iout)
585  call this%parser%terminateblock()
586  close (oc_inunit)
587  else
588  ! read from ascii
589  nrowsread = this%structarray%read_from_parser(this%parser, this%ts_active, &
590  this%iout)
591  end if
592 
593  ! clean up
594  call block_params%destroy()
595  end subroutine parse_structarray_block
596 
597  !> @brief load type keyword
598  !<
599  subroutine load_keyword_type(parser, idt, memoryPath, iout)
600  type(blockparsertype), intent(inout) :: parser !< block parser
601  type(inputparamdefinitiontype), intent(in) :: idt !< input data type object describing this record
602  character(len=*), intent(in) :: memoryPath !< memorypath to put loaded information
603  integer(I4B), intent(in) :: iout !< unit number for output
604  integer(I4B), pointer :: intvar
605  call mem_allocate(intvar, idt%mf6varname, memorypath)
606  intvar = 1
607  call idm_log_var(intvar, idt%tagname, memorypath, idt%datatype, iout)
608  end subroutine load_keyword_type
609 
610  !> @brief load type string
611  !<
612  subroutine load_string_type(parser, idt, memoryPath, iout)
613  use constantsmodule, only: lenbigline
614  type(blockparsertype), intent(inout) :: parser !< block parser
615  type(inputparamdefinitiontype), intent(in) :: idt !< input data type object describing this record
616  character(len=*), intent(in) :: memoryPath !< memorypath to put loaded information
617  integer(I4B), intent(in) :: iout !< unit number for output
618  character(len=LINELENGTH), pointer :: cstr
619  character(len=LENBIGLINE), pointer :: bigcstr
620  integer(I4B) :: ilen
621  select case (idt%shape)
622  case ('LENBIGLINE')
623  ilen = lenbigline
624  call mem_allocate(bigcstr, ilen, idt%mf6varname, memorypath)
625  call parser%GetString(bigcstr, (.not. idt%preserve_case))
626  call idm_log_var(bigcstr, idt%tagname, memorypath, iout)
627  case default
628  ilen = linelength
629  call mem_allocate(cstr, ilen, idt%mf6varname, memorypath)
630  call parser%GetString(cstr, (.not. idt%preserve_case))
631  call idm_log_var(cstr, idt%tagname, memorypath, iout)
632  end select
633  end subroutine load_string_type
634 
635  !> @brief load io tag
636  !<
637  subroutine load_io_tag(parser, idt, memoryPath, which, iout)
641  type(blockparsertype), intent(inout) :: parser !< block parser
642  type(inputparamdefinitiontype), intent(in) :: idt !< input data type object describing this record
643  character(len=*), intent(in) :: memoryPath !< memorypath to put loaded information
644  character(len=*), intent(in) :: which
645  integer(I4B), intent(in) :: iout !< unit number for output
646  character(len=LINELENGTH) :: cstr
647  type(characterstringtype), dimension(:), pointer, contiguous :: charstr1d
648  integer(I4B) :: ilen, isize, idx
649  ilen = linelength
650  if (which == 'FILEIN') then
651  call get_isize(idt%mf6varname, memorypath, isize)
652  if (isize < 0) then
653  call mem_allocate(charstr1d, ilen, 1, idt%mf6varname, memorypath)
654  idx = 1
655  else
656  call mem_setptr(charstr1d, idt%mf6varname, memorypath)
657  call mem_reallocate(charstr1d, ilen, isize + 1, idt%mf6varname, &
658  memorypath)
659  idx = isize + 1
660  end if
661  call parser%GetString(cstr, (.not. idt%preserve_case))
662  charstr1d(idx) = cstr
663  else if (which == 'FILEOUT') then
664  call load_string_type(parser, idt, memorypath, iout)
665  end if
666  end subroutine load_io_tag
667 
668  !> @brief load aux variable names
669  !!
670  !<
671  subroutine load_auxvar_names(parser, idt, memoryPath, iout)
673  use inputoutputmodule, only: urdaux
675  type(blockparsertype), intent(inout) :: parser !< block parser
676  type(inputparamdefinitiontype), intent(in) :: idt !< input data type object describing this record
677  character(len=*), intent(in) :: memoryPath !< memorypath to put loaded information
678  integer(I4B), intent(in) :: iout !< unit number for output
679  character(len=:), allocatable :: line
680  character(len=LENAUXNAME), dimension(:), allocatable :: caux
681  integer(I4B) :: lloc
682  integer(I4B) :: istart
683  integer(I4B) :: istop
684  integer(I4B) :: i
685  character(len=LENPACKAGENAME) :: text = ''
686  integer(I4B), pointer :: intvar
687  type(characterstringtype), dimension(:), &
688  pointer, contiguous :: acharstr1d !< variable for allocation
689  call mem_allocate(intvar, idt%shape, memorypath)
690  intvar = 0
691  call parser%GetRemainingLine(line)
692  lloc = 1
693  call urdaux(intvar, parser%iuactive, iout, lloc, &
694  istart, istop, caux, line, text)
695  call mem_allocate(acharstr1d, lenauxname, intvar, idt%mf6varname, memorypath)
696  do i = 1, intvar
697  acharstr1d(i) = caux(i)
698  end do
699  deallocate (line)
700  deallocate (caux)
701  end subroutine load_auxvar_names
702 
703  !> @brief load type integer
704  !<
705  subroutine load_integer_type(parser, idt, memoryPath, iout)
706  type(blockparsertype), intent(inout) :: parser !< block parser
707  type(inputparamdefinitiontype), intent(in) :: idt !< input data type object describing this record
708  character(len=*), intent(in) :: memoryPath !< memorypath to put loaded information
709  integer(I4B), intent(in) :: iout !< unit number for output
710  integer(I4B), pointer :: intvar
711  call mem_allocate(intvar, idt%mf6varname, memorypath)
712  intvar = parser%GetInteger()
713  call idm_log_var(intvar, idt%tagname, memorypath, idt%datatype, iout)
714  end subroutine load_integer_type
715 
716  !> @brief load type 1d integer
717  !<
718  subroutine load_integer1d_type(parser, idt, mf6_input, mshape, export, &
719  nc_vars, input_fname, iout)
722  type(blockparsertype), intent(inout) :: parser !< block parser
723  type(inputparamdefinitiontype), intent(in) :: idt !< input data type object describing this record
724  type(modflowinputtype), intent(in) :: mf6_input !< description of input
725  integer(I4B), dimension(:), contiguous, pointer, intent(in) :: mshape !< model shape
726  logical(LGP), intent(in) :: export !< export to ascii layer files
727  type(ncpackagevarstype), pointer, intent(in) :: nc_vars
728  character(len=*), intent(in) :: input_fname !< ascii input file name
729  integer(I4B), intent(in) :: iout !< unit number for output
730  integer(I4B), dimension(:), pointer, contiguous :: int1d
731  integer(I4B) :: nlay
732  integer(I4B) :: nvals
733  integer(I4B), dimension(:), allocatable :: array_shape
734  integer(I4B), dimension(:), allocatable :: layer_shape
735  character(len=LINELENGTH) :: keyword
736 
737  ! Check if it is a full grid sized array (NODES), otherwise use
738  ! idt%shape to construct shape from variables in memoryPath
739  if (idt%shape == 'NODES') then
740  nvals = product(mshape)
741  else
742  call get_shape_from_string(idt%shape, array_shape, mf6_input%mempath)
743  nvals = array_shape(1)
744  end if
745 
746  ! allocate memory for the array
747  call mem_allocate(int1d, nvals, idt%mf6varname, mf6_input%mempath)
748 
749  ! read keyword
750  keyword = ''
751  call parser%GetStringCaps(keyword)
752 
753  ! check for "NETCDF" and "LAYERED"
754  if (keyword == 'NETCDF') then
755  call netcdf_read_array(int1d, mshape, idt, mf6_input, nc_vars, &
756  input_fname, iout)
757  else if (keyword == 'LAYERED' .and. idt%layered) then
758  call get_layered_shape(mshape, nlay, layer_shape)
759  call read_int1d_layered(parser, int1d, idt%mf6varname, nlay, layer_shape)
760  else
761  call read_int1d(parser, int1d, idt%mf6varname)
762  end if
763 
764  ! log information on the loaded array to the list file
765  call idm_log_var(int1d, idt%tagname, mf6_input%mempath, iout)
766 
767  ! create export file for griddata parameters if optioned
768  if (export) then
769  if (idt%blockname == 'GRIDDATA') then
770  call idm_export(int1d, idt%tagname, mf6_input%mempath, idt%shape, iout)
771  end if
772  end if
773  end subroutine load_integer1d_type
774 
775  !> @brief load type 2d integer
776  !<
777  subroutine load_integer2d_type(parser, idt, mf6_input, mshape, export, &
778  nc_vars, input_fname, iout)
781  type(blockparsertype), intent(inout) :: parser !< block parser
782  type(inputparamdefinitiontype), intent(in) :: idt !< input data type object describing this record
783  type(modflowinputtype), intent(in) :: mf6_input !< description of input
784  integer(I4B), dimension(:), contiguous, pointer, intent(in) :: mshape !< model shape
785  logical(LGP), intent(in) :: export !< export to ascii layer files
786  type(ncpackagevarstype), pointer, intent(in) :: nc_vars
787  character(len=*), intent(in) :: input_fname !< ascii input file name
788  integer(I4B), intent(in) :: iout !< unit number for output
789  integer(I4B), dimension(:, :), pointer, contiguous :: int2d
790  integer(I4B) :: nlay
791  integer(I4B) :: nsize1, nsize2
792  integer(I4B), dimension(:), allocatable :: array_shape
793  integer(I4B), dimension(:), allocatable :: layer_shape
794  character(len=LINELENGTH) :: keyword
795 
796  ! determine the array shape from the input data definition (idt%shape),
797  ! which looks like "NCOL, NROW, NLAY"
798  call get_shape_from_string(idt%shape, array_shape, mf6_input%mempath)
799  nsize1 = array_shape(1)
800  nsize2 = array_shape(2)
801 
802  ! create a new 3d memory managed variable
803  call mem_allocate(int2d, nsize1, nsize2, idt%mf6varname, mf6_input%mempath)
804 
805  ! read keyword
806  keyword = ''
807  call parser%GetStringCaps(keyword)
808 
809  ! check for "NETCDF" and "LAYERED"
810  if (keyword == 'NETCDF') then
811  call netcdf_read_array(int2d, mshape, idt, mf6_input, nc_vars, &
812  input_fname, iout)
813  else if (keyword == 'LAYERED' .and. idt%layered) then
814  call get_layered_shape(mshape, nlay, layer_shape)
815  call read_int2d_layered(parser, int2d, idt%mf6varname, nlay, layer_shape)
816  else
817  call read_int2d(parser, int2d, idt%mf6varname)
818  end if
819 
820  ! log information on the loaded array to the list file
821  call idm_log_var(int2d, idt%tagname, mf6_input%mempath, iout)
822 
823  ! create export file for griddata parameters if optioned
824  if (export) then
825  if (idt%blockname == 'GRIDDATA') then
826  call idm_export(int2d, idt%tagname, mf6_input%mempath, idt%shape, iout)
827  end if
828  end if
829  end subroutine load_integer2d_type
830 
831  !> @brief load type 3d integer
832  !<
833  subroutine load_integer3d_type(parser, idt, mf6_input, mshape, export, &
834  nc_vars, input_fname, iout)
837  type(blockparsertype), intent(inout) :: parser !< block parser
838  type(inputparamdefinitiontype), intent(in) :: idt !< input data type object describing this record
839  type(modflowinputtype), intent(in) :: mf6_input !< description of input
840  integer(I4B), dimension(:), contiguous, pointer, intent(in) :: mshape !< model shape
841  logical(LGP), intent(in) :: export !< export to ascii layer files
842  type(ncpackagevarstype), pointer, intent(in) :: nc_vars
843  character(len=*), intent(in) :: input_fname !< ascii input file name
844  integer(I4B), intent(in) :: iout !< unit number for output
845  integer(I4B), dimension(:, :, :), pointer, contiguous :: int3d
846  integer(I4B) :: nlay
847  integer(I4B) :: nsize1, nsize2, nsize3
848  integer(I4B), dimension(:), allocatable :: array_shape
849  integer(I4B), dimension(:), allocatable :: layer_shape
850  integer(I4B), dimension(:), pointer, contiguous :: int1d_ptr
851  character(len=LINELENGTH) :: keyword
852 
853  ! determine the array shape from the input data definition (idt%shape),
854  ! which looks like "NCOL, NROW, NLAY"
855  call get_shape_from_string(idt%shape, array_shape, mf6_input%mempath)
856  nsize1 = array_shape(1)
857  nsize2 = array_shape(2)
858  nsize3 = array_shape(3)
859 
860  ! create a new 3d memory managed variable
861  call mem_allocate(int3d, nsize1, nsize2, nsize3, idt%mf6varname, &
862  mf6_input%mempath)
863 
864  ! read keyword
865  keyword = ''
866  call parser%GetStringCaps(keyword)
867 
868  ! check for "NETCDF" and "LAYERED"
869  if (keyword == 'NETCDF') then
870  call netcdf_read_array(int3d, mshape, idt, mf6_input, nc_vars, &
871  input_fname, iout)
872  else if (keyword == 'LAYERED' .and. idt%layered) then
873  call get_layered_shape(mshape, nlay, layer_shape)
874  call read_int3d_layered(parser, int3d, idt%mf6varname, nlay, &
875  layer_shape)
876  else
877  int1d_ptr(1:nsize1 * nsize2 * nsize3) => int3d(:, :, :)
878  call read_int1d(parser, int1d_ptr, idt%mf6varname)
879  end if
880 
881  ! log information on the loaded array to the list file
882  call idm_log_var(int3d, idt%tagname, mf6_input%mempath, iout)
883 
884  ! create export file for griddata parameters if optioned
885  if (export) then
886  if (idt%blockname == 'GRIDDATA') then
887  call idm_export(int3d, idt%tagname, mf6_input%mempath, idt%shape, iout)
888  end if
889  end if
890  end subroutine load_integer3d_type
891 
892  !> @brief load type double
893  !<
894  subroutine load_double_type(parser, idt, memoryPath, iout)
895  type(blockparsertype), intent(inout) :: parser !< block parser
896  type(inputparamdefinitiontype), intent(in) :: idt !< input data type object describing this record
897  character(len=*), intent(in) :: memoryPath !< memorypath to put loaded information
898  integer(I4B), intent(in) :: iout !< unit number for output
899  real(DP), pointer :: dblvar
900  call mem_allocate(dblvar, idt%mf6varname, memorypath)
901  dblvar = parser%GetDouble()
902  call idm_log_var(dblvar, idt%tagname, memorypath, iout)
903  end subroutine load_double_type
904 
905  !> @brief load type 1d double
906  !<
907  subroutine load_double1d_type(parser, idt, mf6_input, mshape, export, &
908  nc_vars, input_fname, iout)
911  type(blockparsertype), intent(inout) :: parser !< block parser
912  type(inputparamdefinitiontype), intent(in) :: idt !< input data type object describing this record
913  type(modflowinputtype), intent(in) :: mf6_input !< description of input
914  integer(I4B), dimension(:), contiguous, pointer, intent(in) :: mshape !< model shape
915  logical(LGP), intent(in) :: export !< export to ascii layer files
916  type(ncpackagevarstype), pointer, intent(in) :: nc_vars
917  character(len=*), intent(in) :: input_fname !< ascii input file name
918  integer(I4B), intent(in) :: iout !< unit number for output
919  real(DP), dimension(:), pointer, contiguous :: dbl1d
920  integer(I4B) :: nlay
921  integer(I4B) :: nvals
922  integer(I4B), dimension(:), allocatable :: array_shape
923  integer(I4B), dimension(:), allocatable :: layer_shape
924  character(len=LINELENGTH) :: keyword
925 
926  ! Check if it is a full grid sized array (NODES)
927  if (idt%shape == 'NODES') then
928  nvals = product(mshape)
929  else
930  call get_shape_from_string(idt%shape, array_shape, mf6_input%mempath)
931  nvals = array_shape(1)
932  end if
933 
934  ! allocate memory for the array
935  call mem_allocate(dbl1d, nvals, idt%mf6varname, mf6_input%mempath)
936 
937  ! read keyword
938  keyword = ''
939  call parser%GetStringCaps(keyword)
940 
941  ! check for "NETCDF" and "LAYERED"
942  if (keyword == 'NETCDF') then
943  call netcdf_read_array(dbl1d, mshape, idt, mf6_input, nc_vars, &
944  input_fname, iout)
945  else if (keyword == 'LAYERED' .and. idt%layered) then
946  call get_layered_shape(mshape, nlay, layer_shape)
947  call read_dbl1d_layered(parser, dbl1d, idt%mf6varname, nlay, layer_shape)
948  else
949  call read_dbl1d(parser, dbl1d, idt%mf6varname)
950  end if
951 
952  ! log information on the loaded array to the list file
953  call idm_log_var(dbl1d, idt%tagname, mf6_input%mempath, iout)
954 
955  ! create export file for griddata parameters if optioned
956  if (export) then
957  if (idt%blockname == 'GRIDDATA') then
958  call idm_export(dbl1d, idt%tagname, mf6_input%mempath, idt%shape, iout)
959  end if
960  end if
961  end subroutine load_double1d_type
962 
963  !> @brief load type 2d double
964  !<
965  subroutine load_double2d_type(parser, idt, mf6_input, mshape, export, &
966  nc_vars, input_fname, iout)
969  type(blockparsertype), intent(inout) :: parser !< block parser
970  type(inputparamdefinitiontype), intent(in) :: idt !< input data type object describing this record
971  type(modflowinputtype), intent(in) :: mf6_input !< description of input
972  integer(I4B), dimension(:), contiguous, pointer, intent(in) :: mshape !< model shape
973  logical(LGP), intent(in) :: export !< export to ascii layer files
974  type(ncpackagevarstype), pointer, intent(in) :: nc_vars
975  character(len=*), intent(in) :: input_fname !< ascii input file name
976  integer(I4B), intent(in) :: iout !< unit number for output
977  real(DP), dimension(:, :), pointer, contiguous :: dbl2d
978  integer(I4B) :: nlay
979  integer(I4B) :: nsize1, nsize2
980  integer(I4B), dimension(:), allocatable :: array_shape
981  integer(I4B), dimension(:), allocatable :: layer_shape
982  character(len=LINELENGTH) :: keyword
983 
984  ! determine the array shape from the input data definition (idt%shape),
985  ! which looks like "NCOL, NROW, NLAY"
986  call get_shape_from_string(idt%shape, array_shape, mf6_input%mempath)
987  nsize1 = array_shape(1)
988  nsize2 = array_shape(2)
989 
990  ! create a new 3d memory managed variable
991  call mem_allocate(dbl2d, nsize1, nsize2, idt%mf6varname, mf6_input%mempath)
992 
993  ! read keyword
994  keyword = ''
995  call parser%GetStringCaps(keyword)
996 
997  ! check for "NETCDF" and "LAYERED"
998  if (keyword == 'NETCDF') then
999  call netcdf_read_array(dbl2d, mshape, idt, mf6_input, nc_vars, &
1000  input_fname, iout)
1001  else if (keyword == 'LAYERED' .and. idt%layered) then
1002  call get_layered_shape(mshape, nlay, layer_shape)
1003  call read_dbl2d_layered(parser, dbl2d, idt%mf6varname, nlay, layer_shape)
1004  else
1005  call read_dbl2d(parser, dbl2d, idt%mf6varname)
1006  end if
1007 
1008  ! log information on the loaded array to the list file
1009  call idm_log_var(dbl2d, idt%tagname, mf6_input%mempath, iout)
1010 
1011  ! create export file for griddata parameters if optioned
1012  if (export) then
1013  if (idt%blockname == 'GRIDDATA') then
1014  call idm_export(dbl2d, idt%tagname, mf6_input%mempath, idt%shape, iout)
1015  end if
1016  end if
1017  end subroutine load_double2d_type
1018 
1019  !> @brief load type 3d double
1020  !<
1021  subroutine load_double3d_type(parser, idt, mf6_input, mshape, export, &
1022  nc_vars, input_fname, iout)
1025  type(blockparsertype), intent(inout) :: parser !< block parser
1026  type(inputparamdefinitiontype), intent(in) :: idt !< input data type object describing this record
1027  type(modflowinputtype), intent(in) :: mf6_input !< description of input
1028  integer(I4B), dimension(:), contiguous, pointer, intent(in) :: mshape !< model shape
1029  logical(LGP), intent(in) :: export !< export to ascii layer files
1030  type(ncpackagevarstype), pointer, intent(in) :: nc_vars
1031  character(len=*), intent(in) :: input_fname !< ascii input file name
1032  integer(I4B), intent(in) :: iout !< unit number for output
1033  real(DP), dimension(:, :, :), pointer, contiguous :: dbl3d
1034  integer(I4B) :: nlay
1035  integer(I4B) :: nsize1, nsize2, nsize3
1036  integer(I4B), dimension(:), allocatable :: array_shape
1037  integer(I4B), dimension(:), allocatable :: layer_shape
1038  real(DP), dimension(:), pointer, contiguous :: dbl1d_ptr
1039  character(len=LINELENGTH) :: keyword
1040 
1041  ! determine the array shape from the input data definition (idt%shape),
1042  ! which looks like "NCOL, NROW, NLAY"
1043  call get_shape_from_string(idt%shape, array_shape, mf6_input%mempath)
1044  nsize1 = array_shape(1)
1045  nsize2 = array_shape(2)
1046  nsize3 = array_shape(3)
1047 
1048  ! create a new 3d memory managed variable
1049  call mem_allocate(dbl3d, nsize1, nsize2, nsize3, idt%mf6varname, &
1050  mf6_input%mempath)
1051 
1052  ! read keyword
1053  keyword = ''
1054  call parser%GetStringCaps(keyword)
1055 
1056  ! check for "NETCDF" and "LAYERED"
1057  if (keyword == 'NETCDF') then
1058  call netcdf_read_array(dbl3d, mshape, idt, mf6_input, nc_vars, &
1059  input_fname, iout)
1060  else if (keyword == 'LAYERED' .and. idt%layered) then
1061  call get_layered_shape(mshape, nlay, layer_shape)
1062  call read_dbl3d_layered(parser, dbl3d, idt%mf6varname, nlay, &
1063  layer_shape)
1064  else
1065  dbl1d_ptr(1:nsize1 * nsize2 * nsize3) => dbl3d(:, :, :)
1066  call read_dbl1d(parser, dbl1d_ptr, idt%mf6varname)
1067  end if
1068 
1069  ! log information on the loaded array to the list file
1070  call idm_log_var(dbl3d, idt%tagname, mf6_input%mempath, iout)
1071 
1072  ! create export file for griddata parameters if optioned
1073  if (export) then
1074  if (idt%blockname == 'GRIDDATA') then
1075  call idm_export(dbl3d, idt%tagname, mf6_input%mempath, idt%shape, iout)
1076  end if
1077  end if
1078  end subroutine load_double3d_type
1079 
1080  function read_control_record(parser, oc_inunit, iout) result(ibinary)
1081  use simmodule, only: store_error_unit
1082  use inputoutputmodule, only: urword
1083  use inputoutputmodule, only: openfile
1084  use openspecmodule, only: form, access
1085  use constantsmodule, only: linelength
1087  type(blockparsertype), intent(inout) :: parser
1088  integer(I4B), intent(inout) :: oc_inunit
1089  integer(I4B), intent(in) :: iout
1090  integer(I4B) :: ibinary
1091  integer(I4B) :: lloc, istart, istop, idum, inunit, itmp, ierr
1092  integer(I4B) :: nunopn = 99
1093  character(len=:), allocatable :: line
1094  character(len=LINELENGTH) :: fname
1095  logical(LGP) :: exists
1096  real(dp) :: r
1097  character(len=*), parameter :: fmtocne = &
1098  &"('Specified OPEN/CLOSE file ',(A),' does not exist')"
1099  character(len=*), parameter :: fmtobf = &
1100  &"(1X,/1X,'OPENING BINARY FILE ON UNIT ',I0,':',/1X,A)"
1101 
1102  ! initialize oc_inunit and ibinary
1103  oc_inunit = 0
1104  ibinary = 0
1105  inunit = parser%getunit()
1106 
1107  ! Read to the first non-commented line
1108  lloc = 1
1109  call parser%line_reader%rdcom(inunit, iout, line, ierr)
1110  call urword(line, lloc, istart, istop, 1, idum, r, iout, inunit)
1111 
1112  if (line(istart:istop) == 'OPEN/CLOSE') then
1113  ! get filename
1114  call urword(line, lloc, istart, istop, 0, idum, r, &
1115  iout, inunit)
1116  fname = line(istart:istop)
1117  ! check to see if file OPEN/CLOSE file exists
1118  inquire (file=fname, exist=exists)
1119  if (.not. exists) then
1120  write (errmsg, fmtocne) line(istart:istop)
1121  call store_error(errmsg)
1122  call store_error('Specified OPEN/CLOSE file does not exist')
1123  call store_error_unit(inunit)
1124  end if
1125 
1126  ! Check for (BINARY) keyword
1127  call urword(line, lloc, istart, istop, 1, idum, r, &
1128  iout, inunit)
1129 
1130  if (line(istart:istop) == '(BINARY)') ibinary = 1
1131  ! Open the file depending on ibinary flag
1132  if (ibinary == 1) then
1133  oc_inunit = nunopn
1134  itmp = iout
1135  if (iout > 0) then
1136  itmp = 0
1137  write (iout, fmtobf) oc_inunit, trim(adjustl(fname))
1138  end if
1139  call openfile(oc_inunit, itmp, fname, 'OPEN/CLOSE', &
1140  fmtarg_opt=form, accarg_opt=access)
1141  end if
1142  end if
1143 
1144  if (ibinary == 0) then
1145  call parser%line_reader%bkspc(parser%getunit())
1146  end if
1147  end function read_control_record
1148 
1149 end module loadmf6filemodule
subroutine init()
Definition: GridSorting.f90:24
This module contains block parser methods.
Definition: BlockParser.f90:7
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter linelength
maximum length of a standard line
Definition: Constants.f90:45
integer(i4b), parameter lenpackagename
maximum length of the package name
Definition: Constants.f90:23
integer(i4b), parameter lenbigline
maximum length of a big line
Definition: Constants.f90:15
integer(i4b), parameter lenvarname
maximum length of a variable name
Definition: Constants.f90:17
integer(i4b), parameter lenauxname
maximum length of a aux variable
Definition: Constants.f90:35
integer(i4b), parameter lenboundname
maximum length of a bound name
Definition: Constants.f90:36
This module contains the DefinitionSelectModule.
type(inputparamdefinitiontype) function, pointer, public get_param_definition_type(input_definition_types, component_type, subcomponent_type, blockname, tagname, filename)
Return parameter definition.
subroutine, public split_record_definition(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 read_dbl1d(parser, dbl1d, aname)
subroutine, public read_dbl2d(parser, dbl2d, aname)
This module contains the DynamicPackageParamsModule.
This module contains the Input Data Model Logger Module.
Definition: IdmLogger.f90:7
subroutine, public idm_log_close(component, subcomponent, iout)
@ brief log the closing message
Definition: IdmLogger.f90:56
subroutine, public idm_log_header(component, subcomponent, iout)
@ brief log a header message
Definition: IdmLogger.f90:44
This module contains the InputDefinitionModule.
subroutine, public urdaux(naux, inunit, iout, lloc, istart, istop, auxname, line, text)
Read auxiliary variables from an input line.
subroutine, public parseline(line, nwords, words, inunit, filename)
Parse a line into words.
subroutine, public openfile(iu, iout, fname, ftype, fmtarg_opt, accarg_opt, filstat_opt, mode_opt)
Open a file.
Definition: InputOutput.f90:30
subroutine, public urword(line, icol, istart, istop, ncode, n, r, iout, in)
Extract a word from a string.
subroutine, public read_int1d(parser, int1d, aname)
subroutine, public read_int2d(parser, int2d, aname)
This module defines variable data types.
Definition: kind.f90:8
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)
This module contains the LoadMf6FileModule.
Definition: LoadMf6File.f90:8
type(inputparamdefinitiontype) function block_index_dfn(this, iblk)
subroutine parse_keyword_tag(this, iblk, tag, idt)
recursive subroutine parse_tag(this, iblk, recursive_call)
load an individual input record into memory
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
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 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.
subroutine finalize(this)
finalize
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
Definition: LoadMf6File.f90:85
integer(i4b) function, public read_control_record(parser, oc_inunit, iout)
This module contains the LoadNCInputModule.
Definition: LoadNCInput.F90:7
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
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
This module contains the ModflowInputModule.
Definition: ModflowInput.f90:9
type(modflowinputtype) function, public getmodflowinput(pkgtype, component_type, subcomponent_type, component_name, subcomponent_name, filename)
function to return ModflowInputType
This module contains the NCFileVarsModule.
Definition: NCFileVars.f90:7
character(len=20) access
Definition: OpenSpec.f90:7
character(len=20) form
Definition: OpenSpec.f90:7
This module contains simulation methods.
Definition: Sim.f90:10
subroutine, public store_error(msg, terminate)
Store an error message.
Definition: Sim.f90:92
subroutine, public store_error_unit(iunit, terminate)
Store the file unit number.
Definition: Sim.f90:168
This module contains simulation variables.
Definition: SimVariables.f90:9
character(len=maxcharlen) errmsg
error message string
This module contains the SourceCommonModule.
Definition: SourceCommon.f90:7
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.
Definition: StructArray.f90:8
type(structarraytype) function, pointer, public constructstructarray(mf6_input, ncol, nrow, blocknum, mempath, component_mempath)
constructor for a struct_array
Definition: StructArray.f90:73
subroutine, public destructstructarray(struct_array)
destructor for a struct_array
This class is used to store a single deferred-length character string. It was designed to work in an ...
Definition: CharString.f90:23
Static parser based input loader.
Definition: LoadMf6File.f90:48
derived type for storing input definition for a file
Type describing input variables for a package in NetCDF file.
Definition: NCFileVars.f90:22
type for structured array
Definition: StructArray.f90:36