MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
swf-sto.f90
Go to the documentation of this file.
1 !> @brief This module contains the storage package methods
2 !!
3 !! This module contains the methods used to add the effects of storage
4 !! on the surface water flow equation.
5 !!
6 !<
8 
9  use kindmodule, only: dp, i4b, lgp
10  use constantsmodule, only: dzero, dem6, dem4, dhalf, done, dtwo, &
13  use simvariablesmodule, only: errmsg
15  use basedismodule, only: disbasetype
19  use disv1dmodule, only: disv1dtype
20  use swfcxsmodule, only: swfcxstype
21 
22  implicit none
23  public :: swfstotype, sto_cr
24 
25  character(len=LENBUDTXT), dimension(1) :: budtxt = & !< text labels for budget terms
26  &[' STORAGE']
27 
28  type, extends(numericalpackagetype) :: swfstotype
29  integer(I4B), pointer :: iss => null() !< steady state flag: 1 = steady, 0 = transient
30  integer(I4B), dimension(:), pointer, contiguous :: ibound => null() !< pointer to model ibound
31  real(dp), dimension(:), pointer, contiguous :: qsto => null() !< storage rates
32 
33  ! -- pointers to information in dfw package
34  integer(I4B), dimension(:), pointer, contiguous :: idcxs => null() !< pointer to cross section id vector in dfw
35 
36  ! -- pointer to packages needed for calculations
37  type(swfcxstype), pointer :: cxs
38 
39  ! -- input context pointers for read and prepare
40  integer(I4B), pointer :: iper => null() !< input context loaded period
41  character(len=:), pointer :: storage !< input context storage string
42  contains
43  procedure :: sto_ar
44  procedure :: sto_rp
45  procedure :: sto_ad
46  procedure :: sto_fc
47  procedure :: sto_fc_dis1d
48  procedure :: sto_fc_dis2d
49  !procedure :: sto_fn
50  procedure :: sto_cq
51  procedure :: sto_bd
52  procedure :: sto_save_model_flows
53  procedure :: sto_da
54  procedure :: allocate_scalars
55  procedure, private :: allocate_arrays
56  procedure, private :: source_options
57  procedure, private :: source_data
58  procedure, private :: log_options
59  procedure, private :: set_dfw_pointers
60  procedure, private :: reach_length_pointer
61  procedure, private :: calc_storage_dis1d
62  procedure, private :: calc_storage_dis2d
63  end type
64 
65 contains
66 
67  !> @ brief Create a new package object
68  !!
69  !! Create a new storage (STO) object
70  !!
71  !<
72  subroutine sto_cr(stoobj, name_model, mempath, inunit, iout, cxs)
73  ! -- dummy variables
74  type(swfstotype), pointer :: stoobj !< SwfStoType object
75  character(len=*), intent(in) :: name_model !< name of model
76  character(len=*), intent(in) :: mempath !< input context mem path
77  integer(I4B), intent(in) :: inunit !< package input file unit
78  integer(I4B), intent(in) :: iout !< model listing file unit
79  type(swfcxstype), pointer, intent(in) :: cxs !< the pointer to the cxs package
80  !
81  ! -- Create the object
82  allocate (stoobj)
83  !
84  ! -- create name and memory path
85  call stoobj%set_names(1, name_model, 'STO', 'STO', mempath)
86  !
87  ! -- Allocate scalars
88  call stoobj%allocate_scalars()
89  !
90  ! -- Set variables
91  stoobj%inunit = inunit
92  stoobj%iout = iout
93 
94  ! -- store pointers
95  stoobj%cxs => cxs
96 
97  end subroutine sto_cr
98 
99  !> @ brief Allocate and read method for package
100  !!
101  !! Method to allocate and read static data for the STO package.
102  !!
103  !<
104  subroutine sto_ar(this, dis, ibound)
105  ! -- modules
108  ! -- dummy variables
109  class(swfstotype) :: this !< SwfStoType object
110  class(disbasetype), pointer, intent(in) :: dis !< model discretization object
111  integer(I4B), dimension(:), pointer, contiguous :: ibound !< model ibound array
112  ! -- local variables
113  ! -- formats
114  character(len=*), parameter :: fmtsto = &
115  "(1x,/1x,'STO -- STORAGE PACKAGE, VERSION 1, 10/27/2023', &
116  &' INPUT READ FROM UNIT ', i0, //)"
117  !
118  ! --print a message identifying the storage package.
119  write (this%iout, fmtsto) this%inunit
120 
121  ! -- set pointers to data in dfw package
122  call this%set_dfw_pointers()
123 
124  !
125  ! -- store pointers to arguments that were passed in
126  this%dis => dis
127  this%ibound => ibound
128  !
129  ! -- set pointer to model iss
130  call mem_setptr(this%iss, 'ISS', create_mem_path(this%name_model))
131  !
132  ! -- Allocate arrays
133  call this%allocate_arrays(dis%nodes)
134  !
135  ! -- Read storage options
136  call this%source_options()
137  !
138  ! -- read the data block
139  ! no griddata at the moment for SWF Storage Package
140  ! call this%source_data()
141  end subroutine sto_ar
142 
143  !> @ brief Read and prepare method for package
144  !!
145  !! Method to read and prepare stress period data for the STO package.
146  !!
147  !<
148  subroutine sto_rp(this)
149  ! -- modules
150  use tdismodule, only: kper
151  implicit none
152  ! -- dummy variables
153  class(swfstotype) :: this !< SwfStoType object
154  ! -- local variables
155  character(len=16) :: css(0:1)
156  ! -- data
157  data css(0)/' TRANSIENT'/
158  data css(1)/' STEADY-STATE'/
159  !
160  ! -- confirm package is active
161  if (this%inunit <= 0) return
162  !
163  ! -- confirm loaded iper
164  if (this%iper /= kper) return
165  !
166  write (this%iout, '(//,1x,a)') 'PROCESSING STORAGE PERIOD DATA'
167  !
168  ! -- set period iss
169  if (this%storage == 'STEADY-STATE') then
170  this%iss = 1
171  else if (this%storage == 'TRANSIENT') then
172  this%iss = 0
173  else
174  write (errmsg, '(a,a)') 'Unknown STORAGE data tag: ', &
175  trim(this%storage)
176  call store_error(errmsg)
177  call store_error_filename(this%input_fname)
178  end if
179  !
180  write (this%iout, '(1x,a)') 'END PROCESSING STORAGE PERIOD DATA'
181  !
182  write (this%iout, '(//1X,A,I0,A,A,/)') &
183  'STRESS PERIOD ', kper, ' IS ', trim(adjustl(css(this%iss)))
184  end subroutine sto_rp
185 
186  !> @ brief Advance the package
187  !!
188  !! Advance data in the STO package.
189  !!
190  !<
191  subroutine sto_ad(this)
192  ! -- modules
193  ! -- dummy variables
194  class(swfstotype) :: this !< SwfStoType object
195  end subroutine sto_ad
196 
197  !> @ brief Fill A and right-hand side for the package
198  !!
199  !! Fill the coefficient matrix and right-hand side with the STO package terms.
200  !!
201  !<
202  subroutine sto_fc(this, kiter, stage_old, stage_new, matrix_sln, idxglo, rhs)
203  ! -- modules
204  use tdismodule, only: delt
205  ! -- dummy
206  class(swfstotype) :: this
207  integer(I4B) :: kiter
208  real(DP), intent(inout), dimension(:) :: stage_old
209  real(DP), intent(inout), dimension(:) :: stage_new
210  class(matrixbasetype), pointer :: matrix_sln
211  integer(I4B), intent(in), dimension(:) :: idxglo
212  real(DP), intent(inout), dimension(:) :: rhs
213  ! -- local
214  character(len=LINELENGTH) :: distype = ''
215  ! -- formats
216  character(len=*), parameter :: fmtsperror = &
217  &"('Detected time step length of zero. SWF Storage Package cannot be ', &
218  &'used unless delt is non-zero.')"
219  !
220  ! -- test if steady-state stress period
221  if (this%iss /= 0) return
222  !
223  ! -- Ensure time step length is not zero
224  if (delt == dzero) then
225  write (errmsg, fmtsperror)
226  call store_error(errmsg, terminate=.true.)
227  end if
228 
229  call this%dis%get_dis_type(distype)
230  if (distype == 'DISV1D') then
231  call this%sto_fc_dis1d(kiter, stage_old, stage_new, matrix_sln, idxglo, rhs)
232  else
233  call this%sto_fc_dis2d(kiter, stage_old, stage_new, matrix_sln, idxglo, rhs)
234  end if
235 
236  end subroutine sto_fc
237 
238  !> @ brief Fill A and right-hand side for the package
239  !!
240  !! Fill the coefficient matrix and right-hand side with the STO package terms.
241  !!
242  !<
243  subroutine sto_fc_dis1d(this, kiter, stage_old, stage_new, matrix_sln, &
244  idxglo, rhs)
245  ! -- modules
246  ! -- dummy
247  class(swfstotype) :: this
248  integer(I4B) :: kiter
249  real(DP), intent(inout), dimension(:) :: stage_old
250  real(DP), intent(inout), dimension(:) :: stage_new
251  class(matrixbasetype), pointer :: matrix_sln
252  integer(I4B), intent(in), dimension(:) :: idxglo
253  real(DP), intent(inout), dimension(:) :: rhs
254  ! -- local
255  integer(I4B) :: n, idiag
256  real(DP) :: derv
257  real(DP) :: qsto
258  real(DP), dimension(:), pointer :: reach_length
259 
260  ! Set pointer to reach_length for 1d
261  reach_length => this%reach_length_pointer()
262 
263  ! -- Calculate coefficients and put into amat
264  do n = 1, this%dis%nodes
265 
266  ! -- skip if constant stage
267  if (this%ibound(n) < 0) cycle
268 
269  call this%calc_storage_dis1d(n, stage_new(n), stage_old(n), &
270  reach_length(n), qsto, derv)
271 
272  ! -- Fill amat and rhs
273  idiag = this%dis%con%ia(n)
274  call matrix_sln%add_value_pos(idxglo(idiag), -derv)
275  rhs(n) = rhs(n) + qsto - derv * stage_new(n)
276 
277  end do
278  end subroutine sto_fc_dis1d
279 
280  !> @ brief Fill A and right-hand side for the package
281  !!
282  !! Fill the coefficient matrix and right-hand side with the STO package terms.
283  !!
284  !<
285  subroutine sto_fc_dis2d(this, kiter, stage_old, stage_new, matrix_sln, &
286  idxglo, rhs)
287  ! -- modules
288  ! -- dummy
289  class(swfstotype) :: this
290  integer(I4B) :: kiter
291  real(DP), intent(inout), dimension(:) :: stage_old
292  real(DP), intent(inout), dimension(:) :: stage_new
293  class(matrixbasetype), pointer :: matrix_sln
294  integer(I4B), intent(in), dimension(:) :: idxglo
295  real(DP), intent(inout), dimension(:) :: rhs
296  ! -- local
297  integer(I4B) :: n, idiag
298  real(DP) :: derv
299  real(DP) :: qsto
300 
301  ! -- Calculate coefficients and put into amat
302  do n = 1, this%dis%nodes
303  !
304  ! -- skip if constant stage
305  if (this%ibound(n) < 0) cycle
306 
307  ! Calculate storage and derivative term
308  call this%calc_storage_dis2d(n, stage_new(n), stage_old(n), &
309  qsto, derv)
310 
311  ! -- Fill amat and rhs
312  idiag = this%dis%con%ia(n)
313  call matrix_sln%add_value_pos(idxglo(idiag), -derv)
314  rhs(n) = rhs(n) + qsto - derv * stage_new(n)
315 
316  end do
317 
318  end subroutine sto_fc_dis2d
319 
320  !> @ brief Calculate flows for package
321  !<
322  subroutine sto_cq(this, flowja, stage_new, stage_old)
323  ! -- dummy
324  class(swfstotype) :: this
325  real(DP), intent(inout), dimension(:) :: flowja
326  real(DP), intent(inout), dimension(:) :: stage_new
327  real(DP), intent(inout), dimension(:) :: stage_old
328  ! -- local
329  real(DP), dimension(:), pointer :: reach_length
330  integer(I4B) :: n
331  integer(I4B) :: idiag
332  real(DP) :: dx
333  real(DP) :: q
334 
335  ! -- test if steady-state stress period
336  if (this%iss /= 0) return
337 
338  ! Set pointer to reach_length for 1d
339  reach_length => this%reach_length_pointer()
340 
341  ! -- Calculate storage term
342  do n = 1, this%dis%nodes
343  !
344  ! -- skip if constant stage
345  if (this%ibound(n) < 0) cycle
346 
347  ! Calculate storage for either the DIS1D or DIS2D cases and
348  ! add to flowja
349  if (associated(reach_length)) then
350  dx = reach_length(n)
351  call this%calc_storage_dis1d(n, stage_new(n), stage_old(n), dx, q)
352  else
353  call this%calc_storage_dis2d(n, stage_new(n), stage_old(n), q)
354  end if
355  this%qsto(n) = -q
356  idiag = this%dis%con%ia(n)
357  flowja(idiag) = flowja(idiag) + this%qsto(n)
358 
359  end do
360  end subroutine sto_cq
361 
362  subroutine calc_storage_dis1d(this, n, stage_new, stage_old, dx, qsto, derv)
363  ! module
364  use tdismodule, only: delt
366  ! dummy
367  class(swfstotype) :: this
368  integer(I4B), intent(in) :: n
369  real(DP), intent(in) :: stage_new
370  real(DP), intent(in) :: stage_old
371  real(DP), intent(in) :: dx
372  real(DP), intent(inout) :: qsto
373  real(DP), intent(inout), optional :: derv
374  ! local
375  real(DP) :: depth_new
376  real(DP) :: depth_old
377  real(DP) :: width_n
378  real(DP) :: width_m
379  real(DP) :: cxs_area_new
380  real(DP) :: cxs_area_old
381  real(DP) :: cxs_area_eps
382  real(DP) :: eps
383 
384  call this%dis%get_flow_width(n, n, 0, width_n, width_m)
385  depth_new = stage_new - this%dis%bot(n)
386  depth_old = stage_old - this%dis%bot(n)
387  cxs_area_new = this%cxs%get_area(this%idcxs(n), width_n, depth_new)
388  cxs_area_old = this%cxs%get_area(this%idcxs(n), width_n, depth_old)
389  qsto = (cxs_area_new - cxs_area_old) * dx / delt
390  if (present(derv)) then
391  eps = get_perturbation(depth_new)
392  cxs_area_eps = this%cxs%get_area(this%idcxs(n), width_n, depth_new + eps)
393  derv = (cxs_area_eps - cxs_area_new) * dx / delt / eps
394  end if
395 
396  end subroutine calc_storage_dis1d
397 
398  subroutine calc_storage_dis2d(this, n, stage_new, stage_old, qsto, derv)
399  ! module
400  use tdismodule, only: delt
402  ! dummy
403  class(swfstotype) :: this
404  integer(I4B), intent(in) :: n
405  real(DP), intent(in) :: stage_new
406  real(DP), intent(in) :: stage_old
407  real(DP), intent(inout) :: qsto
408  real(DP), intent(inout), optional :: derv
409  ! local
410  real(DP) :: area
411  real(DP) :: depth_new
412  real(DP) :: depth_old
413  real(DP) :: depth_eps
414  real(DP) :: volume_new
415  real(DP) :: volume_old
416  real(DP) :: eps
417 
418  area = this%dis%get_area(n)
419  depth_new = stage_new - this%dis%bot(n)
420  depth_old = stage_old - this%dis%bot(n)
421  volume_new = area * depth_new
422  volume_old = area * depth_old
423  qsto = (volume_new - volume_old) / delt
424 
425  if (present(derv)) then
426  eps = get_perturbation(depth_new)
427  depth_eps = depth_new + eps
428  derv = (depth_eps - depth_new) * area / delt / eps
429  end if
430 
431  end subroutine calc_storage_dis2d
432 
433  !> @ brief Model budget calculation for package
434  !!
435  !! Budget calculation for the STO package components. Components include
436  !! specific storage and specific yield storage.
437  !!
438  !<
439  subroutine sto_bd(this, isuppress_output, model_budget)
440  ! -- modules
441  use tdismodule, only: delt
443  ! -- dummy variables
444  class(swfstotype) :: this !< SwfStoType object
445  integer(I4B), intent(in) :: isuppress_output !< flag to suppress model output
446  type(budgettype), intent(inout) :: model_budget !< model budget object
447  ! -- local variables
448  real(DP) :: rin
449  real(DP) :: rout
450  !
451  ! -- Add storage rates to model budget
452  call rate_accumulator(this%qsto, rin, rout)
453  call model_budget%addentry(rin, rout, delt, ' STO', &
454  isuppress_output, ' STORAGE')
455  end subroutine sto_bd
456 
457  !> @ brief Save model flows for package
458  !!
459  !! Save cell-by-cell budget terms for the STO package.
460  !!
461  !<
462  subroutine sto_save_model_flows(this, icbcfl, icbcun)
463  ! -- dummy variables
464  class(swfstotype) :: this !< SwfStoType object
465  integer(I4B), intent(in) :: icbcfl !< flag to output budget data
466  integer(I4B), intent(in) :: icbcun !< cell-by-cell file unit number
467  ! -- local variables
468  integer(I4B) :: ibinun
469  integer(I4B) :: iprint, nvaluesp, nwidthp
470  character(len=1) :: cdatafmp = ' ', editdesc = ' '
471  real(DP) :: dinact
472  !
473  ! -- Set unit number for binary output
474  if (this%ipakcb < 0) then
475  ibinun = icbcun
476  elseif (this%ipakcb == 0) then
477  ibinun = 0
478  else
479  ibinun = this%ipakcb
480  end if
481  if (icbcfl == 0) ibinun = 0
482  !
483  ! -- Record the storage rates if requested
484  if (ibinun /= 0) then
485  iprint = 0
486  dinact = dzero
487  !
488  ! -- qsto
489  call this%dis%record_array(this%qsto, this%iout, iprint, -ibinun, &
490  budtxt(1), cdatafmp, nvaluesp, &
491  nwidthp, editdesc, dinact)
492  end if
493  end subroutine sto_save_model_flows
494 
495  !> @ brief Deallocate package memory
496  !!
497  !! Deallocate STO package scalars and arrays.
498  !!
499  !<
500  subroutine sto_da(this)
501  ! -- modules
503  ! -- dummy variables
504  class(swfstotype) :: this !< SwfStoType object
505  !
506  ! -- Deallocate arrays if package is active
507  if (this%inunit > 0) then
508  call mem_deallocate(this%qsto)
509  nullify (this%idcxs)
510  nullify (this%iper)
511  nullify (this%storage)
512  end if
513  !
514  ! -- Deallocate scalars
515  !
516  ! -- deallocate parent
517  call this%NumericalPackageType%da()
518  end subroutine sto_da
519 
520  !> @ brief Allocate scalars
521  !!
522  !! Allocate and initialize scalars for the STO package. The base numerical
523  !! package allocate scalars method is also called.
524  !!
525  !<
526  subroutine allocate_scalars(this)
527  ! -- modules
529  ! -- dummy variables
530  class(swfstotype) :: this !< SwfStoType object
531  !
532  ! -- allocate scalars in NumericalPackageType
533  call this%NumericalPackageType%allocate_scalars()
534  !
535  ! -- allocate scalars
536  !call mem_allocate(this%xxx, 'XXX', this%memoryPath)
537  !
538  ! -- initialize scalars
539  !this%xxx = 0
540  end subroutine allocate_scalars
541 
542  !> @ brief Allocate package arrays
543  !!
544  !! Allocate and initialize STO package arrays.
545  !!
546  !<
547  subroutine allocate_arrays(this, nodes)
548  ! -- modules
550  ! -- dummy variables
551  class(swfstotype), target :: this !< SwfStoType object
552  integer(I4B), intent(in) :: nodes !< active model nodes
553  ! -- local variables
554  integer(I4B) :: n
555  !
556  ! -- Allocate arrays
557  call mem_allocate(this%qsto, nodes, 'STRGSS', this%memoryPath)
558  !
559  ! -- set input context pointers
560  if (this%inunit > 0) then
561  call mem_setptr(this%iper, 'IPER', this%input_mempath)
562  call mem_setptr(this%storage, 'STORAGE', this%input_mempath)
563  end if
564  !
565  ! -- Initialize arrays
566  this%iss = 0
567  do n = 1, nodes
568  this%qsto(n) = dzero
569  end do
570  end subroutine allocate_arrays
571 
572  !> @ brief Source input options for package
573  !!
574  !! Source options block parameters for STO package.
575  !!
576  !<
577  subroutine source_options(this)
578  ! -- modules
579  use constantsmodule, only: lenmempath
583  ! -- dummy variables
584  class(swfstotype) :: this !< SwfStoType object
585  ! -- local variables
586  type(swfstoparamfoundtype) :: found
587  !
588  ! -- source package input
589  call mem_set_value(this%ipakcb, 'IPAKCB', this%input_mempath, found%ipakcb)
590  !
591  if (found%ipakcb) then
592  this%ipakcb = -1
593  end if
594  !
595  ! -- log found options
596  call this%log_options(found)
597  end subroutine source_options
598 
599  !> @ brief Log found options for package
600  !!
601  !! Log options block for STO package.
602  !!
603  !<
604  subroutine log_options(this, found)
605  ! -- modules
608  ! -- dummy variables
609  class(swfstotype) :: this !< SwfStoType object
610  type(swfstoparamfoundtype), intent(in) :: found
611  ! -- local variables
612  ! -- formats
613  character(len=*), parameter :: fmtisvflow = &
614  "(4x,'CELL-BY-CELL FLOW INFORMATION WILL BE SAVED TO BINARY FILE &
615  &WHENEVER ICBCFL IS NOT ZERO.')"
616  !
617  write (this%iout, '(1x,a)') 'PROCESSING STORAGE OPTIONS'
618  !
619  if (found%ipakcb) then
620  write (this%iout, fmtisvflow)
621  end if
622  !
623  write (this%iout, '(1x,a)') 'END OF STORAGE OPTIONS'
624  end subroutine log_options
625 
626  !> @ brief Source input data for package
627  !!
628  !! Source griddata block parameters for STO package.
629  !!
630  !<
631  subroutine source_data(this)
632  ! -- modules
635  ! -- dummy variables
636  class(swfstotype) :: this !< SwfStoType object
637  ! -- local variables
638  character(len=24), dimension(1) :: aname
639  integer(I4B), dimension(:), pointer, contiguous :: map
640  !type(SwfStoParamFoundType) :: found
641  !
642  ! -- initialize data
643  data aname(1)/' XXX'/
644  !
645  ! -- set map to reduce data input arrays
646  map => null()
647  if (this%dis%nodes < this%dis%nodesuser) map => this%dis%nodeuser
648  !
649  ! -- log griddata
650  write (this%iout, '(1x,a)') 'PROCESSING GRIDDATA'
651  write (this%iout, '(1x,a)') 'END PROCESSING GRIDDATA'
652  end subroutine source_data
653 
654  !> @brief Set pointers to channel properties in DFW Package
655  !<
656  subroutine set_dfw_pointers(this)
657  ! -- modules
659  ! -- dummy
660  class(swfstotype) :: this !< this instance
661  ! -- local
662  character(len=LENMEMPATH) :: dfw_mem_path
663 
664  dfw_mem_path = create_mem_path(this%name_model, 'DFW')
665  call mem_setptr(this%idcxs, 'IDCXS', dfw_mem_path)
666 
667  end subroutine set_dfw_pointers
668 
669  function reach_length_pointer(this) result(ptr)
670  ! dummy
671  class(swfstotype) :: this !< this instance
672  ! return
673  real(dp), dimension(:), pointer :: ptr
674  ! local
675  class(disbasetype), pointer :: dis
676 
677  ptr => null()
678  dis => this%dis
679  select type (dis)
680  type is (disv1dtype)
681  ptr => dis%length
682  end select
683 
684  end function reach_length_pointer
685 
686 end module swfstomodule
This module contains the BudgetModule.
Definition: Budget.f90:20
subroutine, public rate_accumulator(flow, rin, rout)
@ brief Rate accumulator subroutine
Definition: Budget.f90:632
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter linelength
maximum length of a standard line
Definition: Constants.f90:45
real(dp), parameter dhalf
real constant 1/2
Definition: Constants.f90:68
real(dp), parameter dem4
real constant 1e-4
Definition: Constants.f90:107
real(dp), parameter dem6
real constant 1e-6
Definition: Constants.f90:109
real(dp), parameter dzero
real constant zero
Definition: Constants.f90:65
real(dp), parameter dtwo
real constant 2
Definition: Constants.f90:79
integer(i4b), parameter lenbudtxt
maximum length of a budget component names
Definition: Constants.f90:37
integer(i4b), parameter lenmempath
maximum length of the memory path
Definition: Constants.f90:27
real(dp), parameter done
real constant 1
Definition: Constants.f90:76
integer(i4b) function, public getunit()
Get a free unit number.
subroutine, public openfile(iu, iout, fname, ftype, fmtarg_opt, accarg_opt, filstat_opt, mode_opt)
Open a file.
Definition: InputOutput.f90:30
This module defines variable data types.
Definition: kind.f90:8
real(dp) function, public get_perturbation(x)
Calculate a numerical perturbation given the value of x.
Definition: MathUtil.f90:372
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
This module contains the base numerical package type.
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
This module contains the SourceCommonModule.
Definition: SourceCommon.f90:7
logical(lgp) function, public filein_fname(filename, tagname, input_mempath, input_fname)
enforce and set a single input filename provided via FILEIN keyword
This module contains the storage package methods.
Definition: swf-sto.f90:7
subroutine sto_fc_dis2d(this, kiter, stage_old, stage_new, matrix_sln, idxglo, rhs)
@ brief Fill A and right-hand side for the package
Definition: swf-sto.f90:287
subroutine calc_storage_dis2d(this, n, stage_new, stage_old, qsto, derv)
Definition: swf-sto.f90:399
subroutine sto_save_model_flows(this, icbcfl, icbcun)
@ brief Save model flows for package
Definition: swf-sto.f90:463
subroutine source_data(this)
@ brief Source input data for package
Definition: swf-sto.f90:632
subroutine log_options(this, found)
@ brief Log found options for package
Definition: swf-sto.f90:605
subroutine sto_fc(this, kiter, stage_old, stage_new, matrix_sln, idxglo, rhs)
@ brief Fill A and right-hand side for the package
Definition: swf-sto.f90:203
subroutine sto_bd(this, isuppress_output, model_budget)
@ brief Model budget calculation for package
Definition: swf-sto.f90:440
subroutine sto_cq(this, flowja, stage_new, stage_old)
@ brief Calculate flows for package
Definition: swf-sto.f90:323
subroutine sto_rp(this)
@ brief Read and prepare method for package
Definition: swf-sto.f90:149
subroutine sto_ad(this)
@ brief Advance the package
Definition: swf-sto.f90:192
subroutine sto_ar(this, dis, ibound)
@ brief Allocate and read method for package
Definition: swf-sto.f90:105
subroutine sto_da(this)
@ brief Deallocate package memory
Definition: swf-sto.f90:501
subroutine sto_fc_dis1d(this, kiter, stage_old, stage_new, matrix_sln, idxglo, rhs)
@ brief Fill A and right-hand side for the package
Definition: swf-sto.f90:245
real(dp) function, dimension(:), pointer reach_length_pointer(this)
Definition: swf-sto.f90:670
subroutine allocate_arrays(this, nodes)
@ brief Allocate package arrays
Definition: swf-sto.f90:548
subroutine calc_storage_dis1d(this, n, stage_new, stage_old, dx, qsto, derv)
Definition: swf-sto.f90:363
subroutine set_dfw_pointers(this)
Set pointers to channel properties in DFW Package.
Definition: swf-sto.f90:657
subroutine, public sto_cr(stoobj, name_model, mempath, inunit, iout, cxs)
@ brief Create a new package object
Definition: swf-sto.f90:73
subroutine allocate_scalars(this)
@ brief Allocate scalars
Definition: swf-sto.f90:527
subroutine source_options(this)
@ brief Source input options for package
Definition: swf-sto.f90:578
character(len=lenbudtxt), dimension(1) budtxt
Definition: swf-sto.f90:25
integer(i4b), pointer, public kper
current stress period number
Definition: tdis.f90:23
real(dp), pointer, public delt
length of the current time step
Definition: tdis.f90:29
Derived type for the Budget object.
Definition: Budget.f90:39