MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
gwf-drn.f90
Go to the documentation of this file.
1 module drnmodule
2  use kindmodule, only: dp, i4b
3  use constantsmodule, only: dzero, done, dtwo, &
5  use simvariablesmodule, only: errmsg
10  use bndmodule, only: bndtype
11  use bndextmodule, only: bndexttype
14  !
15  implicit none
16  !
17  private
18  public :: drn_create
19  public :: drntype
20  !
21  character(len=LENFTYPE) :: ftype = 'DRN'
22  character(len=LENPACKAGENAME) :: text = ' DRN'
23  !
24  type, extends(bndexttype) :: drntype
25 
26  real(dp), dimension(:), pointer, contiguous :: elev => null() !< DRN elevation
27  real(dp), dimension(:), pointer, contiguous :: cond => null() !< DRN conductance at aquifer interface
28  integer(I4B), pointer :: iauxddrncol => null()
29  integer(I4B), pointer :: icubic_scaling => null()
30 
31  contains
32 
33  procedure :: allocate_scalars => drn_allocate_scalars
34  procedure :: allocate_arrays => drn_allocate_arrays
35  procedure :: source_options => drn_options
36  procedure :: log_drn_options
37  procedure :: bnd_rp => drn_rp
38  procedure :: bnd_ck => drn_ck
39  procedure :: bnd_cf => drn_cf
40  procedure :: bnd_fc => drn_fc
41  procedure :: bnd_fn => drn_fn
42  procedure :: bnd_da => drn_da
43  procedure :: define_listlabel
44  procedure :: get_drain_elevations
45  procedure :: get_drain_factor
46  procedure :: bound_value => drn_bound_value
47  procedure :: cond_mult
48  ! -- methods for observations
49  procedure, public :: bnd_obs_supported => drn_obs_supported
50  procedure, public :: bnd_df_obs => drn_df_obs
51  procedure, public :: drn_store_user_cond
52  end type drntype
53 
54 contains
55 
56  !> @brief Create a New Drn Package and point packobj to the new package
57  !<
58  subroutine drn_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
59  mempath)
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
95  end subroutine drn_create
96 
97  !> @brief Deallocate memory
98  !<
99  subroutine drn_da(this)
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
118  end subroutine drn_da
119 
120  !> @brief Allocate package scalar members
121  !<
122  subroutine drn_allocate_scalars(this)
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
145  end subroutine drn_allocate_scalars
146 
147  !> @brief Allocate package arrays
148  !<
149  subroutine drn_allocate_arrays(this, nodelist, auxvar)
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
172  end subroutine drn_allocate_arrays
173 
174  !> @brief Read and prepare
175  !<
176  subroutine drn_rp(this)
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
198  end subroutine drn_rp
199 
200  !> @brief Source options specific to DrnType
201  !<
202  subroutine drn_options(this)
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
263  end subroutine drn_options
264 
265  !> @ brief Log DRN specific package options
266  !<
267  subroutine log_drn_options(this, found)
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
296  end subroutine log_drn_options
297 
298  !> @brief Check drain boundary condition data
299  !<
300  subroutine drn_ck(this)
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
362  end subroutine drn_ck
363 
364  !> @brief Formulate the HCOF and RHS terms
365  !!
366  !! Skip if no drains
367  !<
368  subroutine drn_cf(this)
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
404  end subroutine drn_cf
405 
406  !> @brief Copy rhs and hcof into solution rhs and amat
407  !<
408  subroutine drn_fc(this, rhs, ia, idxglo, matrix_sln)
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
450  end subroutine drn_fc
451 
452  !> @brief Fill newton terms
453  !<
454  subroutine drn_fn(this, rhs, ia, idxglo, matrix_sln)
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
507  end subroutine drn_fn
508 
509  !> @brief Define the list heading that is written to iout when PRINT_INPUT
510  !! option is used
511  !<
512  subroutine define_listlabel(this)
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
536  end subroutine define_listlabel
537 
538  !> @brief Define drain depth and the top and bottom elevations used to scale
539  !! the drain conductance
540  !<
541  subroutine get_drain_elevations(this, i, drndepth, drntop, drnbot)
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
573  end subroutine get_drain_elevations
574 
575  !> @brief Get the drain conductance scale factor
576  !<
577  subroutine get_drain_factor(this, i, factor, opt_drnbot)
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
620  end subroutine get_drain_factor
621 
622  ! -- Procedures related to observations
623 
624  !> @brief Return true because DRN package supports observations
625  !!
626  !! Overrides BndType%bnd_obs_supported()
627  !<
628  logical function drn_obs_supported(this)
629  implicit none
630  ! -- dummy
631  class(drntype) :: this
632  !
633  drn_obs_supported = .true.
634  !
635  ! -- Return
636  return
637  end function drn_obs_supported
638 
639  !> @brief Store observation type supported by DRN package
640  !!
641  !! Overrides BndType%bnd_df_obs
642  !<
643  subroutine drn_df_obs(this)
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
660  end subroutine drn_df_obs
661 
662  !> @brief Store user-specified drain conductance
663  !<
664  subroutine drn_store_user_cond(this)
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
677  end subroutine drn_store_user_cond
678 
679  !> @brief Apply multiplier to conductance value depending on user-selected option
680  !<
681  function cond_mult(this, row) result(cond)
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
698  end function cond_mult
699 
700  !> @brief Return requested boundary value
701  !<
702  function drn_bound_value(this, col, row) result(bndval)
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
726  end function drn_bound_value
727 
728 end module drnmodule
This module contains the extended boundary package.
This module contains the base boundary package.
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter linelength
maximum length of a standard line
Definition: Constants.f90:44
integer(i4b), parameter lenpackagename
maximum length of the package name
Definition: Constants.f90:22
integer(i4b), parameter lenftype
maximum length of a package type (DIS, WEL, OC, etc.)
Definition: Constants.f90:38
integer(i4b), parameter lenauxname
maximum length of a aux variable
Definition: Constants.f90:34
real(dp), parameter dzero
real constant zero
Definition: Constants.f90:64
real(dp), parameter dtwo
real constant 2
Definition: Constants.f90:78
real(dp), parameter done
real constant 1
Definition: Constants.f90:75
character(len=lenftype) ftype
Definition: gwf-drn.f90:21
subroutine drn_da(this)
Deallocate memory.
Definition: gwf-drn.f90:100
subroutine, public drn_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath)
Create a New Drn Package and point packobj to the new package.
Definition: gwf-drn.f90:60
real(dp) function cond_mult(this, row)
Apply multiplier to conductance value depending on user-selected option.
Definition: gwf-drn.f90:682
subroutine drn_fn(this, rhs, ia, idxglo, matrix_sln)
Fill newton terms.
Definition: gwf-drn.f90:455
subroutine drn_allocate_arrays(this, nodelist, auxvar)
Allocate package arrays.
Definition: gwf-drn.f90:150
real(dp) function drn_bound_value(this, col, row)
Return requested boundary value.
Definition: gwf-drn.f90:703
subroutine define_listlabel(this)
Define the list heading that is written to iout when PRINT_INPUT option is used.
Definition: gwf-drn.f90:513
logical function drn_obs_supported(this)
Return true because DRN package supports observations.
Definition: gwf-drn.f90:629
subroutine get_drain_factor(this, i, factor, opt_drnbot)
Get the drain conductance scale factor.
Definition: gwf-drn.f90:578
subroutine drn_allocate_scalars(this)
Allocate package scalar members.
Definition: gwf-drn.f90:123
subroutine drn_cf(this)
Formulate the HCOF and RHS terms.
Definition: gwf-drn.f90:369
subroutine drn_ck(this)
Check drain boundary condition data.
Definition: gwf-drn.f90:301
subroutine drn_options(this)
Source options specific to DrnType.
Definition: gwf-drn.f90:203
subroutine drn_rp(this)
Read and prepare.
Definition: gwf-drn.f90:177
character(len=lenpackagename) text
Definition: gwf-drn.f90:22
subroutine get_drain_elevations(this, i, drndepth, drntop, drnbot)
Define drain depth and the top and bottom elevations used to scale the drain conductance.
Definition: gwf-drn.f90:542
subroutine log_drn_options(this, found)
@ brief Log DRN specific package options
Definition: gwf-drn.f90:268
subroutine drn_store_user_cond(this)
Store user-specified drain conductance.
Definition: gwf-drn.f90:665
subroutine drn_fc(this, rhs, ia, idxglo, matrix_sln)
Copy rhs and hcof into solution rhs and amat.
Definition: gwf-drn.f90:409
subroutine drn_df_obs(this)
Store observation type supported by DRN package.
Definition: gwf-drn.f90:644
subroutine, public urword(line, icol, istart, istop, ncode, n, r, iout, in)
Extract a word from a string.
This module defines variable data types.
Definition: kind.f90:8
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
This module contains the derived type ObsType.
Definition: Obs.f90:127
subroutine, public defaultobsidprocessor(obsrv, dis, inunitobs, iout)
@ brief Process IDstring provided for each observation
Definition: Obs.f90:249
This module contains simulation methods.
Definition: Sim.f90:10
subroutine, public store_error(msg, terminate)
Store an error message.
Definition: Sim.f90:92
integer(i4b) function, public count_errors()
Return number of errors.
Definition: Sim.f90:59
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
Definition: Sim.f90:203
This module contains simulation variables.
Definition: SimVariables.f90:9
character(len=maxcharlen) errmsg
error message string
real(dp) function squadraticsaturation(top, bot, x, eps)
@ brief sQuadraticSaturation
real(dp) function sqsaturationderivative(top, bot, x, c1, c2)
@ brief sQSaturationDerivative
real(dp) function sqsaturation(top, bot, x, c1, c2)
@ brief sQSaturation
integer(i4b), pointer, public kper
current stress period number
Definition: tdis.f90:23
@ brief BndType
This class is used to store a single deferred-length character string. It was designed to work in an ...
Definition: CharString.f90:23