MODFLOW 6  version 6.8.0.dev0
USGS Modular Hydrologic Model
rchmodule Module Reference

Data Types

type  rchtype
 

Functions/Subroutines

subroutine, public rch_create (packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath)
 Create a New Recharge Package. More...
 
subroutine rch_allocate_scalars (this)
 Allocate scalar members. More...
 
subroutine rch_allocate_arrays (this, nodelist, auxvar)
 Allocate package arrays. More...
 
subroutine rch_source_options (this)
 Source options specific to RchType. More...
 
subroutine log_rch_options (this, found_fixed_cell)
 Log options specific to RchType. More...
 
subroutine rch_read_initial_attr (this)
 Part of allocate and read. More...
 
subroutine rch_rp (this)
 Read and Prepare. More...
 
subroutine set_nodesontop (this)
 Store nodelist in nodesontop. More...
 
subroutine rch_cf (this)
 Formulate the HCOF and RHS terms. More...
 
subroutine rch_fc (this, rhs, ia, idxglo, matrix_sln)
 Copy rhs and hcof into solution rhs and amat. More...
 
subroutine rch_da (this)
 Deallocate memory. More...
 
subroutine rch_define_listlabel (this)
 Define the list heading that is written to iout when PRINT_INPUT option is used. More...
 
logical function rch_obs_supported (this)
 Overrides BndTypebnd_obs_supported() More...
 
subroutine rch_df_obs (this)
 Implements bnd_df_obs. More...
 
real(dp) function rch_bound_value (this, col, row)
 Return requested boundary value. More...
 

Variables

character(len=lenftype) ftype = 'RCH'
 
character(len=lenpackagename) text = ' RCH'
 
character(len=lenpackagename) texta = ' RCHA'
 

Function/Subroutine Documentation

◆ log_rch_options()

subroutine rchmodule::log_rch_options ( class(rchtype), intent(inout)  this,
logical(lgp), intent(in)  found_fixed_cell 
)

Definition at line 155 of file gwf-rch.f90.

156  implicit none
157  ! -- dummy
158  class(RchType), intent(inout) :: this
159  logical(LGP), intent(in) :: found_fixed_cell
160  ! -- formats
161  character(len=*), parameter :: fmtfixedcell = &
162  &"(4x, 'RECHARGE WILL BE APPLIED TO SPECIFIED CELL.')"
163  !
164  ! -- log found options
165  write (this%iout, '(/1x,a)') 'PROCESSING '//trim(adjustl(this%text)) &
166  //' OPTIONS'
167  !
168  if (found_fixed_cell) then
169  write (this%iout, fmtfixedcell)
170  end if
171  !
172  ! -- close logging block
173  write (this%iout, '(1x,a)') &
174  'END OF '//trim(adjustl(this%text))//' OPTIONS'

◆ rch_allocate_arrays()

