MODFLOW 6  version 6.7.0.dev2
USGS Modular Hydrologic Model
mf6filesettingloadmodule Module Reference

This module contains the Mf6FileSettingLoadModule. More...

Data Types

type  idtptrtype
 Pointer type for read state variable. More...
 
type  settingloadtype
 Setting package loader. More...
 

Functions/Subroutines

subroutine oc_init (this, mf6_input, component_name, component_input_name, input_name, iperblock, parser, iout)
 
subroutine df (this)
 
subroutine rp (this, parser)
 
subroutine reset (this)
 
subroutine destroy (this)
 

Detailed Description

This module contains the routines for reading a dfn setting with multiple tokens into a single CharacterStringType array using the StructArrayType.

Preceding param columns can be configured per package (e.g. OC)

Function/Subroutine Documentation

◆ destroy()

subroutine mf6filesettingloadmodule::destroy ( class(settingloadtype), intent(inout)  this)
private

Definition at line 144 of file Mf6FileSetting.f90.

146  class(SettingLoadType), intent(inout) :: this
147  integer(I4B) :: icol
148 
149  if (associated(this%structarray)) then
150  ! destroy the structured array reader
151  call destructstructarray(this%structarray)
152  end if
153 
154  do icol = 1, size(this%idts)
155  ! allocate variable in memory manager
156  deallocate (this%idts(icol)%idt)
157  nullify (this%idts(icol)%idt)
158  end do
159 
160  call this%DynamicPkgLoadType%destroy()
Here is the call graph for this function:

◆ df()

subroutine mf6filesettingloadmodule::df ( class(settingloadtype), intent(inout)  this)

Definition at line 108 of file Mf6FileSetting.f90.

109  class(SettingLoadType), intent(inout) :: this

◆ oc_init()

subroutine mf6filesettingloadmodule::oc_init ( class(settingloadtype), intent(inout)  this,
type(modflowinputtype), intent(in)  mf6_input,
character(len=*), intent(in)  component_name,
character(len=*), intent(in)  component_input_name,
character(len=*), intent(in)  input_name,
integer(i4b), intent(in)  iperblock,
type(blockparsertype), intent(inout), pointer  parser,
integer(i4b), intent(in)  iout 
)
private

Definition at line 49 of file Mf6FileSetting.f90.

53  class(SettingLoadType), intent(inout) :: this
54  type(ModflowInputType), intent(in) :: mf6_input
55  character(len=*), intent(in) :: component_name
56  character(len=*), intent(in) :: component_input_name
57  character(len=*), intent(in) :: input_name
58  integer(I4B), intent(in) :: iperblock
59  type(BlockParserType), pointer, intent(inout) :: parser
60  integer(I4B), intent(in) :: iout
61  type(LoadMf6FileType) :: loader
62  integer(I4B) :: nparam, icol
63 
64  ! init loader
65  call this%DynamicPkgLoadType%init(mf6_input, component_name, &
66  component_input_name, input_name, &
67  iperblock, iout)
68  ! initialize static loader
69  call loader%load(parser, mf6_input, this%nc_vars, this%input_name, iout)
70 
71  ! create and allocate load context
72  call this%ctx%init(mf6_input)
73  call this%ctx%allocate_arrays()
74 
75  ! set nparam
76  nparam = 1
77  select case (mf6_input%subcomponent_type)
78  case ('OC')
79  nparam = nparam + 2
80  case default
81  end select
82 
83  ! allocate idts
84  allocate (this%idts(nparam))
85 
86  ! set leading idts
87  select case (mf6_input%subcomponent_type)
88  case ('OC')
89  this%idts(1)%idt => &
90  idt_default(mf6_input%component_type, mf6_input%subcomponent_type, &
91  'PERIOD', 'OCACTION', 'OCACTION', 'STRING')
92  this%idts(2)%idt => &
93  idt_default(mf6_input%component_type, mf6_input%subcomponent_type, &
94  'PERIOD', 'RTYPE', 'RTYPE', 'STRING')
95  icol = 3
96  case default
97  icol = 1
98  end select
99 
100  ! set setting idt
101  this%idts(icol)%idt => &
102  idt_default(mf6_input%component_type, mf6_input%subcomponent_type, &
103  'PERIOD', 'SETTING', 'SETTING', 'STRING')
104  ! force all setting tokens to be read
105  this%idts(icol)%idt%shape = 'LINELENGTH'
This module contains the DefinitionSelectModule.
type(inputparamdefinitiontype) function, pointer, public idt_default(component_type, subcomponent_type, blockname, tagname, mf6varname, datatype)
return allocated input definition type
This module contains the LoadMf6FileModule.
Definition: LoadMf6File.f90:8
Static parser based input loader.
Definition: LoadMf6File.f90:47
Here is the call graph for this function:

◆ reset()

subroutine mf6filesettingloadmodule::reset ( class(settingloadtype), intent(inout)  this)
private

Definition at line 124 of file Mf6FileSetting.f90.

125  class(SettingLoadType), intent(inout) :: this
126  integer(I4B) :: icol
127 
128  if (associated(this%structarray)) then
129  ! destroy the structured array reader
130  call destructstructarray(this%structarray)
131  end if
132 
133  ! construct and set up the struct array object
134  this%structarray => constructstructarray(this%mf6_input, size(this%idts), &
135  -1, 0, this%mf6_input%mempath, &
136  this%mf6_input%component_mempath)
137  ! set up struct array
138  do icol = 1, size(this%idts)
139  ! allocate variable in memory manager
140  call this%structarray%mem_create_vector(icol, this%idts(icol)%idt)
141  end do
Here is the call graph for this function:

◆ rp()

subroutine mf6filesettingloadmodule::rp ( class(settingloadtype), intent(inout)  this,
type(blockparsertype), intent(inout), pointer  parser 
)
private

Definition at line 112 of file Mf6FileSetting.f90.

113  class(SettingLoadType), intent(inout) :: this
114  type(BlockParserType), pointer, intent(inout) :: parser
115 
116  ! recreate structarray for period load
117  call this%reset()
118 
119  ! read from ascii
120  this%ctx%nbound = &
121  this%structarray%read_from_parser(parser, .false., this%iout)