MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
gwfstomodule Module Reference

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

Data Types

type  gwfstotype
type  defaultstorageformulationtype
 Default storage formulation. More...

Functions/Subroutines

subroutine, public sto_cr (stoobj, name_model, mempath, inunit, iout)
 Create a new package object.
subroutine sto_ar (this, dis, ibound)
 Allocate and read method for package.
subroutine sto_rp (this)
 Read and prepare method for package.
subroutine sto_ad (this)
 Advance the package.
subroutine sto_fc (this, kiter, hold, hnew, matrix_sln, idxglo, rhs)
 Fill A and right-hand side for the package.
subroutine default_storage_fc (this, kiter, matrix_sln, rhs, idxglo, h_old, h_new)
 Fill coefficients for the default storage formulation.
subroutine fc_default_sto (this, n, matrix_sln, rhs, idxglo, hold, hnew)
 Default storage FC.
subroutine sto_fn (this, kiter, hold, hnew, matrix_sln, idxglo, rhs)
 Fill Newton-Raphson terms in A and right-hand side for the package.
subroutine default_storage_fn (this, kiter, matrix_sln, rhs, idxglo, h_old, h_new)
 Fill newton terms for the default storage formulation.
subroutine fn_default_sto (this, n, matrix_sln, rhs, idxglo, hold, hnew)
subroutine sto_cq (this, flowja, hnew, hold)
 Calculate flows for package.
subroutine default_storage_cq (this, flowja, h_new, h_old)
 Calculate flows for the default storage formulation.
logical(lgp) function default_storage_is_active (this, n)
 The default formulation uses the claim mask, not is_active.
subroutine default_storage_bd (this, isuppress_output, model_budget)
 Default storage budget is handled directly by sto_bd.
subroutine default_storage_save_flows (this, iprint, ibinun)
 Default storage flows are saved directly by sto_save_model_flows.
subroutine cq_default_sto (this, n, flowja, hnew, hold)
 Standard flow calculation for the storage.
subroutine sto_bd (this, isuppress_output, model_budget)
 Model budget calculation for package.
subroutine sto_save_model_flows (this, icbcfl, icbcun)
 Save model flows for package.
subroutine sto_da (this)
 Deallocate package memory.
subroutine allocate_scalars (this)
 Allocate scalars.
subroutine allocate_arrays (this, nodes)
 Allocate package arrays.
subroutine source_options (this)
 Source input options for package.
subroutine log_options (this, found)
 Log found options for package.
subroutine source_data (this)
 Source input data for package.
subroutine save_old_ss_sy (this)
 Save old storage property values.
subroutine add_sto_formulation (this, sto_form, form_id)

Variables

character(len=lenbudtxt), dimension(2) budtxt = [' STO-SS', ' STO-SY']

Detailed Description

This module contains the methods used to add the effects of storage on the groundwater flow equation. The contribution of specific storage and specific yield can be represented.

Function/Subroutine Documentation

◆ add_sto_formulation()

subroutine gwfstomodule::add_sto_formulation ( class(gwfstotype), intent(inout) this,
class(gwfstoformulationtype), pointer sto_form,
integer(i4b) form_id )
Parameters
[in,out]thisthis NPF instance
sto_formthe alternative storage calculator
form_idthe id for the flow formulation

Definition at line 1209 of file gwf-sto.f90.

1210 class(GwfStoType), intent(inout) :: this !< this NPF instance
1211 class(GwfStoFormulationType), pointer :: sto_form !< the alternative storage calculator
1212 integer(I4B) :: form_id !< the id for the flow formulation
1213
1214 this%sto_formulations(form_id)%is_active = .true.
1215 this%sto_formulations(form_id)%form => sto_form
1216

◆ allocate_arrays()

subroutine gwfstomodule::allocate_arrays ( class(gwfstotype), target this,
integer(i4b), intent(in) nodes )

Allocate and initialize STO package arrays.

Parameters
thisGwfStoType object
[in]nodesactive model nodes

Definition at line 914 of file gwf-sto.f90.

915 ! -- modules
917 ! -- dummy variables
918 class(GwfStoType), target :: this !< GwfStoType object
919 integer(I4B), intent(in) :: nodes !< active model nodes
920 ! -- local variables
921 integer(I4B) :: n
922 !
923 ! -- Allocate arrays
924 call mem_allocate(this%iconvert, nodes, 'ICONVERT', this%memoryPath)
925 call mem_allocate(this%ss, nodes, 'SS', this%memoryPath)
926 call mem_allocate(this%sy, nodes, 'SY', this%memoryPath)
927 call mem_allocate(this%strgss, nodes, 'STRGSS', this%memoryPath)
928 call mem_allocate(this%strgsy, nodes, 'STRGSY', this%memoryPath)
929 call mem_allocate(this%iformulation, nodes, 'IFORM', this%memoryPath)
930 !
931 ! -- set input context pointers
932 if (this%inunit > 0) then
933 call mem_setptr(this%iper, 'IPER', this%input_mempath)
934 call mem_setptr(this%storage, 'STORAGE', this%input_mempath)
935 end if
936 !
937 ! -- Initialize arrays
938 this%iss = 0
939 do n = 1, nodes
940 this%iconvert(n) = 1
941 this%ss(n) = dzero
942 this%sy(n) = dzero
943 this%strgss(n) = dzero
944 this%strgsy(n) = dzero
945 if (this%integratechanges /= 0) then
946 this%oldss(n) = dzero
947 if (this%iusesy /= 0) then
948 this%oldsy(n) = dzero
949 end if
950 end if
951
952 this%iformulation(n) = default_storage
953 end do
954 !
955 ! -- create the default storage formulation and point it at this package
956 allocate (defaultstorageformulationtype :: this%default_form)
957 select type (form => this%default_form)
958 type is (defaultstorageformulationtype)
959 form%sto => this
960 end select

◆ allocate_scalars()

subroutine gwfstomodule::allocate_scalars ( class(gwfstotype) this)

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

Parameters
thisGwfStoType object

Definition at line 880 of file gwf-sto.f90.

