41 integer(I4B),
pointer :: iper => null()
42 integer(I4B),
pointer :: ionper => null()
58 subroutine input_load(filename, mf6_input, component_filename, iout, nc_vars)
60 character(len=*),
intent(in) :: filename
62 character(len=*),
intent(in) :: component_filename
63 integer(I4B),
intent(in) :: iout
68 integer(I4B) :: inunit
70 if (
present(nc_vars))
then
71 netcdf_vars => nc_vars
77 inunit =
open_mf6file(mf6_input%pkgtype, filename, component_filename, iout)
81 call parser%Initialize(inunit, iout)
84 call loader%load(parser, mf6_input, netcdf_vars, filename, iout)
95 subroutine static_init(this, mf6_input, component_name, component_input_name, &
99 character(len=*),
intent(in) :: component_name
100 character(len=*),
intent(in) :: component_input_name
101 character(len=*),
intent(in) :: input_name
104 call this%StaticPkgLoadType%init(mf6_input, component_name, &
105 component_input_name, input_name)
113 integer(I4B),
intent(in) :: iout
121 if (this%iperblock > 0)
then
124 allocate (mf6_loader)
127 mf6_loader%nc_vars => this%nc_vars
130 nullify (this%nc_vars)
133 call mf6_loader%init(this%mf6_input, this%component_name, &
134 this%component_input_name, this%input_name, &
135 this%iperblock, iout)
138 rp_loader => mf6_loader
143 call input_load(this%input_name, this%mf6_input, &
144 this%component_input_name, iout, this%nc_vars)
154 call this%StaticPkgLoadType%destroy()
160 subroutine dynamic_init(this, mf6_input, component_name, component_input_name, &
161 input_name, iperblock, iout)
167 character(len=*),
intent(in) :: component_name
168 character(len=*),
intent(in) :: component_input_name
169 character(len=*),
intent(in) :: input_name
170 integer(I4B),
intent(in) :: iperblock
171 integer(I4B),
intent(in) :: iout
172 integer(I4B) :: inunit
175 call this%DynamicPkgLoadType%init(mf6_input, component_name, &
176 component_input_name, input_name, &
181 call mem_allocate(this%ionper,
'IONPER', mf6_input%mempath)
189 component_input_name, iout)
192 allocate (this%parser)
193 call this%parser%Initialize(inunit, iout)
196 call this%create_loader()
205 call this%rp_loader%df()
208 call this%read_ionper()
217 call this%rp_loader%ad()
230 if (this%ionper /=
kper)
return
233 call this%rp_loader%rp(this%parser)
240 call this%read_ionper()
242 this%ionper =
nper + 1
254 character(len=LINELENGTH) :: line
255 logical(LGP) :: isblockfound
257 character(len=*),
parameter :: fmtblkerr = &
258 &
"('Looking for BEGIN PERIOD iper. Found ', a, ' instead.')"
260 call this%parser%GetBlock(
'PERIOD', isblockfound, ierr, &
261 supportopenclose=.true., &
262 blockrequired=.false.)
265 if (isblockfound)
then
267 this%ionper = this%parser%GetInteger()
269 if (this%ionper <= this%iper)
then
270 write (
errmsg,
'(a, i0, a, i0, a, i0, a)') &
271 'Error in stress period ',
kper, &
272 '. Period numbers not increasing. Found ', this%ionper, &
273 ' but last period block was assigned ', this%iper,
'.'
275 call this%parser%StoreErrorUnit()
283 this%ionper =
nper + 1
286 call this%parser%GetCurrentLine(line)
287 write (
errmsg, fmtblkerr) adjustl(trim(line))
289 call this%parser%StoreErrorUnit()
307 if (this%mf6_input%subcomponent_type ==
'STO')
then
308 allocate (sto_loader)
309 this%rp_loader => sto_loader
310 else if (this%readasarrays)
then
311 allocate (bndgrid_loader)
312 this%rp_loader => bndgrid_loader
314 allocate (bndlist_loader)
315 this%rp_loader => bndlist_loader
319 this%rp_loader%nc_vars => this%nc_vars
322 call this%rp_loader%ainit(this%mf6_input, &
323 this%component_name, &
324 this%component_input_name, &
342 nullify (this%rp_loader%nc_vars)
343 call this%rp_loader%destroy()
344 deallocate (this%rp_loader)
347 call this%parser%clear()
348 deallocate (this%parser)
351 call this%DynamicPkgLoadType%destroy()
356 function open_mf6file(filetype, filename, component_fname, iout)
result(inunit)
360 character(len=*),
intent(in) :: filetype
361 character(len=*),
intent(in) :: filename
362 character(len=*),
intent(in) :: component_fname
363 integer(I4B),
intent(in) :: iout
365 integer(I4B) :: inunit
371 if (filename /=
'')
then
375 call openfile(inunit, iout, trim(adjustl(filename)), filetype, &
376 'FORMATTED',
'SEQUENTIAL',
'OLD')
378 write (
errmsg,
'(a,a,a)') &
379 'File unspecified, cannot load model or package &
380 &type "', trim(filetype),
'".'
This module contains block parser methods.
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
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.
This module contains the IdmMf6FileModule.
subroutine dynamic_df(this)
define routine for dynamic loader
integer(i4b) function, public open_mf6file(filetype, filename, component_fname, iout)
open a model package files
subroutine dynamic_create_loader(this)
allocate a dynamic loader based on load context
subroutine dynamic_destroy(this)
dynamic loader destroy
subroutine dynamic_init(this, mf6_input, component_name, component_input_name, input_name, iperblock, iout)
dynamic loader init
subroutine, public input_load(filename, mf6_input, component_filename, iout, nc_vars)
input load for traditional mf6 simulation static input file
subroutine dynamic_ad(this)
advance routine for dynamic loader
subroutine static_destroy(this)
static loader destroy
subroutine dynamic_rp(this)
read and prepare routine for dynamic loader
subroutine static_init(this, mf6_input, component_name, component_input_name, input_name)
static loader init
subroutine dynamic_read_ionper(this)
dynamic loader read ionper of next period block
class(dynamicpkgloadbasetype) function, pointer static_load(this, iout)
load routine for static loader
This module defines variable data types.
This module contains the LoadMf6FileModule.
This module contains the NCFileVarsModule.
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
integer(i4b), pointer, public kper
current stress period number
integer(i4b), pointer, public nper
number of stress period
MF6File dynamic loader type.
MF6File static loader type.
Static parser based input loader.
Type describing input variables for a package in NetCDF file.