MODFLOW 6  version 6.6.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 138 of file Integer1dReader.f90.

139  class(Integer1dReaderType) :: this
140  integer(I4B) :: i
141  if (this%factor /= 0) then
142  do i = 1, size(this%int1d)
143  this%int1d(i) = this%int1d(i) * this%factor
144  end do
145  end if

◆ fill_constant()

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

Definition at line 93 of file Integer1dReader.f90.

94  class(Integer1dReaderType) :: this
95  integer(I4B) :: i
96  do i = 1, size(this%int1d)
97  this%int1d(i) = this%constant_array_value
98  end do

◆ read_ascii()

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

Definition at line 101 of file Integer1dReader.f90.

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

◆ read_binary()

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

Definition at line 117 of file Integer1dReader.f90.

118  class(Integer1dReaderType) :: this
119  integer(I4B) :: i
120  integer(I4B) :: nvals
121  integer(I4B) :: istat
122  call read_binary_header(this%input_unit, this%iout, this%array_name, nvals)
123  read (this%input_unit, iostat=istat, iomsg=errmsg) &
124  (this%int1d(i), i=1, size(this%int1d))
125  if (istat /= 0) then
126  errmsg = 'Error reading data for array '//trim(this%array_name)// &
127  '. '//trim(errmsg)
128  call store_error(errmsg)
129  call store_error_unit(this%input_unit)
130  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 34 of file Integer1dReader.f90.

35  ! -- dummy
36  type(BlockParserType), intent(in), target :: parser
37  integer(I4B), dimension(:), contiguous, target :: int1d
38  character(len=*), intent(in) :: aname
39  ! -- local
40  type(Integer1dReaderType) :: this
41 
42  this%parser => parser
43  this%int1d => int1d
44  this%array_name = aname
45 
46  call this%read_array()
47 
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 50 of file Integer1dReader.f90.

52  ! -- dummy
53  type(BlockParserType), intent(in), target :: parser
54  integer(I4B), dimension(:), contiguous, target :: int1d
55  character(len=*), intent(in) :: aname
56  integer(I4B), intent(in) :: nlay
57  integer(I4B), dimension(:), intent(in) :: layer_shape
58  ! -- local
59  integer(I4B) :: k
60  integer(I4B) :: ncpl, nrow, ncol
61  integer(I4B) :: index_start, index_stop
62  integer(I4B), dimension(:, :), contiguous, pointer :: int2d_ptr
63 
64  ncpl = product(layer_shape)
65  index_start = 1
66  do k = 1, nlay
67  index_stop = index_start + ncpl - 1
68  if (size(layer_shape) == 2) then
69  ncol = layer_shape(1)
70  nrow = layer_shape(2)
71  int2d_ptr(1:ncol, 1:nrow) => int1d(index_start:index_stop)
72  call read_int2d(parser, int2d_ptr, aname)
73  else
74  call read_int1d(parser, int1d(index_start:index_stop), aname)
75  end if
76  index_start = index_stop + 1
77  end do
78 
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 81 of file Integer1dReader.f90.

82  class(Integer1dReaderType) :: this
83  call this%ArrayReaderBaseType%reset_reader()
84  this%constant_array_value = 0
85  this%factor = 1

◆ set_constant()

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

Definition at line 88 of file Integer1dReader.f90.

89  class(Integer1dReaderType) :: this
90  this%constant_array_value = this%parser%GetInteger()

◆ set_factor()

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

Definition at line 133 of file Integer1dReader.f90.

134  class(Integer1dReaderType) :: this
135  this%factor = this%parser%GetInteger()