MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
swfmodule Module Reference

Stream Network Flow (SWF) Module. More...

Data Types

type  swfmodeltype
 

Functions/Subroutines

subroutine, public swf_cr (filename, id, modelname)
 Create a new stream network flow model object. More...
 
subroutine allocate_scalars (this, modelname)
 Allocate memory for scalar members. More...
 
subroutine allocate_arrays (this)
 Allocate memory for scalar members. More...
 
subroutine swf_df (this)
 Define packages of the model. More...
 
subroutine swf_ac (this, sparse)
 Add the internal connections of this model to the sparse matrix. More...
 
subroutine swf_mc (this, matrix_sln)
 Map the positions of this models connections in the numerical solution coefficient matrix. More...
 
subroutine swf_ar (this)
 SWF Allocate and Read. More...
 
subroutine swf_rp (this)
 Stream Network Flow Model Read and Prepare. More...
 
subroutine swf_ad (this)
 Stream Network Flow Model Time Step Advance. More...
 
subroutine swf_cf (this, kiter)
 Calculate coefficients. More...
 
subroutine swf_fc (this, kiter, matrix_sln, inwtflag)
 Fill coefficients. More...
 
subroutine swf_nur (this, neqmod, x, xtemp, dx, inewtonur, dxmax, locmax)
 under-relaxation More...
 
subroutine swf_cq (this, icnvg, isuppress_output)
 Calculate flow. More...
 
subroutine swf_bd (this, icnvg, isuppress_output)
 Model Budget. More...
 
subroutine swf_ot (this)
 Stream Network Flow Model Output. More...
 
subroutine swf_ot_obs (this)
 
subroutine swf_ot_flow (this, icbcfl, ibudfl, icbcun)
 
subroutine swf_ot_dv (this, idvsave, idvprint, ipflag)
 
subroutine swf_ot_bdsummary (this, ibudfl, ipflag)
 
subroutine swf_da (this)
 Deallocate. More...
 
subroutine swf_bdentry (this, budterm, budtxt, rowlabel)
 Surface Flow Model Budget Entry. More...
 
subroutine package_create (this, filtyp, ipakid, ipaknum, pakname, mempath, inunit, iout)
 Create boundary condition packages for this model. More...
 
subroutine ftype_check (this, indis)
 Check to make sure required input files have been specified. More...
 
subroutine create_bndpkgs (this, bndpkgs, pkgtypes, pkgnames, mempaths, inunits)
 Source package info and begin to process. More...
 
subroutine create_packages (this)
 Source package info and begin to process. More...
 
subroutine log_namfile_options (this, found)
 Write model namfile options to list file. More...
 
subroutine steady_period_check (this)
 Check for steady state period. More...
 
integer(i4b) function swf_get_iasym (this)
 return 1 if any package causes the matrix to be asymmetric. Otherwise return 0. More...
 

Variables

integer(i4b), parameter, public swf_nbasepkg = 9
 SWF base package array descriptors. More...
 
character(len=lenpackagetype), dimension(swf_nbasepkg), public swf_basepkg = ['DISV1D6', 'DIS2D6 ', 'DISV2D6', 'DFW6 ', 'CXS6 ', 'OC6 ', 'IC6 ', 'OBS6 ', 'STO6 ']
 
integer(i4b), parameter, public swf_nmultipkg = 50
 SWF multi package array descriptors. More...
 
character(len=lenpackagetype), dimension(swf_nmultipkg), public swf_multipkg
 
integer(i4b), parameter niunit_swf = SWF_NBASEPKG + SWF_NMULTIPKG
 

Detailed Description

This module contains the SWF Model