881 ! -- modules
883 ! -- dummy variables
884 class(GwfStoType) :: this !< GwfStoType object
885 !
886 ! -- allocate scalars in NumericalPackageType
887 call this%NumericalPackageType%allocate_scalars()
888 !
889 ! -- allocate scalars
890 call mem_allocate(this%istor_coef, 'ISTOR_COEF', this%memoryPath)
891 call mem_allocate(this%iconf_ss, 'ICONF_SS', this%memoryPath)
892 call mem_allocate(this%iorig_ss, 'IORIG_SS', this%memoryPath)
893 call mem_allocate(this%iusesy, 'IUSESY', this%memoryPath)
894 call mem_allocate(this%satomega, 'SATOMEGA', this%memoryPath)
895 call mem_allocate(this%integratechanges, 'INTEGRATECHANGES', &
896 this%memoryPath)
897 call mem_allocate(this%intvs, 'INTVS', this%memoryPath)
898 !
899 ! -- initialize scalars
900 this%istor_coef = 0
901 this%iconf_ss = 0
902 this%iorig_ss = 0
903 this%iusesy = 0
904 this%satomega = dzero
905 this%integratechanges = 0
906 this%intvs = 0

◆ cq_default_sto()

subroutine gwfstomodule::cq_default_sto ( class(gwfstotype), intent(inout) this,
integer(i4b), intent(in) n,
real(dp), dimension(:), intent(inout) flowja,
real(dp), dimension(:), intent(in) hnew,
real(dp), dimension(:), intent(in) hold )

Definition at line 630 of file gwf-sto.f90.

631 use tdismodule, only: delt
632 class(GwfStoType), intent(inout) :: this
633 integer(I4B), intent(in) :: n
634 real(DP), dimension(:), intent(inout) :: flowja
635 real(DP), dimension(:), intent(in) :: hnew
636 real(DP), dimension(:), intent(in) :: hold
637 ! local
638 integer(I4B) :: idiag
639 real(DP) :: rate
640 real(DP) :: tled
641 real(DP) :: sc1, sc2, rho1, rho2
642 real(DP) :: sc1old, sc2old, rho1old, rho2old
643 real(DP) :: tp, bt
644 real(DP) :: snold, snnew
645 real(DP) :: aterm, rhsterm
646 !
647 tled = done / delt
648 !
649 ! -- aquifer elevations and thickness
650 tp = this%dis%top(n)
651 bt = this%dis%bot(n)
652 !
653 ! -- aquifer saturation
654 if (this%iconvert(n) == 0) then
655 snold = done
656 snnew = done
657 else
658 snold = squadraticsaturation(tp, bt, hold(n), this%satomega)
659 snnew = squadraticsaturation(tp, bt, hnew(n), this%satomega)
660 end if
661 !
662 ! -- primary storage coefficient
663 sc1 = sscapacity(this%istor_coef, tp, bt, this%dis%area(n), this%ss(n))
664 rho1 = sc1 * tled
665 !
666 if (this%integratechanges /= 0) then
667 ! -- Integration of storage changes (e.g. when using TVS):
668 ! separate the old (start of time step) and new (end of time step)
669 ! primary storage capacities
670 sc1old = sscapacity(this%istor_coef, tp, bt, this%dis%area(n), &
671 this%oldss(n))
672 rho1old = sc1old * tled
673 else
674 ! -- No integration of storage changes: old and new values are
675 ! identical => normal MF6 storage formulation
676 rho1old = rho1
677 end if
678 !
679 ! -- calculate specific storage terms and rate
680 call ssterms(this%iconvert(n), this%iorig_ss, this%iconf_ss, tp, bt, &
681 rho1, rho1old, snnew, snold, hnew(n), hold(n), &
682 aterm, rhsterm, rate)
683 !
684 ! -- save rate
685 this%strgss(n) = rate
686 !
687 ! -- add storage term to flowja
688 idiag = this%dis%con%ia(n)
689 flowja(idiag) = flowja(idiag) + rate
690 !
691 ! -- specific yield
692 rate = dzero
693 if (this%iconvert(n) /= 0) then
694 !
695 ! -- secondary storage coefficient
696 sc2 = sycapacity(this%dis%area(n), this%sy(n))
697 rho2 = sc2 * tled
698 !
699 if (this%integratechanges /= 0) then
700 ! -- Integration of storage changes (e.g. when using TVS):
701 ! separate the old (start of time step) and new (end of time
702 ! step) secondary storage capacities
703 sc2old = sycapacity(this%dis%area(n), this%oldsy(n))
704 rho2old = sc2old * tled
705 else
706 ! -- No integration of storage changes: old and new values are
707 ! identical => normal MF6 storage formulation
708 rho2old = rho2
709 end if
710 !
711 ! -- calculate specific yield storage terms and rate
712 call syterms(tp, bt, rho2, rho2old, snnew, snold, &
713 aterm, rhsterm, rate)
714
715 end if
716 this%strgsy(n) = rate
717 !
718 ! -- add storage term to flowja
719 idiag = this%dis%con%ia(n)
720 flowja(idiag) = flowja(idiag) + rate
721
real(dp), pointer, public delt
length of the current time step
Definition tdis.f90:32
Here is the call graph for this function:

◆ default_storage_bd()

subroutine gwfstomodule::default_storage_bd ( class(defaultstorageformulationtype), intent(inout) this,
integer(i4b), intent(in) isuppress_output,
type(budgettype), intent(inout) model_budget )
Parameters
[in,out]thisdefault formulation
[in]isuppress_outputflag to suppress model output
[in,out]model_budgetmodel budget object

Definition at line 613 of file gwf-sto.f90.

614 use budgetmodule, only: budgettype
615 class(DefaultStorageFormulationType), intent(inout) :: this !< default formulation
616 integer(I4B), intent(in) :: isuppress_output !< flag to suppress model output
617 type(BudgetType), intent(inout) :: model_budget !< model budget object
This module contains the BudgetModule.
Definition Budget.f90:20
Derived type for the Budget object.
Definition Budget.f90:40

◆ default_storage_cq()

subroutine gwfstomodule::default_storage_cq ( class(defaultstorageformulationtype), intent(inout) this,
real(dp), dimension(:), intent(inout) flowja,
real(dp), dimension(:), intent(in) h_new,
real(dp), dimension(:), intent(in) h_old )

Runs over all cells and stores the standard STO change in storage, skipping cells claimed by an exclusive formulation.

Parameters
[in,out]thisdefault formulation
[in,out]flowjaconnection flows
[in]h_newcurrent head
[in]h_oldprevious head

Definition at line 585 of file gwf-sto.f90.

586 class(DefaultStorageFormulationType), intent(inout) :: this !< default formulation
587 real(DP), dimension(:), intent(inout) :: flowja !< connection flows
588 real(DP), dimension(:), intent(in) :: h_new !< current head
589 real(DP), dimension(:), intent(in) :: h_old !< previous head
590 ! local
591 integer(I4B) :: n
592
593 do n = 1, this%sto%dis%nodes
594 if (this%sto%ibound(n) <= 0) cycle
595 ! skip cells claimed by an exclusive formulation
596 if (this%sto%iformulation(n) /= default_storage) cycle
597 call this%sto%cq_default_sto(n, flowja, h_new, h_old)
598 end do
599

