MODFLOW 6  version 6.7.0.dev1
USGS Modular Hydrologic Model
swfstomodule Module Reference

This module contains the storage package methods. More...

Data Types

type  swfstotype
 

Functions/Subroutines

subroutine, public sto_cr (stoobj, name_model, mempath, inunit, iout, cxs)
 @ brief Create a new package object More...
 
subroutine sto_ar (this, dis, ibound)
 @ brief Allocate and read method for package More...
 
subroutine sto_rp (this)
 @ brief Read and prepare method for package More...
 
subroutine sto_ad (this)
 @ brief Advance the package More...
 
subroutine sto_fc (this, kiter, stage_old, stage_new, matrix_sln, idxglo, rhs)
 @ brief Fill A and right-hand side for the package More...
 
subroutine sto_fc_dis1d (this, kiter, stage_old, stage_new, matrix_sln, idxglo, rhs)
 @ brief Fill A and right-hand side for the package More...
 
subroutine sto_fc_dis2d (this, kiter, stage_old, stage_new, matrix_sln, idxglo, rhs)
 @ brief Fill A and right-hand side for the package More...
 
subroutine sto_cq (this, flowja, stage_new, stage_old)
 @ brief Calculate flows for package More...
 
subroutine calc_storage_dis1d (this, n, stage_new, stage_old, dx, qsto, derv)
 
subroutine calc_storage_dis2d (this, n, stage_new, stage_old, qsto, derv)
 
subroutine sto_bd (this, isuppress_output, model_budget)
 @ brief Model budget calculation for package More...
 
subroutine sto_save_model_flows (this, icbcfl, icbcun)
 @ brief Save model flows for package More...
 
subroutine sto_da (this)
 @ brief Deallocate package memory More...
 
subroutine allocate_scalars (this)
 @ brief Allocate scalars More...
 
subroutine allocate_arrays (this, nodes)
 @ brief Allocate package arrays More...
 
subroutine source_options (this)
 @ brief Source input options for package More...
 
subroutine log_options (this, found)
 @ brief Log found options for package More...
 
subroutine source_data (this)
 @ brief Source input data for package More...
 
subroutine set_dfw_pointers (this)
 Set pointers to channel properties in DFW Package. More...
 
real(dp) function, dimension(:), pointer reach_length_pointer (this)
 

Variables

character(len=lenbudtxt), dimension(1) budtxt = [' STORAGE']
 

Detailed Description

This module contains the methods used to add the effects of storage on the surface water flow equation.

Function/Subroutine Documentation

◆ allocate_arrays()

subroutine swfstomodule::allocate_arrays ( class(swfstotype), target  this,
integer(i4b), intent(in)  nodes 
)

Allocate and initialize STO package arrays.

Parameters
thisSwfStoType object
[in]nodesactive model nodes

Definition at line 543 of file swf-sto.f90.

544  ! -- modules
546  ! -- dummy variables
547  class(SwfStoType), target :: this !< SwfStoType object
548  integer(I4B), intent(in) :: nodes !< active model nodes
549  ! -- local variables
550  integer(I4B) :: n
551  !
552  ! -- Allocate arrays
553  call mem_allocate(this%qsto, nodes, 'STRGSS', this%memoryPath)
554  !
555  ! -- set input context pointers
556  if (this%inunit > 0) then
557  call mem_setptr(this%iper, 'IPER', this%input_mempath)
558  call mem_setptr(this%storage, 'STORAGE', this%input_mempath)
559  end if
560  !
561  ! -- Initialize arrays
562  this%iss = 0
563  do n = 1, nodes
564  this%qsto(n) = dzero
565  end do

◆ allocate_scalars()