Status and remaining tasks ONGOING – Implement SWF infrastructure DONE – Implement Explicit Model Solution (EMS6) to handle explicit models DONE – Implement DISV1D Package DONE – Implement FLW Package to handle lateral and point inflows DONE – Transfer results into the flowja vector DONE – Implement strategy for storing outflow terms and getting them into budget DONE – Implement SWF and FLW advance routines to handle transient problems DONE – Implement storage terms and getting them into budget DONE – Observations DONE – Initial conditions? DONE – Rework the Iterative Model Solution (IMS6) to handle both implicit and explicit models DONE – Implement output control DONE – Add outflow as a dependent variable that can be written and printed (qoutflow) DONE – Revaluate explicit model solution and consider implementing ExplicitModelType? DONE – Add test of the binary outflow DONE – Rename Stream Network Flow (SWF) to Surface Water Flow (SWF) Model DONE – Rename segment to reach Look into mass conservative MC method (https://hess.copernicus.org/articles/11/1645/2007/hess-11-1645-2007.pdf) Implement IDOMAIN support Use dag_module to calculate iseg_order (if iseg_order not specified by user) We may need subcells and subtiming to improve accuracy Add support for nonlinear Muskingum Cunge Deal with the timestep and subtiming issues Flopy support for DISV1D and DISV1D binary grid file Flopy support for .output() method for SWF Mover support? SWF-SWF Exchange SWF-SWF Exchange in parallel Create QGW package for leakage into or out of groundwater

Function/Subroutine Documentation

◆ allocate_arrays()

subroutine swfmodule::allocate_arrays ( class(swfmodeltype this)
private

Definition at line 254 of file swf.f90.

255  ! -- modules
256  ! -- dummy
257  class(SwfModelType) :: this
258  integer(I4B) :: i
259  !
260  ! -- allocate members from parent class
261  call this%NumericalModelType%allocate_arrays()
262  !
263  ! -- This is not a numerical solution, so x, rhs, and active
264  ! are allocated by a numerical solution, so need to do it
265  ! here.
266  if (this%indfw == 0) then
267  ! -- explicit model, so these must be manually allocated
268  call mem_allocate(this%x, this%dis%nodes, 'X', this%memoryPath)
269  call mem_allocate(this%rhs, this%dis%nodes, 'RHS', this%memoryPath)
270  call mem_allocate(this%ibound, this%dis%nodes, 'IBOUND', this%memoryPath)
271  do i = 1, this%dis%nodes
272  this%x(i) = dzero
273  this%rhs(i) = dzero
274  this%ibound(i) = 1
275  end do
276  end if
277  !
278  ! -- return
279  return

◆ allocate_scalars()

subroutine swfmodule::allocate_scalars ( class(swfmodeltype this,
character(len=*), intent(in)  modelname 
)

Definition at line 220 of file swf.f90.

221  ! -- modules
222  ! -- dummy
223  class(SwfModelType) :: this
224  character(len=*), intent(in) :: modelname
225  !
226  ! -- allocate members from parent class
227  !call this%ExplicitModelType%allocate_scalars(modelname)
228  call this%NumericalModelType%allocate_scalars(modelname)
229  !
230  ! -- allocate members that are part of model class
231  call mem_allocate(this%inic, 'INIC', this%memoryPath)
232  call mem_allocate(this%indfw, 'INDFW', this%memoryPath)
233  call mem_allocate(this%incxs, 'INCXS', this%memoryPath)
234  call mem_allocate(this%insto, 'INSTO', this%memoryPath)
235  call mem_allocate(this%inobs, 'INOBS', this%memoryPath)
236  call mem_allocate(this%inoc, 'INOC', this%memoryPath)
237  call mem_allocate(this%iss, 'ISS', this%memoryPath)
238  call mem_allocate(this%inewtonur, 'INEWTONUR', this%memoryPath)
239  !
240  this%inic = 0
241  this%indfw = 0
242  this%incxs = 0
243  this%insto = 0
244  this%inobs = 0
245  this%inoc = 0
246  this%iss = 1 !default is steady-state (i.e., no STO package)
247  this%inewtonur = 0
248  !
249  ! -- return
250  return

◆ create_bndpkgs()

subroutine swfmodule::create_bndpkgs ( class(swfmodeltype 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 1080 of file swf.f90.

1082  ! -- modules
1085  ! -- dummy
1086  class(SwfModelType) :: this
1087  integer(I4B), dimension(:), allocatable, intent(inout) :: bndpkgs
1088  type(CharacterStringType), dimension(:), contiguous, &
1089  pointer, intent(inout) :: pkgtypes
1090  type(CharacterStringType), dimension(:), contiguous, &
1091  pointer, intent(inout) :: pkgnames
1092  type(CharacterStringType), dimension(:), contiguous, &
1093  pointer, intent(inout) :: mempaths
1094  integer(I4B), dimension(:), contiguous, &
1095  pointer, intent(inout) :: inunits
1096  ! -- local
1097  integer(I4B) :: ipakid, ipaknum
1098  character(len=LENFTYPE) :: pkgtype, bndptype
1099  character(len=LENPACKAGENAME) :: pkgname
1100  character(len=LENMEMPATH) :: mempath
1101  integer(I4B), pointer :: inunit
1102  integer(I4B) :: n
1103 
1104  if (allocated(bndpkgs)) then
1105  !
1106  ! -- create stress packages
1107  ipakid = 1
1108  bndptype = ''
1109  do n = 1, size(bndpkgs)
1110  !
1111  pkgtype = pkgtypes(bndpkgs(n))
1112  pkgname = pkgnames(bndpkgs(n))
1113  mempath = mempaths(bndpkgs(n))
1114  inunit => inunits(bndpkgs(n))
1115  !
1116  if (bndptype /= pkgtype) then
1117  ipaknum = 1
1118  bndptype = pkgtype
1119  end if
1120  !
1121  call this%package_create(pkgtype, ipakid, ipaknum, pkgname, mempath, &
1122  inunit, this%iout)
1123  ipakid = ipakid + 1
1124  ipaknum = ipaknum + 1
1125  end do
1126  !
1127  ! -- cleanup
1128  deallocate (bndpkgs)
1129  end if
1130  !
1131  ! -- return
1132  return
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter linelength
maximum length of a standard line
Definition: Constants.f90:44
integer(i4b), parameter lenpackagename
maximum length of the package name
Definition: Constants.f90:22
This class is used to store a single deferred-length character string. It was designed to work in an ...
Definition: CharString.f90:23

◆ create_packages()

subroutine swfmodule::create_packages ( class(swfmodeltype this)

Definition at line 1137 of file swf.f90.

1138  ! -- modules
1141  use arrayhandlersmodule, only: expandarray
1142  use memorymanagermodule, only: mem_setptr
1144  use simvariablesmodule, only: idm_context
1145  use disv1dmodule, only: disv1d_cr
1146  use dis2dmodule, only: dis2d_cr
1147  use disv2dmodule, only: disv2d_cr
1148  use swfdfwmodule, only: dfw_cr
1149  use swfcxsmodule, only: cxs_cr
1150  use swfstomodule, only: sto_cr
1151  use swficmodule, only: ic_cr
1152  use swfocmodule, only: oc_cr
1153  ! -- dummy
1154  class(SwfModelType) :: this
1155  ! -- local
1156  type(CharacterStringType), dimension(:), contiguous, &
1157  pointer :: pkgtypes => null()
1158  type(CharacterStringType), dimension(:), contiguous, &
1159  pointer :: pkgnames => null()
1160  type(CharacterStringType), dimension(:), contiguous, &
1161  pointer :: mempaths => null()
1162  integer(I4B), dimension(:), contiguous, &
1163  pointer :: inunits => null()
1164  character(len=LENMEMPATH) :: model_mempath
1165  character(len=LENPACKAGETYPE) :: pkgtype
1166  character(len=LENPACKAGENAME) :: pkgname
1167  character(len=LENMEMPATH) :: mempath
1168  integer(I4B), pointer :: inunit
1169  integer(I4B), dimension(:), allocatable :: bndpkgs
1170  integer(I4B) :: n
1171  integer(I4B) :: indis = 0 ! DIS enabled flag
1172  character(len=LENMEMPATH) :: mempathic = ''
1173  character(len=LENMEMPATH) :: mempathdfw = ''
1174  character(len=LENMEMPATH) :: mempathcxs = ''
1175  !
1176  ! -- set input model memory path
1177  model_mempath = create_mem_path(component=this%name, context=idm_context)
1178  !
1179  ! -- set pointers to model path package info
1180  call mem_setptr(pkgtypes, 'PKGTYPES', model_mempath)
1181  call mem_setptr(pkgnames, 'PKGNAMES', model_mempath)
1182  call mem_setptr(mempaths, 'MEMPATHS', model_mempath)
1183  call mem_setptr(inunits, 'INUNITS', model_mempath)
1184  !
1185  do n = 1, size(pkgtypes)
1186  !
1187  ! attributes for this input package
1188  pkgtype = pkgtypes(n)
1189  pkgname = pkgnames(n)
1190  mempath = mempaths(n)
1191  inunit => inunits(n)
1192  !
1193  ! -- create dis package as it is a prerequisite for other packages
1194  select case (pkgtype)
1195  case ('DISV1D6')
1196  indis = 1
1197  call disv1d_cr(this%dis, this%name, mempath, indis, this%iout)
1198  case ('DIS2D6')
1199  indis = 1
1200  call dis2d_cr(this%dis, this%name, mempath, indis, this%iout)
1201  case ('DISV2D6')
1202  indis = 1
1203  call disv2d_cr(this%dis, this%name, mempath, indis, this%iout)
1204  case ('DFW6')
1205  this%indfw = 1
1206  mempathdfw = mempath
1207  case ('CXS6')
1208  this%incxs = 1
1209  mempathcxs = mempath
1210  case ('STO6')
1211  this%insto = inunit
1212  case ('IC6')
1213  this%inic = 1
1214  mempathic = mempath
1215  case ('OC6')
1216  this%inoc = inunit
1217  case ('OBS6')
1218  this%inobs = inunit
1219  case ('CHD6', 'FLW6', 'CDB6', 'ZDG6')
1220  call expandarray(bndpkgs)
1221  bndpkgs(size(bndpkgs)) = n
1222  case default
1223  ! TODO
1224  end select
1225  end do
1226  !
1227  ! -- Create packages that are tied directly to model
1228  if (this%inic > 0) then
1229  call ic_cr(this%ic, this%name, mempathic, this%inic, this%iout, &
1230  this%dis)
1231  end if
1232  call cxs_cr(this%cxs, this%name, mempathcxs, this%incxs, this%iout, &
1233  this%dis)
1234  if (this%indfw > 0) then
1235  call dfw_cr(this%dfw, this%name, mempathdfw, this%indfw, this%iout, &
1236  this%cxs)
1237  end if
1238  if (this%insto > 0) then
1239  call sto_cr(this%sto, this%name, this%insto, this%iout, this%cxs)
1240  end if
1241  call oc_cr(this%oc, this%name, this%inoc, this%iout)
1242  call swf_obs_cr(this%obs, this%inobs)
1243  !
1244  ! -- Check to make sure that required ftype's have been specified
1245  call this%ftype_check(indis)
1246  !
1247  call this%create_bndpkgs(bndpkgs, pkgtypes, pkgnames, mempaths, inunits)
1248  !
1249  ! -- return
1250  return
subroutine, public dis2d_cr(dis, name_model, input_mempath, inunit, iout)
Create a new structured discretization object.
Definition: Dis2d.f90:93
subroutine, public disv1d_cr(dis, name_model, input_mempath, inunit, iout)
Definition: Disv1d.f90:90
subroutine, public disv2d_cr(dis, name_model, input_mempath, inunit, iout)
Create a new discretization by vertices object.
Definition: Disv2d.f90:94
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 cxs_cr(pobj, name_model, input_mempath, inunit, iout, dis)
create package
Definition: swf-cxs.f90:62
subroutine, public ic_cr(ic, name_model, input_mempath, inunit, iout, dis)
Create a new initial conditions object.
Definition: swf-ic.f90:33
subroutine, public oc_cr(ocobj, name_model, inunit, iout)
@ brief Create SwfOcType
Definition: swf-oc.f90:31
This module contains the storage package methods.
Definition: swf-sto.f90:7
subroutine, public sto_cr(stoobj, name_model, inunit, iout, cxs)
@ brief Create a new package object
Definition: swf-sto.f90:70
Here is the call graph for this function:

◆ ftype_check()

subroutine swfmodule::ftype_check ( class(swfmodeltype this,
integer(i4b), intent(in)  indis 
)

Definition at line 1044 of file swf.f90.

1045  ! -- modules
1046  ! -- dummy
1047  class(SwfModelType) :: this
1048  integer(I4B), intent(in) :: indis
1049  ! -- local
1050  !
1051  ! -- Check for required packages. Stop if not present.
1052  if (indis == 0) then
1053  write (errmsg, '(a)') &
1054  'Discretization Package (DISV1D6 or DIS2D6) not specified.'
1055  call store_error(errmsg)
1056  end if
1057  if (this%inic == 0 .and. this%indfw /= 0) then
1058  write (errmsg, '(a)') &
1059  'Initial Conditions (IC6) must be specified if the Diffusive &
1060  &Wave (DFW) package is used.'
1061  call store_error(errmsg)
1062  end if
1063  if (this%indfw == 0) then
1064  write (errmsg, '(1x,a)') &
1065  'DFW6 Package must be specified.'
1066  call store_error(errmsg)
1067  end if
1068  if (count_errors() > 0) then
1069  write (errmsg, '(a)') 'One or more required package(s) not specified.'
1070  call store_error(errmsg)
1071  call store_error_filename(this%filename)
1072  end if
1073  !
1074  ! -- return
1075  return
Here is the call graph for this function:

◆ log_namfile_options()

subroutine swfmodule::log_namfile_options ( class(swfmodeltype this,
type(swfnamparamfoundtype), intent(in)  found 
)

Definition at line 1255 of file swf.f90.

1257  class(SwfModelType) :: this
1258  type(SwfNamParamFoundType), intent(in) :: found
1259 
1260  write (this%iout, '(1x,a)') 'NAMEFILE OPTIONS:'
1261 
1262  if (found%print_input) then
1263  write (this%iout, '(4x,a)') 'STRESS PACKAGE INPUT WILL BE PRINTED '// &
1264  'FOR ALL MODEL STRESS PACKAGES'
1265  end if
1266 
1267  if (found%print_flows) then
1268  write (this%iout, '(4x,a)') 'PACKAGE FLOWS WILL BE PRINTED '// &
1269  'FOR ALL MODEL PACKAGES'
1270  end if
1271 
1272  if (found%save_flows) then
1273  write (this%iout, '(4x,a)') &
1274  'FLOWS WILL BE SAVED TO BUDGET FILE SPECIFIED IN OUTPUT CONTROL'
1275  end if
1276 
1277  write (this%iout, '(1x,a)') 'END NAMEFILE OPTIONS:'

◆ package_create()

subroutine swfmodule::package_create ( class(swfmodeltype 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 
)

Definition at line 981 of file swf.f90.

983  ! -- modules
984  use constantsmodule, only: linelength
986  use swfflwmodule, only: flw_create
987  use chdmodule, only: chd_create
988  use swfcdbmodule, only: cdb_create
989  use swfzdgmodule, only: zdg_create
990  ! -- dummy
991  class(SwfModelType) :: this
992  character(len=*), intent(in) :: filtyp
993  integer(I4B), intent(in) :: ipakid
994  integer(I4B), intent(in) :: ipaknum
995  character(len=*), intent(in) :: pakname
996  character(len=*), intent(in) :: mempath
997  integer(I4B), intent(in) :: inunit
998  integer(I4B), intent(in) :: iout
999  ! -- local
1000  class(BndType), pointer :: packobj
1001  class(BndType), pointer :: packobj2
1002  integer(I4B) :: ip
1003  !
1004  ! -- This part creates the package object
1005  select case (filtyp)
1006  case ('FLW6')
1007  call flw_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
1008  pakname, mempath)
1009  packobj%ictMemPath = ''
1010  case ('CHD6')
1011  call chd_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
1012  pakname, mempath)
1013  packobj%ictMemPath = create_mem_path(this%name, 'DFW')
1014  case ('CDB6')
1015  call cdb_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
1016  pakname, mempath, this%dis, this%cxs, &
1017  this%dfw%lengthconv, this%dfw%timeconv)
1018  case ('ZDG6')
1019  call zdg_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
1020  pakname, mempath, this%dis, this%cxs, this%dfw%unitconv)
1021  case default
1022  write (errmsg, *) 'Invalid package type: ', filtyp
1023  call store_error(errmsg)
1024  call store_error_filename(this%filename)
1025  end select
1026  !
1027  ! -- Check to make sure that the package name is unique, then store a
1028  ! pointer to the package in the model bndlist
1029  do ip = 1, this%bndlist%Count()
1030  packobj2 => getbndfromlist(this%bndlist, ip)
1031  if (packobj2%packName == pakname) then
1032  write (errmsg, '(a,a)') 'Cannot create package. Package name '// &
1033  'already exists: ', trim(pakname)
1034  call store_error(errmsg, terminate=.true.)
1035  end if
1036  end do
1037  call addbndtolist(this%bndlist, packobj)
1038  !
1039  ! -- return
1040  return
subroutine, public chd_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath)
Create a new constant head package.
Definition: gwf-chd.f90:56
This module contains the CDB package methods.
Definition: swf-cdb.f90:7
subroutine, public cdb_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath, dis, cxs, lengthconv, timeconv)
@ brief Create a new package object
Definition: swf-cdb.f90:75
This module contains the FLW package methods.
Definition: swf-flw.f90:7
subroutine, public flw_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath)
@ brief Create a new package object
Definition: swf-flw.f90:65
This module contains the ZDG package methods.
Definition: swf-zdg.f90:7
subroutine, public zdg_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath, dis, cxs, unitconv)
@ brief Create a new package object
Definition: swf-zdg.f90:79
Here is the call graph for this function:

◆ steady_period_check()

subroutine swfmodule::steady_period_check ( class(swfmodeltype this)

Write warning message if steady state period and adaptive time stepping is active for the period

Definition at line 1287 of file swf.f90.

1288  ! -- modules
1289  use tdismodule, only: kper
1291  use simvariablesmodule, only: warnmsg
1292  use simmodule, only: store_warning
1293  ! -- dummy
1294  class(SwfModelType) :: this
1295  if (this%iss == 1) then
1296  if (isadaptiveperiod(kper)) then
1297  write (warnmsg, '(a,a,a,i0,a)') &
1298  'SWF Model (', trim(this%name), ') is steady state for period ', &
1299  kper, ' and adaptive time stepping is active. Adaptive time &
1300  &stepping may not work properly for steady-state conditions.'
1301  call store_warning(warnmsg)
1302  end if
1303  end if
1304  return
logical(lgp) function, public isadaptiveperiod(kper)
@ brief Determine if period is adaptive
Definition: ats.f90:45
This module contains simulation methods.
Definition: Sim.f90:10
subroutine, public store_warning(msg, substring)
Store warning message.
Definition: Sim.f90:236
character(len=maxcharlen) warnmsg
warning message string
integer(i4b), pointer, public kper
current stress period number
Definition: tdis.f90:23
Here is the call graph for this function:

◆ swf_ac()

subroutine swfmodule::swf_ac ( class(swfmodeltype this,
type(sparsematrix), intent(inout)  sparse 
)
private

Definition at line 321 of file swf.f90.

322  ! -- modules
323  use sparsemodule, only: sparsematrix
324  ! -- dummy
325  class(SwfModelType) :: this
326  type(sparsematrix), intent(inout) :: sparse
327  ! -- local
328  class(BndType), pointer :: packobj
329  integer(I4B) :: ip
330  !
331  ! -- Add the primary grid connections of this model to sparse
332  call this%dis%dis_ac(this%moffset, sparse)
333  !
334  ! -- Add any additional connections
335  ! none
336  !
337  ! -- Add any package connections
338  do ip = 1, this%bndlist%Count()
339  packobj => getbndfromlist(this%bndlist, ip)
340  call packobj%bnd_ac(this%moffset, sparse)
341  end do
342  !
343  ! -- return
344  return
Here is the call graph for this function:

◆ swf_ad()

subroutine swfmodule::swf_ad ( class(swfmodeltype this)

(1) calls package advance subroutines

Definition at line 458 of file swf.f90.

459  ! -- modules
461  ! -- dummy
462  class(SwfModelType) :: this
463  class(BndType), pointer :: packobj
464  ! -- local
465  integer(I4B) :: irestore
466  integer(I4B) :: ip, n
467  !
468  ! -- Reset state variable
469  irestore = 0
470  if (ifailedstepretry > 0) irestore = 1
471  if (irestore == 0) then
472  !
473  ! -- copy x into xold
474  do n = 1, this%dis%nodes
475  this%xold(n) = this%x(n)
476  end do
477  else
478  !
479  ! -- copy xold into x if this time step is a redo
480  do n = 1, this%dis%nodes
481  this%x(n) = this%xold(n)
482  end do
483  end if
484  !
485  ! -- Advance
486  if (this%indfw > 0) call this%dfw%dfw_ad(irestore)
487  if (this%insto > 0) call this%sto%sto_ad()
488  !if (this%inmvr > 0) call this%mvr%mvr_ad()
489  do ip = 1, this%bndlist%Count()
490  packobj => getbndfromlist(this%bndlist, ip)
491  call packobj%bnd_ad()
492  if (isimcheck > 0) then
493  call packobj%bnd_ck()
494  end if
495  end do
496  !
497  ! -- Push simulated values to preceding time/subtime step
498  call this%obs%obs_ad()
499  !
500  ! -- return
501  return
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:

◆ swf_ar()

subroutine swfmodule::swf_ar ( class(swfmodeltype this)
private

Definition at line 377 of file swf.f90.

378  ! -- dummy
379  class(SwfModelType) :: this
380  ! -- locals
381  integer(I4B), dimension(:), allocatable :: itemp
382  integer(I4B) :: ip
383  class(BndType), pointer :: packobj
384  !
385  ! -- Allocate and read modules attached to model
386  if (this%inic > 0) call this%ic%ic_ar(this%x)
387 
388  ! -- need temporary integer variable to pass to dis_ar
389  ! -- TODO: this should be generalized so dis_ar doesn't have to have it
390  allocate (itemp(this%dis%nodes))
391  !
392  ! -- Call dis_ar to write binary grid file
393  call this%dis%dis_ar(itemp)
394  if (this%indfw > 0) call this%dfw%dfw_ar(this%ibound, this%x)
395  if (this%insto > 0) call this%sto%sto_ar(this%dis, this%ibound)
396  if (this%inobs > 0) call this%obs%swf_obs_ar(this%ic, this%x, this%flowja)
397  deallocate (itemp)
398  !
399  ! -- set up output control
400  if (this%indfw > 0) then
401  call this%oc%oc_ar('STAGE', this%x, this%dis, dnodata)
402  end if
403  call this%budget%set_ibudcsv(this%oc%ibudcsv)
404  !
405  ! -- Package input files now open, so allocate and read
406  do ip = 1, this%bndlist%Count()
407  packobj => getbndfromlist(this%bndlist, ip)
408  call packobj%set_pointers(this%dis%nodes, this%ibound, this%x, &
409  this%xold, this%flowja)
410  ! -- Read and allocate package
411  call packobj%bnd_ar()
412  end do
413  !
414  ! -- return
415  return
Here is the call graph for this function:

◆ swf_bd()

subroutine swfmodule::swf_bd ( class(swfmodeltype this,
integer(i4b), intent(in)  icnvg,
integer(i4b), intent(in)  isuppress_output 
)
private

Definition at line 679 of file swf.f90.

680  ! -- modules
681  use sparsemodule, only: csr_diagsum
682  ! -- dummy
683  class(SwfModelType) :: this
684  integer(I4B), intent(in) :: icnvg
685  integer(I4B), intent(in) :: isuppress_output
686  ! -- local
687  integer(I4B) :: ip
688  class(BndType), pointer :: packobj
689  !
690  ! -- Finalize calculation of flowja by adding face flows to the diagonal.
691  ! This results in the flow residual being stored in the diagonal
692  ! position for each cell.
693  call csr_diagsum(this%dis%con%ia, this%flowja)
694  !
695  ! -- Budget routines (start by resetting). Sole purpose of this section
696  ! is to add in and outs to model budget. All ins and out for a model
697  ! should be added here to this%budget. In a subsequent exchange call,
698  ! exchange flows might also be added.
699  call this%budget%reset()
700  if (this%insto > 0) call this%sto%sto_bd(isuppress_output, this%budget)
701  if (this%indfw > 0) call this%dfw%dfw_bd(isuppress_output, this%budget)
702  do ip = 1, this%bndlist%Count()
703  packobj => getbndfromlist(this%bndlist, ip)
704  call packobj%bnd_bd(this%budget)
705  end do
706  !
707  ! -- dfw velocities have to be calculated here, after swf-swf exchanges
708  ! have passed in their contributions from exg_cq()
709  if (this%indfw > 0) then
710  if (this%dfw%icalcvelocity /= 0) then
711  call this%dfw%calc_velocity(this%flowja)
712  end if
713  end if
714  !
715  ! -- Return
716  return
subroutine csr_diagsum(ia, flowja)
Definition: Sparse.f90:281
Here is the call graph for this function:

◆ swf_bdentry()

subroutine swfmodule::swf_bdentry ( class(swfmodeltype this,
real(dp), dimension(:, :), intent(in)  budterm,
character(len=lenbudtxt), dimension(:), intent(in)  budtxt,
character(len=*), intent(in)  rowlabel 
)

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

(1) adds the entry to the budget object

Definition at line 963 of file swf.f90.

964  ! -- modules
965  use constantsmodule, only: lenbudtxt
966  use tdismodule, only: delt
967  ! -- dummy
968  class(SwfModelType) :: this
969  real(DP), dimension(:, :), intent(in) :: budterm
970  character(len=LENBUDTXT), dimension(:), intent(in) :: budtxt
971  character(len=*), intent(in) :: rowlabel
972  !
973  call this%budget%addentry(budterm, delt, budtxt, rowlabel=rowlabel)
974  !
975  ! -- return
976  return
integer(i4b), parameter lenbudtxt
maximum length of a budget component names
Definition: Constants.f90:36
real(dp), pointer, public delt
length of the current time step
Definition: tdis.f90:29

◆ swf_cf()

subroutine swfmodule::swf_cf ( class(swfmodeltype this,
integer(i4b), intent(in)  kiter 
)

Definition at line 505 of file swf.f90.

506  ! -- dummy
507  class(SwfModelType) :: this
508  integer(I4B), intent(in) :: kiter
509  ! -- local
510  class(BndType), pointer :: packobj
511  integer(I4B) :: ip
512  !
513  ! -- Call package cf routines
514  !if (this%indfw > 0) call this%dfw%dfw_cf(kiter, this%dis%nodes, this%x)
515  do ip = 1, this%bndlist%Count()
516  packobj => getbndfromlist(this%bndlist, ip)
517  call packobj%bnd_cf()
518  end do
519  !
520  ! -- return
521  return
Here is the call graph for this function:

◆ swf_cq()

subroutine swfmodule::swf_cq ( class(swfmodeltype this,
integer(i4b), intent(in)  icnvg,
integer(i4b), intent(in)  isuppress_output 
)

Definition at line 642 of file swf.f90.

643  ! -- modules
644  ! -- dummy
645  class(SwfModelType) :: this
646  integer(I4B), intent(in) :: icnvg
647  integer(I4B), intent(in) :: isuppress_output
648  ! -- local
649  integer(I4B) :: i
650  integer(I4B) :: ip
651  class(BndType), pointer :: packobj
652  !
653  ! -- Construct the flowja array. Flowja is calculated each time, even if
654  ! output is suppressed. (flowja is positive into a cell.) The diagonal
655  ! position of the flowja array will contain the flow residual after
656  ! these routines are called, so each package is responsible for adding
657  ! its flow to this diagonal position.
658  do i = 1, this%dis%nja
659  this%flowja(i) = dzero
660  end do
661  if (this%indfw > 0) call this%dfw%dfw_cq(this%x, this%xold, this%flowja)
662  if (this%insto > 0) call this%sto%sto_cq(this%flowja, this%x, this%xold)
663  !
664  ! -- Go through packages and call cq routines. cf() routines are called
665  ! first to regenerate non-linear terms to be consistent with the final
666  ! head solution.
667  do ip = 1, this%bndlist%Count()
668  packobj => getbndfromlist(this%bndlist, ip)
669  call packobj%bnd_cf()
670  call packobj%bnd_cq(this%x, this%flowja)
671  end do
672  !
673  ! -- Return
674  return
Here is the call graph for this function:

◆ swf_cr()

subroutine, public swfmodule::swf_cr ( character(len=*), intent(in)  filename,
integer(i4b), intent(in)  id,
character(len=*), intent(in)  modelname 
)

(1) creates model object and add to modellist (2) assign values

Parameters
[in]filenameinput file
[in]idconsecutive model number listed in mfsim.nam
[in]modelnamename of the model

Definition at line 144 of file swf.f90.

145  ! -- modules
146  use listsmodule, only: basemodellist
152  use budgetmodule, only: budget_cr
153  ! -- dummy
154  character(len=*), intent(in) :: filename !< input file
155  integer(I4B), intent(in) :: id !< consecutive model number listed in mfsim.nam
156  character(len=*), intent(in) :: modelname !< name of the model
157  ! -- local
158  type(SwfModelType), pointer :: this
159  class(BaseModelType), pointer :: model
160  character(len=LENMEMPATH) :: input_mempath
161  character(len=LINELENGTH) :: lst_fname
162  type(SwfNamParamFoundType) :: found
163  ! -- format
164  !
165  ! -- Allocate a new model (this) and add it to basemodellist
166  allocate (this)
167  !
168  ! -- Set memory path before allocation in memory manager can be done
169  this%memoryPath = create_mem_path(modelname)
170  !
171  call this%allocate_scalars(modelname)
172  model => this
173  call addbasemodeltolist(basemodellist, model)
174  !
175  ! -- Assign values
176  this%filename = filename
177  this%name = modelname
178  this%macronym = 'SWF'
179  this%id = id
180  !
181  ! -- set input model namfile memory path
182  input_mempath = create_mem_path(modelname, 'NAM', idm_context)
183  !
184  ! -- copy option params from input context
185  call mem_set_value(lst_fname, 'LIST', input_mempath, found%list)
186  call mem_set_value(this%inewton, 'NEWTON', input_mempath, found%newton)
187  call mem_set_value(this%inewtonur, 'UNDER_RELAXATION', input_mempath, &
188  found%under_relaxation)
189  call mem_set_value(this%iprpak, 'PRINT_INPUT', input_mempath, &
190  found%print_input)
191  call mem_set_value(this%iprflow, 'PRINT_FLOWS', input_mempath, &
192  found%print_flows)
193  call mem_set_value(this%ipakcb, 'SAVE_FLOWS', input_mempath, found%save_flows)
194  !
195  ! -- create the list file
196  call this%create_lstfile(lst_fname, filename, found%list, &
197  'SURFACE WATER FLOW MODEL (SWF)')
198  !
199  ! -- activate save_flows if found
200  if (found%save_flows) then
201  this%ipakcb = -1
202  end if
203  !
204  ! -- log set options
205  if (this%iout > 0) then
206  call this%log_namfile_options(found)
207  end if
208  !
209  ! -- Create utility objects
210  call budget_cr(this%budget, this%name)
211  !
212  ! -- create model packages
213  call this%create_packages()
214  !
215  ! -- return
216  return
subroutine, public addbasemodeltolist(list, model)
Definition: BaseModel.f90:161
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
type(listtype), public basemodellist
Definition: mf6lists.f90:16
Here is the call graph for this function:
Here is the caller graph for this function:

◆ swf_da()

subroutine swfmodule::swf_da ( class(swfmodeltype this)

Definition at line 898 of file swf.f90.

899  ! -- modules
903  ! -- dummy
904  class(SwfModelType) :: this
905  ! -- local
906  integer(I4B) :: ip
907  class(BndType), pointer :: packobj
908  !
909  ! -- Deallocate idm memory
910  call memorylist_remove(this%name, 'NAM', idm_context)
911  call memorylist_remove(component=this%name, context=idm_context)
912  !
913  ! -- Internal flow packages deallocate
914  call this%dis%dis_da()
915  if (this%insto > 0) call this%sto%sto_da()
916  if (this%inic > 0) call this%ic%ic_da()
917  if (this%indfw > 0) call this%dfw%dfw_da()
918  call this%cxs%cxs_da()
919  call this%obs%obs_da()
920  call this%oc%oc_da()
921  call this%budget%budget_da()
922  !
923  ! -- Internal package objects
924  deallocate (this%dis)
925  deallocate (this%budget)
926  deallocate (this%obs)
927  deallocate (this%oc)
928  !
929  ! -- Boundary packages
930  do ip = 1, this%bndlist%Count()
931  packobj => getbndfromlist(this%bndlist, ip)
932  call packobj%bnd_da()
933  deallocate (packobj)
934  end do
935  !
936  ! -- Scalars
937  call mem_deallocate(this%inic)
938  call mem_deallocate(this%indfw)
939  call mem_deallocate(this%incxs)
940  call mem_deallocate(this%insto)
941  call mem_deallocate(this%inobs)
942  call mem_deallocate(this%inoc)
943  call mem_deallocate(this%iss)
944  call mem_deallocate(this%inewtonur)
945  !
946  ! -- Arrays
947  !
948  ! -- NumericalModelType
949  call this%NumericalModelType%model_da()
950  !
951  ! -- return
952  return
subroutine, public memorylist_remove(component, subcomponent, context)
Here is the call graph for this function:

◆ swf_df()

subroutine swfmodule::swf_df ( class(swfmodeltype this)
private

Definition at line 284 of file swf.f90.

285  ! -- modules
286  ! -- dummy
287  class(SwfModelType) :: this
288  ! -- local
289  integer(I4B) :: ip
290  class(BndType), pointer :: packobj
291  !
292  !
293  call this%dis%dis_df()
294  call this%dfw%dfw_df(this%dis)
295  call this%oc%oc_df()
296  call this%budget%budget_df(niunit_swf, 'VOLUME', 'L**3')
297  !
298  ! -- set model sizes
299  this%neq = this%dis%nodes
300  this%nja = this%dis%nja
301  this%ia => this%dis%con%ia
302  this%ja => this%dis%con%ja
303  !
304  ! -- Allocate model arrays, now that neq and nja are known
305  call this%allocate_arrays()
306  !
307  ! -- Define packages and assign iout for time series managers
308  do ip = 1, this%bndlist%Count()
309  packobj => getbndfromlist(this%bndlist, ip)
310  call packobj%bnd_df(this%dis%nodes, this%dis)
311  end do
312  !
313  ! -- Store information needed for observations
314  call this%obs%obs_df(this%iout, this%name, 'SWF', this%dis)
315  !
316  ! -- return
317  return
Here is the call graph for this function:

◆ swf_fc()

subroutine swfmodule::swf_fc ( class(swfmodeltype this,
integer(i4b), intent(in)  kiter,
class(matrixbasetype), pointer  matrix_sln,
integer(i4b), intent(in)  inwtflag 
)
private

Definition at line 525 of file swf.f90.

526  ! -- dummy
527  class(SwfModelType) :: this
528  integer(I4B), intent(in) :: kiter
529  class(MatrixBaseType), pointer :: matrix_sln
530  integer(I4B), intent(in) :: inwtflag
531  ! -- local
532  class(BndType), pointer :: packobj
533  integer(I4B) :: ip
534  integer(I4B) :: inwt, inwtpak
535  !
536  ! -- newton flags
537  inwt = inwtflag
538  ! if (inwtflag == 1) inwt = this%dfw%inewton
539  ! inwtsto = inwtflag
540  ! if (this%insto > 0) then
541  ! if (inwtflag == 1) inwtsto = this%sto%inewton
542  ! end if
543  ! inwtcsub = inwtflag
544  ! if (this%incsub > 0) then
545  ! if (inwtflag == 1) inwtcsub = this%csub%inewton
546  ! end if
547  !
548  ! -- Fill standard conductance terms
549  if (this%indfw > 0) call this%dfw%dfw_fc(kiter, matrix_sln, this%idxglo, &
550  this%rhs, this%x, this%xold)
551  ! -- storage
552  if (this%insto > 0) then
553  call this%sto%sto_fc(kiter, this%xold, this%x, matrix_sln, &
554  this%idxglo, this%rhs)
555  end if
556  ! if (this%inmvr > 0) call this%mvr%mvr_fc()
557  do ip = 1, this%bndlist%Count()
558  packobj => getbndfromlist(this%bndlist, ip)
559  call packobj%bnd_fc(this%rhs, this%ia, this%idxglo, matrix_sln)
560  end do
561  !
562  !--Fill newton terms
563  if (this%indfw > 0) then
564  if (inwt /= 0) then
565  call this%dfw%dfw_fn(kiter, matrix_sln, this%idxglo, this%rhs, this%x)
566  end if
567  end if
568  !
569  ! -- Fill newton terms for storage
570  ! if (this%insto > 0) then
571  ! if (inwtsto /= 0) then
572  ! call this%sto%sto_fn(kiter, this%xold, this%x, matrix_sln, &
573  ! this%idxglo, this%rhs)
574  ! end if
575  ! end if
576  !
577  ! -- Fill Newton terms for packages
578  do ip = 1, this%bndlist%Count()
579  packobj => getbndfromlist(this%bndlist, ip)
580  inwtpak = inwtflag
581  if (inwtflag == 1) inwtpak = packobj%inewton
582  if (inwtpak /= 0) then
583  call packobj%bnd_fn(this%rhs, this%ia, this%idxglo, matrix_sln)
584  end if
585  end do
586  !
587  ! -- return
588  return
Here is the call graph for this function:

◆ swf_get_iasym()

integer(i4b) function swfmodule::swf_get_iasym ( class(swfmodeltype this)

Definition at line 1310 of file swf.f90.

1311  class(SwfModelType) :: this
1312  ! -- local
1313  integer(I4B) :: iasym
1314  integer(I4B) :: ip
1315  class(BndType), pointer :: packobj
1316  !
1317  ! -- Start by setting iasym to zero
1318  iasym = 0
1319  !
1320  ! -- DFW
1321  if (this%indfw > 0) then
1322  iasym = 1
1323  end if
1324  !
1325  ! -- Check for any packages that introduce matrix asymmetry
1326  do ip = 1, this%bndlist%Count()
1327  packobj => getbndfromlist(this%bndlist, ip)
1328  if (packobj%iasym /= 0) iasym = 1
1329  end do
1330  !
1331  ! -- return
1332  return
Here is the call graph for this function:

◆ swf_mc()

subroutine swfmodule::swf_mc ( class(swfmodeltype this,
class(matrixbasetype), pointer  matrix_sln 
)

Definition at line 350 of file swf.f90.

351  ! -- dummy
352  class(SwfModelType) :: this
353  class(MatrixBaseType), pointer :: matrix_sln
354  ! -- local
355  class(BndType), pointer :: packobj
356  integer(I4B) :: ip
357  !
358  ! -- Find the position of each connection in the global ia, ja structure
359  ! and store them in idxglo.
360  call this%dis%dis_mc(this%moffset, this%idxglo, matrix_sln)
361  !
362  ! -- Map any additional connections
363  ! none
364  !
365  ! -- Map any package connections
366  do ip = 1, this%bndlist%Count()
367  packobj => getbndfromlist(this%bndlist, ip)
368  call packobj%bnd_mc(this%moffset, matrix_sln)
369  end do
370  !
371  ! -- return
372  return
Here is the call graph for this function:

◆ swf_nur()

subroutine swfmodule::swf_nur ( class(swfmodeltype this,
integer(i4b), intent(in)  neqmod,
real(dp), dimension(neqmod), intent(inout)  x,
real(dp), dimension(neqmod), intent(in)  xtemp,
real(dp), dimension(neqmod), intent(inout)  dx,
integer(i4b), intent(inout)  inewtonur,
real(dp), intent(inout)  dxmax,
integer(i4b), intent(inout)  locmax 
)
private

(1) Under-relaxation of Surface water Flow Model stages for current outer iteration using the reach bottoms

Definition at line 597 of file swf.f90.

598  ! modules
599  use constantsmodule, only: done, dp9
600  ! -- dummy
601  class(SwfModelType) :: this
602  integer(I4B), intent(in) :: neqmod
603  real(DP), dimension(neqmod), intent(inout) :: x
604  real(DP), dimension(neqmod), intent(in) :: xtemp
605  real(DP), dimension(neqmod), intent(inout) :: dx
606  integer(I4B), intent(inout) :: inewtonur
607  real(DP), intent(inout) :: dxmax
608  integer(I4B), intent(inout) :: locmax
609  ! -- local
610  integer(I4B) :: i0
611  integer(I4B) :: i1
612  class(BndType), pointer :: packobj
613  integer(I4B) :: ip
614  !
615  ! -- apply Newton-Raphson under-relaxation if model is using
616  ! the Newton-Raphson formulation and this Newton-Raphson
617  ! under-relaxation is turned on.
618  if (this%inewton /= 0 .and. this%inewtonur /= 0) then
619  if (this%indfw > 0) then
620  call this%dfw%dfw_nur(neqmod, x, xtemp, dx, inewtonur, dxmax, locmax)
621  end if
622  !
623  ! -- Call package nur routines
624  i0 = this%dis%nodes + 1
625  do ip = 1, this%bndlist%Count()
626  packobj => getbndfromlist(this%bndlist, ip)
627  if (packobj%npakeq > 0) then
628  i1 = i0 + packobj%npakeq - 1
629  call packobj%bnd_nur(packobj%npakeq, x(i0:i1), xtemp(i0:i1), &
630  dx(i0:i1), inewtonur, dxmax, locmax)
631  i0 = i1 + 1
632  end if
633  end do
634  end if
635  !
636  ! -- return
637  return
real(dp), parameter dp9
real constant 9/10
Definition: Constants.f90:71
real(dp), parameter done
real constant 1
Definition: Constants.f90:75
Here is the call graph for this function:

◆ swf_ot()

subroutine swfmodule::swf_ot ( class(swfmodeltype this)

Definition at line 720 of file swf.f90.

721  ! -- modules
722  use tdismodule, only: tdis_ot, endofperiod
723  ! -- dummy
724  class(SwfModelType) :: this
725  ! -- local
726  integer(I4B) :: idvsave
727  integer(I4B) :: idvprint
728  integer(I4B) :: icbcfl
729  integer(I4B) :: icbcun
730  integer(I4B) :: ibudfl
731  integer(I4B) :: ipflag
732  integer(I4B) :: icnvg = 1
733  ! -- formats
734  !
735  ! -- Set write and print flags
736  idvsave = 0
737  idvprint = 0
738  icbcfl = 0
739  ibudfl = 0
740  if (this%oc%oc_save('QOUTFLOW')) idvsave = 1
741  if (this%oc%oc_print('QOUTFLOW')) idvprint = 1
742  if (this%oc%oc_save('BUDGET')) icbcfl = 1
743  if (this%oc%oc_print('BUDGET')) ibudfl = 1
744  icbcun = this%oc%oc_save_unit('BUDGET')
745  !
746  ! -- Override ibudfl and idvprint flags for nonconvergence
747  ! and end of period
748  ibudfl = this%oc%set_print_flag('BUDGET', icnvg, endofperiod)
749  idvprint = this%oc%set_print_flag('QOUTFLOW', icnvg, endofperiod)
750  !
751  ! Calculate and save observations
752  call this%swf_ot_obs()
753  ! !
754  ! Save and print flows
755  call this%swf_ot_flow(icbcfl, ibudfl, icbcun)
756  !
757  ! Save and print dependent variables
758  call this%swf_ot_dv(idvsave, idvprint, ipflag)
759  !
760  ! Print budget summaries
761  call this%swf_ot_bdsummary(ibudfl, ipflag)
762  !
763  ! -- Timing Output; if any dependent variables or budgets
764  ! are printed, then ipflag is set to 1.
765  if (ipflag == 1) call tdis_ot(this%iout)
766  !
767  ! -- Return
768  return
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:349
Here is the call graph for this function:

◆ swf_ot_bdsummary()

subroutine swfmodule::swf_ot_bdsummary ( class(swfmodeltype this,
integer(i4b), intent(in)  ibudfl,
integer(i4b), intent(inout)  ipflag 
)
private

Definition at line 865 of file swf.f90.

866  use tdismodule, only: kstp, kper, totim, delt
867  class(SwfModelType) :: this
868  integer(I4B), intent(in) :: ibudfl
869  integer(I4B), intent(inout) :: ipflag
870  class(BndType), pointer :: packobj
871  integer(I4B) :: ip
872 
873  !
874  ! -- Package budget summary
875  do ip = 1, this%bndlist%Count()
876  packobj => getbndfromlist(this%bndlist, ip)
877  call packobj%bnd_ot_bdsummary(kstp, kper, this%iout, ibudfl)
878  end do
879 
880  ! ! -- mover budget summary
881  ! if (this%inmvr > 0) then
882  ! call this%mvr%mvr_ot_bdsummary(ibudfl)
883  ! end if
884 
885  ! -- model budget summary
886  call this%budget%finalize_step(delt)
887  if (ibudfl /= 0) then
888  ipflag = 1
889  call this%budget%budget_ot(kstp, kper, this%iout)
890  end if
891 
892  ! -- Write to budget csv every time step
893  call this%budget%writecsv(totim)
894 
real(dp), pointer, public totim
time relative to start of simulation
Definition: tdis.f90:32
integer(i4b), pointer, public kstp
current time step number
Definition: tdis.f90:24
Here is the call graph for this function:

◆ swf_ot_dv()

subroutine swfmodule::swf_ot_dv ( class(swfmodeltype this,
integer(i4b), intent(in)  idvsave,
integer(i4b), intent(in)  idvprint,
integer(i4b), intent(inout)  ipflag 
)
private

Definition at line 844 of file swf.f90.

845  class(SwfModelType) :: this
846  integer(I4B), intent(in) :: idvsave
847  integer(I4B), intent(in) :: idvprint
848  integer(I4B), intent(inout) :: ipflag
849  class(BndType), pointer :: packobj
850  integer(I4B) :: ip
851  !
852  ! -- Print advanced package dependent variables
853  do ip = 1, this%bndlist%Count()
854  packobj => getbndfromlist(this%bndlist, ip)
855  call packobj%bnd_ot_dv(idvsave, idvprint)
856  end do
857  !
858  ! -- save stage and print stage (if implemented)
859  call this%oc%oc_ot(ipflag)
860  !
861  ! -- Return
862  return
Here is the call graph for this function:

◆ swf_ot_flow()

subroutine swfmodule::swf_ot_flow ( class(swfmodeltype this,
integer(i4b), intent(in)  icbcfl,
integer(i4b), intent(in)  ibudfl,
integer(i4b), intent(in)  icbcun 
)
private

Definition at line 795 of file swf.f90.

796  class(SwfModelType) :: this
797  integer(I4B), intent(in) :: icbcfl
798  integer(I4B), intent(in) :: ibudfl
799  integer(I4B), intent(in) :: icbcun
800  class(BndType), pointer :: packobj
801  integer(I4B) :: ip
802 
803  ! -- Save SWF flows
804  if (this%insto > 0) then
805  call this%sto%sto_save_model_flows(icbcfl, icbcun)
806  end if
807  if (this%indfw > 0) then
808  call this%dfw%dfw_save_model_flows(this%flowja, icbcfl, icbcun)
809  end if
810  do ip = 1, this%bndlist%Count()
811  packobj => getbndfromlist(this%bndlist, ip)
812  call packobj%bnd_ot_model_flows(icbcfl=icbcfl, ibudfl=0, icbcun=icbcun)
813  end do
814 
815  ! -- Save advanced package flows
816  do ip = 1, this%bndlist%Count()
817  packobj => getbndfromlist(this%bndlist, ip)
818  call packobj%bnd_ot_package_flows(icbcfl=icbcfl, ibudfl=0)
819  end do
820  ! if (this%inmvr > 0) then
821  ! call this%mvr%mvr_ot_saveflow(icbcfl, ibudfl)
822  ! end if
823 
824  ! -- Print SWF flows
825  if (this%indfw > 0) then
826  call this%dfw%dfw_print_model_flows(ibudfl, this%flowja)
827  end if
828  do ip = 1, this%bndlist%Count()
829  packobj => getbndfromlist(this%bndlist, ip)
830  call packobj%bnd_ot_model_flows(icbcfl=icbcfl, ibudfl=ibudfl, icbcun=0)
831  end do
832 
833  ! -- Print advanced package flows
834  do ip = 1, this%bndlist%Count()
835  packobj => getbndfromlist(this%bndlist, ip)
836  call packobj%bnd_ot_package_flows(icbcfl=0, ibudfl=ibudfl)
837  end do
838  ! if (this%inmvr > 0) then
839  ! call this%mvr%mvr_ot_printflow(icbcfl, ibudfl)
840  ! end if
841 
Here is the call graph for this function:

◆ swf_ot_obs()

subroutine swfmodule::swf_ot_obs ( class(swfmodeltype this)

Definition at line 771 of file swf.f90.

772  class(SwfModelType) :: this
773  class(BndType), pointer :: packobj
774  integer(I4B) :: ip
775 
776  ! -- Calculate and save SWF observations
777  call this%obs%obs_bd()
778  call this%obs%obs_ot()
779 
780  ! -- Calculate and save dfw observations
781  if (this%indfw > 0) then
782  call this%dfw%dfw_bd_obs()
783  call this%dfw%obs%obs_ot()
784  end if
785 
786  ! -- Calculate and save package observations
787  do ip = 1, this%bndlist%Count()
788  packobj => getbndfromlist(this%bndlist, ip)
789  call packobj%bnd_bd_obs()
790  call packobj%bnd_ot_obs()
791  end do
792 
Here is the call graph for this function:

◆ swf_rp()

subroutine swfmodule::swf_rp ( class(swfmodeltype this)
private

(1) calls package read and prepare routines

Definition at line 423 of file swf.f90.

424  ! -- modules
425  use tdismodule, only: readnewdata
426  ! -- dummy
427  class(SwfModelType) :: this
428  ! -- local
429  class(BndType), pointer :: packobj
430  integer(I4B) :: ip
431  !
432  ! -- Check with TDIS on whether or not it is time to RP
433  if (.not. readnewdata) return
434  !
435  ! -- Read and prepare
436  if (this%indfw > 0) call this%dfw%dfw_rp()
437  if (this%inoc > 0) call this%oc%oc_rp()
438  if (this%insto > 0) call this%sto%sto_rp()
439  !if (this%inmvr > 0) call this%mvr%mvr_rp()
440  do ip = 1, this%bndlist%Count()
441  packobj => getbndfromlist(this%bndlist, ip)
442  call packobj%bnd_rp()
443  call packobj%bnd_rp_obs()
444  end do
445  !
446  ! -- Check for steady state period
447  call this%steady_period_check()
448  !
449  ! -- Return
450  return
logical(lgp), pointer, public readnewdata
flag indicating time to read new data
Definition: tdis.f90:26
Here is the call graph for this function:

Variable Documentation

◆ niunit_swf

integer(i4b), parameter swfmodule::niunit_swf = SWF_NBASEPKG + SWF_NMULTIPKG
private

Definition at line 134 of file swf.f90.

134  integer(I4B), parameter :: NIUNIT_SWF = swf_nbasepkg + swf_nmultipkg

◆ swf_basepkg

character(len=lenpackagetype), dimension(swf_nbasepkg), public swfmodule::swf_basepkg = ['DISV1D6', 'DIS2D6 ', 'DISV2D6', 'DFW6 ', 'CXS6 ', 'OC6 ', 'IC6 ', 'OBS6 ', 'STO6 ']

Definition at line 118 of file swf.f90.

118  character(len=LENPACKAGETYPE), dimension(SWF_NBASEPKG) :: &
119  SWF_BASEPKG = ['DISV1D6', 'DIS2D6 ', 'DISV2D6', &
120  'DFW6 ', 'CXS6 ', 'OC6 ', &
121  'IC6 ', 'OBS6 ', 'STO6 ']

◆ swf_multipkg

character(len=lenpackagetype), dimension(swf_nmultipkg), public swfmodule::swf_multipkg

Definition at line 129 of file swf.f90.

129  character(len=LENPACKAGETYPE), dimension(SWF_NMULTIPKG) :: SWF_MULTIPKG

◆ swf_nbasepkg

integer(i4b), parameter, public swfmodule::swf_nbasepkg = 9

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

Definition at line 117 of file swf.f90.

117  integer(I4B), parameter :: SWF_NBASEPKG = 9

◆ swf_nmultipkg

integer(i4b), parameter, public swfmodule::swf_nmultipkg = 50

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

Definition at line 128 of file swf.f90.

128  integer(I4B), parameter :: SWF_NMULTIPKG = 50