◆ default_storage_fc()

subroutine gwfstomodule::default_storage_fc ( class(defaultstorageformulationtype), intent(inout) this,
integer(i4b), intent(in) kiter,
class(matrixbasetype), intent(inout), pointer matrix_sln,
real(dp), dimension(:), intent(inout) rhs,
integer(i4b), dimension(:), intent(in) idxglo,
real(dp), dimension(:), intent(in) h_old,
real(dp), dimension(:), intent(in) h_new )

Runs over all cells and fills the standard STO terms, skipping cells claimed by an exclusive formulation.

Parameters
[in,out]thisdefault formulation
[in]kiterouter iteration number
[in,out]matrix_slnA matrix
[in,out]rhsright-hand side
[in]idxgloglobal index model to solution
[in]h_oldprevious heads
[in]h_newcurrent heads

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

302 class(DefaultStorageFormulationType), intent(inout) :: this !< default formulation
303 integer(I4B), intent(in) :: kiter !< outer iteration number
304 class(MatrixBaseType), pointer, intent(inout) :: matrix_sln !< A matrix
305 real(DP), dimension(:), intent(inout) :: rhs !< right-hand side
306 integer(I4B), dimension(:), intent(in) :: idxglo !< global index model to solution
307 real(DP), dimension(:), intent(in) :: h_old !< previous heads
308 real(DP), dimension(:), intent(in) :: h_new !< current heads
309 ! local
310 integer(I4B) :: n
311
312 do n = 1, this%sto%dis%nodes
313 if (this%sto%ibound(n) < 1) cycle
314 ! skip cells claimed by an exclusive formulation
315 if (this%sto%iformulation(n) /= default_storage) cycle
316 call this%sto%fc_default_sto(n, matrix_sln, rhs, idxglo, h_old, h_new)
317 end do
318

◆ default_storage_fn()

subroutine gwfstomodule::default_storage_fn ( class(defaultstorageformulationtype), intent(inout) this,
integer(i4b), intent(in) kiter,
class(matrixbasetype), intent(inout), pointer matrix_sln,
real(dp), dimension(:), intent(inout) rhs,
integer(i4b), dimension(:), intent(in) idxglo,
real(dp), dimension(:), intent(in) h_old,
real(dp), dimension(:), intent(in) h_new )

Runs over all cells and fills the standard STO newton terms, skipping cells claimed by an exclusive formulation.

Parameters
[in,out]thisdefault formulation
[in]kiterouter iteration number
[in,out]matrix_slnA matrix
[in,out]rhsright-hand side
[in]idxgloglobal index model to solution
[in]h_oldprevious heads
[in]h_newcurrent heads

Definition at line 453 of file gwf-sto.f90.

455 class(DefaultStorageFormulationType), intent(inout) :: this !< default formulation
456 integer(I4B), intent(in) :: kiter !< outer iteration number
457 class(MatrixBaseType), pointer, intent(inout) :: matrix_sln !< A matrix
458 real(DP), dimension(:), intent(inout) :: rhs !< right-hand side
459 integer(I4B), dimension(:), intent(in) :: idxglo !< global index model to solution
460 real(DP), dimension(:), intent(in) :: h_old !< previous heads
461 real(DP), dimension(:), intent(in) :: h_new !< current heads
462 ! local
463 integer(I4B) :: n
464
465 do n = 1, this%sto%dis%nodes
466 if (this%sto%ibound(n) <= 0) cycle
467 ! skip cells claimed by an exclusive formulation
468 if (this%sto%iformulation(n) /= default_storage) cycle
469 call this%sto%fn_default_sto(n, matrix_sln, rhs, idxglo, h_old, h_new)
470 end do
471

◆ default_storage_is_active()

logical(lgp) function gwfstomodule::default_storage_is_active ( class(defaultstorageformulationtype), intent(inout) this,
integer(i4b), intent(in) n )
Parameters
[in,out]thisdefault formulation
[in]nnode number
Returns
always false for the default formulation

Definition at line 604 of file gwf-sto.f90.

605 class(DefaultStorageFormulationType), intent(inout) :: this !< default formulation
606 integer(I4B), intent(in) :: n !< node number
607 logical(LGP) :: is_active !< always false for the default formulation
608 is_active = .false.

◆ default_storage_save_flows()

subroutine gwfstomodule::default_storage_save_flows ( class(defaultstorageformulationtype), intent(inout) this,
integer(i4b), intent(in) iprint,
integer(i4b), intent(in) ibinun )
Parameters
[in,out]thisdefault formulation
[in]iprintprint flag
[in]ibinuncell-by-cell file unit number

Definition at line 622 of file gwf-sto.f90.

623 class(DefaultStorageFormulationType), intent(inout) :: this !< default formulation
624 integer(I4B), intent(in) :: iprint !< print flag
625 integer(I4B), intent(in) :: ibinun !< cell-by-cell file unit number

◆ fc_default_sto()

subroutine gwfstomodule::fc_default_sto ( class(gwfstotype) this,
integer(i4b), intent(in) n,
class(matrixbasetype), intent(inout), pointer matrix_sln,
real(dp), dimension(:), intent(inout) rhs,
integer(i4b), dimension(:), intent(in) idxglo,
real(dp), dimension(:), intent(in) hold,
real(dp), dimension(:), intent(in) hnew )
Parameters
thisGwfStoType object

Definition at line 323 of file gwf-sto.f90.