subroutine swfstomodule::allocate_scalars ( class(swfstotype this)

Allocate and initialize scalars for the STO package. The base numerical package allocate scalars method is also called.

Parameters
thisSwfStoType object

Definition at line 522 of file swf-sto.f90.

523  ! -- modules
525  ! -- dummy variables
526  class(SwfStoType) :: this !< SwfStoType object
527  !
528  ! -- allocate scalars in NumericalPackageType
529  call this%NumericalPackageType%allocate_scalars()
530  !
531  ! -- allocate scalars
532  !call mem_allocate(this%xxx, 'XXX', this%memoryPath)
533  !
534  ! -- initialize scalars
535  !this%xxx = 0

◆ calc_storage_dis1d()

subroutine swfstomodule::calc_storage_dis1d ( class(swfstotype this,
integer(i4b), intent(in)  n,
real(dp), intent(in)  stage_new,
real(dp), intent(in)  stage_old,
real(dp), intent(in)  dx,
real(dp), intent(inout)  qsto,
real(dp), intent(inout), optional  derv 
)

Definition at line 358 of file swf-sto.f90.

359  ! module
360  use tdismodule, only: delt
362  ! dummy
363  class(SwfStoType) :: this
364  integer(I4B), intent(in) :: n
365  real(DP), intent(in) :: stage_new
366  real(DP), intent(in) :: stage_old
367  real(DP), intent(in) :: dx
368  real(DP), intent(inout) :: qsto
369  real(DP), intent(inout), optional :: derv
370  ! local
371  real(DP) :: depth_new
372  real(DP) :: depth_old
373  real(DP) :: width_n
374  real(DP) :: width_m
375  real(DP) :: cxs_area_new
376  real(DP) :: cxs_area_old
377  real(DP) :: cxs_area_eps
378  real(DP) :: eps
379 
380  call this%dis%get_flow_width(n, n, 0, width_n, width_m)
381  depth_new = stage_new - this%dis%bot(n)
382  depth_old = stage_old - this%dis%bot(n)
383  cxs_area_new = this%cxs%get_area(this%idcxs(n), width_n, depth_new)
384  cxs_area_old = this%cxs%get_area(this%idcxs(n), width_n, depth_old)
385  qsto = (cxs_area_new - cxs_area_old) * dx / delt
386  if (present(derv)) then
387  eps = get_perturbation(depth_new)
388  cxs_area_eps = this%cxs%get_area(this%idcxs(n), width_n, depth_new + eps)
389  derv = (cxs_area_eps - cxs_area_new) * dx / delt / eps
390  end if
391 
real(dp) function, public get_perturbation(x)
Calculate a numerical perturbation given the value of x.
Definition: MathUtil.f90:372
real(dp), pointer, public delt
length of the current time step
Definition: tdis.f90:29
Here is the call graph for this function:

◆ calc_storage_dis2d()

subroutine swfstomodule::calc_storage_dis2d ( class(swfstotype this,
integer(i4b), intent(in)  n,
real(dp), intent(in)  stage_new,
real(dp), intent(in)  stage_old,
real(dp), intent(inout)  qsto,
real(dp), intent(inout), optional  derv 
)

Definition at line 394 of file swf-sto.f90.

395  ! module
396  use tdismodule, only: delt
398  ! dummy
399  class(SwfStoType) :: this
400  integer(I4B), intent(in) :: n
401  real(DP), intent(in) :: stage_new
402  real(DP), intent(in) :: stage_old
403  real(DP), intent(inout) :: qsto
404  real(DP), intent(inout), optional :: derv
405  ! local
406  real(DP) :: area
407  real(DP) :: depth_new
408  real(DP) :: depth_old
409  real(DP) :: depth_eps
410  real(DP) :: volume_new
411  real(DP) :: volume_old
412  real(DP) :: eps
413 
414  area = this%dis%get_area(n)
415  depth_new = stage_new - this%dis%bot(n)
416  depth_old = stage_old - this%dis%bot(n)
417  volume_new = area * depth_new
418  volume_old = area * depth_old
419  qsto = (volume_new - volume_old) / delt
420 
421  if (present(derv)) then
422  eps = get_perturbation(depth_new)
423  depth_eps = depth_new + eps
424  derv = (depth_eps - depth_new) * area / delt / eps
425  end if
426 
Here is the call graph for this function:

◆ log_options()

subroutine swfstomodule::log_options ( class(swfstotype this,
type(swfstoparamfoundtype), intent(in)  found 
)

Log options block for STO package.

Parameters
thisSwfStoType object

Definition at line 599 of file swf-sto.f90.

600  ! -- modules
603  ! -- dummy variables
604  class(SwfStoType) :: this !< SwfStoType object
605  type(SwfStoParamFoundType), intent(in) :: found
606  ! -- local variables
607  ! -- formats
608  character(len=*), parameter :: fmtisvflow = &
609  "(4x,'CELL-BY-CELL FLOW INFORMATION WILL BE SAVED TO BINARY FILE &
610  &WHENEVER ICBCFL IS NOT ZERO.')"
611  !
612  write (this%iout, '(1x,a)') 'PROCESSING STORAGE OPTIONS'
613  !
614  if (found%ipakcb) then
615  write (this%iout, fmtisvflow)
616  end if
617  !
618  write (this%iout, '(1x,a)') 'END OF STORAGE OPTIONS'

◆ reach_length_pointer()

real(dp) function, dimension(:), pointer swfstomodule::reach_length_pointer ( class(swfstotype this)
Parameters
thisthis instance

Definition at line 664 of file swf-sto.f90.

665  ! dummy
666  class(SwfStoType) :: this !< this instance
667  ! return
668  real(DP), dimension(:), pointer :: ptr
669  ! local
670  class(DisBaseType), pointer :: dis
671 
672  ptr => null()
673  dis => this%dis
674  select type (dis)
675  type is (disv1dtype)
676  ptr => dis%length
677  end select
678 

◆ set_dfw_pointers()

subroutine swfstomodule::set_dfw_pointers ( class(swfstotype this)
Parameters
thisthis instance

Definition at line 651 of file swf-sto.f90.

652  ! -- modules
654  ! -- dummy
655  class(SwfStoType) :: this !< this instance
656  ! -- local
657  character(len=LENMEMPATH) :: dfw_mem_path
658 
659  dfw_mem_path = create_mem_path(this%name_model, 'DFW')
660  call mem_setptr(this%idcxs, 'IDCXS', dfw_mem_path)
661 
Here is the call graph for this function:

◆ source_data()

subroutine swfstomodule::source_data ( class(swfstotype this)

Source griddata block parameters for STO package.

Parameters
thisSwfStoType object

Definition at line 626 of file swf-sto.f90.

627  ! -- modules
630  ! -- dummy variables
631  class(SwfStotype) :: this !< SwfStoType object
632  ! -- local variables
633  character(len=24), dimension(1) :: aname
634  integer(I4B), dimension(:), pointer, contiguous :: map
635  !type(SwfStoParamFoundType) :: found
636  !
637  ! -- initialize data
638  data aname(1)/' XXX'/
639  !
640  ! -- set map to reduce data input arrays
641  map => null()
642  if (this%dis%nodes < this%dis%nodesuser) map => this%dis%nodeuser
643  !
644  ! -- log griddata
645  write (this%iout, '(1x,a)') 'PROCESSING GRIDDATA'
646  write (this%iout, '(1x,a)') 'END PROCESSING GRIDDATA'

◆ source_options()

subroutine swfstomodule::source_options ( class(swfstotype this)

Source options block parameters for STO package.

Parameters
thisSwfStoType object

Definition at line 573 of file swf-sto.f90.

574  ! -- modules
578  ! -- dummy variables
579  class(SwfStoType) :: this !< SwfStoType object
580  ! -- local variables
581  type(SwfStoParamFoundType) :: found
582  !
583  ! -- source package input
584  call mem_set_value(this%ipakcb, 'IPAKCB', this%input_mempath, found%ipakcb)
585  !
586  if (found%ipakcb) then
587  this%ipakcb = -1
588  end if
589  !
590  ! -- log found options
591  call this%log_options(found)
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
Here is the call graph for this function:

◆ sto_ad()

subroutine swfstomodule::sto_ad ( class(swfstotype this)

Advance data in the STO package.

Parameters
thisSwfStoType object

Definition at line 189 of file swf-sto.f90.

190  ! -- modules
191  ! -- dummy variables
192  class(SwfStoType) :: this !< SwfStoType object

◆ sto_ar()

subroutine swfstomodule::sto_ar ( class(swfstotype this,
class(disbasetype), intent(in), pointer  dis,
integer(i4b), dimension(:), pointer, contiguous  ibound 
)

Method to allocate and read static data for the STO package.

Parameters
thisSwfStoType object
[in]dismodel discretization object
iboundmodel ibound array

Definition at line 102 of file swf-sto.f90.

103  ! -- modules
106  ! -- dummy variables
107  class(SwfStoType) :: this !< SwfStoType object
108  class(DisBaseType), pointer, intent(in) :: dis !< model discretization object
109  integer(I4B), dimension(:), pointer, contiguous :: ibound !< model ibound array
110  ! -- local variables
111  ! -- formats
112  character(len=*), parameter :: fmtsto = &
113  "(1x,/1x,'STO -- STORAGE PACKAGE, VERSION 1, 10/27/2023', &
114  &' INPUT READ FROM UNIT ', i0, //)"
115  !
116  ! --print a message identifying the storage package.
117  write (this%iout, fmtsto) this%inunit
118 
119  ! -- set pointers to data in dfw package
120  call this%set_dfw_pointers()
121 
122  !
123  ! -- store pointers to arguments that were passed in
124  this%dis => dis
125  this%ibound => ibound
126  !
127  ! -- set pointer to model iss
128  call mem_setptr(this%iss, 'ISS', create_mem_path(this%name_model))
129  !
130  ! -- Allocate arrays
131  call this%allocate_arrays(dis%nodes)
132  !
133  ! -- Read storage options
134  call this%source_options()
135  !
136  ! -- read the data block
137  ! no griddata at the moment for SWF Storage Package
138  ! call this%source_data()
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
Here is the call graph for this function:

◆ sto_bd()

subroutine swfstomodule::sto_bd ( class(swfstotype this,
integer(i4b), intent(in)  isuppress_output,
type(budgettype), intent(inout)  model_budget 
)

Budget calculation for the STO package components. Components include specific storage and specific yield storage.

Parameters
thisSwfStoType object
[in]isuppress_outputflag to suppress model output
[in,out]model_budgetmodel budget object

Definition at line 435 of file swf-sto.f90.

436  ! -- modules
437  use tdismodule, only: delt
439  ! -- dummy variables
440  class(SwfStoType) :: this !< SwfStoType object
441  integer(I4B), intent(in) :: isuppress_output !< flag to suppress model output
442  type(BudgetType), intent(inout) :: model_budget !< model budget object
443  ! -- local variables
444  real(DP) :: rin
445  real(DP) :: rout
446  !
447  ! -- Add storage rates to model budget
448  call rate_accumulator(this%qsto, rin, rout)
449  call model_budget%addentry(rin, rout, delt, ' STO', &
450  isuppress_output, ' STORAGE')
This module contains the BudgetModule.
Definition: Budget.f90:20
subroutine, public rate_accumulator(flow, rin, rout)
@ brief Rate accumulator subroutine
Definition: Budget.f90:632
Derived type for the Budget object.
Definition: Budget.f90:39
Here is the call graph for this function:

◆ sto_cq()

subroutine swfstomodule::sto_cq ( class(swfstotype this,
real(dp), dimension(:), intent(inout)  flowja,
real(dp), dimension(:), intent(inout)  stage_new,
real(dp), dimension(:), intent(inout)  stage_old 
)

Definition at line 318 of file swf-sto.f90.

319  ! -- dummy
320  class(SwfStoType) :: this
321  real(DP), intent(inout), dimension(:) :: flowja
322  real(DP), intent(inout), dimension(:) :: stage_new
323  real(DP), intent(inout), dimension(:) :: stage_old
324  ! -- local
325  real(DP), dimension(:), pointer :: reach_length
326  integer(I4B) :: n
327  integer(I4B) :: idiag
328  real(DP) :: dx
329  real(DP) :: q
330 
331  ! -- test if steady-state stress period
332  if (this%iss /= 0) return
333 
334  ! Set pointer to reach_length for 1d
335  reach_length => this%reach_length_pointer()
336 
337  ! -- Calculate storage term
338  do n = 1, this%dis%nodes
339  !
340  ! -- skip if constant stage
341  if (this%ibound(n) < 0) cycle
342 
343  ! Calculate storage for either the DIS1D or DIS2D cases and
344  ! add to flowja
345  if (associated(reach_length)) then
346  dx = reach_length(n)
347  call this%calc_storage_dis1d(n, stage_new(n), stage_old(n), dx, q)
348  else
349  call this%calc_storage_dis2d(n, stage_new(n), stage_old(n), q)
350  end if
351  this%qsto(n) = -q
352  idiag = this%dis%con%ia(n)
353  flowja(idiag) = flowja(idiag) + this%qsto(n)
354 
355  end do

◆ sto_cr()

subroutine, public swfstomodule::sto_cr ( type(swfstotype), pointer  stoobj,
character(len=*), intent(in)  name_model,
character(len=*), intent(in)  mempath,
integer(i4b), intent(in)  inunit,
integer(i4b), intent(in)  iout,
type(swfcxstype), intent(in), pointer  cxs 
)

Create a new storage (STO) object

Parameters
stoobjSwfStoType object
[in]name_modelname of model
[in]mempathinput context mem path
[in]inunitpackage input file unit
[in]ioutmodel listing file unit
[in]cxsthe pointer to the cxs package

Definition at line 70 of file swf-sto.f90.

71  ! -- dummy variables
72  type(SwfStoType), pointer :: stoobj !< SwfStoType object
73  character(len=*), intent(in) :: name_model !< name of model
74  character(len=*), intent(in) :: mempath !< input context mem path
75  integer(I4B), intent(in) :: inunit !< package input file unit
76  integer(I4B), intent(in) :: iout !< model listing file unit
77  type(SwfCxsType), pointer, intent(in) :: cxs !< the pointer to the cxs package
78  !
79  ! -- Create the object
80  allocate (stoobj)
81  !
82  ! -- create name and memory path
83  call stoobj%set_names(1, name_model, 'STO', 'STO', mempath)
84  !
85  ! -- Allocate scalars
86  call stoobj%allocate_scalars()
87  !
88  ! -- Set variables
89  stoobj%inunit = inunit
90  stoobj%iout = iout
91 
92  ! -- store pointers
93  stoobj%cxs => cxs
94 
Here is the caller graph for this function:

◆ sto_da()

subroutine swfstomodule::sto_da ( class(swfstotype this)

Deallocate STO package scalars and arrays.

Parameters
thisSwfStoType object

Definition at line 496 of file swf-sto.f90.

497  ! -- modules
499  ! -- dummy variables
500  class(SwfStoType) :: this !< SwfStoType object
501  !
502  ! -- Deallocate arrays if package is active
503  if (this%inunit > 0) then
504  call mem_deallocate(this%qsto)
505  nullify (this%idcxs)
506  nullify (this%iper)
507  nullify (this%storage)
508  end if
509  !
510  ! -- Deallocate scalars
511  !
512  ! -- deallocate parent
513  call this%NumericalPackageType%da()

◆ sto_fc()

subroutine swfstomodule::sto_fc ( class(swfstotype this,
integer(i4b)  kiter,
real(dp), dimension(:), intent(inout)  stage_old,
real(dp), dimension(:), intent(inout)  stage_new,
class(matrixbasetype), pointer  matrix_sln,
integer(i4b), dimension(:), intent(in)  idxglo,
real(dp), dimension(:), intent(inout)  rhs 
)

Fill the coefficient matrix and right-hand side with the STO package terms.

Definition at line 200 of file swf-sto.f90.

201  ! -- modules
202  use tdismodule, only: delt
203  ! -- dummy
204  class(SwfStoType) :: this
205  integer(I4B) :: kiter
206  real(DP), intent(inout), dimension(:) :: stage_old
207  real(DP), intent(inout), dimension(:) :: stage_new
208  class(MatrixBaseType), pointer :: matrix_sln
209  integer(I4B), intent(in), dimension(:) :: idxglo
210  real(DP), intent(inout), dimension(:) :: rhs
211  ! -- local
212  ! -- formats
213  character(len=*), parameter :: fmtsperror = &
214  &"('Detected time step length of zero. SWF Storage Package cannot be ', &
215  &'used unless delt is non-zero.')"
216  !
217  ! -- test if steady-state stress period
218  if (this%iss /= 0) return
219  !
220  ! -- Ensure time step length is not zero
221  if (delt == dzero) then
222  write (errmsg, fmtsperror)
223  call store_error(errmsg, terminate=.true.)
224  end if
225 
226  if (this%dis%is_1d()) then
227  call this%sto_fc_dis1d(kiter, stage_old, stage_new, matrix_sln, idxglo, rhs)
228  else
229  call this%sto_fc_dis2d(kiter, stage_old, stage_new, matrix_sln, idxglo, rhs)
230  end if
231 
Here is the call graph for this function:

◆ sto_fc_dis1d()

subroutine swfstomodule::sto_fc_dis1d ( class(swfstotype this,
integer(i4b)  kiter,
real(dp), dimension(:), intent(inout)  stage_old,
real(dp), dimension(:), intent(inout)  stage_new,
class(matrixbasetype), pointer  matrix_sln,
integer(i4b), dimension(:), intent(in)  idxglo,
real(dp), dimension(:), intent(inout)  rhs 
)

Fill the coefficient matrix and right-hand side with the STO package terms.

Definition at line 239 of file swf-sto.f90.

241  ! -- modules
242  ! -- dummy
243  class(SwfStoType) :: this
244  integer(I4B) :: kiter
245  real(DP), intent(inout), dimension(:) :: stage_old
246  real(DP), intent(inout), dimension(:) :: stage_new
247  class(MatrixBaseType), pointer :: matrix_sln
248  integer(I4B), intent(in), dimension(:) :: idxglo
249  real(DP), intent(inout), dimension(:) :: rhs
250  ! -- local
251  integer(I4B) :: n, idiag
252  real(DP) :: derv
253  real(DP) :: qsto
254  real(DP), dimension(:), pointer :: reach_length
255 
256  ! Set pointer to reach_length for 1d
257  reach_length => this%reach_length_pointer()
258 
259  ! -- Calculate coefficients and put into amat
260  do n = 1, this%dis%nodes
261 
262  ! -- skip if constant stage
263  if (this%ibound(n) < 0) cycle
264 
265  call this%calc_storage_dis1d(n, stage_new(n), stage_old(n), &
266  reach_length(n), qsto, derv)
267 
268  ! -- Fill amat and rhs
269  idiag = this%dis%con%ia(n)
270  call matrix_sln%add_value_pos(idxglo(idiag), -derv)
271  rhs(n) = rhs(n) + qsto - derv * stage_new(n)
272 
273  end do

◆ sto_fc_dis2d()

subroutine swfstomodule::sto_fc_dis2d ( class(swfstotype this,
integer(i4b)  kiter,
real(dp), dimension(:), intent(inout)  stage_old,
real(dp), dimension(:), intent(inout)  stage_new,
class(matrixbasetype), pointer  matrix_sln,
integer(i4b), dimension(:), intent(in)  idxglo,
real(dp), dimension(:), intent(inout)  rhs 
)

Fill the coefficient matrix and right-hand side with the STO package terms.

Definition at line 281 of file swf-sto.f90.

283  ! -- modules
284  ! -- dummy
285  class(SwfStoType) :: this
286  integer(I4B) :: kiter
287  real(DP), intent(inout), dimension(:) :: stage_old
288  real(DP), intent(inout), dimension(:) :: stage_new
289  class(MatrixBaseType), pointer :: matrix_sln
290  integer(I4B), intent(in), dimension(:) :: idxglo
291  real(DP), intent(inout), dimension(:) :: rhs
292  ! -- local
293  integer(I4B) :: n, idiag
294  real(DP) :: derv
295  real(DP) :: qsto
296 
297  ! -- Calculate coefficients and put into amat
298  do n = 1, this%dis%nodes
299  !
300  ! -- skip if constant stage
301  if (this%ibound(n) < 0) cycle
302 
303  ! Calculate storage and derivative term
304  call this%calc_storage_dis2d(n, stage_new(n), stage_old(n), &
305  qsto, derv)
306 
307  ! -- Fill amat and rhs
308  idiag = this%dis%con%ia(n)
309  call matrix_sln%add_value_pos(idxglo(idiag), -derv)
310  rhs(n) = rhs(n) + qsto - derv * stage_new(n)
311 
312  end do
313 

◆ sto_rp()

subroutine swfstomodule::sto_rp ( class(swfstotype this)

Method to read and prepare stress period data for the STO package.

Parameters
thisSwfStoType object

Definition at line 146 of file swf-sto.f90.

147  ! -- modules
148  use tdismodule, only: kper
149  implicit none
150  ! -- dummy variables
151  class(SwfStoType) :: this !< SwfStoType object
152  ! -- local variables
153  character(len=16) :: css(0:1)
154  ! -- data
155  data css(0)/' TRANSIENT'/
156  data css(1)/' STEADY-STATE'/
157  !
158  ! -- confirm package is active
159  if (this%inunit <= 0) return
160  !
161  ! -- confirm loaded iper
162  if (this%iper /= kper) return
163  !
164  write (this%iout, '(//,1x,a)') 'PROCESSING STORAGE PERIOD DATA'
165  !
166  ! -- set period iss
167  if (this%storage == 'STEADY-STATE') then
168  this%iss = 1
169  else if (this%storage == 'TRANSIENT') then
170  this%iss = 0
171  else
172  write (errmsg, '(a,a)') 'Unknown STORAGE data tag: ', &
173  trim(this%storage)
174  call store_error(errmsg)
175  call store_error_filename(this%input_fname)
176  end if
177  !
178  write (this%iout, '(1x,a)') 'END PROCESSING STORAGE PERIOD DATA'
179  !
180  write (this%iout, '(//1X,A,I0,A,A,/)') &
181  'STRESS PERIOD ', kper, ' IS ', trim(adjustl(css(this%iss)))
integer(i4b), pointer, public kper
current stress period number
Definition: tdis.f90:23
Here is the call graph for this function:

◆ sto_save_model_flows()

subroutine swfstomodule::sto_save_model_flows ( class(swfstotype this,
integer(i4b), intent(in)  icbcfl,
integer(i4b), intent(in)  icbcun 
)

Save cell-by-cell budget terms for the STO package.

Parameters
thisSwfStoType object
[in]icbcflflag to output budget data
[in]icbcuncell-by-cell file unit number

Definition at line 458 of file swf-sto.f90.

459  ! -- dummy variables
460  class(SwfStoType) :: this !< SwfStoType object
461  integer(I4B), intent(in) :: icbcfl !< flag to output budget data
462  integer(I4B), intent(in) :: icbcun !< cell-by-cell file unit number
463  ! -- local variables
464  integer(I4B) :: ibinun
465  integer(I4B) :: iprint, nvaluesp, nwidthp
466  character(len=1) :: cdatafmp = ' ', editdesc = ' '
467  real(DP) :: dinact
468  !
469  ! -- Set unit number for binary output
470  if (this%ipakcb < 0) then
471  ibinun = icbcun
472  elseif (this%ipakcb == 0) then
473  ibinun = 0
474  else
475  ibinun = this%ipakcb
476  end if
477  if (icbcfl == 0) ibinun = 0
478  !
479  ! -- Record the storage rates if requested
480  if (ibinun /= 0) then
481  iprint = 0
482  dinact = dzero
483  !
484  ! -- qsto
485  call this%dis%record_array(this%qsto, this%iout, iprint, -ibinun, &
486  budtxt(1), cdatafmp, nvaluesp, &
487  nwidthp, editdesc, dinact)
488  end if

Variable Documentation

◆ budtxt

character(len=lenbudtxt), dimension(1) swfstomodule::budtxt = [' STORAGE']

Definition at line 23 of file swf-sto.f90.

23  character(len=LENBUDTXT), dimension(1) :: budtxt = & !< text labels for budget terms
24  &[' STORAGE']