MODFLOW 6  version 6.7.0.dev2
USGS Modular Hydrologic Model
transportmodelmodule Module Reference

This module contains the base transport model type. More...

Data Types

type  transportmodeltype
 

Functions/Subroutines

subroutine tsp_cr (this, filename, id, modelname, macronym, indis)
 Create a new generalized transport model object. More...
 
subroutine tsp_df (this)
 Generalized transport model define model. More...
 
subroutine tsp_ac (this, sparse)
 Generalized transport model add connections. More...
 
subroutine tsp_mc (this, matrix_sln)
 Generalized transport model map coefficients. More...
 
subroutine tsp_ar (this)
 Generalized transport model allocate and read. More...
 
subroutine tsp_rp (this)
 Generalized transport model read and prepare. More...
 
subroutine tsp_ad (this)
 Generalized transport model time step advance. More...
 
subroutine tsp_fc (this, kiter, matrix_sln, inwtflag)
 Generalized transport model fill coefficients. More...
 
subroutine tsp_cc (this, innertot, kiter, iend, icnvgmod, cpak, ipak, dpak)
 Generalized transport model final convergence check. More...
 
subroutine tsp_cq (this, icnvg, isuppress_output)
 Generalized transport model calculate flows. More...
 
subroutine tsp_bd (this, icnvg, isuppress_output)
 Generalized transport model budget. More...
 
subroutine tsp_ot (this)
 Generalized transport model output routine. More...
 
subroutine tsp_ot_obs (this)
 Generalized transport model output routine. More...
 
subroutine tsp_ot_flow (this, icbcfl, ibudfl, icbcun)
 Generalized transport model output routine. More...
 
subroutine tsp_ot_flowja (this, nja, flowja, icbcfl, icbcun)
 Generalized transport model output routine. More...
 
subroutine tsp_ot_dv (this, idvsave, idvprint, ipflag)
 Generalized transport model output routine. More...
 
subroutine tsp_ot_bdsummary (this, ibudfl, ipflag)
 Generalized transport model output budget summary. More...
 
subroutine allocate_tsp_scalars (this, modelname)
 Allocate scalar variables for transport model. More...
 
subroutine set_tsp_labels (this, tsptype, depvartype, depvarunit, depvarunitabbrev)
 Define the labels corresponding to the flavor of transport model. More...
 
subroutine tsp_da (this)
 Deallocate memory. More...
 
subroutine ftype_check (this, indis, inmst)
 Generalized transport model routine. More...
 
subroutine log_namfile_options (this, found)
 Write model name file options to list file. More...
 
subroutine create_tsp_packages (this, indis)
 Source package info and begin to process. More...
 
integer(i4b) function tsp_get_idv_scale (this)
 return 1 if option to normalize the x and rhs has been specified. Otherwise return 0. More...
 

Detailed Description

This module contains the base class for transport models.

Function/Subroutine Documentation

◆ allocate_tsp_scalars()