324 use tdismodule, only: delt
325 class(GwfStoType) :: this !< GwfStoType object
326 integer(I4B), intent(in) :: n
327 class(MatrixBaseType), pointer, intent(inout) :: matrix_sln
328 real(DP), dimension(:), intent(inout) :: rhs
329 integer(I4B), dimension(:), intent(in) :: idxglo
330 real(DP), dimension(:), intent(in) :: hold
331 real(DP), dimension(:), intent(in) :: hnew
332 ! local
333 integer(I4B) :: idiag
334 real(DP) :: tled
335 real(DP) :: sc1, sc2
336 real(DP) :: rho1, rho2
337 real(DP) :: sc1old, sc2old, rho1old, rho2old
338 real(DP) :: tp, bt
339 real(DP) :: snold, snnew
340 real(DP) :: aterm, rhsterm
341 !
342 ! -- set variables
343 tled = done / delt
344 idiag = this%dis%con%ia(n)
345 !
346 ! -- aquifer elevations and thickness
347 tp = this%dis%top(n)
348 bt = this%dis%bot(n)
349 !
350 ! -- aquifer saturation
351 if (this%iconvert(n) == 0) then
352 snold = done
353 snnew = done
354 else
355 snold = squadraticsaturation(tp, bt, hold(n), this%satomega)
356 snnew = squadraticsaturation(tp, bt, hnew(n), this%satomega)
357 end if
358 !
359 ! -- storage coefficients
360 sc1 = sscapacity(this%istor_coef, tp, bt, this%dis%area(n), this%ss(n))
361 rho1 = sc1 * tled
362 !
363 if (this%integratechanges /= 0) then
364 ! -- Integration of storage changes (e.g. when using TVS):
365 ! separate the old (start of time step) and new (end of time step)
366 ! primary storage capacities
367 sc1old = sscapacity(this%istor_coef, tp, bt, this%dis%area(n), &
368 this%oldss(n))
369 rho1old = sc1old * tled
370 else
371 ! -- No integration of storage changes: old and new values are
372 ! identical => normal MF6 storage formulation
373 rho1old = rho1
374 end if
375 !
376 ! -- calculate specific storage terms
377 call ssterms(this%iconvert(n), this%iorig_ss, this%iconf_ss, tp, bt, &
378 rho1, rho1old, snnew, snold, hnew(n), hold(n), &
379 aterm, rhsterm)
380 !
381 ! -- add specific storage terms to amat and rhs
382 call matrix_sln%add_value_pos(idxglo(idiag), aterm)
383 rhs(n) = rhs(n) + rhsterm
384 !
385 ! -- specific yield
386 if (this%iconvert(n) /= 0) then
387 rhsterm = dzero
388 !
389 ! -- secondary storage coefficient
390 sc2 = sycapacity(this%dis%area(n), this%sy(n))
391 rho2 = sc2 * tled
392 !
393 if (this%integratechanges /= 0) then
394 ! -- Integration of storage changes (e.g. when using TVS):
395 ! separate the old (start of time step) and new (end of time step)
396 ! secondary storage capacities
397 sc2old = sycapacity(this%dis%area(n), this%oldsy(n))
398 rho2old = sc2old * tled
399 else
400 ! -- No integration of storage changes: old and new values are
401 ! identical => normal MF6 storage formulation
402 rho2old = rho2
403 end if
404 !
405 ! -- calculate specific storage terms
406 call syterms(tp, bt, rho2, rho2old, snnew, snold, &
407 aterm, rhsterm)
408 !
409 ! -- add specific yield terms to amat and rhs
410 call matrix_sln%add_value_pos(idxglo(idiag), aterm)
411 rhs(n) = rhs(n) + rhsterm
412 end if
413
Here is the call graph for this function:

◆ fn_default_sto()

subroutine gwfstomodule::fn_default_sto ( class(gwfstotype), intent(inout) this,
integer(i4b), intent(in) n,
class(matrixbasetype), intent(inout), pointer matrix_sln,
real(dp), dimension(:), intent(inout) rhs,
integer(i4b), dimension(:), intent(in) idxglo,
real(dp), dimension(:), intent(in) hold,
real(dp), dimension(:), intent(in) hnew )

Definition at line 474 of file gwf-sto.f90.

475 use tdismodule, only: delt
476 class(GwfStoType), intent(inout) :: this
477 integer(I4B), intent(in) :: n
478 class(MatrixBaseType), pointer, intent(inout) :: matrix_sln
479 real(DP), dimension(:), intent(inout) :: rhs
480 integer(I4B), dimension(:), intent(in) :: idxglo
481 real(DP), dimension(:), intent(in) :: hold
482 real(DP), dimension(:), intent(in) :: hnew
483 ! local
484 integer(I4B) :: idiag
485 real(DP) :: tled
486 real(DP) :: sc1, sc2, rho1, rho2
487 real(DP) :: tp, bt
488 real(DP) :: tthk
489 real(DP) :: h
490 real(DP) :: snnew
491 real(DP) :: derv, rterm, drterm
492 !
493 ! set variables
494 tled = done / delt
495 idiag = this%dis%con%ia(n)
496 !
497 ! -- aquifer elevations and thickness
498 tp = this%dis%top(n)
499 bt = this%dis%bot(n)
500 tthk = tp - bt
501 h = hnew(n)
502 !
503 ! -- aquifer saturation
504 snnew = squadraticsaturation(tp, bt, h)
505 !
506 ! -- storage coefficients
507 sc1 = sscapacity(this%istor_coef, tp, bt, this%dis%area(n), this%ss(n))
508 sc2 = sycapacity(this%dis%area(n), this%sy(n))
509 rho1 = sc1 * tled
510 rho2 = sc2 * tled
511 !
512 ! -- calculate newton terms for specific storage
513 ! and specific yield
514 if (this%iconvert(n) /= 0) then
515 !
516 ! -- calculate saturation derivative
517 derv = squadraticsaturationderivative(tp, bt, h)
518 !
519 ! -- newton terms for specific storage
520 if (this%iconf_ss == 0) then
521 if (this%iorig_ss == 0) then
522 drterm = -rho1 * derv * (h - bt) + rho1 * tthk * snnew * derv
523 else
524 drterm = -(rho1 * derv * h)
525 end if
526 call matrix_sln%add_value_pos(idxglo(idiag), drterm)
527 rhs(n) = rhs(n) + drterm * h
528 end if
529 !
530 ! -- newton terms for specific yield
531 ! only calculated if the current saturation
532 ! is less than one
533 if (snnew < done) then
534 ! -- calculate newton terms for specific yield
535 if (snnew > dzero) then
536 rterm = -rho2 * tthk * snnew
537 drterm = -rho2 * tthk * derv
538 call matrix_sln%add_value_pos(idxglo(idiag), drterm + rho2)
539 rhs(n) = rhs(n) - rterm + drterm * h + rho2 * bt
540 end if
541 end if
542 end if
543
Here is the call graph for this function:

◆ log_options()

subroutine gwfstomodule::log_options ( class(gwfstotype) this,
type(gwfstoparamfoundtype), intent(in) found )

Log options block for STO package.

Parameters
thisGwfStoType object

Definition at line 1030 of file gwf-sto.f90.

1031 ! -- modules
1034 ! -- dummy variables
1035 class(GwfStoType) :: this !< GwfStoType object
1036 type(GwfStoParamFoundType), intent(in) :: found
1037 ! -- local variables
1038 ! -- formats
1039 character(len=*), parameter :: fmtisvflow = &
1040 "(4x,'CELL-BY-CELL FLOW INFORMATION WILL BE SAVED TO BINARY FILE &
1041 &WHENEVER ICBCFL IS NOT ZERO.')"
1042 character(len=*), parameter :: fmtflow = &
1043 &"(4x, 'FLOWS WILL BE SAVED TO FILE: ', a, /4x, 'OPENED ON UNIT: ', I7)"
1044 character(len=*), parameter :: fmtorigss = &
1045 "(4X,'ORIGINAL_SPECIFIC_STORAGE OPTION:',/, &
1046 &1X,'The original specific storage formulation will be used')"
1047 character(len=*), parameter :: fmtstoc = &
1048 "(4X,'STORAGECOEFFICIENT OPTION:',/, &
1049 &1X,'Read storage coefficient rather than specific storage')"
1050 character(len=*), parameter :: fmtconfss = &
1051 "(4X,'SS_CONFINED_ONLY OPTION:',/, &
1052 &1X,'Specific storage changes only occur under confined conditions')"
1053 !
1054 write (this%iout, '(1x,a)') 'PROCESSING STORAGE OPTIONS'
1055 !
1056 if (found%ipakcb) then
1057 write (this%iout, fmtisvflow)
1058 end if
1059 !
1060 if (found%istor_coef) then
1061 write (this%iout, fmtstoc)
1062 end if
1063 !
1064 if (found%ss_confined_only) then
1065 write (this%iout, fmtconfss)
1066 end if
1067 !
1068 if (found%iorig_ss) then
1069 write (this%iout, fmtorigss)
1070 end if
1071 !
1072 if (found%iconf_ss) then
1073 write (this%iout, fmtconfss)
1074 end if
1075 !
1076 write (this%iout, '(1x,a)') 'END OF STORAGE OPTIONS'

◆ save_old_ss_sy()

subroutine gwfstomodule::save_old_ss_sy ( class(gwfstotype) this)

Save ss and sy values from the previous time step for use with storage integration when integratechanges is non-zero.

Parameters
thisGwfStoType object

Definition at line 1180 of file gwf-sto.f90.

1181 ! -- modules
1183 ! -- dummy variables
1184 class(GwfStoType) :: this !< GwfStoType object
1185 ! -- local variables
1186 integer(I4B) :: n
1187 !
1188 ! -- Allocate TVS arrays if needed
1189 if (.not. associated(this%oldss)) then
1190 call mem_allocate(this%oldss, this%dis%nodes, 'OLDSS', this%memoryPath)
1191 end if
1192 if (this%iusesy == 1 .and. .not. associated(this%oldsy)) then
1193 call mem_allocate(this%oldsy, this%dis%nodes, 'OLDSY', this%memoryPath)
1194 end if
1195 !
1196 ! -- Save current specific storage
1197 do n = 1, this%dis%nodes
1198 this%oldss(n) = this%ss(n)
1199 end do
1200 !
1201 ! -- Save current specific yield, if used
1202 if (this%iusesy == 1) then
1203 do n = 1, this%dis%nodes
1204 this%oldsy(n) = this%sy(n)
1205 end do
1206 end if

◆ source_data()

subroutine gwfstomodule::source_data ( class(gwfstotype) this)

Source griddata block parameters for STO package.

Parameters
thisGwfStoType object

Definition at line 1084 of file gwf-sto.f90.

1085 ! -- modules
1088 ! -- dummy variables
1089 class(GwfStotype) :: this !< GwfStoType object
1090 ! -- local variables
1091 character(len=LINELENGTH) :: cellstr
1092 logical(LGP) :: isconv
1093 character(len=24), dimension(4) :: aname
1094 integer(I4B) :: n
1095 integer(I4B), dimension(:), pointer, contiguous :: map
1096 type(GwfStoParamFoundType) :: found
1097 !
1098 ! -- initialize data
1099 data aname(1)/' ICONVERT'/
1100 data aname(2)/' SPECIFIC STORAGE'/
1101 data aname(3)/' SPECIFIC YIELD'/
1102 !
1103 ! -- set map to reduce data input arrays
1104 map => null()
1105 if (this%dis%nodes < this%dis%nodesuser) map => this%dis%nodeuser
1106 !
1107 ! -- copy data from input context
1108 call mem_set_value(this%iconvert, 'ICONVERT', this%input_mempath, map, &
1109 found%iconvert)
1110 call mem_set_value(this%ss, 'SS', this%input_mempath, map, found%ss)
1111 call mem_set_value(this%sy, 'SY', this%input_mempath, map, found%sy)
1112 !
1113 ! -- Check for ICONVERT
1114 if (found%iconvert) then
1115 isconv = .false.
1116 do n = 1, this%dis%nodes
1117 if (this%iconvert(n) /= 0) then
1118 isconv = .true.
1119 this%iusesy = 1
1120 exit
1121 end if
1122 end do
1123 else
1124 write (errmsg, '(a, a, a)') 'Error in GRIDDATA block: ', &
1125 trim(adjustl(aname(1))), ' not found.'
1126 call store_error(errmsg)
1127 end if
1128 !
1129 ! -- Check for SS
1130 if (found%ss) then
1131 ! no-op
1132 else
1133 write (errmsg, '(a, a, a)') 'Error in GRIDDATA block: ', &
1134 trim(adjustl(aname(2))), ' not found.'
1135 call store_error(errmsg)
1136 end if
1137 !
1138 ! -- Check for SY
1139 if (found%sy) then
1140 ! no-op
1141 else
1142 if (isconv) then
1143 write (errmsg, '(a, a, a)') 'Error in GRIDDATA block: ', &
1144 trim(adjustl(aname(3))), ' not found.'
1145 call store_error(errmsg)
1146 end if
1147 end if
1148 !
1149 if (count_errors() > 0) then
1150 call store_error_filename(this%input_fname)
1151 end if
1152 !
1153 ! -- Check SS and SY for negative values
1154 do n = 1, this%dis%nodes
1155 if (this%ss(n) < dzero) then
1156 call this%dis%noder_to_string(n, cellstr)
1157 write (errmsg, '(a,2(1x,a),1x,g0,1x,a)') &
1158 'Error in SS DATA: SS value in cell', trim(adjustl(cellstr)), &
1159 'is less than zero (', this%ss(n), ').'
1160 call store_error(errmsg)
1161 end if
1162 if (found%sy) then
1163 if (this%sy(n) < dzero) then
1164 call this%dis%noder_to_string(n, cellstr)
1165 write (errmsg, '(a,2(1x,a),1x,g0,1x,a)') &
1166 'Error in SY DATA: SY value in cell', trim(adjustl(cellstr)), &
1167 'is less than zero (', this%sy(n), ').'
1168 call store_error(errmsg)
1169 end if
1170 end if
1171 end do
Here is the call graph for this function:

◆ source_options()

