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

Data Types

type  gwemodeltype

Functions/Subroutines

subroutine, public gwe_cr (filename, id, modelname)
 Create a new groundwater energy transport model object.
subroutine gwe_df (this)
 Define packages of the GWE model.
subroutine gwe_ac (this, sparse)
 Add the internal connections of this model to the sparse matrix.
subroutine gwe_mc (this, matrix_sln)
 Map the positions of the GWE model connections in the numerical solution coefficient matrix.
subroutine gwe_ar (this)
 GWE Model Allocate and Read.
subroutine gwe_rp (this)
 GWE Model Read and Prepare.
subroutine gwe_dt (this)
 GWT Model time step size.
subroutine gwe_ad (this)
 GWE Model Time Step Advance.
subroutine gwe_cf (this, kiter)
 GWE Model calculate coefficients.
subroutine gwe_fc (this, kiter, matrix_sln, inwtflag)
 GWE Model fill coefficients.
subroutine gwe_cc (this, innertot, kiter, iend, icnvgmod, cpak, ipak, dpak)
 GWE Model Final Convergence Check.
subroutine gwe_cq (this, icnvg, isuppress_output)
 GWE Model calculate flow.
subroutine gwe_bd (this, icnvg, isuppress_output)
 GWE Model Budget.
subroutine gwe_ot_flow (this, icbcfl, ibudfl, icbcun)
 GWE model output routine.
subroutine gwe_da (this)
 Deallocate.
subroutine gwe_bdentry (this, budterm, budtxt, rowlabel)
 GroundWater Energy Transport Model Budget Entry.
integer(i4b) function gwe_get_iasym (this)
 return 1 if any package causes the matrix to be asymmetric. Otherwise return 0.
subroutine allocate_scalars (this, modelname)
 Allocate memory for non-allocatable members.
subroutine package_create (this, filtyp, ipakid, ipaknum, pakname, mempath, inunit, iout)
 Create boundary condition packages for this model.
class(gwemodeltype) function, pointer, public castasgwemodel (model)
 Cast to GweModelType.
subroutine create_bndpkgs (this, bndpkgs, pkgtypes, pkgnames, mempaths, inunits)
 Source package info and begin to process.
subroutine create_gwe_packages (this, indis)
 Source package info and begin to process.

Variables

character(len=lenvarname), parameter dvt = 'TEMPERATURE '
 dependent variable type, varies based on model type
character(len=lenvarname), parameter dvu = 'ENERGY '
 dependent variable unit of measure, either "mass" or "energy"
character(len=lenvarname), parameter dvua = 'E '
 abbreviation of the dependent variable unit of measure, either "M" or "E"
integer(i4b), parameter, public gwe_nbasepkg = 50
 GWE base package array descriptors.
character(len=lenpackagetype), dimension(gwe_nbasepkg), public gwe_basepkg
integer(i4b), parameter, public gwe_nmultipkg = 50
 GWE multi package array descriptors.
character(len=lenpackagetype), dimension(gwe_nmultipkg), public gwe_multipkg
integer(i4b), parameter niunit_gwe = GWE_NBASEPKG + GWE_NMULTIPKG

Function/Subroutine Documentation

◆ allocate_scalars()

subroutine gwemodule::allocate_scalars ( class(gwemodeltype) this,
character(len=*), intent(in) modelname )
private

A subroutine for allocating the scalars specific to the GWE model type. Additional scalars used by the parent class are allocated by the parent class.

Definition at line 696 of file gwe.f90.

697 ! -- modules
699 ! -- dummy
700 class(GweModelType) :: this
701 character(len=*), intent(in) :: modelname
702 !
703 ! -- Allocate parent class scalars
704 call this%allocate_tsp_scalars(modelname)
705 !
706 ! -- Allocate members that are part of model class
707 call mem_allocate(this%inest, 'INEST', this%memoryPath)
708 call mem_allocate(this%incnd, 'INCND', this%memoryPath)
709 !
710 this%inest = 0
711 this%incnd = 0

◆ castasgwemodel()

class(gwemodeltype) function, pointer, public gwemodule::castasgwemodel ( class(*), pointer model)
Parameters
modelThe object to be cast
Returns
The GWE model

Definition at line 797 of file gwe.f90.

798 ! -- dummy
799 class(*), pointer :: model !< The object to be cast
800 ! -- return
801 class(GweModelType), pointer :: gwemodel !< The GWE model
802 !
803 gwemodel => null()
804 if (.not. associated(model)) return
805 select type (model)
806 type is (gwemodeltype)
807 gwemodel => model
808 end select
Here is the caller graph for this function:

◆ create_bndpkgs()

subroutine gwemodule::create_bndpkgs ( class(gwemodeltype) this,
integer(i4b), dimension(:), intent(inout), allocatable bndpkgs,
type(characterstringtype), dimension(:), intent(inout), pointer, contiguous pkgtypes,
type(characterstringtype), dimension(:), intent(inout), pointer, contiguous pkgnames,
type(characterstringtype), dimension(:), intent(inout), pointer, contiguous mempaths,
integer(i4b), dimension(:), intent(inout), pointer, contiguous inunits )
private

Definition at line 813 of file gwe.f90.

