MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
Mf6FileStoInput.f90
Go to the documentation of this file.
1 !> @brief This module contains the Mf6FileStoInputModule
2 !!
3 !! This module contains the routines for reading STO period block input
4 !!
5 !<
7 
8  use kindmodule, only: i4b, dp, lgp
9  use constantsmodule, only: linelength
14 
15  implicit none
16  private
17  public :: stoinputtype
18 
19  !> @brief STO package loader
20  !!
21  !<
23  character(len=LINELENGTH), pointer :: storage => null()
24  contains
25  procedure :: ainit => sto_init
26  procedure :: rp => sto_rp
27  procedure :: destroy => sto_destroy
28  end type stoinputtype
29 
30 contains
31 
32  subroutine sto_init(this, mf6_input, component_name, component_input_name, &
33  input_name, iperblock, parser, iout)
37  class(stoinputtype), intent(inout) :: this
38  type(modflowinputtype), intent(in) :: mf6_input
39  character(len=*), intent(in) :: component_name
40  character(len=*), intent(in) :: component_input_name
41  character(len=*), intent(in) :: input_name
42  integer(I4B), intent(in) :: iperblock
43  type(blockparsertype), pointer, intent(inout) :: parser
44  integer(I4B), intent(in) :: iout
45  type(loadmf6filetype) :: loader
46  !
47  ! -- init loader
48  call this%DynamicPkgLoadType%init(mf6_input, component_name, &
49  component_input_name, input_name, &
50  iperblock, iout)
51  !
52  ! -- initialize static loader
53  call loader%load(parser, mf6_input, this%nc_vars, this%input_name, iout)
54  !
55  ! -- allocate storage string
56  call mem_allocate(this%storage, linelength, 'STORAGE', this%mf6_input%mempath)
57  !
58  ! -- initialize storage to TRANSIENT (model iss=0)
59  this%storage = 'TRANSIENT'
60  end subroutine sto_init
61 
62  subroutine sto_rp(this, parser)
63  ! -- modules
67  ! -- dummy
68  class(stoinputtype), intent(inout) :: this
69  type(blockparsertype), pointer, intent(inout) :: parser
70  ! -- local
71  character(len=LINELENGTH) :: tagname
72  type(inputparamdefinitiontype), pointer :: idt
73  logical(LGP) :: endOfBlock
74  !
75  ! -- read next line
76  call parser%GetNextLine(endofblock)
77  !
78  ! -- return if no input
79  if (endofblock) return
80  !
81  ! -- read the tag
82  call parser%GetStringCaps(tagname)
83  !
84  ! -- verify tag is supported
85  idt => get_param_definition_type(this%mf6_input%param_dfns, &
86  this%mf6_input%component_type, &
87  this%mf6_input%subcomponent_type, &
88  'PERIOD', tagname, this%input_name)
89  ! -- set storage
90  this%storage = idt%tagname
91  !
92  ! -- only one input line is expected, terminate block
93  call parser%terminateblock()
94  !
95  ! -- log lst file header
96  call idm_log_header(this%mf6_input%component_name, &
97  this%mf6_input%subcomponent_name, this%iout)
98  !
99  call idm_log_var(this%storage, tagname, this%mf6_input%mempath, this%iout)
100  !
101  ! -- close logging statement
102  call idm_log_close(this%mf6_input%component_name, &
103  this%mf6_input%subcomponent_name, this%iout)
104  end subroutine sto_rp
105 
106  subroutine sto_destroy(this)
108  class(stoinputtype), intent(inout) :: this
109  call mem_deallocate(this%storage, 'STORAGE', this%mf6_input%mempath)
110  call this%DynamicPkgLoadType%destroy()
111  end subroutine sto_destroy
112 
113 end module mf6filestoinputmodule
This module contains the AsciiInputLoadTypeModule.
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
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 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.
This module defines variable data types.
Definition: kind.f90:8
This module contains the LoadMf6FileModule.
Definition: LoadMf6File.f90:8
This module contains the Mf6FileStoInputModule.
subroutine sto_destroy(this)
subroutine sto_rp(this, parser)
subroutine sto_init(this, mf6_input, component_name, component_input_name, input_name, iperblock, parser, iout)
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
base abstract type for ascii source dynamic load
Static parser based input loader.
Definition: LoadMf6File.f90:48
derived type for storing input definition for a file