subroutine gwfstomodule::source_options ( class(gwfstotype) this)

Source options block parameters for STO package.

Parameters
thisGwfStoType object

Definition at line 968 of file gwf-sto.f90.

969 ! -- modules
970 use constantsmodule, only: lenmempath
976 ! -- dummy variables
977 class(GwfStoType) :: this !< GwfStoType object
978 ! -- local variables
979 type(GwfStoParamFoundType) :: found
980 type(CharacterStringType), dimension(:), pointer, contiguous :: tvs6_mempaths
981 character(len=LINELENGTH) :: tvs6_filename
982 character(len=LENMEMPATH) :: tvs6_mempath
983 !
984 ! -- source package input
985 call mem_set_value(this%ipakcb, 'IPAKCB', this%input_mempath, found%ipakcb)
986 call mem_set_value(this%istor_coef, 'ISTOR_COEF', this%input_mempath, &
987 found%istor_coef)
988 call mem_set_value(this%iconf_ss, 'SS_CONFINED_ONLY', this%input_mempath, &
989 found%ss_confined_only)
990 call mem_set_value(this%iorig_ss, 'IORIG_SS', this%input_mempath, &
991 found%iorig_ss)
992 call mem_set_value(this%iconf_ss, 'ICONF_SS', this%input_mempath, &
993 found%iconf_ss)
994 !
995 if (found%ipakcb) then
996 this%ipakcb = -1
997 end if
998 !
999 if (found%ss_confined_only) then
1000 this%iorig_ss = 0
1001 end if
1002 !
1003 ! -- TVS6 subpackage
1004 if (filein_fname(tvs6_filename, 'TVS6_FILENAME', &
1005 this%input_mempath, this%input_fname)) then
1006 call mem_setptr(tvs6_mempaths, 'TVS6_MEMPATH', this%input_mempath)
1007 tvs6_mempath = tvs6_mempaths(1)
1008 this%intvs = 1 ! tvs active
1009 call tvs_cr(this%tvs, this%name_model, tvs6_mempath, this%intvs, this%iout)
1010 end if
1011 !
1012 if (found%iconf_ss) then
1013 this%iorig_ss = 0
1014 end if
1015 !
1016 ! -- log found options
1017 call this%log_options(found)
1018 !
1019 ! -- set omega value used for saturation calculations
1020 if (this%inewton > 0) then
1021 this%satomega = dem6
1022 end if
This module contains simulation constants.
Definition Constants.f90:9
real(dp), parameter dem6
real constant 1e-6
integer(i4b), parameter lenmempath
maximum length of the memory path
Definition Constants.f90:27
subroutine, public get_isize(name, mem_path, isize)
Get the number of elements for this variable.
This module contains the SourceCommonModule.
logical(lgp) function, public filein_fname(filename, tagname, input_mempath, input_fname)
enforce and set a single input filename provided via FILEIN keyword
This class is used to store a single deferred-length character string. It was designed to work in an ...
Here is the call graph for this function:

◆ sto_ad()

subroutine gwfstomodule::sto_ad ( class(gwfstotype) this)

Advance data in the STO package.

Parameters
thisGwfStoType object

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

237 ! -- modules
238 use tdismodule, only: kstp
239 ! -- dummy variables
240 class(GwfStoType) :: this !< GwfStoType object
241 !
242 ! -- Store ss and sy values from end of last time step if needed
243 if (this%integratechanges /= 0 .and. kstp > 1) then
244 call this%save_old_ss_sy()
245 end if
246 !
247 ! -- TVS
248 if (this%intvs /= 0) then
249 call this%tvs%ad()
250 end if
integer(i4b), pointer, public kstp
current time step number
Definition tdis.f90:27

◆ sto_ar()