815 ! -- modules
818 ! -- dummy
819 class(GweModelType) :: this
820 integer(I4B), dimension(:), allocatable, intent(inout) :: bndpkgs
821 type(CharacterStringType), dimension(:), contiguous, &
822 pointer, intent(inout) :: pkgtypes
823 type(CharacterStringType), dimension(:), contiguous, &
824 pointer, intent(inout) :: pkgnames
825 type(CharacterStringType), dimension(:), contiguous, &
826 pointer, intent(inout) :: mempaths
827 integer(I4B), dimension(:), contiguous, &
828 pointer, intent(inout) :: inunits
829 ! -- local
830 integer(I4B) :: ipakid, ipaknum
831 character(len=LENFTYPE) :: pkgtype, bndptype
832 character(len=LENPACKAGENAME) :: pkgname
833 character(len=LENMEMPATH) :: mempath
834 integer(I4B), pointer :: inunit
835 integer(I4B) :: n
836 !
837 if (allocated(bndpkgs)) then
838 !
839 ! -- Create stress packages
840 ipakid = 1
841 bndptype = ''
842 do n = 1, size(bndpkgs)
843 !
844 pkgtype = pkgtypes(bndpkgs(n))
845 pkgname = pkgnames(bndpkgs(n))
846 mempath = mempaths(bndpkgs(n))
847 inunit => inunits(bndpkgs(n))
848 !
849 if (bndptype /= pkgtype) then
850 ipaknum = 1
851 bndptype = pkgtype
852 end if
853 !
854 call this%package_create(pkgtype, ipakid, ipaknum, pkgname, mempath, &
855 inunit, this%iout)
856 ipakid = ipakid + 1
857 ipaknum = ipaknum + 1
858 end do
859 !
860 ! -- Cleanup
861 deallocate (bndpkgs)
862 end if
This module contains simulation constants.
Definition Constants.f90:9
integer(i4b), parameter lenpackagename
maximum length of the package name
Definition Constants.f90:23
This class is used to store a single deferred-length character string. It was designed to work in an ...

◆ create_gwe_packages()

subroutine gwemodule::create_gwe_packages ( class(gwemodeltype) this,
integer(i4b), intent(in) indis )
private

Definition at line 867 of file gwe.f90.

868 ! -- modules
875 use gweestmodule, only: est_cr
876 use gwecndmodule, only: cnd_cr
877 ! -- dummy
878 class(GweModelType) :: this
879 integer(I4B), intent(in) :: indis
880 ! -- local
881 type(CharacterStringType), dimension(:), contiguous, &
882 pointer :: pkgtypes => null()
883 type(CharacterStringType), dimension(:), contiguous, &
884 pointer :: pkgnames => null()
885 type(CharacterStringType), dimension(:), contiguous, &
886 pointer :: mempaths => null()
887 integer(I4B), dimension(:), contiguous, &
888 pointer :: inunits => null()
889 character(len=LENMEMPATH) :: model_mempath
890 character(len=LENFTYPE) :: pkgtype
891 character(len=LENPACKAGENAME) :: pkgname
892 character(len=LENMEMPATH) :: mempath
893 integer(I4B), pointer :: inunit
894 integer(I4B), dimension(:), allocatable :: bndpkgs
895 integer(I4B) :: n
896 character(len=LENMEMPATH) :: mempathcnd = ''
897 character(len=LENMEMPATH) :: mempathest = ''
898 !
899 ! -- Set input memory paths, input/model and input/model/namfile
900 model_mempath = create_mem_path(component=this%name, context=idm_context)
901 !
902 ! -- Set pointers to model path package info
903 call mem_setptr(pkgtypes, 'PKGTYPES', model_mempath)
904 call mem_setptr(pkgnames, 'PKGNAMES', model_mempath)
905 call mem_setptr(mempaths, 'MEMPATHS', model_mempath)
906 call mem_setptr(inunits, 'INUNITS', model_mempath)
907 !
908 do n = 1, size(pkgtypes)
909 !
910 ! -- Attributes for this input package
911 pkgtype = pkgtypes(n)
912 pkgname = pkgnames(n)
913 mempath = mempaths(n)
914 inunit => inunits(n)
915 !
916 ! -- Create dis package as it is a prerequisite for other packages
917 select case (pkgtype)
918 case ('EST6')
919 this%inest = 1
920 mempathest = mempath
921 case ('CND6')
922 this%incnd = 1
923 mempathcnd = mempath
924 case ('CTP6', 'ESL6', 'LKE6', 'SFE6', &
925 'MWE6', 'UZE6', 'API6')
926 call expandarray(bndpkgs)
927 bndpkgs(size(bndpkgs)) = n
928 case default
929 ! TODO
930 end select
931 end do
932 !
933 ! -- Create packages that are tied directly to model
934 call est_cr(this%est, this%name, mempathest, this%inest, this%iout, &
935 this%fmi, this%eqnsclfac, this%gwecommon)
936 call cnd_cr(this%cnd, this%name, mempathcnd, this%incnd, this%iout, &
937 this%fmi, this%eqnsclfac, this%gwecommon)
938 !
939 ! -- Check to make sure that required ftype's have been specified
940 call this%ftype_check(indis, this%inest)
941 !
942 call this%create_bndpkgs(bndpkgs, pkgtypes, pkgnames, mempaths, inunits)
subroutine, public cnd_cr(cndobj, name_model, input_mempath, inunit, iout, fmi, eqnsclfac, gwecommon)
Create a new CND object.
Definition gwe-cnd.f90:86
Energy Storage and Transfer (EST) Module.
Definition gwe-est.f90:13
subroutine, public est_cr(estobj, name_model, input_mempath, inunit, iout, fmi, eqnsclfac, gwecommon)
Create a new EST package object.
Definition gwe-est.f90:105
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
This module contains simulation variables.
character(len=linelength) idm_context
Here is the call graph for this function:

◆ gwe_ac()

subroutine gwemodule::gwe_ac ( class(gwemodeltype) this,
type(sparsematrix), intent(inout) sparse )
private

Definition at line 199 of file gwe.f90.

200 ! -- modules
201 use sparsemodule, only: sparsematrix
202 ! -- dummy
203 class(GweModelType) :: this
204 type(sparsematrix), intent(inout) :: sparse
205 ! -- local
206 class(BndType), pointer :: packobj
207 integer(I4B) :: ip
208 !
209 ! -- Add the internal connections of this model to sparse
210 call this%dis%dis_ac(this%moffset, sparse)
211 if (this%incnd > 0) &
212 call this%cnd%cnd_ac(this%moffset, sparse)
213 !
214 ! -- Add any package connections
215 do ip = 1, this%bndlist%Count()
216 packobj => getbndfromlist(this%bndlist, ip)
217 call packobj%bnd_ac(this%moffset, sparse)
218 end do
Here is the call graph for this function:

◆ gwe_ad()

subroutine gwemodule::gwe_ad ( class(gwemodeltype) this)
private

This subroutine calls the attached packages' advance subroutines

Definition at line 347 of file gwe.f90.

348 ! -- modules
350 ! -- dummy
351 class(GweModelType) :: this
352 class(BndType), pointer :: packobj
353 ! -- local
354 integer(I4B) :: irestore
355 integer(I4B) :: ip, n
356 !
357 ! -- Reset state variable
358 irestore = 0
359 if (ifailedstepretry > 0) irestore = 1
360 if (irestore == 0) then
361 !
362 ! -- Copy x into xold
363 do n = 1, this%dis%nodes
364 if (this%ibound(n) == 0) then
365 this%xold(n) = dzero
366 else
367 this%xold(n) = this%x(n)
368 end if
369 end do
370 else
371 !
372 ! -- Copy xold into x if this time step is a redo
373 do n = 1, this%dis%nodes
374 this%x(n) = this%xold(n)
375 end do
376 end if
377 !
378 ! -- Advance fmi
379 call this%fmi%fmi_ad(this%x)
380 !
381 ! -- Advance
382 if (this%incnd > 0) call this%cnd%cnd_ad()
383 if (this%inssm > 0) call this%ssm%ssm_ad()
384 do ip = 1, this%bndlist%Count()
385 packobj => getbndfromlist(this%bndlist, ip)
386 call packobj%bnd_ad()
387 if (isimcheck > 0) then
388 call packobj%bnd_ck()
389 end if
390 end do
391 !
392 ! -- Push simulated values to preceding time/subtime step
393 call this%obs%obs_ad()
integer(i4b) isimcheck
simulation input check flag (1) to check input, (0) to ignore checks
integer(i4b) ifailedstepretry
current retry for this time step
Here is the call graph for this function:

◆ gwe_ar()

subroutine gwemodule::gwe_ar ( class(gwemodeltype) this)
private

This subroutine:

  • allocates and reads packages that are part of this model,
  • allocates memory for arrays used by this model object

Definition at line 251 of file gwe.f90.

252 ! -- modules
253 use constantsmodule, only: dhnoflo
254 ! -- dummy
255 class(GweModelType) :: this
256 ! -- locals
257 integer(I4B) :: ip
258 class(BndType), pointer :: packobj
259 !
260 ! -- Allocate and read modules attached to model
261 call this%fmi%fmi_ar(this%ibound)
262 if (this%inmvt > 0) call this%mvt%mvt_ar()
263 if (this%inic > 0) call this%ic%ic_ar(this%x)
264 if (this%inest > 0) call this%est%est_ar(this%dis, this%ibound)
265 if (this%inadv > 0) call this%adv%adv_ar(this%dis, this%ibound)
266 if (this%incnd > 0) call this%cnd%cnd_ar(this%ibound, this%est%porosity)
267 if (this%inssm > 0) call this%ssm%ssm_ar(this%dis, this%ibound, this%x)
268 if (this%inobs > 0) call this%obs%tsp_obs_ar(this%ic, this%x, this%flowja)
269 !
270 ! -- Set governing equation scale factor
271 this%eqnsclfac = this%gwecommon%gwerhow * this%gwecommon%gwecpw
272 !
273 ! -- Call dis_ar to write binary grid file
274 !call this%dis%dis_ar(this%npf%icelltype)
275 !
276 ! -- Set up output control
277 call this%oc%oc_ar(this%x, this%dis, dhnoflo, this%depvartype)
278 call this%budget%set_ibudcsv(this%oc%ibudcsv)
279 !
280 ! -- Package input files now open, so allocate and read
281 do ip = 1, this%bndlist%Count()
282 packobj => getbndfromlist(this%bndlist, ip)
283 call packobj%set_pointers(this%dis%nodes, this%ibound, this%x, &
284 this%xold, this%flowja)
285 ! -- Read and allocate package
286 call packobj%bnd_ar()
287 end do
real(dp), parameter dhnoflo
real no flow constant
Definition Constants.f90:93
Here is the call graph for this function:

◆ gwe_bd()

subroutine gwemodule::gwe_bd ( class(gwemodeltype) this,
integer(i4b), intent(in) icnvg,
integer(i4b), intent(in) isuppress_output )
private

This subroutine:

  • calculates intercell flows (flowja)
  • calculates package contributions to the model budget

Definition at line 532 of file gwe.f90.

533 ! -- dummy
534 class(GweModelType) :: this
535 integer(I4B), intent(in) :: icnvg
536 integer(I4B), intent(in) :: isuppress_output
537 ! -- local
538 integer(I4B) :: ip
539 class(BndType), pointer :: packobj
540 !
541 ! -- Save the solution convergence flag
542 this%icnvg = icnvg
543 !
544 ! -- Budget routines (start by resetting). Sole purpose of this section
545 ! is to add in and outs to model budget. All ins and out for a model
546 ! should be added here to this%budget. In a subsequent exchange call,
547 ! exchange flows might also be added.
548 call this%budget%reset()
549 if (this%inest > 0) call this%est%est_bd(isuppress_output, this%budget)
550 if (this%inssm > 0) call this%ssm%ssm_bd(isuppress_output, this%budget)
551 if (this%infmi > 0) call this%fmi%fmi_bd(isuppress_output, this%budget)
552 if (this%inmvt > 0) call this%mvt%mvt_bd()
553 do ip = 1, this%bndlist%Count()
554 packobj => getbndfromlist(this%bndlist, ip)
555 call packobj%bnd_bd(this%budget)
556 end do
Here is the call graph for this function:

◆ gwe_bdentry()

subroutine gwemodule::gwe_bdentry ( class(gwemodeltype) this,
real(dp), dimension(:, :), intent(in) budterm,
character(len=lenbudtxt), dimension(:), intent(in) budtxt,
character(len=*), intent(in) rowlabel )
private

This subroutine adds a budget entry to the flow budget. It was added as a method for the gwe model object so that the exchange object could add its contributions.

Definition at line 647 of file gwe.f90.

648 ! -- modules
649 use constantsmodule, only: lenbudtxt
650 use tdismodule, only: delt
651 ! -- dummy
652 class(GweModelType) :: this
653 real(DP), dimension(:, :), intent(in) :: budterm
654 character(len=LENBUDTXT), dimension(:), intent(in) :: budtxt
655 character(len=*), intent(in) :: rowlabel
656 !
657 call this%budget%addentry(budterm, delt, budtxt, rowlabel=rowlabel)
integer(i4b), parameter lenbudtxt
maximum length of a budget component names
Definition Constants.f90:37
real(dp), pointer, public delt
length of the current time step
Definition tdis.f90:32

◆ gwe_cc()

subroutine gwemodule::gwe_cc ( class(gwemodeltype) this,
integer(i4b), intent(in) innertot,
integer(i4b), intent(in) kiter,
integer(i4b), intent(in) iend,
integer(i4b), intent(in) icnvgmod,
character(len=lenpakloc), intent(inout) cpak,
integer(i4b), intent(inout) ipak,
real(dp), intent(inout) dpak )
private

If MVR/MVT is active, this subroutine calls the MVR convergence check subroutines.

Definition at line 465 of file gwe.f90.

466 ! -- dummy
467 class(GweModelType) :: this
468 integer(I4B), intent(in) :: innertot
469 integer(I4B), intent(in) :: kiter
470 integer(I4B), intent(in) :: iend
471 integer(I4B), intent(in) :: icnvgmod
472 character(len=LENPAKLOC), intent(inout) :: cpak
473 integer(I4B), intent(inout) :: ipak
474 real(DP), intent(inout) :: dpak
475 !
476 ! -- If mover is on, then at least 2 outers required
477 if (this%inmvt > 0) call this%mvt%mvt_cc(kiter, iend, icnvgmod, cpak, dpak)

◆ gwe_cf()

subroutine gwemodule::gwe_cf ( class(gwemodeltype) this,
integer(i4b), intent(in) kiter )
private

This subroutine calls the attached packages' calculate coefficients subroutines

Definition at line 401 of file gwe.f90.

402 ! -- dummy
403 class(GweModelType) :: this
404 integer(I4B), intent(in) :: kiter
405 ! -- local
406 class(BndType), pointer :: packobj
407 integer(I4B) :: ip
408 !
409 ! -- Call package cf routines
410 do ip = 1, this%bndlist%Count()
411 packobj => getbndfromlist(this%bndlist, ip)
412 call packobj%bnd_cf()
413 end do
Here is the call graph for this function:

◆ gwe_cq()

subroutine gwemodule::gwe_cq ( class(gwemodeltype) this,
integer(i4b), intent(in) icnvg,
integer(i4b), intent(in) isuppress_output )
private

This subroutine calls the attached packages' intercell flows (flow ja)

Definition at line 484 of file gwe.f90.

485 ! -- modules
486 use sparsemodule, only: csr_diagsum
487 ! -- dummy
488 class(GweModelType) :: this
489 integer(I4B), intent(in) :: icnvg
490 integer(I4B), intent(in) :: isuppress_output
491 ! -- local
492 integer(I4B) :: i
493 integer(I4B) :: ip
494 class(BndType), pointer :: packobj
495 !
496 ! -- Construct the flowja array. Flowja is calculated each time, even if
497 ! output is suppressed. (flowja is positive into a cell.) The diagonal
498 ! position of the flowja array will contain the flow residual after
499 ! these routines are called, so each package is responsible for adding
500 ! its flow to this diagonal position.
501 do i = 1, this%nja
502 this%flowja(i) = dzero
503 end do
504 if (this%inadv > 0) call this%adv%adv_cq(this%x, this%flowja)
505 if (this%incnd > 0) call this%cnd%cnd_cq(this%x, this%flowja)
506 if (this%inest > 0) call this%est%est_cq(this%dis%nodes, this%x, this%xold, &
507 this%flowja)
508 if (this%inssm > 0) call this%ssm%ssm_cq(this%flowja)
509 if (this%infmi > 0) call this%fmi%fmi_cq(this%x, this%flowja)
510 !
511 ! -- Go through packages and call cq routines. cf() routines are called
512 ! first to regenerate non-linear terms to be consistent with the final
513 ! conc solution.
514 do ip = 1, this%bndlist%Count()
515 packobj => getbndfromlist(this%bndlist, ip)
516 call packobj%bnd_cf()
517 call packobj%bnd_cq(this%x, this%flowja)
518 end do
519 !
520 ! -- Finalize calculation of flowja by adding face flows to the diagonal.
521 ! This results in the flow residual being stored in the diagonal
522 ! position for each cell.
523 call csr_diagsum(this%dis%con%ia, this%flowja)
subroutine csr_diagsum(ia, flowja)
Definition Sparse.f90:263
Here is the call graph for this function:

◆ gwe_cr()

subroutine, public gwemodule::gwe_cr ( character(len=*), intent(in) filename,
integer(i4b), intent(in) id,
character(len=*), intent(in) modelname )
Parameters
[in]filenameinput file
[in]idconsecutive model number listed in mfsim.nam
[in]modelnamename of the model

Definition at line 97 of file gwe.f90.

98 ! -- modules
99 use listsmodule, only: basemodellist
105 use budgetmodule, only: budget_cr
107 ! -- dummy
108 character(len=*), intent(in) :: filename !< input file
109 integer(I4B), intent(in) :: id !< consecutive model number listed in mfsim.nam
110 character(len=*), intent(in) :: modelname !< name of the model
111 ! -- local
112 integer(I4B) :: indis
113 type(GweModelType), pointer :: this
114 class(BaseModelType), pointer :: model
115 !
116 ! -- Allocate a new GWE Model (this) and add it to basemodellist
117 allocate (this)
118 !
119 ! -- Set memory path before allocation in memory manager can be done
120 this%memoryPath = create_mem_path(modelname)
121 !
122 ! -- Allocate scalars and add model to basemodellist
123 call this%allocate_scalars(modelname)
124 !
125 ! -- Set labels for transport model - needed by create_packages() below
126 call this%set_tsp_labels(this%macronym, dvt, dvu, dvua)
127 !
128 model => this
130 !
131 ! -- Instantiate shared data container
132 call gweshared_dat_cr(this%gwecommon)
133 !
134 ! -- Call parent class routine
135 call this%tsp_cr(filename, id, modelname, 'GWE', indis)
136 !
137 ! -- Create model packages
138 call this%create_packages(indis)
subroutine, public addbasemodeltolist(list, model)
This module contains the BudgetModule.
Definition Budget.f90:20
subroutine, public budget_cr(this, name_model)
Create a new budget object.
Definition Budget.f90:85
subroutine, public gweshared_dat_cr(gwe_dat)
Allocate the shared data.
type(listtype), public basemodellist
Definition mf6lists.f90:16
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gwe_da()

subroutine gwemodule::gwe_da ( class(gwemodeltype) this)
private

Deallocate memory at conclusion of model run

Definition at line 580 of file gwe.f90.

581 ! -- modules
585 ! -- dummy
586 class(GweModelType) :: this
587 ! -- local
588 integer(I4B) :: ip
589 class(BndType), pointer :: packobj
590 !
591 ! -- Deallocate idm memory
592 call memorystore_remove(this%name, 'NAM', idm_context)
593 call memorystore_remove(component=this%name, context=idm_context)
594 !
595 ! -- Internal flow packages deallocate
596 call this%dis%dis_da()
597 call this%ic%ic_da()
598 call this%fmi%fmi_da()
599 call this%adv%adv_da()
600 call this%cnd%cnd_da()
601 call this%ssm%ssm_da()
602 call this%est%est_da()
603 call this%mvt%mvt_da()
604 call this%budget%budget_da()
605 call this%oc%oc_da()
606 call this%obs%obs_da()
607 call this%gwecommon%gweshared_dat_da()
608 !
609 ! -- Internal package objects
610 deallocate (this%dis)
611 deallocate (this%ic)
612 deallocate (this%fmi)
613 deallocate (this%adv)
614 deallocate (this%cnd)
615 deallocate (this%ssm)
616 deallocate (this%est)
617 deallocate (this%mvt)
618 deallocate (this%budget)
619 deallocate (this%oc)
620 deallocate (this%obs)
621 nullify (this%gwecommon)
622 !
623 ! -- Boundary packages
624 do ip = 1, this%bndlist%Count()
625 packobj => getbndfromlist(this%bndlist, ip)
626 call packobj%bnd_da()
627 deallocate (packobj)
628 end do
629 !
630 ! -- Scalars
631 call mem_deallocate(this%inest)
632 call mem_deallocate(this%incnd)
633 !
634 ! -- Parent class members
635 call this%TransportModelType%tsp_da()
636 !
637 ! -- NumericalModelType
638 call this%NumericalModelType%model_da()
subroutine, public memorystore_remove(component, subcomponent, context)
Here is the call graph for this function:

◆ gwe_df()

subroutine gwemodule::gwe_df ( class(gwemodeltype) this)
private

This subroutine defines a gwe model type. Steps include:

  • call df routines for each package
  • set variables and pointers

Definition at line 147 of file gwe.f90.

148 ! -- modules
149 use simmodule, only: store_error
150 ! -- dummy
151 class(GweModelType) :: this
152 ! -- local
153 integer(I4B) :: ip
154 class(BndType), pointer :: packobj
155 !
156 ! -- Define packages and utility objects
157 call this%dis%dis_df()
158 call this%fmi%fmi_df(this%dis, 0)
159 if (this%inmvt > 0) call this%mvt%mvt_df(this%dis)
160 if (this%inadv > 0) call this%adv%adv_df()
161 if (this%incnd > 0) call this%cnd%cnd_df(this%dis)
162 if (this%inssm > 0) call this%ssm%ssm_df()
163 call this%oc%oc_df()
164 call this%budget%budget_df(niunit_gwe, this%depvarunit, &
165 this%depvarunitabbrev)
166 !
167 ! -- Check for SSM package
168 if (this%inssm == 0) then
169 if (this%fmi%nflowpack > 0) then
170 call store_error('Flow model has boundary packages, but there &
171 &is no SSM package. The SSM package must be activated.', &
172 terminate=.true.)
173 end if
174 end if
175 !
176 ! -- Assign or point model members to dis members
177 this%neq = this%dis%nodes
178 this%nja = this%dis%nja
179 this%ia => this%dis%con%ia
180 this%ja => this%dis%con%ja
181 !
182 ! -- Allocate model arrays, now that neq and nja are assigned
183 call this%allocate_arrays()
184 !
185 ! -- Define packages and assign iout for time series managers
186 do ip = 1, this%bndlist%Count()
187 packobj => getbndfromlist(this%bndlist, ip)
188 call packobj%bnd_df(this%neq, this%dis)
189 packobj%TsManager%iout = this%iout
190 packobj%TasManager%iout = this%iout
191 end do
192 !
193 ! -- Store information needed for observations
194 call this%obs%obs_df(this%iout, this%name, 'GWE', this%dis)
This module contains simulation methods.
Definition Sim.f90:10
subroutine, public store_error(msg, terminate)
Store an error message.
Definition Sim.f90:94
Here is the call graph for this function:

◆ gwe_dt()

subroutine gwemodule::gwe_dt ( class(gwemodeltype) this)
private

Calculate the maximum allowable time step size subject to time-step constraints. If adaptive time steps are used, then the time step used will be no larger than dtmax calculated here.

Definition at line 327 of file gwe.f90.

328 use tdismodule, only: kstp, kper, ats
329 ! dummy
330 class(GweModelType) :: this
331 ! local
332 real(DP) :: dtmax
333 character(len=LINELENGTH) :: msg
334 dtmax = dnodata
335
336 ! advection package courant stability
337 call this%adv%adv_dt(dtmax, msg, this%est%porosity)
338 if (msg /= '') then
339 call ats%ats_submit_delt(kstp, kper, dtmax, msg)
340 end if
class(atstype), pointer, public ats
Definition tdis.f90:48
integer(i4b), pointer, public kstp
current time step number
Definition tdis.f90:27
integer(i4b), pointer, public kper
current stress period number
Definition tdis.f90:26

◆ gwe_fc()

subroutine gwemodule::gwe_fc ( class(gwemodeltype) this,
integer(i4b), intent(in) kiter,
class(matrixbasetype), pointer matrix_sln,
integer(i4b), intent(in) inwtflag )
private

This subroutine calls the attached packages' fill coefficients subroutines

Definition at line 421 of file gwe.f90.

422 ! -- dummy
423 class(GweModelType) :: this
424 integer(I4B), intent(in) :: kiter
425 class(MatrixBaseType), pointer :: matrix_sln
426 integer(I4B), intent(in) :: inwtflag
427 ! -- local
428 class(BndType), pointer :: packobj
429 integer(I4B) :: ip
430 !
431 ! -- Call fc routines
432 call this%fmi%fmi_fc(this%dis%nodes, this%xold, this%nja, matrix_sln, &
433 this%idxglo, this%rhs)
434 if (this%inmvt > 0) then
435 call this%mvt%mvt_fc(this%x, this%x)
436 end if
437 if (this%inest > 0) then
438 call this%est%est_fc(this%dis%nodes, this%xold, this%nja, matrix_sln, &
439 this%idxglo, this%x, this%rhs, kiter)
440 end if
441 if (this%inadv > 0) then
442 call this%adv%adv_fc(this%dis%nodes, matrix_sln, this%idxglo, this%x, &
443 this%rhs)
444 end if
445 if (this%incnd > 0) then
446 call this%cnd%cnd_fc(kiter, this%dis%nodes, this%nja, matrix_sln, &
447 this%idxglo, this%rhs, this%x)
448 end if
449 if (this%inssm > 0) then
450 call this%ssm%ssm_fc(matrix_sln, this%idxglo, this%rhs)
451 end if
452 !
453 ! -- Packages
454 do ip = 1, this%bndlist%Count()
455 packobj => getbndfromlist(this%bndlist, ip)
456 call packobj%bnd_fc(this%rhs, this%ia, this%idxglo, matrix_sln)
457 end do
Here is the call graph for this function:

◆ gwe_get_iasym()

integer(i4b) function gwemodule::gwe_get_iasym ( class(gwemodeltype) this)
private

Definition at line 663 of file gwe.f90.

664 class(GweModelType) :: this
665 ! -- local
666 integer(I4B) :: iasym
667 integer(I4B) :: ip
668 class(BndType), pointer :: packobj
669 !
670 ! -- Start by setting iasym to zero
671 iasym = 0
672 !
673 ! -- ADV
674 if (this%inadv > 0) then
675 if (this%adv%iasym /= 0) iasym = 1
676 end if
677 !
678 ! -- CND
679 if (this%incnd > 0) then
680 if (this%cnd%ixt3d /= 0) iasym = 1
681 end if
682 !
683 ! -- Check for any packages that introduce matrix asymmetry
684 do ip = 1, this%bndlist%Count()
685 packobj => getbndfromlist(this%bndlist, ip)
686 if (packobj%iasym /= 0) iasym = 1
687 end do
Here is the call graph for this function:

◆ gwe_mc()

subroutine gwemodule::gwe_mc ( class(gwemodeltype) this,
class(matrixbasetype), pointer matrix_sln )
private
Parameters
matrix_slnglobal system matrix

Definition at line 224 of file gwe.f90.

225 ! -- dummy
226 class(GweModelType) :: this
227 class(MatrixBaseType), pointer :: matrix_sln !< global system matrix
228 ! -- local
229 class(BndType), pointer :: packobj
230 integer(I4B) :: ip
231 !
232 ! -- Find the position of each connection in the global ia, ja structure
233 ! and store them in idxglo.
234 call this%dis%dis_mc(this%moffset, this%idxglo, matrix_sln)
235 !
236 if (this%incnd > 0) call this%cnd%cnd_mc(this%moffset, matrix_sln)
237 !
238 ! -- Map any package connections
239 do ip = 1, this%bndlist%Count()
240 packobj => getbndfromlist(this%bndlist, ip)
241 call packobj%bnd_mc(this%moffset, matrix_sln)
242 end do
Here is the call graph for this function:

◆ gwe_ot_flow()

subroutine gwemodule::gwe_ot_flow ( class(gwemodeltype) this,
integer(i4b), intent(in) icbcfl,
integer(i4b), intent(in) ibudfl,
integer(i4b), intent(in) icbcun )
private

Save and print flows

Definition at line 563 of file gwe.f90.

564 ! dummy
565 class(GweModelType) :: this
566 integer(I4B), intent(in) :: icbcfl
567 integer(I4B), intent(in) :: ibudfl
568 integer(I4B), intent(in) :: icbcun
569 ! local
570
571 if (this%inest > 0) call this%est%est_ot_flow(icbcfl, icbcun)
572 call this%TransportModelType%tsp_ot_flow(icbcfl, ibudfl, icbcun)
573

◆ gwe_rp()

subroutine gwemodule::gwe_rp ( class(gwemodeltype) this)
private

This subroutine calls the attached packages' read and prepare routines

Definition at line 294 of file gwe.f90.

295 ! -- modules
296 use tdismodule, only: readnewdata
297 ! -- dummy
298 class(GweModelType) :: this
299 ! -- local
300 class(BndType), pointer :: packobj
301 integer(I4B) :: ip
302 !
303 ! -- In fmi, check for mvt and mvrbudobj consistency
304 call this%fmi%fmi_rp(this%inmvt)
305 if (this%inmvt > 0) call this%mvt%mvt_rp()
306 !
307 ! -- Check with TDIS on whether or not it is time to RP
308 if (.not. readnewdata) return
309 !
310 ! -- Read and prepare
311 if (this%inoc > 0) call this%oc%oc_rp()
312 if (this%inssm > 0) call this%ssm%ssm_rp()
313 do ip = 1, this%bndlist%Count()
314 packobj => getbndfromlist(this%bndlist, ip)
315 call packobj%bnd_rp()
316 call packobj%bnd_rp_log()
317 call packobj%bnd_rp_obs()
318 end do
logical(lgp), pointer, public readnewdata
flag indicating time to read new data
Definition tdis.f90:29
Here is the call graph for this function:

◆ package_create()

subroutine gwemodule::package_create ( class(gwemodeltype) this,
character(len=*), intent(in) filtyp,
integer(i4b), intent(in) ipakid,
integer(i4b), intent(in) ipaknum,
character(len=*), intent(in) pakname,
character(len=*), intent(in) mempath,
integer(i4b), intent(in) inunit,
integer(i4b), intent(in) iout )
private

This subroutine calls the package create routines for packages activated by the user.

Definition at line 719 of file gwe.f90.

