MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
drnmodule Module Reference

Data Types

type  drntype
 

Functions/Subroutines

subroutine, public drn_create (packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath)
 Create a New Drn Package and point packobj to the new package. More...
 
subroutine drn_da (this)
 Deallocate memory. More...
 
subroutine drn_allocate_scalars (this)
 Allocate package scalar members. More...
 
subroutine drn_allocate_arrays (this, nodelist, auxvar)
 Allocate package arrays. More...
 
subroutine drn_rp (this)
 Read and prepare. More...
 
subroutine drn_options (this)
 Source options specific to DrnType. More...
 
subroutine log_drn_options (this, found)
 @ brief Log DRN specific package options More...
 
subroutine drn_ck (this)
 Check drain boundary condition data. More...
 
subroutine drn_cf (this)
 Formulate the HCOF and RHS terms. More...
 
subroutine drn_fc (this, rhs, ia, idxglo, matrix_sln)
 Copy rhs and hcof into solution rhs and amat. More...
 
subroutine drn_fn (this, rhs, ia, idxglo, matrix_sln)
 Fill newton terms. More...
 
subroutine define_listlabel (this)
 Define the list heading that is written to iout when PRINT_INPUT option is used. More...
 
subroutine get_drain_elevations (this, i, drndepth, drntop, drnbot)
 Define drain depth and the top and bottom elevations used to scale the drain conductance. More...
 
subroutine get_drain_factor (this, i, factor, opt_drnbot)
 Get the drain conductance scale factor. More...
 
logical function drn_obs_supported (this)
 Return true because DRN package supports observations. More...
 
subroutine drn_df_obs (this)
 Store observation type supported by DRN package. More...
 
subroutine drn_store_user_cond (this)
 Store user-specified drain conductance. More...
 
real(dp) function cond_mult (this, row)
 Apply multiplier to conductance value depending on user-selected option. More...
 
real(dp) function drn_bound_value (this, col, row)
 Return requested boundary value. More...
 

Variables

character(len=lenftype) ftype = 'DRN'
 
character(len=lenpackagename) text = ' DRN'
 

Function/Subroutine Documentation

◆ cond_mult()

real(dp) function drnmodule::cond_mult ( class(drntype), intent(inout)  this,
integer(i4b), intent(in)  row 
)
private
Parameters
[in,out]thisBndExtType object

Definition at line 681 of file gwf-drn.f90.

682  ! -- modules
683  use constantsmodule, only: dzero
684  ! -- dummy variables
685  class(DrnType), intent(inout) :: this !< BndExtType object
686  integer(I4B), intent(in) :: row
687  ! -- result
688  real(DP) :: cond
689  !
690  if (this%iauxmultcol > 0) then
691  cond = this%cond(row) * this%auxvar(this%iauxmultcol, row)
692  else
693  cond = this%cond(row)
694  end if
695  !
696  ! -- Return
697  return
This module contains simulation constants.
Definition: Constants.f90:9
real(dp), parameter dzero
real constant zero
Definition: Constants.f90:64

◆ define_listlabel()

subroutine drnmodule::define_listlabel ( class(drntype), intent(inout)  this)
private

Definition at line 512 of file gwf-drn.f90.

513  ! -- dummy
514  class(DrnType), intent(inout) :: this
515  !
516  ! -- create the header list label
517  this%listlabel = trim(this%filtyp)//' NO.'
518  if (this%dis%ndim == 3) then
519  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'LAYER'
520  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'ROW'
521  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'COL'
522  elseif (this%dis%ndim == 2) then
523  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'LAYER'
524  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'CELL2D'
525  else
526  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'NODE'
527  end if
528  write (this%listlabel, '(a, a16)') trim(this%listlabel), 'DRAIN EL.'
529  write (this%listlabel, '(a, a16)') trim(this%listlabel), 'CONDUCTANCE'
530  if (this%inamedbound == 1) then
531  write (this%listlabel, '(a, a16)') trim(this%listlabel), 'BOUNDARY NAME'
532  end if
533  !
534  ! -- Return
535  return

◆ drn_allocate_arrays()