subroutine gwfstomodule::sto_ar ( class(gwfstotype) 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
thisGwfStoType object
[in]dismodel discretization object
iboundmodel ibound array

Definition at line 135 of file gwf-sto.f90.

136 ! -- modules
139 ! -- dummy variables
140 class(GwfStoType) :: this !< GwfStoType object
141 class(DisBaseType), pointer, intent(in) :: dis !< model discretization object
142 integer(I4B), dimension(:), pointer, contiguous :: ibound !< model ibound array
143 ! -- local variables
144 ! -- formats
145 character(len=*), parameter :: fmtsto = &
146 "(1x,/1x,'STO -- STORAGE PACKAGE, VERSION 1, 5/19/2014', &
147 &' INPUT READ FROM MEMPATH: ', A, //)"
148 !
149 ! --print a message identifying the storage package.
150 write (this%iout, fmtsto) this%input_mempath
151 !
152 ! -- store pointers to arguments that were passed in
153 this%dis => dis
154 this%ibound => ibound
155 !
156 ! -- set pointer to gwf iss
157 call mem_setptr(this%iss, 'ISS', create_mem_path(this%name_model))
158 !
159 ! -- Allocate arrays
160 call this%allocate_arrays(dis%nodes)
161 !!
162 !! -- Register side effect handlers
163 !call this%register_handlers()
164 !
165 ! -- Read storage options
166 call this%source_options()
167 !
168 ! -- read the data block
169 call this%source_data()
170 !
171 ! -- TVS
172 if (this%intvs /= 0) then
173 call this%tvs%ar(this%dis)
174 end if
175
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 gwfstomodule::sto_bd ( class(gwfstotype) 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
thisGwfStoType object
[in]isuppress_outputflag to suppress model output
[in,out]model_budgetmodel budget object

Definition at line 730 of file gwf-sto.f90.

731 ! -- modules
732 use tdismodule, only: delt
734 ! -- dummy variables
735 class(GwfStoType) :: this !< GwfStoType object
736 integer(I4B), intent(in) :: isuppress_output !< flag to suppress model output
737 type(BudgetType), intent(inout) :: model_budget !< model budget object
738 ! -- local variables
739 integer(I4B) :: i
740 real(DP) :: rin
741 real(DP) :: rout
742 !
743 ! -- Add external storage rates to model budget
744 do i = 1, max_ext_sto_forms
745 if (this%sto_formulations(i)%is_active) then
746 call this%sto_formulations(i)%form%bd(isuppress_output, model_budget)
747 end if
748 end do
749 !
750 ! -- Add confined storage rates to model budget
751 call rate_accumulator(this%strgss, rin, rout)
752 call model_budget%addentry(rin, rout, delt, budtxt(1), &
753 isuppress_output, ' STORAGE')
754 !
755 ! -- Add unconfined storage rates to model budget (TODO_UZR: extension as a separate entry?)
756 if (this%iusesy == 1) then
757 call rate_accumulator(this%strgsy, rin, rout)
758 call model_budget%addentry(rin, rout, delt, budtxt(2), &
759 isuppress_output, ' STORAGE')
760 end if
subroutine, public rate_accumulator(flow, rin, rout)
Rate accumulator subroutine.
Definition Budget.f90:634
Here is the call graph for this function:

◆ sto_cq()

subroutine gwfstomodule::sto_cq ( class(gwfstotype) this,
real(dp), dimension(:), intent(inout), contiguous flowja,
real(dp), dimension(:), intent(in), contiguous hnew,
real(dp), dimension(:), intent(in), contiguous hold )

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

Parameters
thisGwfStoType object
[in,out]flowjaconnection flows
[in]hnewcurrent head
[in]holdprevious head

Definition at line 552 of file gwf-sto.f90.

553 ! -- dummy variables
554 class(GwfStoType) :: this !< GwfStoType object
555 real(DP), dimension(:), contiguous, intent(inout) :: flowja !< connection flows
556 real(DP), dimension(:), contiguous, intent(in) :: hnew !< current head
557 real(DP), dimension(:), contiguous, intent(in) :: hold !< previous head
558 ! -- local variables
559 integer(I4B) :: n
560 integer(I4B) :: iform
561 !
562 ! -- reset storage rates
563 do n = 1, this%dis%nodes
564 this%strgss(n) = dzero
565 this%strgsy(n) = dzero
566 end do
567 !
568 if (this%iss == 1) return !< no storage for steady state period
569 !
570 ! -- Each active formulation runs over all cells and adds its storage
571 ! change; the default storage formulation is always active.
572 call this%default_form%cq(flowja, hnew, hold)
573 do iform = 1, max_ext_sto_forms
574 if (this%sto_formulations(iform)%is_active) then
575 call this%sto_formulations(iform)%form%cq(flowja, hnew, hold)
576 end if
577 end do

◆ sto_cr()

subroutine, public gwfstomodule::sto_cr ( type(gwfstotype), pointer stoobj,
character(len=*), intent(in) name_model,
character(len=*), intent(in) mempath,
integer(i4b), intent(in) inunit,
integer(i4b), intent(in) iout )

Create a new storage (STO) object

Parameters
stoobjGwfStoType object
[in]name_modelname of model
[in]mempathinput context mem path
[in]inunitpackage input file unit
[in]ioutmodel listing file unit

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

109 ! -- dummy variables
110 type(GwfStoType), pointer :: stoobj !< GwfStoType object
111 character(len=*), intent(in) :: name_model !< name of model
112 character(len=*), intent(in) :: mempath !< input context mem path
113 integer(I4B), intent(in) :: inunit !< package input file unit
114 integer(I4B), intent(in) :: iout !< model listing file unit
115 !
116 ! -- Create the object
117 allocate (stoobj)
118 !
119 ! -- create name and memory path
120 call stoobj%set_names(1, name_model, 'STO', 'STO', mempath)
121 !
122 ! -- Allocate scalars
123 call stoobj%allocate_scalars()
124 !
125 ! -- Set variables
126 stoobj%inunit = inunit
127 stoobj%iout = iout
Here is the caller graph for this function:

◆ sto_da()

subroutine gwfstomodule::sto_da ( class(gwfstotype) this)

Deallocate STO package scalars and arrays.

Parameters
thisGwfStoType object

Definition at line 821 of file gwf-sto.f90.

822 ! -- modules
824 ! -- dummy variables
825 class(GwfStoType) :: this !< GwfStoType object
826 !
827 ! -- TVS
828 if (this%intvs /= 0) then
829 call this%tvs%da()
830 deallocate (this%tvs)
831 end if
832 !
833 ! -- Deallocate arrays if package is active
834 if (this%inunit > 0) then
835 call mem_deallocate(this%iconvert)
836 call mem_deallocate(this%ss)
837 call mem_deallocate(this%sy)
838 call mem_deallocate(this%strgss)
839 call mem_deallocate(this%strgsy)
840 call mem_deallocate(this%iformulation)
841 !
842 ! -- deallocate the default storage formulation
843 if (associated(this%default_form)) then
844 deallocate (this%default_form)
845 this%default_form => null()
846 end if
847 !
848 ! -- deallocate TVS arrays
849 if (associated(this%oldss)) then
850 call mem_deallocate(this%oldss)
851 end if
852 if (associated(this%oldsy)) then
853 call mem_deallocate(this%oldsy)
854 end if
855 !
856 ! -- nullify input context pointers
857 nullify (this%iper)
858 nullify (this%storage)
859 end if
860 !
861 ! -- Deallocate scalars
862 call mem_deallocate(this%istor_coef)
863 call mem_deallocate(this%iconf_ss)
864 call mem_deallocate(this%iorig_ss)
865 call mem_deallocate(this%iusesy)
866 call mem_deallocate(this%satomega)
867 call mem_deallocate(this%integratechanges)
868 call mem_deallocate(this%intvs)
869 !
870 ! -- deallocate parent
871 call this%NumericalPackageType%da()

◆ sto_fc()

subroutine gwfstomodule::sto_fc ( class(gwfstotype) this,
integer(i4b), intent(in) kiter,
real(dp), dimension(:), intent(in) hold,
real(dp), dimension(:), intent(in) hnew,
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.

Parameters
thisGwfStoType object
[in]kiterouter iteration number
[in]holdprevious heads
[in]hnewcurrent heads
matrix_slnA matrix
[in]idxgloglobal index model to solution
[in,out]rhsright-hand side

Definition at line 258 of file gwf-sto.f90.

259 use tdismodule, only: delt
260 ! -- dummy variables
261 class(GwfStoType) :: this !< GwfStoType object
262 integer(I4B), intent(in) :: kiter !< outer iteration number
263 real(DP), intent(in), dimension(:) :: hold !< previous heads
264 real(DP), intent(in), dimension(:) :: hnew !< current heads
265 class(MatrixBaseType), pointer :: matrix_sln !< A matrix
266 integer(I4B), intent(in), dimension(:) :: idxglo !< global index model to solution
267 real(DP), intent(inout), dimension(:) :: rhs !< right-hand side
268 ! -- local variables
269 integer(I4B) :: iform
270 ! -- formats
271 character(len=*), parameter :: fmtsperror = &
272 &"('DETECTED TIME STEP LENGTH OF ZERO. GWF STORAGE PACKAGE CANNOT BE ', &
273 &'USED UNLESS DELT IS NON-ZERO.')"
274 !
275 ! -- test if steady-state stress period
276 if (this%iss /= 0) return
277 !
278 ! -- Ensure time step length is not zero
279 if (delt == dzero) then
280 write (errmsg, fmtsperror)
281 call store_error(errmsg, terminate=.true.)
282 end if
283 !
284 ! -- Each active formulation runs over all cells and adds its storage
285 ! terms; the default storage formulation is always active.
286 call this%default_form%fc(kiter, matrix_sln, rhs, idxglo, hold, hnew)
287 do iform = 1, max_ext_sto_forms
288 if (this%sto_formulations(iform)%is_active) then
289 call this%sto_formulations(iform)%form%fc( &
290 kiter, matrix_sln, rhs, idxglo, hold, hnew)
291 end if
292 end do
Here is the call graph for this function:

◆ sto_fn()

subroutine gwfstomodule::sto_fn ( class(gwfstotype) this,
integer(i4b), intent(in) kiter,
real(dp), dimension(:), intent(in) hold,
real(dp), dimension(:), intent(in) hnew,
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 STO package with Newton-Raphson terms.

Parameters
thisGwfStoType object
[in]kiterouter iteration number
[in]holdprevious heads
[in]hnewcurrent heads
matrix_slnA matrix
[in]idxgloglobal index model to solution
[in,out]rhsright-hand side

Definition at line 422 of file gwf-sto.f90.

423 ! -- dummy variables
424 class(GwfStoType) :: this !< GwfStoType object
425 integer(I4B), intent(in) :: kiter !< outer iteration number
426 real(DP), intent(in), dimension(:) :: hold !< previous heads
427 real(DP), intent(in), dimension(:) :: hnew !< current heads
428 class(MatrixBaseType), pointer :: matrix_sln !< A matrix
429 integer(I4B), intent(in), dimension(:) :: idxglo !< global index model to solution
430 real(DP), intent(inout), dimension(:) :: rhs !< right-hand side
431 ! -- local variables
432 integer(I4B) :: iform
433 !
434 ! -- test if steady-state stress period
435 if (this%iss /= 0) return
436 !
437 ! -- Each active formulation runs over all cells and adds its newton
438 ! terms; the default storage formulation is always active.
439 call this%default_form%fn(kiter, matrix_sln, rhs, idxglo, hold, hnew)
440 do iform = 1, max_ext_sto_forms
441 if (this%sto_formulations(iform)%is_active) then
442 call this%sto_formulations(iform)%form%fn( &
443 kiter, matrix_sln, rhs, idxglo, hold, hnew)
444 end if
445 end do

◆ sto_rp()

subroutine gwfstomodule::sto_rp ( class(gwfstotype) this)

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

Parameters
thisGwfStoType object

Definition at line 183 of file gwf-sto.f90.

184 ! -- modules
185 use tdismodule, only: kper
186 implicit none
187 ! -- dummy variables
188 class(GwfStoType) :: this !< GwfStoType object
189 ! -- local variables
190 character(len=16) :: css(0:1)
191 ! -- data
192 data css(0)/' TRANSIENT'/
193 data css(1)/' STEADY-STATE'/
194 !
195 ! -- Store ss and sy values from end of last stress period if needed
196 if (this%integratechanges /= 0) then
197 call this%save_old_ss_sy()
198 end if
199 !
200 ! -- confirm package is active
201 if (this%inunit <= 0) return
202 !
203 ! -- process STO period data if loaded for this period
204 if (this%iper == kper) then
205 write (this%iout, '(//,1x,a)') 'PROCESSING STORAGE PERIOD DATA'
206 !
207 ! -- set period iss
208 if (this%storage == 'STEADY-STATE') then
209 this%iss = 1
210 else if (this%storage == 'TRANSIENT') then
211 this%iss = 0
212 else
213 write (errmsg, '(a,a)') 'Unknown STORAGE data tag: ', &
214 trim(this%storage)
215 call store_error(errmsg)
216 call store_error_filename(this%input_fname)
217 end if
218 !
219 write (this%iout, '(1x,a)') 'END PROCESSING STORAGE PERIOD DATA'
220 !
221 write (this%iout, '(//1X,A,I0,A,A,/)') &
222 'STRESS PERIOD ', kper, ' IS ', trim(adjustl(css(this%iss)))
223 end if
224 !
225 ! -- TVS (has its own PERIOD blocks independent of STO)
226 if (this%intvs /= 0) then
227 call this%tvs%rp()
228 end if
integer(i4b), pointer, public kper
current stress period number
Definition tdis.f90:26
Here is the call graph for this function:

◆ sto_save_model_flows()

subroutine gwfstomodule::sto_save_model_flows ( class(gwfstotype) this,
integer(i4b), intent(in) icbcfl,
integer(i4b), intent(in) icbcun )

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

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

Definition at line 768 of file gwf-sto.f90.

769 ! -- dummy variables
770 class(GwfStoType) :: this !< GwfStoType object
771 integer(I4B), intent(in) :: icbcfl !< flag to output budget data
772 integer(I4B), intent(in) :: icbcun !< cell-by-cell file unit number
773 ! -- local variables
774 integer(I4B) :: iform
775 integer(I4B) :: ibinun
776 integer(I4B) :: iprint, nvaluesp, nwidthp
777 character(len=1) :: cdatafmp = ' ', editdesc = ' '
778 real(DP) :: dinact
779 !
780 ! -- Set unit number for binary output
781 if (this%ipakcb < 0) then
782 ibinun = icbcun
783 elseif (this%ipakcb == 0) then
784 ibinun = 0
785 else
786 ibinun = this%ipakcb
787 end if
788 if (icbcfl == 0) ibinun = 0
789 !
790 ! -- Record the storage rates if requested
791 if (ibinun /= 0) then
792 iprint = 0
793 dinact = dzero
794 !
795 ! -- external formulations first
796 do iform = 1, max_ext_sto_forms
797 if (this%sto_formulations(iform)%is_active) then
798 call this%sto_formulations(iform)%form%save_flows(iprint, ibinun)
799 end if
800 end do
801 !
802 ! -- storage(ss)
803 call this%dis%record_array(this%strgss, this%iout, iprint, -ibinun, &
804 budtxt(1), cdatafmp, nvaluesp, &
805 nwidthp, editdesc, dinact)
806 !
807 ! -- storage(sy)
808 if (this%iusesy == 1) then
809 call this%dis%record_array(this%strgsy, this%iout, iprint, -ibinun, &
810 budtxt(2), cdatafmp, nvaluesp, &
811 nwidthp, editdesc, dinact)
812 end if
813 end if

Variable Documentation

◆ budtxt

character(len=lenbudtxt), dimension(2) gwfstomodule::budtxt = [' STO-SS', ' STO-SY']

Definition at line 31 of file gwf-sto.f90.