MODFLOW 6  version 6.7.0.dev0
USGS Modular Hydrologic Model
integer1dreadermodule Module Reference

Data Types

type  integer1dreadertype
 

Functions/Subroutines

subroutine, public read_int1d (parser, int1d, aname)
 
subroutine, public read_int1d_layered (parser, int1d, aname, nlay, layer_shape)
 
subroutine reset_reader (this)
 
subroutine set_constant (this)
 
subroutine fill_constant (this)
 
subroutine read_ascii (this)
 
subroutine read_binary (this)
 
subroutine set_factor (this)
 
subroutine apply_factor (this)
 

Function/Subroutine Documentation

◆ apply_factor()

subroutine integer1dreadermodule::apply_factor ( class(integer1dreadertype this)
private

Definition at line 144 of file Integer1dReader.f90.

145  class(Integer1dReaderType) :: this
146  integer(I4B) :: i
147  if (this%factor /= 0) then
148  do i = 1, size(this%int1d)
149  this%int1d(i) = this%int1d(i) * this%factor
150  end do
151  end if

◆ fill_constant()

subroutine integer1dreadermodule::fill_constant ( class(integer1dreadertype this)
private

Definition at line 96 of file Integer1dReader.f90.

97  class(Integer1dReaderType) :: this
98  integer(I4B) :: i
99  do i = 1, size(this%int1d)
100  this%int1d(i) = this%constant_array_value
101  end do

◆ read_ascii()

subroutine integer1dreadermodule::read_ascii ( class(integer1dreadertype this)
private

Definition at line 104 of file Integer1dReader.f90.

105  class(Integer1dReaderType) :: this
106  integer(I4B) :: i
107  integer(I4B) :: nvals
108  integer(I4B) :: istat
109  nvals = size(this%int1d)
110  read (this%input_unit, *, iostat=istat, iomsg=errmsg) &
111  (this%int1d(i), i=1, size(this%int1d))
112  if (istat /= 0) then
113  errmsg = 'Error reading data for array '//trim(this%array_name)// &
114  '. '//trim(errmsg)
115  call store_error(errmsg)
116  call store_error_unit(this%input_unit)
117  end if
Here is the call graph for this function:

◆ read_binary()

subroutine integer1dreadermodule::read_binary ( class(integer1dreadertype this)
private

Definition at line 120 of file Integer1dReader.f90.

121  class(Integer1dReaderType) :: this
122  integer(I4B) :: i
123  integer(I4B) :: nvals
124  integer(I4B) :: istat
125  integer(I4B) :: expected_size
126  expected_size = binary_header_bytes + (size(this%int1d) * binary_int_bytes)
127  call read_binary_header(this%input_unit, this%iout, this%array_name, nvals)
128  call check_binary_filesize(this%input_unit, expected_size, this%array_name)
129  read (this%input_unit, iostat=istat, iomsg=errmsg) &
130  (this%int1d(i), i=1, size(this%int1d))
131  if (istat /= 0) then
132  errmsg = 'Error reading data for array '//trim(this%array_name)// &
133  '. '//trim(errmsg)
134  call store_error(errmsg)
135  call store_error_unit(this%input_unit)
136  end if
Here is the call graph for this function:

◆ read_int1d()

subroutine, public integer1dreadermodule::read_int1d ( type(blockparsertype), intent(in), target  parser,
integer(i4b), dimension(:), target, contiguous  int1d,
character(len=*), intent(in)  aname 
)

Definition at line 37 of file Integer1dReader.f90.

38  ! -- dummy
39  type(BlockParserType), intent(in), target :: parser
40  integer(I4B), dimension(:), contiguous, target :: int1d
41  character(len=*), intent(in) :: aname
42  ! -- local
43  type(Integer1dReaderType) :: this
44 
45  this%parser => parser
46  this%int1d => int1d
47  this%array_name = aname
48 
49  call this%read_array()
50 
Here is the caller graph for this function:

◆ read_int1d_layered()

subroutine, public integer1dreadermodule::read_int1d_layered ( type(blockparsertype), intent(in), target  parser,
integer(i4b), dimension(:), target, contiguous  int1d,
character(len=*), intent(in)  aname,
integer(i4b), intent(in)  nlay,
integer(i4b), dimension(:), intent(in)  layer_shape 
)

Definition at line 53 of file Integer1dReader.f90.

55  ! -- dummy
56  type(BlockParserType), intent(in), target :: parser
57  integer(I4B), dimension(:), contiguous, target :: int1d
58  character(len=*), intent(in) :: aname
59  integer(I4B), intent(in) :: nlay
60  integer(I4B), dimension(:), intent(in) :: layer_shape
61  ! -- local
62  integer(I4B) :: k
63  integer(I4B) :: ncpl, nrow, ncol
64  integer(I4B) :: index_start, index_stop
65  integer(I4B), dimension(:, :), contiguous, pointer :: int2d_ptr
66 
67  ncpl = product(layer_shape)
68  index_start = 1
69  do k = 1, nlay
70  index_stop = index_start + ncpl - 1
71  if (size(layer_shape) == 2) then
72  ncol = layer_shape(1)
73  nrow = layer_shape(2)
74  int2d_ptr(1:ncol, 1:nrow) => int1d(index_start:index_stop)
75  call read_int2d(parser, int2d_ptr, aname)
76  else
77  call read_int1d(parser, int1d(index_start:index_stop), aname)
78  end if
79  index_start = index_stop + 1
80  end do
81 
subroutine, public read_int2d(parser, int2d, aname)
Here is the call graph for this function:

◆ reset_reader()

subroutine integer1dreadermodule::reset_reader ( class(integer1dreadertype this)

Definition at line 84 of file Integer1dReader.f90.

85  class(Integer1dReaderType) :: this
86  call this%ArrayReaderBaseType%reset_reader()
87  this%constant_array_value = 0
88  this%factor = 1

◆ set_constant()

subroutine integer1dreadermodule::set_constant ( class(integer1dreadertype this)
private

Definition at line 91 of file Integer1dReader.f90.

92  class(Integer1dReaderType) :: this
93  this%constant_array_value = this%parser%GetInteger()

◆ set_factor()

subroutine integer1dreadermodule::set_factor ( class(integer1dreadertype this)
private

Definition at line 139 of file Integer1dReader.f90.

140  class(Integer1dReaderType) :: this
141  this%factor = this%parser%GetInteger()