40 integer(I4B),
pointer :: iper => null()
41 integer(I4B),
pointer :: ionper => null()
57 subroutine input_load(filename, mf6_input, component_filename, iout)
59 character(len=*),
intent(in) :: filename
61 character(len=*),
intent(in) :: component_filename
62 integer(I4B),
intent(in) :: iout
65 integer(I4B) :: inunit
68 inunit =
open_mf6file(mf6_input%pkgtype, filename, component_filename, iout)
72 call parser%Initialize(inunit, iout)
75 call loader%load(parser, mf6_input, filename, iout)
89 subroutine static_init(this, mf6_input, component_name, component_input_name, &
93 character(len=*),
intent(in) :: component_name
94 character(len=*),
intent(in) :: component_input_name
95 character(len=*),
intent(in) :: input_name
98 call this%StaticPkgLoadType%init(mf6_input, component_name, &
99 component_input_name, input_name)
107 integer(I4B),
intent(in) :: iout
115 if (this%iperblock > 0)
then
118 allocate (mf6_loader)
121 call mf6_loader%init(this%mf6_input, this%component_name, &
122 this%component_input_name, this%input_name, &
123 this%iperblock, iout)
126 rp_loader => mf6_loader
131 call input_load(this%input_name, this%mf6_input, &
132 this%component_input_name, iout)
145 call this%StaticPkgLoadType%destroy()
151 subroutine dynamic_init(this, mf6_input, component_name, component_input_name, &
152 input_name, iperblock, iout)
158 character(len=*),
intent(in) :: component_name
159 character(len=*),
intent(in) :: component_input_name
160 character(len=*),
intent(in) :: input_name
161 integer(I4B),
intent(in) :: iperblock
162 integer(I4B),
intent(in) :: iout
163 integer(I4B) :: inunit
166 call this%DynamicPkgLoadType%init(mf6_input, component_name, &
167 component_input_name, input_name, &
172 call mem_allocate(this%ionper,
'IONPER', mf6_input%mempath)
180 component_input_name, iout)
183 allocate (this%parser)
184 call this%parser%Initialize(inunit, iout)
187 call this%create_loader()
199 call this%rp_loader%df()
202 call this%read_ionper()
214 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
257 character(len=LINELENGTH) :: line
258 logical(LGP) :: isblockfound
260 character(len=*),
parameter :: fmtblkerr = &
261 &
"('Looking for BEGIN PERIOD iper. Found ', a, ' instead.')"
263 call this%parser%GetBlock(
'PERIOD', isblockfound, ierr, &
264 supportopenclose=.true., &
265 blockrequired=.false.)
268 if (isblockfound)
then
270 this%ionper = this%parser%GetInteger()
272 if (this%ionper <= this%iper)
then
273 write (
errmsg,
'(a, i0, a, i0, a, i0, a)') &
274 'Error in stress period ',
kper, &
275 '. Period numbers not increasing. Found ', this%ionper, &
276 ' but last period block was assigned ', this%iper,
'.'
278 call this%parser%StoreErrorUnit()
286 this%ionper =
nper + 1
289 call this%parser%GetCurrentLine(line)
290 write (
errmsg, fmtblkerr) adjustl(trim(line))
292 call this%parser%StoreErrorUnit()
311 if (this%readasarrays)
then
312 allocate (bndgrid_loader)
313 this%rp_loader => bndgrid_loader
315 allocate (bndlist_loader)
316 this%rp_loader => bndlist_loader
320 call this%rp_loader%ainit(this%mf6_input, &
321 this%component_name, &
322 this%component_input_name, &
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()
359 function open_mf6file(filetype, filename, component_fname, iout)
result(inunit)
363 character(len=*),
intent(in) :: filetype
364 character(len=*),
intent(in) :: filename
365 character(len=*),
intent(in) :: component_fname
366 integer(I4B),
intent(in) :: iout
368 integer(I4B) :: inunit
374 if (filename /=
'')
then
378 call openfile(inunit, iout, trim(adjustl(filename)), filetype, &
379 'FORMATTED',
'SEQUENTIAL',
'OLD')
381 write (
errmsg,
'(a,a,a)') &
382 'File unspecified, cannot load model or package &
383 &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
subroutine, public input_load(filename, mf6_input, component_filename, iout)
input load for traditional mf6 simulation static input file
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 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 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.