subroutine transportmodelmodule::allocate_tsp_scalars ( class(transportmodeltype this,
character(len=*), intent(in)  modelname 
)

Method to allocate memory for non-allocatable members.

Definition at line 507 of file tsp.f90.

508  ! -- modules
510  ! -- dummy
511  class(TransportModelType) :: this
512  character(len=*), intent(in) :: modelname
513  !
514  ! -- allocate members from (grand)parent class
515  call this%NumericalModelType%allocate_scalars(modelname)
516  !
517  ! -- allocate members that are part of model class
518  call mem_allocate(this%inic, 'INIC', this%memoryPath)
519  call mem_allocate(this%infmi, 'INFMI', this%memoryPath)
520  call mem_allocate(this%inmvt, 'INMVT', this%memoryPath)
521  call mem_allocate(this%inadv, 'INADV', this%memoryPath)
522  call mem_allocate(this%inssm, 'INSSM', this%memoryPath)
523  call mem_allocate(this%inoc, 'INOC ', this%memoryPath)
524  call mem_allocate(this%inobs, 'INOBS', this%memoryPath)
525  call mem_allocate(this%eqnsclfac, 'EQNSCLFAC', this%memoryPath)
526  call mem_allocate(this%idv_scale, 'IDV_SCALE', this%memoryPath)
527 
528  this%inic = 0
529  this%infmi = 0
530  this%inmvt = 0
531  this%inadv = 0
532  this%inssm = 0
533  this%inoc = 0
534  this%inobs = 0
535  this%eqnsclfac = dzero
536  this%idv_scale = 0

◆ create_tsp_packages()

subroutine transportmodelmodule::create_tsp_packages ( class(transportmodeltype this,
integer(i4b), intent(inout)  indis 
)

Definition at line 666 of file tsp.f90.

667  ! -- modules
673  use dismodule, only: dis_cr
674  use disvmodule, only: disv_cr
675  use disumodule, only: disu_cr
676  use tspicmodule, only: ic_cr
677  use tspfmimodule, only: fmi_cr
678  use tspadvmodule, only: adv_cr
679  use tspssmmodule, only: ssm_cr
680  use tspmvtmodule, only: mvt_cr
681  use tspocmodule, only: oc_cr
682  use tspobsmodule, only: tsp_obs_cr
683  ! -- dummy
684  class(TransportModelType) :: this
685  integer(I4B), intent(inout) :: indis ! DIS enabled flag
686  ! -- local
687  type(CharacterStringType), dimension(:), contiguous, &
688  pointer :: pkgtypes => null()
689  type(CharacterStringType), dimension(:), contiguous, &
690  pointer :: pkgnames => null()
691  type(CharacterStringType), dimension(:), contiguous, &
692  pointer :: mempaths => null()
693  integer(I4B), dimension(:), contiguous, &
694  pointer :: inunits => null()
695  character(len=LENMEMPATH) :: model_mempath
696  character(len=LENFTYPE) :: pkgtype
697  character(len=LENPACKAGENAME) :: pkgname
698  character(len=LENMEMPATH) :: mempath
699  integer(I4B), pointer :: inunit
700  integer(I4B) :: n
701  character(len=LENMEMPATH) :: mempathadv = ''
702  character(len=LENMEMPATH) :: mempathfmi = ''
703  character(len=LENMEMPATH) :: mempathic = ''
704  character(len=LENMEMPATH) :: mempathssm = ''
705  !
706  ! -- Initialize
707  indis = 0
708  !
709  ! -- Set input memory paths, input/model and input/model/namfile
710  model_mempath = create_mem_path(component=this%name, context=idm_context)
711  !
712  ! -- Set pointers to model path package info
713  call mem_setptr(pkgtypes, 'PKGTYPES', model_mempath)
714  call mem_setptr(pkgnames, 'PKGNAMES', model_mempath)
715  call mem_setptr(mempaths, 'MEMPATHS', model_mempath)
716  call mem_setptr(inunits, 'INUNITS', model_mempath)
717  !
718  do n = 1, size(pkgtypes)
719  !
720  ! -- Attributes for this input package
721  pkgtype = pkgtypes(n)
722  pkgname = pkgnames(n)
723  mempath = mempaths(n)
724  inunit => inunits(n)
725  !
726  ! -- Create dis package as it is a prerequisite for other packages
727  select case (pkgtype)
728  case ('DIS6')
729  indis = 1
730  call dis_cr(this%dis, this%name, mempath, indis, this%iout)
731  case ('DISV6')
732  indis = 1
733  call disv_cr(this%dis, this%name, mempath, indis, this%iout)
734  case ('DISU6')
735  indis = 1
736  call disu_cr(this%dis, this%name, mempath, indis, this%iout)
737  case ('IC6')
738  this%inic = 1
739  mempathic = mempath
740  case ('FMI6')
741  this%infmi = 1
742  mempathfmi = mempath
743  case ('MVT6', 'MVE6')
744  this%inmvt = inunit
745  case ('ADV6')
746  this%inadv = 1
747  mempathadv = mempath
748  case ('SSM6')
749  this%inssm = 1
750  mempathssm = mempath
751  case ('OC6')
752  this%inoc = inunit
753  case ('OBS6')
754  this%inobs = inunit
755  !case default
756  ! TODO
757  end select
758  end do
759  !
760  ! -- Create packages that are tied directly to model
761  call ic_cr(this%ic, this%name, mempathic, this%inic, this%iout, this%dis, &
762  this%depvartype)
763  call fmi_cr(this%fmi, this%name, mempathfmi, this%infmi, this%iout, &
764  this%eqnsclfac, this%depvartype)
765  call adv_cr(this%adv, this%name, mempathadv, this%inadv, this%iout, &
766  this%fmi, this%eqnsclfac)
767  call ssm_cr(this%ssm, this%name, mempathssm, this%inssm, this%iout, &
768  this%fmi, this%eqnsclfac, this%depvartype)
769  call mvt_cr(this%mvt, this%name, this%inmvt, this%iout, this%fmi, &
770  this%eqnsclfac, this%depvartype)
771  call oc_cr(this%oc, this%name, this%inoc, this%iout)
772  call tsp_obs_cr(this%obs, this%inobs, this%depvartype)
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter linelength
maximum length of a standard line
Definition: Constants.f90:45
integer(i4b), parameter lenpackagename
maximum length of the package name
Definition: Constants.f90:23
Definition: Dis.f90:1
subroutine, public dis_cr(dis, name_model, input_mempath, inunit, iout)
Create a new structured discretization object.
Definition: Dis.f90:99
subroutine, public disu_cr(dis, name_model, input_mempath, inunit, iout)
Create a new unstructured discretization object.
Definition: Disu.f90:127
subroutine, public disv_cr(dis, name_model, input_mempath, inunit, iout)
Create a new discretization by vertices object.
Definition: Disv.f90:111
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
This module contains simulation variables.
Definition: SimVariables.f90:9
character(len=linelength) idm_context
subroutine, public adv_cr(advobj, name_model, input_mempath, inunit, iout, fmi, eqnsclfac)
@ brief Create a new ADV object
Definition: tsp-adv.f90:58
subroutine, public fmi_cr(fmiobj, name_model, input_mempath, inunit, iout, eqnsclfac, depvartype)
Create a new FMI object.
Definition: tsp-fmi.f90:76
subroutine, public ic_cr(ic, name_model, input_mempath, inunit, iout, dis, depvartype)
Create a new initial conditions object.
Definition: tsp-ic.f90:25
subroutine, public mvt_cr(mvt, name_model, inunit, iout, fmi1, eqnsclfac, depvartype, gwfmodelname1, gwfmodelname2, fmi2)
Create a new mover transport object.
Definition: tsp-mvt.f90:75
subroutine, public tsp_obs_cr(obs, inobs, dvt)
Create a new TspObsType object.
Definition: tsp-obs.f90:44
subroutine, public oc_cr(ocobj, name_model, inunit, iout)
@ brief Create TspOcType
Definition: tsp-oc.f90:31
This module contains the TspSsm Module.
Definition: tsp-ssm.f90:8
subroutine, public ssm_cr(ssmobj, name_model, input_mempath, inunit, iout, fmi, eqnsclfac, depvartype)
@ brief Create a new SSM package
Definition: tsp-ssm.f90:82
This class is used to store a single deferred-length character string. It was designed to work in an ...
Definition: CharString.f90:23
Here is the call graph for this function:

◆ ftype_check()

subroutine transportmodelmodule::ftype_check ( class(transportmodeltype this,
integer(i4b), intent(in)  indis,
integer(i4b), intent(in)  inmst 
)

Check to make sure required input files have been specified

Parameters
[in]inmstrepresentative of both inmst and inest depending on model type

Definition at line 591 of file tsp.f90.

592  ! -- modules
593  use constantsmodule, only: linelength
595  ! -- dummy
596  class(TransportModelType) :: this
597  integer(I4B), intent(in) :: indis
598  integer(I4B), intent(in) :: inmst !< representative of both inmst and inest depending on model type
599  ! -- local
600  character(len=LINELENGTH) :: errmsg
601  !
602  ! -- Check for IC6, DIS(u), and MST. Stop if not present.
603  if (this%inic == 0) then
604  write (errmsg, '(a)') &
605  'Initial conditions (IC6) package not specified.'
606  call store_error(errmsg)
607  end if
608  if (indis == 0) then
609  write (errmsg, '(a)') &
610  'Discretization (DIS6 or DISU6) package not specified.'
611  call store_error(errmsg)
612  end if
613  if (inmst == 0) then
614  write (errmsg, '(a)') 'Mass storage and transfer (MST6) &
615  &package not specified.'
616  call store_error(errmsg)
617  end if
618  !
619  if (count_errors() > 0) then
620  write (errmsg, '(a)') 'Required package(s) not specified.'
621  call store_error(errmsg)
622  call store_error_filename(this%filename)
623  end if
This module contains simulation methods.
Definition: Sim.f90:10
subroutine, public store_error(msg, terminate)
Store an error message.
Definition: Sim.f90:92
integer(i4b) function, public count_errors()
Return number of errors.
Definition: Sim.f90:59
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
Definition: Sim.f90:203
Here is the call graph for this function:

◆ log_namfile_options()

subroutine transportmodelmodule::log_namfile_options ( class(transportmodeltype this,
type(gwtnamparamfoundtype), intent(in)  found 
)

Definition at line 628 of file tsp.f90.

629  ! -- modules
631  ! -- dummy
632  class(TransportModelType) :: this
633  type(GwtNamParamFoundType), intent(in) :: found
634  !
635  write (this%iout, '(1x,a)') 'NAMEFILE OPTIONS:'
636  !
637  !
638  if (found%print_input) then
639  write (this%iout, '(4x,a)') 'STRESS PACKAGE INPUT WILL BE PRINTED '// &
640  'FOR ALL MODEL STRESS PACKAGES'
641  end if
642  !
643  if (found%print_flows) then
644  write (this%iout, '(4x,a)') 'PACKAGE FLOWS WILL BE PRINTED '// &
645  'FOR ALL MODEL PACKAGES'
646  end if
647  !
648  if (found%save_flows) then
649  write (this%iout, '(4x,a)') &
650  'FLOWS WILL BE SAVED TO BUDGET FILE SPECIFIED IN OUTPUT CONTROL'
651  end if
652 
653  if (found%idv_scale) then
654  write (this%iout, '(2(3x,a,/),3x,a,/,9x,a,/)') &
655  'X and RHS will be scaled to avoid very large positive or negative', &
656  'dependent variable values in the model IMS package.', &
657  'NOTE: Specified outer and inner DVCLOSE values in the model IMS &
658  &package', 'will be relative closure criteria.'
659  end if
660  !
661  write (this%iout, '(1x,a)') 'END NAMEFILE OPTIONS:'

◆ set_tsp_labels()

subroutine transportmodelmodule::set_tsp_labels ( class(transportmodeltype this,
character(len=*), intent(in), pointer  tsptype,
character(len=*), intent(in)  depvartype,
character(len=*), intent(in)  depvarunit,
character(len=*), intent(in)  depvarunitabbrev 
)

Set variable names according to type of transport model

Parameters
[in]tsptypetype of model, default is GWT (alternative is GWE)
[in]depvartypedependent variable type, default is "CONCENTRATION"
[in]depvarunitunits of dependent variable for writing to list file
[in]depvarunitabbrevabbreviation of associated units

Definition at line 544 of file tsp.f90.

546  class(TransportModelType) :: this
547  character(len=*), intent(in), pointer :: tsptype !< type of model, default is GWT (alternative is GWE)
548  character(len=*), intent(in) :: depvartype !< dependent variable type, default is "CONCENTRATION"
549  character(len=*), intent(in) :: depvarunit !< units of dependent variable for writing to list file
550  character(len=*), intent(in) :: depvarunitabbrev !< abbreviation of associated units
551  !
552  ! -- Set the model type
553  this%tsptype = tsptype
554  !
555  ! -- Set the type of dependent variable being solved for
556  this%depvartype = depvartype
557  !
558  ! -- Set the units associated with the dependent variable
559  this%depvarunit = depvarunit
560  !
561  ! -- Set the units abbreviation
562  this%depvarunitabbrev = depvarunitabbrev

◆ tsp_ac()

subroutine transportmodelmodule::tsp_ac ( class(transportmodeltype this,
type(sparsematrix), intent(inout)  sparse 
)
private

This subroutine extended by either GWT or GWE. This routine adds the internal connections of this model to the sparse matrix

Definition at line 171 of file tsp.f90.

172  ! -- modules
173  use sparsemodule, only: sparsematrix
174  ! -- dummy
175  class(TransportModelType) :: this
176  type(sparsematrix), intent(inout) :: sparse

◆ tsp_ad()

subroutine transportmodelmodule::tsp_ad ( class(transportmodeltype this)
private

This subroutine extended by either GWT or GWE. This routine calls the advance time step (ad) routines of attached packages.

Definition at line 217 of file tsp.f90.

218  ! -- dummy
219  class(TransportModelType) :: this

◆ tsp_ar()

subroutine transportmodelmodule::tsp_ar ( class(transportmodeltype this)
private

This subroutine extended by either GWT or GWE. This routine calls the allocate and reads (ar) routines of attached packages and allocates memory for arrays required by the model object.

Definition at line 197 of file tsp.f90.

198  ! -- dummy
199  class(TransportModelType) :: this

◆ tsp_bd()

subroutine transportmodelmodule::tsp_bd ( class(transportmodeltype this,
integer(i4b), intent(in)  icnvg,
integer(i4b), intent(in)  isuppress_output 
)
private

This subroutine extended by either GWT or GWE. This routine calculates package contributions to model budget

Definition at line 269 of file tsp.f90.

270  ! -- dummy
271  class(TransportModelType) :: this
272  integer(I4B), intent(in) :: icnvg
273  integer(I4B), intent(in) :: isuppress_output

◆ tsp_cc()

subroutine transportmodelmodule::tsp_cc ( class(transportmodeltype 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

This subroutine extended by either GWT or GWE. This routine calls the convergence check (cc) routines of attached packages.

Definition at line 240 of file tsp.f90.

241  ! -- dummy
242  class(TransportModelType) :: this
243  integer(I4B), intent(in) :: innertot
244  integer(I4B), intent(in) :: kiter
245  integer(I4B), intent(in) :: iend
246  integer(I4B), intent(in) :: icnvgmod
247  character(len=LENPAKLOC), intent(inout) :: cpak
248  integer(I4B), intent(inout) :: ipak
249  real(DP), intent(inout) :: dpak

◆ tsp_cq()

subroutine transportmodelmodule::tsp_cq ( class(transportmodeltype this,
integer(i4b), intent(in)  icnvg,
integer(i4b), intent(in)  isuppress_output 
)
private

This subroutine extended by either GWT or GWE. This routine calculates intercell flows (flowja)

Definition at line 257 of file tsp.f90.

258  ! -- dummy
259  class(TransportModelType) :: this
260  integer(I4B), intent(in) :: icnvg
261  integer(I4B), intent(in) :: isuppress_output

◆ tsp_cr()

subroutine transportmodelmodule::tsp_cr ( class(transportmodeltype this,
character(len=*), intent(in)  filename,
integer(i4b), intent(in)  id,
character(len=*), intent(in)  modelname,
character(len=*), intent(in)  macronym,
integer(i4b), intent(inout)  indis 
)
private

Create a new transport model that will be further refined into GWT or GWE

Definition at line 95 of file tsp.f90.

96  ! -- modules
101  use budgetmodule, only: budget_cr
102  ! -- dummy
103  class(TransportModelType) :: this
104  character(len=*), intent(in) :: filename
105  integer(I4B), intent(in) :: id
106  integer(I4B), intent(inout) :: indis
107  character(len=*), intent(in) :: modelname
108  character(len=*), intent(in) :: macronym
109  ! -- local
110  character(len=LENMEMPATH) :: input_mempath
111  character(len=LINELENGTH) :: lst_fname
112  type(GwtNamParamFoundType) :: found
113  !
114  ! -- Assign values
115  this%filename = filename
116  this%name = modelname
117  this%id = id
118  this%macronym = macronym
119  !
120  ! -- set input model namfile memory path
121  input_mempath = create_mem_path(modelname, 'NAM', idm_context)
122  !
123  ! -- copy option params from input context
124  call mem_set_value(lst_fname, 'LIST', input_mempath, found%list)
125  call mem_set_value(this%iprpak, 'PRINT_INPUT', input_mempath, &
126  found%print_input)
127  call mem_set_value(this%iprflow, 'PRINT_FLOWS', input_mempath, &
128  found%print_flows)
129  call mem_set_value(this%ipakcb, 'SAVE_FLOWS', input_mempath, &
130  found%save_flows)
131  call mem_set_value(this%idv_scale, 'IDV_SCALE', input_mempath, &
132  found%idv_scale)
133  !
134  ! -- create the list file
135  call this%create_lstfile(lst_fname, filename, found%list, &
136  'TRANSPORT MODEL ('//trim(macronym)//')')
137  !
138  ! -- activate save_flows if found
139  if (found%save_flows) then
140  this%ipakcb = -1
141  end if
142  !
143  ! -- log set options
144  if (this%iout > 0) then
145  call this%log_namfile_options(found)
146  end if
147  !
148  ! -- Create utility objects
149  call budget_cr(this%budget, this%name)
150  !
151  ! -- create model packages
152  call this%create_tsp_packages(indis)
This module contains the BudgetModule.
Definition: Budget.f90:20
subroutine, public budget_cr(this, name_model)
@ brief Create a new budget object
Definition: Budget.f90:84
Here is the call graph for this function:

◆ tsp_da()

subroutine transportmodelmodule::tsp_da ( class(transportmodeltype this)
private

Deallocate memory at conclusion of model run

Definition at line 569 of file tsp.f90.

570  ! -- modules
572  ! -- dummy
573  class(TransportModelType) :: this
574  ! -- local
575  !
576  ! -- Scalars
577  call mem_deallocate(this%inic)
578  call mem_deallocate(this%infmi)
579  call mem_deallocate(this%inadv)
580  call mem_deallocate(this%inssm)
581  call mem_deallocate(this%inmvt)
582  call mem_deallocate(this%inoc)
583  call mem_deallocate(this%inobs)
584  call mem_deallocate(this%eqnsclfac)

◆ tsp_df()

subroutine transportmodelmodule::tsp_df ( class(transportmodeltype this)

This subroutine extended by either GWT or GWE. This routine calls the define (df) routines for each attached package and sets variables and pointers.

Definition at line 161 of file tsp.f90.

162  ! -- dummy
163  class(TransportModelType) :: this

◆ tsp_fc()

subroutine transportmodelmodule::tsp_fc ( class(transportmodeltype this,
integer(i4b), intent(in)  kiter,
class(matrixbasetype), pointer  matrix_sln,
integer(i4b), intent(in)  inwtflag 
)
private

This subroutine extended by either GWT or GWE. This routine calls the fill coefficients (fc) routines of attached packages.

Definition at line 227 of file tsp.f90.

228  ! -- dummy
229  class(TransportModelType) :: this
230  integer(I4B), intent(in) :: kiter
231  class(MatrixBaseType), pointer :: matrix_sln
232  integer(I4B), intent(in) :: inwtflag

◆ tsp_get_idv_scale()

integer(i4b) function transportmodelmodule::tsp_get_idv_scale ( class(transportmodeltype this)

Definition at line 778 of file tsp.f90.

779  class(TransportModelType) :: this
780  ! -- local
781  integer(I4B) :: idv_scale
782  !
783  ! -- Start by setting iasym to zero
784  idv_scale = this%idv_scale

◆ tsp_mc()

subroutine transportmodelmodule::tsp_mc ( class(transportmodeltype this,
class(matrixbasetype), pointer  matrix_sln 
)

This subroutine extended by either GWT or GWE. This routine maps the positions of this models connections in the numerical solution coefficient matrix.

Parameters
matrix_slnglobal system matrix

Definition at line 185 of file tsp.f90.

186  ! -- dummy
187  class(TransportModelType) :: this
188  class(MatrixBaseType), pointer :: matrix_sln !< global system matrix

◆ tsp_ot()

subroutine transportmodelmodule::tsp_ot ( class(transportmodeltype this)
private

Generalized transport model output

Definition at line 280 of file tsp.f90.

281  ! -- modules
282  use tdismodule, only: kstp, kper, tdis_ot, endofperiod
283  ! -- dummy
284  class(TransportModelType) :: this
285  ! -- local
286  integer(I4B) :: idvsave
287  integer(I4B) :: idvprint
288  integer(I4B) :: icbcfl
289  integer(I4B) :: icbcun
290  integer(I4B) :: ibudfl
291  integer(I4B) :: ipflag
292  ! -- formats
293  character(len=*), parameter :: fmtnocnvg = &
294  "(1X,/9X,'****FAILED TO MEET SOLVER CONVERGENCE CRITERIA IN TIME STEP ', &
295  &I0,' OF STRESS PERIOD ',I0,'****')"
296  !
297  ! -- Set write and print flags
298  idvsave = 0
299  idvprint = 0
300  icbcfl = 0
301  ibudfl = 0
302  if (this%oc%oc_save(trim(this%depvartype))) idvsave = 1
303  if (this%oc%oc_print(trim(this%depvartype))) idvprint = 1
304  if (this%oc%oc_save('BUDGET')) icbcfl = 1
305  if (this%oc%oc_print('BUDGET')) ibudfl = 1
306  icbcun = this%oc%oc_save_unit('BUDGET')
307  !
308  ! -- Override ibudfl and idvprint flags for nonconvergence
309  ! and end of period
310  ibudfl = this%oc%set_print_flag('BUDGET', this%icnvg, endofperiod)
311  idvprint = this%oc%set_print_flag(trim(this%depvartype), &
312  this%icnvg, endofperiod)
313  !
314  ! -- Calculate and save observations
315  call this%tsp_ot_obs()
316  !
317  ! -- Save and print flows
318  call this%tsp_ot_flow(icbcfl, ibudfl, icbcun)
319  !
320  ! -- Save and print dependent variables
321  call this%tsp_ot_dv(idvsave, idvprint, ipflag)
322  !
323  ! -- Print budget summaries
324  call this%tsp_ot_bdsummary(ibudfl, ipflag)
325  !
326  ! -- Timing Output; if any dependent variables or budgets
327  ! are printed, then ipflag is set to 1.
328  if (ipflag == 1) call tdis_ot(this%iout)
329  !
330  ! -- Write non-convergence message
331  if (this%icnvg == 0) then
332  write (this%iout, fmtnocnvg) kstp, kper
333  end if
logical(lgp), pointer, public endofperiod
flag indicating end of stress period
Definition: tdis.f90:27
subroutine, public tdis_ot(iout)
Print simulation time.
Definition: tdis.f90:274
integer(i4b), pointer, public kstp
current time step number
Definition: tdis.f90:24
integer(i4b), pointer, public kper
current stress period number
Definition: tdis.f90:23
Here is the call graph for this function:

◆ tsp_ot_bdsummary()

subroutine transportmodelmodule::tsp_ot_bdsummary ( class(transportmodeltype this,
integer(i4b), intent(in)  ibudfl,
integer(i4b), intent(inout)  ipflag 
)
private

Loop through attached packages and write budget summaries

Definition at line 473 of file tsp.f90.

474  use tdismodule, only: kstp, kper, totim, delt
475  class(TransportModelType) :: this
476  integer(I4B), intent(in) :: ibudfl
477  integer(I4B), intent(inout) :: ipflag
478  class(BndType), pointer :: packobj
479  integer(I4B) :: ip
480  !
481  ! -- Package budget summary
482  do ip = 1, this%bndlist%Count()
483  packobj => getbndfromlist(this%bndlist, ip)
484  call packobj%bnd_ot_bdsummary(kstp, kper, this%iout, ibudfl)
485  end do
486  !
487  ! -- Mover budget summary
488  if (this%inmvt > 0) then
489  call this%mvt%mvt_ot_bdsummary(ibudfl)
490  end if
491  !
492  ! -- Model budget summary
493  call this%budget%finalize_step(delt)
494  if (ibudfl /= 0) then
495  ipflag = 1
496  call this%budget%budget_ot(kstp, kper, this%iout)
497  end if
498  !
499  ! -- Write to budget csv
500  call this%budget%writecsv(totim)
real(dp), pointer, public totim
time relative to start of simulation
Definition: tdis.f90:32
real(dp), pointer, public delt
length of the current time step
Definition: tdis.f90:29
Here is the call graph for this function:

◆ tsp_ot_dv()

subroutine transportmodelmodule::tsp_ot_dv ( class(transportmodeltype this,
integer(i4b), intent(in)  idvsave,
integer(i4b), intent(in)  idvprint,
integer(i4b), intent(inout)  ipflag 
)
private

Loop through attached packages saving and printing dependent variables

Definition at line 451 of file tsp.f90.

452  class(TransportModelType) :: this
453  integer(I4B), intent(in) :: idvsave
454  integer(I4B), intent(in) :: idvprint
455  integer(I4B), intent(inout) :: ipflag
456  class(BndType), pointer :: packobj
457  integer(I4B) :: ip
458  !
459  ! -- Print advanced package dependent variables
460  do ip = 1, this%bndlist%Count()
461  packobj => getbndfromlist(this%bndlist, ip)
462  call packobj%bnd_ot_dv(idvsave, idvprint)
463  end do
464  !
465  ! -- Save head and print head
466  call this%oc%oc_ot(ipflag)
Here is the call graph for this function:

◆ tsp_ot_flow()

subroutine transportmodelmodule::tsp_ot_flow ( class(transportmodeltype this,
integer(i4b), intent(in)  icbcfl,
integer(i4b), intent(in)  ibudfl,
integer(i4b), intent(in)  icbcun 
)
private

Save and print flows

Definition at line 361 of file tsp.f90.

362  ! -- dummy
363  class(TransportModelType) :: this
364  integer(I4B), intent(in) :: icbcfl
365  integer(I4B), intent(in) :: ibudfl
366  integer(I4B), intent(in) :: icbcun
367  ! -- local
368  class(BndType), pointer :: packobj
369  integer(I4B) :: ip
370  !
371  ! -- Save TSP flows
372  call this%tsp_ot_flowja(this%nja, this%flowja, icbcfl, icbcun)
373  if (this%infmi > 0) call this%fmi%fmi_ot_flow(icbcfl, icbcun)
374  if (this%inssm > 0) then
375  call this%ssm%ssm_ot_flow(icbcfl=icbcfl, ibudfl=0, icbcun=icbcun)
376  end if
377  !
378  do ip = 1, this%bndlist%Count()
379  packobj => getbndfromlist(this%bndlist, ip)
380  call packobj%bnd_ot_model_flows(icbcfl=icbcfl, ibudfl=0, icbcun=icbcun)
381  end do
382  !
383  ! -- Save advanced package flows
384  do ip = 1, this%bndlist%Count()
385  packobj => getbndfromlist(this%bndlist, ip)
386  call packobj%bnd_ot_package_flows(icbcfl=icbcfl, ibudfl=0)
387  end do
388  if (this%inmvt > 0) then
389  call this%mvt%mvt_ot_saveflow(icbcfl, ibudfl)
390  end if
391  !
392  ! -- Print Model (GWT or GWE) flows
393  ! no need to print flowja
394  ! no need to print mst
395  ! no need to print fmi
396  if (this%inssm > 0) then
397  call this%ssm%ssm_ot_flow(icbcfl=icbcfl, ibudfl=ibudfl, icbcun=0)
398  end if
399  do ip = 1, this%bndlist%Count()
400  packobj => getbndfromlist(this%bndlist, ip)
401  call packobj%bnd_ot_model_flows(icbcfl=icbcfl, ibudfl=ibudfl, icbcun=0)
402  end do
403  !
404  ! -- Print advanced package flows
405  do ip = 1, this%bndlist%Count()
406  packobj => getbndfromlist(this%bndlist, ip)
407  call packobj%bnd_ot_package_flows(icbcfl=0, ibudfl=ibudfl)
408  end do
409  !
410  if (this%inmvt > 0) then
411  call this%mvt%mvt_ot_printflow(icbcfl, ibudfl)
412  end if
413  !
Here is the call graph for this function:

◆ tsp_ot_flowja()

subroutine transportmodelmodule::tsp_ot_flowja ( class(transportmodeltype this,
integer(i4b), intent(in)  nja,
real(dp), dimension(nja), intent(in)  flowja,
integer(i4b), intent(in)  icbcfl,
integer(i4b), intent(in)  icbcun 
)
private

Write intercell flows for the transport model

Definition at line 420 of file tsp.f90.

421  ! -- dummy
422  class(TransportModelType) :: this
423  integer(I4B), intent(in) :: nja
424  real(DP), dimension(nja), intent(in) :: flowja
425  integer(I4B), intent(in) :: icbcfl
426  integer(I4B), intent(in) :: icbcun
427  ! -- local
428  integer(I4B) :: ibinun
429  ! -- formats
430  !
431  ! -- Set unit number for binary output
432  if (this%ipakcb < 0) then
433  ibinun = icbcun
434  elseif (this%ipakcb == 0) then
435  ibinun = 0
436  else
437  ibinun = this%ipakcb
438  end if
439  if (icbcfl == 0) ibinun = 0
440  !
441  ! -- Write the face flows if requested
442  if (ibinun /= 0) then
443  call this%dis%record_connection_array(flowja, ibinun, this%iout)
444  end if

◆ tsp_ot_obs()

subroutine transportmodelmodule::tsp_ot_obs ( class(transportmodeltype this)

Calculate and save observations

Definition at line 340 of file tsp.f90.

341  class(TransportModelType) :: this
342  class(BndType), pointer :: packobj
343  integer(I4B) :: ip
344  ! -- Calculate and save observations
345  call this%obs%obs_bd()
346  call this%obs%obs_ot()
347  !
348  ! -- Calculate and save package obserations
349  do ip = 1, this%bndlist%Count()
350  packobj => getbndfromlist(this%bndlist, ip)
351  call packobj%bnd_bd_obs()
352  call packobj%bnd_ot_obs()
353  end do
354  !
Here is the call graph for this function:

◆ tsp_rp()

subroutine transportmodelmodule::tsp_rp ( class(transportmodeltype this)
private

This subroutine extended by either GWT or GWE. This routine calls the read and prepare (rp) routines of attached packages.

Definition at line 207 of file tsp.f90.

208  ! -- dummy
209  class(TransportModelType) :: this