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

Data Types

type  integer2dreadertype
 

Functions/Subroutines

subroutine, public read_int2d (parser, int2d, aname)
 
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 integer2dreadermodule::apply_factor ( class(integer2dreadertype this)
private

Definition at line 117 of file Integer2dReader.f90.

118  class(Integer2dReaderType) :: this
119  integer(I4B) :: i, j
120  if (this%factor /= dzero) then
121  do i = 1, size(this%int2d, dim=2)
122  do j = 1, size(this%int2d, dim=1)
123  this%int2d(j, i) = this%int2d(j, i) * this%factor
124  end do
125  end do
126  end if

◆ fill_constant()

subroutine integer2dreadermodule::fill_constant ( class(integer2dreadertype this)
private

Definition at line 66 of file Integer2dReader.f90.

67  class(Integer2dReaderType) :: this
68  integer(I4B) :: i, j
69  do i = 1, size(this%int2d, dim=2)
70  do j = 1, size(this%int2d, dim=1)
71  this%int2d(j, i) = this%constant_array_value
72  end do
73  end do

◆ read_ascii()

subroutine integer2dreadermodule::read_ascii ( class(integer2dreadertype this)
private

Definition at line 76 of file Integer2dReader.f90.

77  class(Integer2dReaderType) :: this
78  integer(I4B) :: i, j
79  integer(I4B) :: istat
80  do i = 1, size(this%int2d, dim=2)
81  read (this%input_unit, *, iostat=istat, iomsg=errmsg) &
82  (this%int2d(j, i), j=1, size(this%int2d, dim=1))
83  end do
84  if (istat /= 0) then
85  errmsg = 'Error reading data for array '//trim(this%array_name)// &
86  '. '//trim(errmsg)
87  call store_error(errmsg)
88  call store_error_unit(this%input_unit)
89  end if
Here is the call graph for this function:

◆ read_binary()

subroutine integer2dreadermodule::read_binary ( class(integer2dreadertype this)
private

Definition at line 92 of file Integer2dReader.f90.

93  class(Integer2dReaderType) :: this
94  integer(I4B) :: i, j
95  integer(I4B) :: nvals
96  integer(I4B) :: istat
97  integer(I4B) :: expected_size
98  expected_size = binary_header_bytes + (size(this%int2d) * binary_int_bytes)
99  call read_binary_header(this%input_unit, this%iout, this%array_name, nvals)
100  call check_binary_filesize(this%input_unit, expected_size, this%array_name)
101  read (this%input_unit, iostat=istat, iomsg=errmsg) &
102  ((this%int2d(j, i), j=1, size(this%int2d, dim=1)), &
103  i=1, size(this%int2d, dim=2))
104  if (istat /= 0) then
105  errmsg = 'Error reading data for array '//trim(this%array_name)// &
106  '. '//trim(errmsg)
107  call store_error(errmsg)
108  call store_error_unit(this%input_unit)
109  end if
Here is the call graph for this function:

◆ read_int2d()

subroutine, public integer2dreadermodule::read_int2d ( type(blockparsertype), intent(in), target  parser,
integer(i4b), dimension(:, :), target, contiguous  int2d,
character(len=*), intent(in)  aname 
)

Definition at line 38 of file Integer2dReader.f90.

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

◆ reset_reader()

subroutine integer2dreadermodule::reset_reader ( class(integer2dreadertype this)
private

Definition at line 54 of file Integer2dReader.f90.

55  class(Integer2dReaderType) :: this
56  call this%ArrayReaderBaseType%reset_reader()
57  this%constant_array_value = 0
58  this%factor = 1

◆ set_constant()

subroutine integer2dreadermodule::set_constant ( class(integer2dreadertype this)
private

Definition at line 61 of file Integer2dReader.f90.

62  class(Integer2dReaderType) :: this
63  this%constant_array_value = this%parser%GetInteger()

◆ set_factor()

subroutine integer2dreadermodule::set_factor ( class(integer2dreadertype this)
private

Definition at line 112 of file Integer2dReader.f90.

113  class(Integer2dReaderType) :: this
114  this%factor = this%parser%GetInteger()