subroutine rchmodule::rch_allocate_arrays ( class(rchtype this,
integer(i4b), dimension(:), optional, pointer, contiguous  nodelist,
real(dp), dimension(:, :), optional, pointer, contiguous  auxvar 
)
private

Definition at line 108 of file gwf-rch.f90.

109  ! -- modules
111  ! -- dummy
112  class(RchType) :: this
113  integer(I4B), dimension(:), pointer, contiguous, optional :: nodelist
114  real(DP), dimension(:, :), pointer, contiguous, optional :: auxvar
115  !
116  ! -- allocate base arrays
117  call this%BndExtType%allocate_arrays(nodelist, auxvar)
118  !
119  ! -- set recharge input context pointer
120  call mem_setptr(this%recharge, 'RECHARGE', this%input_mempath)
121  !
122  ! -- checkin recharge input context pointer
123  call mem_checkin(this%recharge, 'RECHARGE', this%memoryPath, &
124  'RECHARGE', this%input_mempath)

◆ rch_allocate_scalars()

subroutine rchmodule::rch_allocate_scalars ( class(rchtype), intent(inout)  this)
private

Definition at line 92 of file gwf-rch.f90.

93  ! -- dummy
94  class(RchType), intent(inout) :: this
95  !
96  ! -- allocate base scalars
97  call this%BndExtType%allocate_scalars()
98  !
99  ! -- allocate internal members
100  allocate (this%fixed_cell)
101  !
102  ! -- Set values
103  this%fixed_cell = .false.

◆ rch_bound_value()

real(dp) function rchmodule::rch_bound_value ( class(rchtype), intent(inout)  this,
integer(i4b), intent(in)  col,
integer(i4b), intent(in)  row 
)
private

Definition at line 394 of file gwf-rch.f90.

395  ! -- modules
396  use constantsmodule, only: dzero
397  ! -- dummy
398  class(RchType), intent(inout) :: this
399  integer(I4B), intent(in) :: col
400  integer(I4B), intent(in) :: row
401  ! -- result
402  real(DP) :: bndval
403  !
404  select case (col)
405  case (1)
406  if (this%iauxmultcol > 0) then
407  bndval = this%recharge(row) * this%auxvar(this%iauxmultcol, row)
408  else
409  bndval = this%recharge(row)
410  end if
411  case default
412  errmsg = 'Programming error. RCH bound value requested column '&
413  &'outside range of ncolbnd (1).'
414  call store_error(errmsg)
415  call store_error_filename(this%input_fname)
416  end select
This module contains simulation constants.
Definition: Constants.f90:9
real(dp), parameter dzero
real constant zero
Definition: Constants.f90:65
Here is the call graph for this function:

◆ rch_cf()

subroutine rchmodule::rch_cf ( class(rchtype this)
private

Skip if no recharge. Otherwise, calculate hcof and rhs

Definition at line 236 of file gwf-rch.f90.

237  ! -- dummy
238  class(rchtype) :: this
239  ! -- local
240  integer(I4B) :: i, node
241  !
242  ! -- Return if no recharge
243  if (this%nbound == 0) return
244  !
245  ! -- Calculate hcof and rhs for each recharge entry
246  do i = 1, this%nbound
247  !
248  ! -- Find the node number
249  if (this%fixed_cell) then
250  node = this%nodelist(i)
251  else
252  node = this%nodesontop(i)
253  end if
254  !
255  ! -- cycle if nonexistent bound
256  if (node <= 0) then
257  this%hcof(i) = dzero
258  this%rhs(i) = dzero
259  cycle
260  end if
261  !
262  ! -- reset nodelist to highest active
263  if (.not. this%fixed_cell) then
264  if (this%ibound(node) == 0) &
265  call this%dis%highest_active(node, this%ibound)
266  this%nodelist(i) = node
267  end if
268  !
269  ! -- Set rhs and hcof
270  this%hcof(i) = dzero
271  if (this%iauxmultcol > 0) then
272  this%rhs(i) = -this%recharge(i) * this%dis%get_area(node) * &
273  this%auxvar(this%iauxmultcol, i)
274  else
275  this%rhs(i) = -this%recharge(i) * this%dis%get_area(node)
276  end if
277  if (this%ibound(node) <= 0) then
278  this%rhs(i) = dzero
279  cycle
280  end if
281  if (this%ibound(node) == iwetlake) then
282  this%rhs(i) = dzero
283  cycle
284  end if
285  end do

◆ rch_create()

subroutine, public rchmodule::rch_create ( class(bndtype), pointer  packobj,
integer(i4b), intent(in)  id,
integer(i4b), intent(in)  ibcnum,
integer(i4b), intent(in)  inunit,
integer(i4b), intent(in)  iout,
character(len=*), intent(in)  namemodel,
character(len=*), intent(in)  pakname,
character(len=*), intent(in)  mempath 
)

Create new RCH package and point packobj to the new package

Definition at line 54 of file gwf-rch.f90.

56  ! -- dummy
57  class(BndType), pointer :: packobj
58  integer(I4B), intent(in) :: id
59  integer(I4B), intent(in) :: ibcnum
60  integer(I4B), intent(in) :: inunit
61  integer(I4B), intent(in) :: iout
62  character(len=*), intent(in) :: namemodel
63  character(len=*), intent(in) :: pakname
64  character(len=*), intent(in) :: mempath
65  ! -- local
66  type(rchtype), pointer :: rchobj
67  !
68  ! -- allocate recharge object and scalar variables
69  allocate (rchobj)
70  packobj => rchobj
71  !
72  ! -- create name and memory path
73  call packobj%set_names(ibcnum, namemodel, pakname, ftype, mempath)
74  packobj%text = text
75  !
76  ! -- allocate scalars
77  call rchobj%rch_allocate_scalars()
78  !
79  ! -- initialize package
80  call packobj%pack_initialize()
81  !
82  packobj%inunit = inunit
83  packobj%iout = iout
84  packobj%id = id
85  packobj%ibcnum = ibcnum
86  packobj%ncolbnd = 1
87  packobj%ictMemPath = create_mem_path(namemodel, 'NPF')
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rch_da()

subroutine rchmodule::rch_da ( class(rchtype this)
private

Definition at line 318 of file gwf-rch.f90.

319  ! -- modules
321  ! -- dummy
322  class(RchType) :: this
323  !
324  ! -- Deallocate parent package
325  call this%BndExtType%bnd_da()
326  !
327  ! -- scalars
328  deallocate (this%fixed_cell)
329  !
330  ! -- arrays
331  if (associated(this%nodesontop)) deallocate (this%nodesontop)
332  call mem_deallocate(this%recharge, 'RECHARGE', this%memoryPath)

◆ rch_define_listlabel()

subroutine rchmodule::rch_define_listlabel ( class(rchtype), intent(inout)  this)

Definition at line 338 of file gwf-rch.f90.

339  ! -- dummy
340  class(RchType), intent(inout) :: this
341  !
342  ! -- create the header list label
343  this%listlabel = trim(this%filtyp)//' NO.'
344  if (this%dis%ndim == 3) then
345  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'LAYER'
346  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'ROW'
347  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'COL'
348  elseif (this%dis%ndim == 2) then
349  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'LAYER'
350  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'CELL2D'
351  else
352  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'NODE'
353  end if
354  write (this%listlabel, '(a, a16)') trim(this%listlabel), 'RECHARGE'
355 ! if(this%multindex > 0) &
356 ! write(this%listlabel, '(a, a16)') trim(this%listlabel), 'MULTIPLIER'
357  if (this%inamedbound == 1) then
358  write (this%listlabel, '(a, a16)') trim(this%listlabel), 'BOUNDARY NAME'
359  end if

◆ rch_df_obs()

subroutine rchmodule::rch_df_obs ( class(rchtype this)
private

Store observation type supported by RCH package. Overrides BndTypebnd_df_obs

Definition at line 381 of file gwf-rch.f90.

382  implicit none
383  ! -- dummy
384  class(RchType) :: this
385  ! -- local
386  integer(I4B) :: indx
387  !
388  call this%obs%StoreObsType('rch', .true., indx)
389  this%obs%obsData(indx)%ProcessIdPtr => defaultobsidprocessor
Here is the call graph for this function:

◆ rch_fc()

subroutine rchmodule::rch_fc ( class(rchtype this,
real(dp), dimension(:), intent(inout)  rhs,
integer(i4b), dimension(:), intent(in)  ia,
integer(i4b), dimension(:), intent(in)  idxglo,
class(matrixbasetype), pointer  matrix_sln 
)
private

Definition at line 290 of file gwf-rch.f90.

291  ! -- dummy
292  class(RchType) :: this
293  real(DP), dimension(:), intent(inout) :: rhs
294  integer(I4B), dimension(:), intent(in) :: ia
295  integer(I4B), dimension(:), intent(in) :: idxglo
296  class(MatrixBaseType), pointer :: matrix_sln
297  ! -- local
298  integer(I4B) :: i, n, ipos
299  !
300  ! -- Copy package rhs and hcof into solution rhs and amat
301  do i = 1, this%nbound
302  n = this%nodelist(i)
303  if (n <= 0) cycle
304  ! -- reset hcof and rhs for excluded cells
305  if (this%ibound(n) == iwetlake) then
306  this%hcof(i) = dzero
307  this%rhs(i) = dzero
308  cycle
309  end if
310  rhs(n) = rhs(n) + this%rhs(i)
311  ipos = ia(n)
312  call matrix_sln%add_value_pos(idxglo(ipos), this%hcof(i))
313  end do

◆ rch_obs_supported()

logical function rchmodule::rch_obs_supported ( class(rchtype this)
private

Definition at line 368 of file gwf-rch.f90.

369  implicit none
370  ! -- dummy
371  class(RchType) :: this
372  !
373  rch_obs_supported = .true.

◆ rch_read_initial_attr()

subroutine rchmodule::rch_read_initial_attr ( class(rchtype), intent(inout)  this)
private

Definition at line 179 of file gwf-rch.f90.

180  ! -- dummy
181  class(RchType), intent(inout) :: this
182  !
183  if (this%readasarrays) then
184  call this%default_nodelist()
185  end if
186  !
187  ! -- if fixed_cell option not set, then need to store nodelist
188  ! in the nodesontop array
189  if (.not. this%fixed_cell) call this%set_nodesontop()

◆ rch_rp()

subroutine rchmodule::rch_rp ( class(rchtype), intent(inout)  this)
private

Read itmp and read new boundaries if itmp > 0

Definition at line 196 of file gwf-rch.f90.

197  ! -- modules
198  use tdismodule, only: kper
199  implicit none
200  ! -- dummy
201  class(RchType), intent(inout) :: this
202  !
203  if (this%iper /= kper) return
204  !
205  call this%BndExtType%bnd_rp()
206  !
207  ! -- copy nodelist to nodesontop if not fixed cell
208  if (.not. this%fixed_cell) call this%set_nodesontop()
209  !
integer(i4b), pointer, public kper
current stress period number
Definition: tdis.f90:23

◆ rch_source_options()

subroutine rchmodule::rch_source_options ( class(rchtype), intent(inout)  this)

Definition at line 129 of file gwf-rch.f90.

130  ! -- modules
132  implicit none
133  ! -- dummy
134  class(RchType), intent(inout) :: this
135  ! -- local
136  logical(LGP) :: found_fixed_cell = .false.
137  !
138  ! -- source common bound options
139  call this%BndExtType%source_options()
140  !
141  ! -- update defaults with idm sourced values
142  call mem_set_value(this%fixed_cell, 'FIXED_CELL', this%input_mempath, &
143  found_fixed_cell)
144  !
145  if (this%readasarrays) then
146  this%text = texta
147  end if
148  !
149  ! -- log rch params
150  call this%log_rch_options(found_fixed_cell)

◆ set_nodesontop()

subroutine rchmodule::set_nodesontop ( class(rchtype), intent(inout)  this)

Definition at line 214 of file gwf-rch.f90.

215  implicit none
216  ! -- dummy
217  class(RchType), intent(inout) :: this
218  ! -- local
219  integer(I4B) :: n
220  !
221  ! -- allocate if necessary
222  if (.not. associated(this%nodesontop)) then
223  allocate (this%nodesontop(this%maxbound))
224  end if
225  !
226  ! -- copy nodelist into nodesontop
227  do n = 1, this%nbound
228  this%nodesontop(n) = this%nodelist(n)
229  end do

Variable Documentation

◆ ftype

character(len=lenftype) rchmodule::ftype = 'RCH'
private

Definition at line 19 of file gwf-rch.f90.

19  character(len=LENFTYPE) :: ftype = 'RCH'

◆ text

character(len=lenpackagename) rchmodule::text = ' RCH'
private

Definition at line 20 of file gwf-rch.f90.

20  character(len=LENPACKAGENAME) :: text = ' RCH'

◆ texta

character(len=lenpackagename) rchmodule::texta = ' RCHA'
private

Definition at line 21 of file gwf-rch.f90.

21  character(len=LENPACKAGENAME) :: texta = ' RCHA'