35 character(len=LENCOMPONENTNAME) :: pkgtype
36 character(len=LENCOMPONENTNAME) :: component_type
37 character(len=LENCOMPONENTNAME) :: subcomponent_type
38 character(len=LENCOMPONENTNAME) :: component_name
39 character(len=LENCOMPONENTNAME) :: subcomponent_name
40 character(len=LENMEMPATH) :: mempath
41 character(len=LENMEMPATH) :: component_mempath
42 character(len=LENCOMPONENTNAME) :: load_scope
53 component_name, subcomponent_name, &
54 load_scope, filename) &
56 character(len=*),
intent(in) :: pkgtype
57 character(len=*),
intent(in) :: component_type
58 character(len=*),
intent(in) :: subcomponent_type
59 character(len=*),
intent(in) :: component_name
60 character(len=*),
intent(in) :: subcomponent_name
61 character(len=*),
intent(in) :: load_scope
62 character(len=*),
optional,
intent(in) :: filename
64 character(len=LENPACKAGETYPE) :: dfn_subcomponent_type
67 if (
present(filename))
then
68 dfn_subcomponent_type =
update_sc_type(pkgtype, filename, component_type, &
71 dfn_subcomponent_type = trim(subcomponent_type)
75 mf6_input%pkgtype = trim(pkgtype)
76 mf6_input%component_type = trim(component_type)
77 mf6_input%subcomponent_type = trim(dfn_subcomponent_type)
78 mf6_input%component_name = trim(component_name)
79 mf6_input%subcomponent_name = trim(subcomponent_name)
80 mf6_input%load_scope = trim(load_scope)
83 mf6_input%mempath =
create_mem_path(component_name, subcomponent_name, &
85 mf6_input%component_mempath =
create_mem_path(component=component_name, &
90 mf6_input%subcomponent_type)
92 mf6_input%subcomponent_type)
94 mf6_input%subcomponent_type)
97 function update_sc_type(filetype, filename, component_type, subcomponent_type) &
99 character(len=*),
intent(in) :: component_type
100 character(len=*),
intent(in) :: subcomponent_type
101 character(len=*),
intent(in) :: filetype
102 character(len=*),
intent(in) :: filename
103 character(len=LENPACKAGETYPE) :: sc_type
104 sc_type = subcomponent_type
105 select case (subcomponent_type)
106 case (
'CHD',
'DRN',
'EVT',
'GHB',
'RCH',
'RIV',
'SCP',
'WEL')
107 sc_type =
readarray(filetype, filename, component_type, &
113 function readarray(filetype, filename, component_type, subcomponent_type) &
118 character(len=*),
intent(in) :: component_type
119 character(len=*),
intent(in) :: subcomponent_type
120 character(len=*),
intent(in) :: filetype
121 character(len=*),
intent(in) :: filename
122 character(len=LENPACKAGETYPE) :: sc_type
124 integer(I4B) :: ierr, inunit
125 logical(LGP) :: isfound
126 logical(LGP) :: endofblock
127 character(len=LINELENGTH) :: keyword
129 sc_type = subcomponent_type
131 call openfile(inunit, 0, trim(adjustl(filename)), filetype, &
132 'FORMATTED',
'SEQUENTIAL',
'OLD')
133 call parser%Initialize(inunit, 0)
136 call parser%GetBlock(
'OPTIONS', isfound, ierr, &
137 supportopenclose=.true., blockrequired=.false.)
142 call parser%GetNextLine(endofblock)
144 call parser%GetStringCaps(keyword)
145 select case (keyword)
146 case (
'READASARRAYS')
147 write (sc_type,
'(a)') trim(subcomponent_type)//
'A'
148 case (
'READARRAYGRID')
149 write (sc_type,
'(a)') trim(subcomponent_type)//
'G'
This module contains block parser methods.
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
integer(i4b), parameter lencomponentname
maximum length of a component name
integer(i4b), parameter lenpackagetype
maximum length of a package type (DIS6, SFR6, CSUB6, etc.)
integer(i4b), parameter lenmempath
maximum length of the memory path
type(inputblockdefinitiontype) function, dimension(:), pointer, public block_definitions(component, subcomponent)
type(inputparamdefinitiontype) function, dimension(:), pointer, public param_definitions(component, subcomponent)
type(inputparamdefinitiontype) function, dimension(:), pointer, public aggregate_definitions(component, subcomponent)
This module defines variable data types.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
This module contains simulation variables.
character(len=linelength) idm_context