MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
arrayreaderbasemodule Module Reference

Data Types

type  arrayreaderbasetype
 

Functions/Subroutines

subroutine read_array (this)
 
subroutine reset_reader (this)
 
subroutine read_control_record (this)
 
subroutine set_constant (this)
 
subroutine fill_constant (this)
 
subroutine fill_internal (this)
 
subroutine fill_open_close (this)
 
subroutine read_ascii (this)
 
subroutine read_binary (this)
 
subroutine set_factor (this)
 
subroutine apply_factor (this)
 
subroutine open_file (this)
 

Function/Subroutine Documentation

◆ apply_factor()

subroutine arrayreaderbasemodule::apply_factor ( class(arrayreaderbasetype this)
private

Definition at line 169 of file ArrayReaderBase.f90.

170  class(ArrayReaderBaseType) :: this
171  errmsg = 'Programming error in ArrayReader'
172  call store_error(errmsg, terminate=.true.)
Here is the call graph for this function:

◆ fill_constant()

subroutine arrayreaderbasemodule::fill_constant ( class(arrayreaderbasetype this)
private

Definition at line 125 of file ArrayReaderBase.f90.

126  class(ArrayReaderBaseType) :: this
127  errmsg = 'Programming error in ArrayReader'
128  call store_error(errmsg, terminate=.true.)
Here is the call graph for this function:

◆ fill_internal()

subroutine arrayreaderbasemodule::fill_internal ( class(arrayreaderbasetype this)
private

Definition at line 131 of file ArrayReaderBase.f90.

132  class(ArrayReaderBaseType) :: this
133  this%input_unit = this%parser%iuactive
134  call this%read_ascii()
135  call this%apply_factor()

◆ fill_open_close()

subroutine arrayreaderbasemodule::fill_open_close ( class(arrayreaderbasetype this)
private

Definition at line 138 of file ArrayReaderBase.f90.

139  class(ArrayReaderBaseType) :: this
140  this%input_unit = 0
141  call this%open_file()
142  if (this%isBinary) then
143  call this%read_binary()
144  else
145  call this%read_ascii()
146  end if
147  close (this%input_unit)
148  call this%apply_factor()

◆ open_file()

subroutine arrayreaderbasemodule::open_file ( class(arrayreaderbasetype this)
private

Definition at line 175 of file ArrayReaderBase.f90.

176  use openspecmodule, only: form, access
177  class(ArrayReaderBaseType) :: this
178  if (this%isBinary) then
179  call openfile(this%input_unit, this%iout, this%filename, &
180  'OPEN/CLOSE', fmtarg_opt=form, accarg_opt=access)
181  else
182  call openfile(this%input_unit, this%iout, this%filename, 'OPEN/CLOSE')
183  end if
character(len=20) access
Definition: OpenSpec.f90:7
character(len=20) form
Definition: OpenSpec.f90:7
Here is the call graph for this function:

◆ read_array()

subroutine arrayreaderbasemodule::read_array ( class(arrayreaderbasetype this)
private

Definition at line 46 of file ArrayReaderBase.f90.

47  class(ArrayReaderBaseType) :: this
48 
49  ! read control record
50  call this%read_control_record()
51 
52  ! fill array
53  if (this%isConstant) then
54  call this%fill_constant()
55  else if (this%isInternal) then
56  call this%fill_internal()
57  else if (this%isOpenClose) then
58  call this%fill_open_close()
59  end if
60 

◆ read_ascii()

subroutine arrayreaderbasemodule::read_ascii ( class(arrayreaderbasetype this)
private

Definition at line 151 of file ArrayReaderBase.f90.

152  class(ArrayReaderBaseType) :: this
153  errmsg = 'Programming error in ArrayReader'
154  call store_error(errmsg, terminate=.true.)
Here is the call graph for this function:

◆ read_binary()

subroutine arrayreaderbasemodule::read_binary ( class(arrayreaderbasetype this)
private

Definition at line 157 of file ArrayReaderBase.f90.

158  class(ArrayReaderBaseType) :: this
159  errmsg = 'Programming error in ArrayReader'
160  call store_error(errmsg, terminate=.true.)
Here is the call graph for this function:

◆ read_control_record()

subroutine arrayreaderbasemodule::read_control_record ( class(arrayreaderbasetype this)
private

Definition at line 72 of file ArrayReaderBase.f90.

73  class(ArrayReaderBaseType) :: this
74  logical(LGP) :: endOfBlock
75  character(len=100) :: keyword
76  character(len=MAXCHARLEN) :: string
77 
78  ! read the array input style
79  call this%parser%GetNextLine(endofblock)
80  call this%parser%GetStringCaps(keyword)
81 
82  ! load array based on the different styles
83  select case (keyword)
84  case ('CONSTANT')
85  this%isConstant = .true.
86  call this%set_constant()
87  case ('INTERNAL')
88  this%isInternal = .true.
89  case ('OPEN/CLOSE')
90  this%isOpenClose = .true.
91  call this%parser%GetString(string)
92  this%filename = trim(string)
93  case default
94  write (errmsg, *) 'Error reading control record for '// &
95  trim(adjustl(this%array_name))//'. &
96  & Use CONSTANT, INTERNAL, or OPEN/CLOSE.'
97  call store_error(errmsg)
98  call this%parser%StoreErrorUnit()
99  end select
100 
101  ! if INTERNAL or OPEN/CLOSE then look for FACTOR and IPRN
102  if (this%isInternal .or. this%isOpenClose) then
103  do
104  call this%parser%GetStringCaps(keyword)
105  if (keyword == '') exit
106  select case (keyword)
107  case ('FACTOR')
108  call this%set_factor()
109  case ('IPRN')
110  this%iprn = this%parser%GetInteger()
111  case ('(BINARY)')
112  this%isBinary = .true.
113  end select
114  end do
115  end if
116 
Here is the call graph for this function:

◆ reset_reader()

subroutine arrayreaderbasemodule::reset_reader ( class(arrayreaderbasetype this)
private

Definition at line 63 of file ArrayReaderBase.f90.

64  class(ArrayReaderBaseType) :: this
65  this%iprn = 0
66  this%isConstant = .false.
67  this%isInternal = .false.
68  this%isOpenClose = .false.
69  this%isBinary = .false.

◆ set_constant()

subroutine arrayreaderbasemodule::set_constant ( class(arrayreaderbasetype this)
private

Definition at line 119 of file ArrayReaderBase.f90.

120  class(ArrayReaderBaseType) :: this
121  errmsg = 'Programming error in ArrayReader'
122  call store_error(errmsg, terminate=.true.)
Here is the call graph for this function:

◆ set_factor()

subroutine arrayreaderbasemodule::set_factor ( class(arrayreaderbasetype this)
private

Definition at line 163 of file ArrayReaderBase.f90.

164  class(ArrayReaderBaseType) :: this
165  errmsg = 'Programming error in ArrayReader'
166  call store_error(errmsg, terminate=.true.)
Here is the call graph for this function: