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