subroutine drnmodule::drn_allocate_arrays ( class(drntype this,
integer(i4b), dimension(:), optional, pointer, contiguous  nodelist,
real(dp), dimension(:, :), optional, pointer, contiguous  auxvar 
)

Definition at line 149 of file gwf-drn.f90.

150  ! -- modules
152  ! -- dummy
153  class(DrnType) :: this
154  integer(I4B), dimension(:), pointer, contiguous, optional :: nodelist
155  real(DP), dimension(:, :), pointer, contiguous, optional :: auxvar
156  !
157  ! -- call base type allocate arrays
158  call this%BndExtType%allocate_arrays(nodelist, auxvar)
159  !
160  ! -- set drn input context pointers
161  call mem_setptr(this%elev, 'ELEV', this%input_mempath)
162  call mem_setptr(this%cond, 'COND', this%input_mempath)
163  !
164  ! --checkin drn input context pointers
165  call mem_checkin(this%elev, 'ELEV', this%memoryPath, &
166  'ELEV', this%input_mempath)
167  call mem_checkin(this%cond, 'COND', this%memoryPath, &
168  'COND', this%input_mempath)
169  !
170  ! -- Return
171  return

◆ drn_allocate_scalars()

subroutine drnmodule::drn_allocate_scalars ( class(drntype this)

Definition at line 122 of file gwf-drn.f90.

123  ! -- modules
125  ! -- dummy
126  class(DrnType) :: this
127  !
128  ! -- call base type allocate scalars
129  call this%BndExtType%allocate_scalars()
130  !
131  ! -- allocate the object and assign values to object variables
132  call mem_allocate(this%iauxddrncol, 'IAUXDDRNCOL', this%memoryPath)
133  call mem_allocate(this%icubic_scaling, 'ICUBIC_SCALING', this%memoryPath)
134  !
135  ! -- Set values
136  this%iauxddrncol = 0
137  if (this%inewton /= 0) then
138  this%icubic_scaling = 1
139  else
140  this%icubic_scaling = 0
141  end if
142  !
143  ! -- Return
144  return

◆ drn_bound_value()

real(dp) function drnmodule::drn_bound_value ( class(drntype), intent(inout)  this,
integer(i4b), intent(in)  col,
integer(i4b), intent(in)  row 
)
Parameters
[in,out]thisBndExtType object

Definition at line 702 of file gwf-drn.f90.

703  ! -- modules
704  use constantsmodule, only: dzero
705  ! -- dummy variables
706  class(DrnType), intent(inout) :: this !< BndExtType object
707  integer(I4B), intent(in) :: col
708  integer(I4B), intent(in) :: row
709  ! -- result
710  real(DP) :: bndval
711  !
712  select case (col)
713  case (1)
714  bndval = this%elev(row)
715  case (2)
716  bndval = this%cond_mult(row)
717  case default
718  errmsg = 'Programming error. DRN bound value requested column '&
719  &'outside range of ncolbnd (2).'
720  call store_error(errmsg)
721  call store_error_filename(this%input_fname)
722  end select
723  !
724  ! -- Return
725  return
Here is the call graph for this function:

◆ drn_cf()

subroutine drnmodule::drn_cf ( class(drntype this)
private

Skip if no drains

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

369  ! -- dummy
370  class(DrnType) :: this
371  ! -- local
372  integer(I4B) :: i
373  integer(I4B) :: node
374  real(DP) :: cdrn
375  real(DP) :: drnbot
376  real(DP) :: fact
377  !
378  ! -- Return if no drains
379  if (this%nbound == 0) return
380  !
381  ! -- Calculate hcof and rhs for each drn entry
382  do i = 1, this%nbound
383  node = this%nodelist(i)
384  if (this%ibound(node) <= 0) then
385  this%hcof(i) = dzero
386  this%rhs(i) = dzero
387  cycle
388  end if
389  !
390  ! -- set local variables for this drain
391  cdrn = this%cond_mult(i)
392 
393  !
394  ! -- calculate the drainage scaling factor
395  call this%get_drain_factor(i, fact, drnbot)
396  !
397  ! -- calculate rhs and hcof
398  this%rhs(i) = -fact * cdrn * drnbot
399  this%hcof(i) = -fact * cdrn
400  end do
401  !
402  ! -- Return
403  return

◆ drn_ck()

subroutine drnmodule::drn_ck ( class(drntype), intent(inout)  this)

Definition at line 300 of file gwf-drn.f90.

301  ! -- dummy
302  class(DrnType), intent(inout) :: this
303  ! -- local
304  integer(I4B) :: i
305  integer(I4B) :: node
306  real(DP) :: bt
307  real(DP) :: drndepth
308  real(DP) :: drntop
309  real(DP) :: drnbot
310  ! -- formats
311  character(len=*), parameter :: fmtddrnerr = &
312  "('SCALED-CONDUCTANCE DRN BOUNDARY (',i0,') BOTTOM ELEVATION &
313  &(',f10.3,') IS LESS THAN CELL BOTTOM (',f10.3,')')"
314  character(len=*), parameter :: fmtdrnerr = &
315  "('DRN BOUNDARY (',i0,') ELEVATION (',f10.3,') IS LESS THAN CELL &
316  &BOTTOM (',f10.3,')')"
317  character(len=*), parameter :: fmtcondmulterr = &
318  "('DRN BOUNDARY (',i0,') CONDUCTANCE MULTIPLIER (',g10.3,') IS &
319  &LESS THAN ZERO')"
320  character(len=*), parameter :: fmtconderr = &
321  "('DRN BOUNDARY (',i0,') CONDUCTANCE (',g10.3,') IS LESS THAN &
322  &ZERO')"
323  !
324  ! -- check stress period data
325  do i = 1, this%nbound
326  node = this%nodelist(i)
327  bt = this%dis%bot(node)
328  !
329  ! -- calculate the drainage depth and the top and bottom of
330  ! the conductance scaling elevations
331  call this%get_drain_elevations(i, drndepth, drntop, drnbot)
332  !
333  ! -- accumulate errors
334  if (drnbot < bt .and. this%icelltype(node) /= 0) then
335  if (drndepth /= dzero) then
336  write (errmsg, fmt=fmtddrnerr) i, drnbot, bt
337  else
338  write (errmsg, fmt=fmtdrnerr) i, drnbot, bt
339  end if
340  call store_error(errmsg)
341  end if
342  if (this%iauxmultcol > 0) then
343  if (this%auxvar(this%iauxmultcol, i) < dzero) then
344  write (errmsg, fmt=fmtcondmulterr) &
345  i, this%auxvar(this%iauxmultcol, i)
346  call store_error(errmsg)
347  end if
348  end if
349  if (this%cond(i) < dzero) then
350  write (errmsg, fmt=fmtconderr) i, this%cond(i)
351  call store_error(errmsg)
352  end if
353  end do
354  !
355  ! -- write summary of drain package error messages
356  if (count_errors() > 0) then
357  call store_error_filename(this%input_fname)
358  end if
359  !
360  ! -- Return
361  return
Here is the call graph for this function:

◆ drn_create()

subroutine, public drnmodule::drn_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 
)

Definition at line 58 of file gwf-drn.f90.

60  ! -- dummy
61  class(BndType), pointer :: packobj
62  integer(I4B), intent(in) :: id
63  integer(I4B), intent(in) :: ibcnum
64  integer(I4B), intent(in) :: inunit
65  integer(I4B), intent(in) :: iout
66  character(len=*), intent(in) :: namemodel
67  character(len=*), intent(in) :: pakname
68  character(len=*), intent(in) :: mempath
69  ! -- local
70  type(DrnType), pointer :: drnobj
71  !
72  ! -- allocate the object and assign values to object variables
73  allocate (drnobj)
74  packobj => drnobj
75  !
76  ! -- create name and memory path
77  call packobj%set_names(ibcnum, namemodel, pakname, ftype, mempath)
78  packobj%text = text
79  !
80  ! -- allocate scalars
81  call drnobj%allocate_scalars()
82  !s
83  ! -- initialize package
84  call packobj%pack_initialize()
85  !
86  ! -- initialize
87  packobj%inunit = inunit
88  packobj%iout = iout
89  packobj%id = id
90  packobj%ibcnum = ibcnum
91  packobj%ictMemPath = create_mem_path(namemodel, 'NPF')
92  !
93  ! -- Return
94  return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drn_da()

subroutine drnmodule::drn_da ( class(drntype this)
private

Definition at line 99 of file gwf-drn.f90.

100  ! -- modules
102  ! -- dummy
103  class(DrnType) :: this
104  !
105  ! -- Deallocate parent package
106  call this%BndExtType%bnd_da()
107  !
108  ! -- scalars
109  call mem_deallocate(this%iauxddrncol)
110  call mem_deallocate(this%icubic_scaling)
111  !
112  ! -- arrays
113  call mem_deallocate(this%elev, 'ELEV', this%memoryPath)
114  call mem_deallocate(this%cond, 'COND', this%memoryPath)
115  !
116  ! -- Return
117  return

◆ drn_df_obs()

subroutine drnmodule::drn_df_obs ( class(drntype this)
private

Overrides BndTypebnd_df_obs

Definition at line 643 of file gwf-drn.f90.

644  implicit none
645  ! -- dummy
646  class(DrnType) :: this
647  ! -- local
648  integer(I4B) :: indx
649  !
650  call this%obs%StoreObsType('drn', .true., indx)
651  this%obs%obsData(indx)%ProcessIdPtr => defaultobsidprocessor
652  !
653  ! -- Store obs type and assign procedure pointer
654  ! for to-mvr observation type.
655  call this%obs%StoreObsType('to-mvr', .true., indx)
656  this%obs%obsData(indx)%ProcessIdPtr => defaultobsidprocessor
657  !
658  ! -- Return
659  return
Here is the call graph for this function:

◆ drn_fc()

subroutine drnmodule::drn_fc ( class(drntype 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 408 of file gwf-drn.f90.

409  ! -- dummy
410  class(DrnType) :: this
411  real(DP), dimension(:), intent(inout) :: rhs
412  integer(I4B), dimension(:), intent(in) :: ia
413  integer(I4B), dimension(:), intent(in) :: idxglo
414  class(MatrixBaseType), pointer :: matrix_sln
415  ! -- local
416  integer(I4B) :: i
417  integer(I4B) :: n
418  integer(I4B) :: ipos
419  real(DP) :: fact
420  real(DP) :: drnbot
421  real(DP) :: drncond
422  real(DP) :: qdrn
423  !
424  ! -- packmvrobj fc
425  if (this%imover == 1) then
426  call this%pakmvrobj%fc()
427  end if
428  !
429  ! -- Copy package rhs and hcof into solution rhs and amat
430  do i = 1, this%nbound
431  n = this%nodelist(i)
432  rhs(n) = rhs(n) + this%rhs(i)
433  ipos = ia(n)
434  call matrix_sln%add_value_pos(idxglo(ipos), this%hcof(i))
435  !
436  ! -- calculate the drainage scaling factor
437  call this%get_drain_factor(i, fact, drnbot)
438  !
439  ! -- If mover is active and this drain is discharging,
440  ! store available water (as positive value).
441  if (this%imover == 1 .and. fact > dzero) then
442  drncond = this%cond_mult(i)
443  qdrn = fact * drncond * (this%xnew(n) - drnbot)
444  call this%pakmvrobj%accumulate_qformvr(i, qdrn)
445  end if
446  end do
447  !
448  ! -- Return
449  return

◆ drn_fn()

subroutine drnmodule::drn_fn ( class(drntype 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 454 of file gwf-drn.f90.

455  implicit none
456  ! -- dummy
457  class(DrnType) :: this
458  real(DP), dimension(:), intent(inout) :: rhs
459  integer(I4B), dimension(:), intent(in) :: ia
460  integer(I4B), dimension(:), intent(in) :: idxglo
461  class(MatrixBaseType), pointer :: matrix_sln
462  ! -- local
463  integer(I4B) :: i
464  integer(I4B) :: node
465  integer(I4B) :: ipos
466  real(DP) :: cdrn
467  real(DP) :: xnew
468  real(DP) :: drndepth
469  real(DP) :: drntop
470  real(DP) :: drnbot
471  real(DP) :: drterm
472  !
473  ! -- Copy package rhs and hcof into solution rhs and amat
474  if (this%iauxddrncol /= 0) then
475  do i = 1, this%nbound
476  node = this%nodelist(i)
477  !
478  ! -- test if node is constant or inactive
479  if (this%ibound(node) <= 0) then
480  cycle
481  end if
482  !
483  ! -- set local variables for this drain
484  cdrn = this%cond_mult(i)
485  xnew = this%xnew(node)
486  !
487  ! -- calculate the drainage depth and the top and bottom of
488  ! the conductance scaling elevations
489  call this%get_drain_elevations(i, drndepth, drntop, drnbot)
490  !
491  ! -- calculate scaling factor
492  if (drndepth /= dzero) then
493  drterm = sqsaturationderivative(drntop, drnbot, xnew, &
494  c1=-done, c2=dtwo)
495  drterm = drterm * cdrn * (drnbot - xnew)
496  !
497  ! -- fill amat and rhs with newton-raphson terms
498  ipos = ia(node)
499  call matrix_sln%add_value_pos(idxglo(ipos), drterm)
500  rhs(node) = rhs(node) + drterm * xnew
501  end if
502  end do
503  end if
504  !
505  ! -- Return
506  return
Here is the call graph for this function:

◆ drn_obs_supported()

logical function drnmodule::drn_obs_supported ( class(drntype this)
private

Overrides BndTypebnd_obs_supported()

Definition at line 628 of file gwf-drn.f90.

629  implicit none
630  ! -- dummy
631  class(DrnType) :: this
632  !
633  drn_obs_supported = .true.
634  !
635  ! -- Return
636  return

◆ drn_options()

subroutine drnmodule::drn_options ( class(drntype), intent(inout)  this)

Definition at line 202 of file gwf-drn.f90.

203  ! -- modules
204  use inputoutputmodule, only: urword
208  ! -- dummy
209  class(DrnType), intent(inout) :: this
210  ! -- local
211  type(GwfDrnParamFoundType) :: found
212  character(len=LENAUXNAME) :: ddrnauxname
213  integer(I4B) :: n
214  !
215  ! -- source base class options
216  call this%BndExtType%source_options()
217  !
218  ! -- source drain options
219  call mem_set_value(this%imover, 'MOVER', this%input_mempath, found%mover)
220  call mem_set_value(ddrnauxname, 'AUXDEPTHNAME', this%input_mempath, &
221  found%auxdepthname)
222  call mem_set_value(this%icubic_scaling, 'ICUBICSFAC', this%input_mempath, &
223  found%icubicsfac)
224  !
225  if (found%auxdepthname) then
226  this%iauxddrncol = -1
227  !
228  ! -- Error if no aux variable specified
229  if (this%naux == 0) then
230  write (errmsg, '(a,2(1x,a))') &
231  'AUXDEPTHNAME was specified as', trim(adjustl(ddrnauxname)), &
232  'but no AUX variables specified.'
233  call store_error(errmsg)
234  end if
235  !
236  ! -- Assign ddrn column
237  this%iauxddrncol = 0
238  do n = 1, this%naux
239  if (ddrnauxname == this%auxname(n)) then
240  this%iauxddrncol = n
241  exit
242  end if
243  end do
244  !
245  ! -- Error if aux variable cannot be found
246  if (this%iauxddrncol == 0) then
247  write (errmsg, '(a,2(1x,a))') &
248  'AUXDEPTHNAME was specified as', trim(adjustl(ddrnauxname)), &
249  'but no AUX variable found with this name.'
250  call store_error(errmsg)
251  end if
252  end if
253  !
254  if (found%icubicsfac) then
255  call this%parser%DevOpt()
256  end if
257  !
258  ! -- log DRN specific options
259  call this%log_drn_options(found)
260  !
261  ! -- Return
262  return
subroutine, public urword(line, icol, istart, istop, ncode, n, r, iout, in)
Extract a word from a string.
This class is used to store a single deferred-length character string. It was designed to work in an ...
Definition: CharString.f90:23
Here is the call graph for this function:

◆ drn_rp()

subroutine drnmodule::drn_rp ( class(drntype), intent(inout)  this)

Definition at line 176 of file gwf-drn.f90.

177  use tdismodule, only: kper
178  ! -- dummy
179  class(DrnType), intent(inout) :: this
180  !
181  if (this%iper /= kper) return
182  !
183  ! -- Call the parent class read and prepare
184  call this%BndExtType%bnd_rp()
185  !
186  ! -- store user cond
187  if (this%ivsc == 1) then
188  call this%drn_store_user_cond()
189  end if
190  !
191  ! -- Write the list to iout if requested
192  if (this%iprpak /= 0) then
193  call this%write_list()
194  end if
195  !
196  ! -- Return
197  return
integer(i4b), pointer, public kper
current stress period number
Definition: tdis.f90:23

◆ drn_store_user_cond()

subroutine drnmodule::drn_store_user_cond ( class(drntype), intent(inout)  this)
private
Parameters
[in,out]thisBndExtType object

Definition at line 664 of file gwf-drn.f90.

665  ! -- dummy
666  class(DrnType), intent(inout) :: this !< BndExtType object
667  ! -- local
668  integer(I4B) :: n
669  !
670  ! -- store backup copy of conductance values
671  do n = 1, this%nbound
672  this%condinput(n) = this%cond_mult(n)
673  end do
674  !
675  ! -- Return
676  return

◆ get_drain_elevations()

subroutine drnmodule::get_drain_elevations ( class(drntype), intent(inout)  this,
integer(i4b), intent(in)  i,
real(dp), intent(inout)  drndepth,
real(dp), intent(inout)  drntop,
real(dp), intent(inout)  drnbot 
)
private

Definition at line 541 of file gwf-drn.f90.

542  ! -- dummy
543  class(DrnType), intent(inout) :: this
544  integer(I4B), intent(in) :: i
545  real(DP), intent(inout) :: drndepth
546  real(DP), intent(inout) :: drntop
547  real(DP), intent(inout) :: drnbot
548  ! -- local
549  real(DP) :: drnelev
550  real(DP) :: elev
551  !
552  ! -- initialize dummy and local variables
553  drndepth = dzero
554  drnelev = this%elev(i)
555  !
556  ! -- set the drain depth
557  if (this%iauxddrncol > 0) then
558  drndepth = this%auxvar(this%iauxddrncol, i)
559  end if
560  !
561  ! -- calculate the top and bottom drain elevations
562  if (drndepth /= dzero) then
563  elev = drnelev + drndepth
564  drntop = max(elev, drnelev)
565  drnbot = min(elev, drnelev)
566  else
567  drntop = drnelev
568  drnbot = drnelev
569  end if
570  !
571  ! -- Return
572  return

◆ get_drain_factor()

subroutine drnmodule::get_drain_factor ( class(drntype), intent(inout)  this,
integer(i4b), intent(in)  i,
real(dp), intent(inout)  factor,
real(dp), intent(inout), optional  opt_drnbot 
)
private

Definition at line 577 of file gwf-drn.f90.

578  ! -- dummy
579  class(DrnType), intent(inout) :: this
580  integer(I4B), intent(in) :: i
581  real(DP), intent(inout) :: factor
582  real(DP), intent(inout), optional :: opt_drnbot
583  ! -- local
584  integer(I4B) :: node
585  real(DP) :: xnew
586  real(DP) :: drndepth
587  real(DP) :: drntop
588  real(DP) :: drnbot
589  !
590  ! -- set local variables for this drain
591  node = this%nodelist(i)
592  xnew = this%xnew(node)
593  !
594  ! -- calculate the drainage depth and the top and bottom of
595  ! the conductance scaling elevations
596  call this%get_drain_elevations(i, drndepth, drntop, drnbot)
597  !
598  ! -- set opt_drnbot to drnbot if passed as dummy variable
599  if (present(opt_drnbot)) then
600  opt_drnbot = drnbot
601  end if
602  !
603  ! -- calculate scaling factor
604  if (drndepth /= dzero) then
605  if (this%icubic_scaling /= 0) then
606  factor = sqsaturation(drntop, drnbot, xnew, c1=-done, c2=dtwo)
607  else
608  factor = squadraticsaturation(drntop, drnbot, xnew, eps=dzero)
609  end if
610  else
611  if (xnew <= drnbot) then
612  factor = dzero
613  else
614  factor = done
615  end if
616  end if
617  !
618  ! -- Return
619  return
Here is the call graph for this function:

◆ log_drn_options()

subroutine drnmodule::log_drn_options ( class(drntype), intent(inout)  this,
type(gwfdrnparamfoundtype), intent(in)  found 
)
Parameters
[in,out]thisBndExtType object

Definition at line 267 of file gwf-drn.f90.

268  ! -- modules
270  ! -- dummy variables
271  class(DrnType), intent(inout) :: this !< BndExtType object
272  type(GwfDrnParamFoundType), intent(in) :: found
273  ! -- local variables
274  ! -- format
275  !
276  ! -- log found options
277  write (this%iout, '(/1x,a)') 'PROCESSING '//trim(adjustl(this%text)) &
278  //' OPTIONS'
279  !
280  if (found%mover) then
281  write (this%iout, '(4x,A)') 'MOVER OPTION ENABLED'
282  end if
283  !
284  if (found%icubicsfac) then
285  write (this%iout, '(4x,a,1x,a)') &
286  'CUBIC SCALING will be used for drains with non-zero DDRN values', &
287  'even if the NEWTON-RAPHSON method is not being used.'
288  end if
289  !
290  ! -- close logging block
291  write (this%iout, '(1x,a)') &
292  'END OF '//trim(adjustl(this%text))//' OPTIONS'
293  !
294  ! -- Return
295  return

Variable Documentation

◆ ftype

character(len=lenftype) drnmodule::ftype = 'DRN'
private

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

21  character(len=LENFTYPE) :: ftype = 'DRN'

◆ text

character(len=lenpackagename) drnmodule::text = ' DRN'
private

Definition at line 22 of file gwf-drn.f90.

22  character(len=LENPACKAGENAME) :: text = ' DRN'