721 ! -- modules
722 use simmodule, only: store_error
723 use gwectpmodule, only: ctp_create
724 use gweeslmodule, only: esl_create
725 use gwelkemodule, only: lke_create
726 use gwesfemodule, only: sfe_create
727 use gwemwemodule, only: mwe_create
728 use gweuzemodule, only: uze_create
729 use apimodule, only: api_create
730 ! -- dummy
731 class(GweModelType) :: this
732 character(len=*), intent(in) :: filtyp
733 character(len=LINELENGTH) :: errmsg
734 integer(I4B), intent(in) :: ipakid
735 integer(I4B), intent(in) :: ipaknum
736 character(len=*), intent(in) :: pakname
737 character(len=*), intent(in) :: mempath
738 integer(I4B), intent(in) :: inunit
739 integer(I4B), intent(in) :: iout
740 ! -- local
741 class(BndType), pointer :: packobj
742 class(BndType), pointer :: packobj2
743 integer(I4B) :: ip
744 !
745 ! -- This part creates the package object
746 select case (filtyp)
747 case ('CTP6')
748 call ctp_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
749 pakname, this%depvartype, mempath)
750 case ('ESL6')
751 call esl_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
752 pakname, this%gwecommon, mempath)
753 case ('LKE6')
754 call lke_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
755 pakname, mempath, this%fmi, this%eqnsclfac, &
756 this%gwecommon, this%depvartype, this%depvarunit, &
757 this%depvarunitabbrev)
758 case ('SFE6')
759 call sfe_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
760 pakname, mempath, this%fmi, this%eqnsclfac, &
761 this%gwecommon, this%depvartype, this%depvarunit, &
762 this%depvarunitabbrev)
763 case ('MWE6')
764 call mwe_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
765 pakname, mempath, this%fmi, this%eqnsclfac, &
766 this%gwecommon, this%depvartype, this%depvarunit, &
767 this%depvarunitabbrev)
768 case ('UZE6')
769 call uze_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
770 pakname, mempath, this%fmi, this%eqnsclfac, &
771 this%gwecommon, this%depvartype, this%depvarunit, &
772 this%depvarunitabbrev)
773 !case('API6')
774 ! call api_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
775 ! pakname)
776 case default
777 write (errmsg, *) 'Invalid package type: ', filtyp
778 call store_error(errmsg, terminate=.true.)
779 end select
780 !
781 ! -- Packages is the bndlist that is associated with the parent model
782 ! -- The following statement puts a pointer to this package in the ipakid
783 ! -- position of packages.
784 do ip = 1, this%bndlist%Count()
785 packobj2 => getbndfromlist(this%bndlist, ip)
786 if (packobj2%packName == pakname) then
787 write (errmsg, '(a,a)') 'Cannot create package. Package name '// &
788 'already exists: ', trim(pakname)
789 call store_error(errmsg, terminate=.true.)
790 end if
791 end do
792 call addbndtolist(this%bndlist, packobj)
This module contains the API package methods.
subroutine, public api_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath)
Create a new package object.
subroutine, public ctp_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, depvartype, mempath)
Create a new constant temperature package.
Definition gwe-ctp.f90:57
subroutine, public esl_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, gwecommon, input_mempath)
Create an energy source loading package.
Definition gwe-esl.f90:50
subroutine, public lke_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath, fmi, eqnsclfac, gwecommon, dvt, dvu, dvua)
Create a new lke package.
Definition gwe-lke.f90:112
subroutine, public mwe_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath, fmi, eqnsclfac, gwecommon, dvt, dvu, dvua)
Create new MWE package.
Definition gwe-mwe.f90:105
subroutine, public sfe_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath, fmi, eqnsclfac, gwecommon, dvt, dvu, dvua)
Create a new sfe package.
Definition gwe-sfe.f90:117
subroutine, public uze_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath, fmi, eqnsclfac, gwecommon, dvt, dvu, dvua)
Create a new UZE package.
Definition gwe-uze.f90:99
Here is the call graph for this function:

Variable Documentation

◆ dvt

character(len=lenvarname), parameter gwemodule::dvt = 'TEMPERATURE '
private

Definition at line 29 of file gwe.f90.

◆ dvu

character(len=lenvarname), parameter gwemodule::dvu = 'ENERGY '
private

Definition at line 30 of file gwe.f90.

◆ dvua

character(len=lenvarname), parameter gwemodule::dvua = 'E '
private

Definition at line 31 of file gwe.f90.

◆ gwe_basepkg

character(len=lenpackagetype), dimension(gwe_nbasepkg), public gwemodule::gwe_basepkg

Definition at line 72 of file gwe.f90.

72 character(len=LENPACKAGETYPE), dimension(GWE_NBASEPKG) :: GWE_BASEPKG

◆ gwe_multipkg

character(len=lenpackagetype), dimension(gwe_nmultipkg), public gwemodule::gwe_multipkg

Definition at line 85 of file gwe.f90.

85 character(len=LENPACKAGETYPE), dimension(GWE_NMULTIPKG) :: GWE_MULTIPKG

◆ gwe_nbasepkg

integer(i4b), parameter, public gwemodule::gwe_nbasepkg = 50

GWE6 model base package types. Only listed packages are candidates for input and these will be loaded in the order specified.

Definition at line 71 of file gwe.f90.

◆ gwe_nmultipkg

integer(i4b), parameter, public gwemodule::gwe_nmultipkg = 50

GWE6 model multi-instance package types. Only listed packages are candidates for input and these will be loaded in the order specified.

Definition at line 84 of file gwe.f90.

◆ niunit_gwe

integer(i4b), parameter gwemodule::niunit_gwe = GWE_NBASEPKG + GWE_NMULTIPKG
private

Definition at line 91 of file gwe.f90.