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

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

Data Types

type  gwfcsubtype
 

Functions/Subroutines

subroutine, public csub_cr (csubobj, name_model, mempath, istounit, stoPckName, inunit, iout)
 @ brief Create a new package object More...
 
subroutine csub_ar (this, dis, ibound)
 @ brief Allocate and read method for package More...
 
subroutine source_options (this)
 @ brief Source options for package More...
 
subroutine log_options (this, warn_estress_lag)
 @ brief log options for package More...
 
subroutine csub_source_dimensions (this)
 @ brief Source dimensions for package More...
 
subroutine csub_allocate_scalars (this)
 @ brief Allocate scalars More...
 
subroutine csub_allocate_arrays (this)
 @ brief Allocate package arrays More...
 
subroutine csub_source_griddata (this)
 @ brief Source griddata for package More...
 
subroutine csub_source_packagedata (this)
 @ brief source packagedata for package More...
 
subroutine csub_fp (this)
 @ brief Final processing for package More...
 
subroutine csub_da (this)
 @ brief Deallocate package memory More...
 
subroutine csub_rp (this)
 @ brief Read and prepare stress period data for package More...
 
subroutine csub_ad (this, nodes, hnew)
 @ brief Advance the package More...
 
subroutine csub_fc (this, kiter, hold, hnew, matrix_sln, idxglo, rhs)
 @ brief Fill A and r for the package More...
 
subroutine csub_fn (this, kiter, hold, hnew, matrix_sln, idxglo, rhs)
 @ brief Fill Newton-Raphson terms in A and r for the package More...
 
subroutine csub_initialize_tables (this)
 @ brief Initialize optional tables More...
 
subroutine csub_cc (this, innertot, kiter, iend, icnvgmod, nodes, hnew, hold, cpak, ipak, dpak)
 @ brief Final convergence check More...
 
subroutine csub_cq (this, nodes, hnew, hold, isuppress_output, flowja)
 @ brief Calculate flows for package More...
 
subroutine csub_bd (this, isuppress_output, model_budget)
 @ brief Model budget calculation for package More...
 
subroutine csub_save_model_flows (this, icbcfl, icbcun)
 @ brief Save model flows for package More...
 
subroutine csub_ot_dv (this, idvfl, idvprint)
 @ brief Save and print dependent values for package More...
 
subroutine csub_cg_calc_stress (this, nodes, hnew)
 @ brief Calculate the stress for model cells More...
 
subroutine csub_cg_chk_stress (this)
 @ brief Check effective stress values More...
 
subroutine csub_nodelay_update (this, i)
 @ brief Update no-delay material properties More...
 
subroutine csub_nodelay_fc (this, ib, hcell, hcellold, rho1, rho2, rhs, argtled)
 @ brief Calculate no-delay interbed storage coefficients More...
 
subroutine csub_nodelay_calc_comp (this, ib, hcell, hcellold, comp, rho1, rho2)
 @ brief Calculate no-delay interbed compaction More...
 
subroutine csub_set_initial_state (this, nodes, hnew)
 @ brief Set initial states for the package More...
 
subroutine csub_cg_fc (this, node, tled, area, hcell, hcellold, hcof, rhs)
 @ brief Formulate the coefficients for coarse-grained materials More...
 
subroutine csub_cg_fn (this, node, tled, area, hcell, hcof, rhs)
 @ brief Formulate coarse-grained Newton-Raphson terms More...
 
subroutine csub_interbed_fc (this, ib, node, area, hcell, hcellold, hcof, rhs)
 @ brief Formulate the coefficients for a interbed More...
 
subroutine csub_interbed_fn (this, ib, node, hcell, hcellold, hcof, rhs)
 @ brief Formulate the coefficients for a interbed More...
 
subroutine csub_cg_calc_sske (this, n, sske, hcell)
 @ brief Calculate Sske for a cell More...
 
subroutine csub_cg_calc_comp (this, node, hcell, hcellold, comp)
 @ brief Calculate coarse-grained compaction in a cell More...
 
subroutine csub_cg_update (this, node)
 @ brief Update coarse-grained material properties More...
 
subroutine csub_cg_wcomp_fc (this, node, tled, area, hcell, hcellold, hcof, rhs)
 @ brief Formulate coarse-grained water compressibility coefficients More...
 
subroutine csub_cg_wcomp_fn (this, node, tled, area, hcell, hcellold, hcof, rhs)
 @ brief Formulate coarse-grained water compressibility coefficients More...
 
subroutine csub_nodelay_wcomp_fc (this, ib, node, tled, area, hcell, hcellold, hcof, rhs)
 @ brief Formulate no-delay interbed water compressibility coefficients More...
 
subroutine csub_nodelay_wcomp_fn (this, ib, node, tled, area, hcell, hcellold, hcof, rhs)
 @ brief Formulate no-delay interbed water compressibility coefficients More...
 
real(dp) function csub_calc_void_ratio (this, theta)
 Calculate the void ratio. More...
 
real(dp) function csub_calc_theta (this, void_ratio)
 Calculate the porosity. More...
 
real(dp) function csub_calc_interbed_thickness (this, ib)
 Calculate the interbed thickness. More...
 
real(dp) function csub_calc_znode (this, top, bottom, zbar)
 Calculate the cell node. More...
 
real(dp) function csub_calc_adjes (this, node, es0, z0, z)
 Calculate the effective stress at elevation z. More...
 
subroutine csub_delay_head_check (this, ib)
 Check delay interbed head. More...
 
subroutine csub_calc_sat (this, node, hcell, hcellold, snnew, snold)
 Calculate cell saturation. More...
 
real(dp) function csub_calc_sat_derivative (this, node, hcell)
 Calculate the saturation derivative. More...
 
subroutine csub_calc_sfacts (this, node, bot, znode, theta, es, es0, fact)
 Calculate specific storage coefficient factor. More...
 
subroutine csub_adj_matprop (this, comp, thick, theta)
 Calculate new material properties. More...
 
subroutine csub_delay_sln (this, ib, hcell, update)
 Solve delay interbed continuity equation. More...
 
subroutine csub_delay_init_zcell (this, ib)
 Calculate delay interbed znode and z relative to interbed center. More...
 
subroutine csub_delay_calc_stress (this, ib, hcell)
 Calculate delay interbed stress values. More...
 
subroutine csub_delay_calc_ssksske (this, ib, n, hcell, ssk, sske)
 Calculate delay interbed cell storage coefficients. More...
 
subroutine csub_delay_assemble (this, ib, hcell)
 Assemble delay interbed coefficients. More...
 
subroutine csub_delay_assemble_fc (this, ib, n, hcell, aii, au, al, r)
 Assemble delay interbed standard formulation coefficients. More...
 
subroutine csub_delay_assemble_fn (this, ib, n, hcell, aii, au, al, r)
 Assemble delay interbed Newton-Raphson formulation coefficients. More...
 
subroutine csub_delay_calc_sat (this, node, idelay, n, hcell, hcellold, snnew, snold)
 Calculate delay interbed saturation. More...
 
real(dp) function csub_delay_calc_sat_derivative (this, node, idelay, n, hcell)
 Calculate the delay interbed cell saturation derivative. More...
 
subroutine csub_delay_calc_dstor (this, ib, hcell, stoe, stoi)
 Calculate delay interbed storage change. More...
 
subroutine csub_delay_calc_wcomp (this, ib, dwc)
 Calculate delay interbed water compressibility. More...
 
subroutine csub_delay_calc_comp (this, ib, hcell, hcellold, comp, compi, compe)
 Calculate delay interbed compaction. More...
 
subroutine csub_delay_update (this, ib)
 Update delay interbed material properties. More...
 
subroutine csub_delay_fc (this, ib, hcof, rhs)
 Calculate delay interbed contribution to the cell. More...
 
real(dp) function csub_calc_delay_flow (this, ib, n, hcell)
 Calculate the flow from delay interbed top or bottom. More...
 
logical function csub_obs_supported (this)
 Determine if observations are supported. More...
 
subroutine csub_df_obs (this)
 Define the observation types available in the package. More...
 
subroutine csub_bd_obs (this)
 Set the observations for this time step. More...
 
subroutine csub_rp_obs (this)
 Read and prepare the observations. More...
 
subroutine csub_process_obsid (obsrv, dis, inunitobs, iout)
 Process the observation IDs for the package. More...
 
subroutine define_listlabel (this)
 @ brief Define the list label for the package More...
 

Variables

character(len=lenbudtxt), dimension(4) budtxt = [' CSUB-CGELASTIC', ' CSUB-ELASTIC', ' CSUB-INELASTIC', ' CSUB-WATERCOMP']
 
character(len=lenbudtxt), dimension(6) comptxt = ['CSUB-COMPACTION', ' CSUB-INELASTIC', ' CSUB-ELASTIC', ' CSUB-INTERBED', ' CSUB-COARSE', ' CSUB-ZDISPLACE']
 
real(dp), parameter dlog10es = 0.4342942_DP
 derivative of the log of effective stress More...
 

Detailed Description

This module contains the methods used to add the effects of elastic skeletal storage, compaction, and subsidence on the groundwater flow equation. The contribution of elastic skelatal, inelastic and elastic interbed storage and water compressibility can be represented.

Function/Subroutine Documentation

◆ csub_ad()

subroutine gwfcsubmodule::csub_ad ( class(gwfcsubtype this,
integer(i4b), intent(in)  nodes,
real(dp), dimension(nodes), intent(in)  hnew 
)

Advance data in the CSUB package. The method sets data for the previous time step to the current value for the data (e.g., HOLD = HNEW). The method also calls the method to initialize the initial stress conditions if this is the first transient stress period.

Parameters
[in]nodesnumber of active model nodes
[in]hnewcurrent head

Definition at line 2249 of file gwf-csub.f90.

2250  ! -- modules
2251  use tdismodule, only: nper, kper
2252  ! -- dummy variables
2253  class(GwfCsubType) :: this
2254  integer(I4B), intent(in) :: nodes !< number of active model nodes
2255  real(DP), dimension(nodes), intent(in) :: hnew !< current head
2256  ! -- local variables
2257  integer(I4B) :: ib
2258  integer(I4B) :: n
2259  integer(I4B) :: idelay
2260  integer(I4B) :: node
2261  real(DP) :: h
2262  real(DP) :: es
2263  real(DP) :: pcs
2264  !
2265  ! -- evaluate if steady-state stress periods are specified for more
2266  ! than the first and last stress period if interbeds are simulated
2267  if (this%ninterbeds > 0) then
2268  if (kper > 1 .and. kper < nper) then
2269  if (this%gwfiss /= 0) then
2270  write (errmsg, '(a,i0,a,1x,a,1x,a,1x,i0,1x,a)') &
2271  'Only the first and last (', nper, ')', &
2272  'stress period can be steady if interbeds are simulated.', &
2273  'Stress period', kper, 'has been defined to be steady state.'
2274  call store_error(errmsg, terminate=.true.)
2275  end if
2276  end if
2277  end if
2278  !
2279  ! -- set initial states
2280  if (this%initialized == 0) then
2281  if (this%gwfiss == 0) then
2282  call this%csub_set_initial_state(nodes, hnew)
2283  end if
2284  end if
2285  !
2286  ! -- update state variables
2287  !
2288  ! -- coarse-grained materials
2289  do node = 1, nodes
2290  this%cg_comp(node) = dzero
2291  this%cg_es0(node) = this%cg_es(node)
2292  if (this%iupdatematprop /= 0) then
2293  this%cg_thick0(node) = this%cg_thick(node)
2294  this%cg_theta0(node) = this%cg_theta(node)
2295  end if
2296  end do
2297  !
2298  ! -- interbeds
2299  do ib = 1, this%ninterbeds
2300  idelay = this%idelay(ib)
2301  !
2302  ! -- update common terms for no-delay and delay interbeds
2303  this%comp(ib) = dzero
2304  node = this%nodelist(ib)
2305  if (this%initialized /= 0) then
2306  es = this%cg_es(node)
2307  pcs = this%pcs(ib)
2308  if (es > pcs) then
2309  this%pcs(ib) = es
2310  end if
2311  end if
2312  if (this%iupdatematprop /= 0) then
2313  this%thick0(ib) = this%thick(ib)
2314  this%theta0(ib) = this%theta(ib)
2315  end if
2316  !
2317  ! -- update delay interbed terms
2318  if (idelay /= 0) then
2319  !
2320  ! -- update state if previous period was steady state
2321  if (kper > 1) then
2322  if (this%gwfiss0 /= 0) then
2323  node = this%nodelist(ib)
2324  h = hnew(node)
2325  do n = 1, this%ndelaycells
2326  this%dbh(n, idelay) = h
2327  end do
2328  end if
2329  end if
2330  !
2331  ! -- update preconsolidation stress, stresses, head, dbdz0, and theta0
2332  do n = 1, this%ndelaycells
2333  ! update preconsolidation stress
2334  if (this%initialized /= 0) then
2335  if (this%dbes(n, idelay) > this%dbpcs(n, idelay)) then
2336  this%dbpcs(n, idelay) = this%dbes(n, idelay)
2337  end if
2338  end if
2339  this%dbh0(n, idelay) = this%dbh(n, idelay)
2340  this%dbes0(n, idelay) = this%dbes(n, idelay)
2341  if (this%iupdatematprop /= 0) then
2342  this%dbdz0(n, idelay) = this%dbdz(n, idelay)
2343  this%dbtheta0(n, idelay) = this%dbtheta(n, idelay)
2344  end if
2345  end do
2346  end if
2347  end do
2348  !
2349  ! -- set gwfiss0
2350  this%gwfiss0 = this%gwfiss
2351  !
2352  ! -- For each observation, push simulated value and corresponding
2353  ! simulation time from "current" to "preceding" and reset
2354  ! "current" value.
2355  call this%obs%obs_ad()
integer(i4b), pointer, public kper
current stress period number
Definition: tdis.f90:23
integer(i4b), pointer, public nper
number of stress period
Definition: tdis.f90:21
Here is the call graph for this function:

◆ csub_adj_matprop()

subroutine gwfcsubmodule::csub_adj_matprop ( class(gwfcsubtype), intent(inout)  this,
real(dp), intent(in)  comp,
real(dp), intent(inout)  thick,
real(dp), intent(inout)  theta 
)
private

Method to calculate the current thickness and porosity.

Parameters
[in,out]thickinitial and current thickness
[in,out]thetainitial and current porosity
[in]compcompaction
[in,out]thickthickness
[in,out]thetaporosity

Definition at line 5221 of file gwf-csub.f90.

5222  ! -- dummy variables
5223  class(GwfCsubType), intent(inout) :: this
5224  real(DP), intent(in) :: comp !< compaction
5225  real(DP), intent(inout) :: thick !< thickness
5226  real(DP), intent(inout) :: theta !< porosity
5227  ! -- local variables
5228  real(DP) :: strain
5229  real(DP) :: void_ratio
5230  !
5231  ! -- initialize variables
5232  strain = dzero
5233  void_ratio = this%csub_calc_void_ratio(theta)
5234  !
5235  ! -- calculate strain
5236  if (thick > dzero) strain = -comp / thick
5237  !
5238  ! -- update void ratio, theta, and thickness
5239  void_ratio = void_ratio + strain * (done + void_ratio)
5240  theta = this%csub_calc_theta(void_ratio)
5241  thick = thick - comp

◆ csub_allocate_arrays()

subroutine gwfcsubmodule::csub_allocate_arrays ( class(gwfcsubtype), intent(inout)  this)

Allocate and initialize CSUB package arrays.

Definition at line 951 of file gwf-csub.f90.

952  ! -- modules
954  ! -- dummy variables
955  class(GwfCsubType), intent(inout) :: this
956  ! -- local variables
957  integer(I4B) :: j
958  integer(I4B) :: n
959  integer(I4B) :: iblen
960  integer(I4B) :: naux
961  !
962  ! -- grid based data
963  if (this%ioutcomp == 0 .and. this%ioutcompi == 0 .and. &
964  this%ioutcompe == 0 .and. this%ioutcompib == 0 .and. &
965  this%ioutcomps == 0 .and. this%ioutzdisp == 0) then
966  call mem_allocate(this%buff, 1, 'BUFF', trim(this%memoryPath))
967  else
968  call mem_allocate(this%buff, this%dis%nodes, 'BUFF', trim(this%memoryPath))
969  end if
970  if (this%ioutcomp == 0 .and. this%ioutzdisp == 0) then
971  call mem_allocate(this%buffusr, 1, 'BUFFUSR', trim(this%memoryPath))
972  else
973  call mem_allocate(this%buffusr, this%dis%nodesuser, 'BUFFUSR', &
974  trim(this%memoryPath))
975  end if
976  call mem_allocate(this%sgm, this%dis%nodes, 'SGM', trim(this%memoryPath))
977  call mem_allocate(this%sgs, this%dis%nodes, 'SGS', trim(this%memoryPath))
978  call mem_allocate(this%cg_ske_cr, this%dis%nodes, 'CG_SKE_CR', &
979  trim(this%memoryPath))
980  call mem_allocate(this%cg_es, this%dis%nodes, 'CG_ES', &
981  trim(this%memoryPath))
982  call mem_allocate(this%cg_es0, this%dis%nodes, 'CG_ES0', &
983  trim(this%memoryPath))
984  call mem_allocate(this%cg_pcs, this%dis%nodes, 'CG_PCS', &
985  trim(this%memoryPath))
986  call mem_allocate(this%cg_comp, this%dis%nodes, 'CG_COMP', &
987  trim(this%memoryPath))
988  call mem_allocate(this%cg_tcomp, this%dis%nodes, 'CG_TCOMP', &
989  trim(this%memoryPath))
990  call mem_allocate(this%cg_stor, this%dis%nodes, 'CG_STOR', &
991  trim(this%memoryPath))
992  call mem_allocate(this%cg_ske, this%dis%nodes, 'CG_SKE', &
993  trim(this%memoryPath))
994  call mem_allocate(this%cg_sk, this%dis%nodes, 'CG_SK', &
995  trim(this%memoryPath))
996  call mem_allocate(this%cg_thickini, this%dis%nodes, 'CG_THICKINI', &
997  trim(this%memoryPath))
998  call mem_allocate(this%cg_thetaini, this%dis%nodes, 'CG_THETAINI', &
999  trim(this%memoryPath))
1000  if (this%iupdatematprop == 0) then
1001  call mem_setptr(this%cg_thick, 'CG_THICKINI', trim(this%memoryPath))
1002  call mem_setptr(this%cg_thick0, 'CG_THICKINI', trim(this%memoryPath))
1003  call mem_setptr(this%cg_theta, 'CG_THETAINI', trim(this%memoryPath))
1004  call mem_setptr(this%cg_theta0, 'CG_THETAINI', trim(this%memoryPath))
1005  else
1006  call mem_allocate(this%cg_thick, this%dis%nodes, 'CG_THICK', &
1007  trim(this%memoryPath))
1008  call mem_allocate(this%cg_thick0, this%dis%nodes, 'CG_THICK0', &
1009  trim(this%memoryPath))
1010  call mem_allocate(this%cg_theta, this%dis%nodes, 'CG_THETA', &
1011  trim(this%memoryPath))
1012  call mem_allocate(this%cg_theta0, this%dis%nodes, 'CG_THETA0', &
1013  trim(this%memoryPath))
1014  end if
1015  !
1016  ! -- cell storage data
1017  call mem_allocate(this%cell_wcstor, this%dis%nodes, 'CELL_WCSTOR', &
1018  trim(this%memoryPath))
1019  call mem_allocate(this%cell_thick, this%dis%nodes, 'CELL_THICK', &
1020  trim(this%memoryPath))
1021  !
1022  ! -- interbed data
1023  iblen = 1
1024  if (this%ninterbeds > 0) then
1025  iblen = this%ninterbeds
1026  end if
1027  naux = 1
1028  if (this%naux > 0) then
1029  naux = this%naux
1030  end if
1031  call mem_allocate(this%auxvar, naux, iblen, 'AUXVAR', this%memoryPath)
1032  do n = 1, iblen
1033  do j = 1, naux
1034  this%auxvar(j, n) = dzero
1035  end do
1036  end do
1037  call mem_allocate(this%unodelist, iblen, 'UNODELIST', trim(this%memoryPath))
1038  call mem_allocate(this%nodelist, iblen, 'NODELIST', trim(this%memoryPath))
1039  call mem_allocate(this%cg_gs, this%dis%nodes, 'CG_GS', trim(this%memoryPath))
1040  call mem_allocate(this%pcs, iblen, 'PCS', trim(this%memoryPath))
1041  call mem_allocate(this%rnb, iblen, 'RNB', trim(this%memoryPath))
1042  call mem_allocate(this%kv, iblen, 'KV', trim(this%memoryPath))
1043  call mem_allocate(this%h0, iblen, 'H0', trim(this%memoryPath))
1044  call mem_allocate(this%ci, iblen, 'CI', trim(this%memoryPath))
1045  call mem_allocate(this%rci, iblen, 'RCI', trim(this%memoryPath))
1046  call mem_allocate(this%idelay, iblen, 'IDELAY', trim(this%memoryPath))
1047  call mem_allocate(this%ielastic, iblen, 'IELASTIC', trim(this%memoryPath))
1048  call mem_allocate(this%iconvert, iblen, 'ICONVERT', trim(this%memoryPath))
1049  call mem_allocate(this%comp, iblen, 'COMP', trim(this%memoryPath))
1050  call mem_allocate(this%tcomp, iblen, 'TCOMP', trim(this%memoryPath))
1051  call mem_allocate(this%tcompi, iblen, 'TCOMPI', trim(this%memoryPath))
1052  call mem_allocate(this%tcompe, iblen, 'TCOMPE', trim(this%memoryPath))
1053  call mem_allocate(this%storagee, iblen, 'STORAGEE', trim(this%memoryPath))
1054  call mem_allocate(this%storagei, iblen, 'STORAGEI', trim(this%memoryPath))
1055  call mem_allocate(this%ske, iblen, 'SKE', trim(this%memoryPath))
1056  call mem_allocate(this%sk, iblen, 'SK', trim(this%memoryPath))
1057  call mem_allocate(this%thickini, iblen, 'THICKINI', trim(this%memoryPath))
1058  call mem_allocate(this%thetaini, iblen, 'THETAINI', trim(this%memoryPath))
1059  if (this%iupdatematprop == 0) then
1060  call mem_setptr(this%thick, 'THICKINI', trim(this%memoryPath))
1061  call mem_setptr(this%thick0, 'THICKINI', trim(this%memoryPath))
1062  call mem_setptr(this%theta, 'THETAINI', trim(this%memoryPath))
1063  call mem_setptr(this%theta0, 'THETAINI', trim(this%memoryPath))
1064  else
1065  call mem_allocate(this%thick, iblen, 'THICK', trim(this%memoryPath))
1066  call mem_allocate(this%thick0, iblen, 'THICK0', trim(this%memoryPath))
1067  call mem_allocate(this%theta, iblen, 'THETA', trim(this%memoryPath))
1068  call mem_allocate(this%theta0, iblen, 'THETA0', trim(this%memoryPath))
1069  end if
1070  !
1071  ! -- delay bed storage - allocated in csub_source_packagedata
1072  ! after number of delay beds is defined
1073  !
1074  ! -- allocate boundname
1075  if (this%inamedbound /= 0) then
1076  call mem_allocate(this%boundname, lenboundname, this%ninterbeds, &
1077  'BOUNDNAME', trim(this%memoryPath))
1078  else
1079  call mem_allocate(this%boundname, lenboundname, 1, &
1080  'BOUNDNAME', trim(this%memoryPath))
1081 
1082  end if
1083  !
1084  ! -- allocate the nodelist and bound arrays
1085  call mem_allocate(this%nodelistsig0, this%maxsig0, 'NODELISTSIG0', &
1086  this%memoryPath)
1087 
1088  ! -- set sig0 input context pointer
1089  call mem_setptr(this%sig0, 'SIG0', this%input_mempath)
1090  call mem_checkin(this%sig0, 'SIG0', this%memoryPath, &
1091  'SIG0', this%input_mempath)
1092  !
1093  ! -- set pointers to gwf variables
1094  call mem_setptr(this%gwfiss, 'ISS', trim(this%name_model))
1095  !
1096  ! -- set pointers to variables in the storage package
1097  call mem_setptr(this%stoiconv, 'ICONVERT', this%stoMemPath)
1098  call mem_setptr(this%stoss, 'SS', this%stoMemPath)
1099  !
1100  ! -- initialize variables that are not specified by user
1101  do n = 1, this%dis%nodes
1102  this%cg_gs(n) = dzero
1103  this%cg_es(n) = dzero
1104  this%cg_comp(n) = dzero
1105  this%cg_tcomp(n) = dzero
1106  this%cell_wcstor(n) = dzero
1107  end do
1108  do n = 1, this%ninterbeds
1109  this%theta(n) = dzero
1110  this%tcomp(n) = dzero
1111  this%tcompi(n) = dzero
1112  this%tcompe(n) = dzero
1113  end do
1114  do n = 1, this%maxsig0
1115  this%nodelistsig0(n) = 0
1116  end do

◆ csub_allocate_scalars()

subroutine gwfcsubmodule::csub_allocate_scalars ( class(gwfcsubtype), intent(inout)  this)

Allocate and initialize scalars for the CSUB package. The base model allocate scalars method is also called.

Definition at line 841 of file gwf-csub.f90.

842  ! -- modules
844  ! -- dummy variables
845  class(GwfCsubType), intent(inout) :: this
846  !
847  ! -- call standard NumericalPackageType allocate scalars
848  call this%NumericalPackageType%allocate_scalars()
849  !
850  ! -- allocate character variables
851  call mem_allocate(this%listlabel, lenlistlabel, 'LISTLABEL', this%memoryPath)
852  call mem_allocate(this%stoMemPath, lenmempath, 'STONAME', this%memoryPath)
853  !
854  ! -- allocate the object and assign values to object variables
855  call mem_allocate(this%istounit, 'ISTOUNIT', this%memoryPath)
856  call mem_allocate(this%inobspkg, 'INOBSPKG', this%memoryPath)
857  call mem_allocate(this%ninterbeds, 'NINTERBEDS', this%memoryPath)
858  call mem_allocate(this%maxsig0, 'MAXSIG0', this%memoryPath)
859  call mem_allocate(this%nbound, 'NBOUND', this%memoryPath)
860  call mem_allocate(this%iscloc, 'ISCLOC', this%memoryPath)
861  call mem_allocate(this%iauxmultcol, 'IAUXMULTCOL', this%memoryPath)
862  call mem_allocate(this%ndelaycells, 'NDELAYCELLS', this%memoryPath)
863  call mem_allocate(this%ndelaybeds, 'NDELAYBEDS', this%memoryPath)
864  call mem_allocate(this%initialized, 'INITIALIZED', this%memoryPath)
865  call mem_allocate(this%ieslag, 'IESLAG', this%memoryPath)
866  call mem_allocate(this%ipch, 'IPCH', this%memoryPath)
867  call mem_allocate(this%lhead_based, 'LHEAD_BASED', this%memoryPath)
868  call mem_allocate(this%iupdatestress, 'IUPDATESTRESS', this%memoryPath)
869  call mem_allocate(this%ispecified_pcs, 'ISPECIFIED_PCS', this%memoryPath)
870  call mem_allocate(this%ispecified_dbh, 'ISPECIFIED_DBH', this%memoryPath)
871  call mem_allocate(this%inamedbound, 'INAMEDBOUND', this%memoryPath)
872  call mem_allocate(this%iconvchk, 'ICONVCHK', this%memoryPath)
873  call mem_allocate(this%naux, 'NAUX', this%memoryPath)
874  call mem_allocate(this%istoragec, 'ISTORAGEC', this%memoryPath)
875  call mem_allocate(this%istrainib, 'ISTRAINIB', this%memoryPath)
876  call mem_allocate(this%istrainsk, 'ISTRAINSK', this%memoryPath)
877  call mem_allocate(this%ioutcomp, 'IOUTCOMP', this%memoryPath)
878  call mem_allocate(this%ioutcompi, 'IOUTCOMPI', this%memoryPath)
879  call mem_allocate(this%ioutcompe, 'IOUTCOMPE', this%memoryPath)
880  call mem_allocate(this%ioutcompib, 'IOUTCOMPIB', this%memoryPath)
881  call mem_allocate(this%ioutcomps, 'IOUTCOMPS', this%memoryPath)
882  call mem_allocate(this%ioutzdisp, 'IOUTZDISP', this%memoryPath)
883  call mem_allocate(this%ipakcsv, 'IPAKCSV', this%memoryPath)
884  call mem_allocate(this%iupdatematprop, 'IUPDATEMATPROP', this%memoryPath)
885  call mem_allocate(this%epsilon, 'EPSILON', this%memoryPath)
886  call mem_allocate(this%cc_crit, 'CC_CRIT', this%memoryPath)
887  call mem_allocate(this%gammaw, 'GAMMAW', this%memoryPath)
888  call mem_allocate(this%beta, 'BETA', this%memoryPath)
889  call mem_allocate(this%brg, 'BRG', this%memoryPath)
890  call mem_allocate(this%satomega, 'SATOMEGA', this%memoryPath)
891  call mem_allocate(this%icellf, 'ICELLF', this%memoryPath)
892  call mem_allocate(this%gwfiss0, 'GWFISS0', this%memoryPath)
893  !
894  ! -- allocate text strings
895  call mem_allocate(this%auxname, lenauxname, 0, 'AUXNAME', this%memoryPath)
896  !
897  ! -- initialize values
898  this%istounit = 0
899  this%inobspkg = 0
900  this%ninterbeds = 0
901  this%maxsig0 = 0
902  this%nbound = 0
903  this%iscloc = 0
904  this%iauxmultcol = 0
905  this%ndelaycells = 19
906  this%ndelaybeds = 0
907  this%initialized = 0
908  this%ieslag = 0
909  this%ipch = 0
910  this%lhead_based = .false.
911  this%iupdatestress = 1
912  this%ispecified_pcs = 0
913  this%ispecified_dbh = 0
914  this%inamedbound = 0
915  this%iconvchk = 1
916  this%naux = 0
917  this%istoragec = 1
918  this%istrainib = 0
919  this%istrainsk = 0
920  this%ioutcomp = 0
921  this%ioutcompi = 0
922  this%ioutcompe = 0
923  this%ioutcompib = 0
924  this%ioutcomps = 0
925  this%ioutzdisp = 0
926  this%ipakcsv = 0
927  this%iupdatematprop = 0
928  this%epsilon = dzero
929  this%cc_crit = dem7
930  this%gammaw = dgravity * 1000._dp
931  this%beta = 4.6512e-10_dp
932  this%brg = this%gammaw * this%beta
933  !
934  ! -- set omega value used for saturation calculations
935  if (this%inewton /= 0) then
936  this%satomega = dem6
937  this%epsilon = dhalf * dem6
938  else
939  this%satomega = dzero
940  end if
941  this%icellf = 0
942  this%ninterbeds = 0
943  this%gwfiss0 = 0

◆ csub_ar()

subroutine gwfcsubmodule::csub_ar ( class(gwfcsubtype), intent(inout)  this,
class(disbasetype), intent(in), pointer  dis,
integer(i4b), dimension(:), pointer, contiguous  ibound 
)
private

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

Parameters
[in]dismodel discretization
iboundmodel ibound array

Definition at line 352 of file gwf-csub.f90.

353  ! -- modules
355  use constantsmodule, only: linelength
356  use kindmodule, only: i4b
357  ! -- dummy variables
358  class(GwfCsubType), intent(inout) :: this
359  class(DisBaseType), pointer, intent(in) :: dis !< model discretization
360  integer(I4B), dimension(:), pointer, contiguous :: ibound !< model ibound array
361  ! -- local variables
362  character(len=20) :: cellid
363  integer(I4B) :: idelay
364  integer(I4B) :: ib
365  integer(I4B) :: node
366  integer(I4B) :: istoerr
367  real(DP) :: top
368  real(DP) :: bot
369  real(DP) :: thick
370  real(DP) :: cg_ske_cr
371  real(DP) :: theta
372  real(DP) :: v
373  ! -- format
374  character(len=*), parameter :: fmtcsub = &
375  "(1x,/1x,'CSUB -- COMPACTION PACKAGE, VERSION 1, 12/15/2019', &
376  &' INPUT READ FROM MEMPATH: ', A, /)"
377  !
378  ! --print a message identifying the csub package.
379  write (this%iout, fmtcsub) this%input_mempath
380  !
381  ! -- store pointers to arguments that were passed in
382  this%dis => dis
383  this%ibound => ibound
384  !
385  ! -- create obs package
386  call obs_cr(this%obs, this%inobspkg)
387  !
388  ! -- source csub options
389  call this%source_options()
390  !
391  ! -- source the csub dimensions
392  call this%source_dimensions()
393  !
394  ! - observation data
395  call this%obs%obs_ar()
396  !
397  ! -- terminate if errors dimensions block data
398  if (count_errors() > 0) then
399  call store_error_filename(this%input_fname)
400  end if
401 
402  ! -- Allocate arrays in
403  call this%csub_allocate_arrays()
404  !
405  ! -- source griddata
406  call this%csub_source_griddata()
407  !
408  ! -- evaluate the coarse-grained material properties and if
409  ! non-zero specific storage values are specified in the
410  ! STO package
411  istoerr = 0
412  do node = 1, this%dis%nodes
413  call this%dis%noder_to_string(node, cellid)
414  cg_ske_cr = this%cg_ske_cr(node)
415  theta = this%cg_thetaini(node)
416  !
417  ! -- coarse-grained storage error condition
418  if (cg_ske_cr < dzero) then
419  write (errmsg, '(a,g0,a,1x,a,1x,a,a)') &
420  'Coarse-grained material CG_SKE_CR (', cg_ske_cr, ') is less', &
421  'than zero in cell', trim(adjustl(cellid)), '.'
422  end if
423  !
424  ! -- storage (STO) package error condition
425  if (this%stoss(node) /= dzero) then
426  istoerr = 1
427  end if
428  !
429  ! -- porosity error condition
430  if (theta > done .or. theta < dzero) then
431  write (errmsg, '(a,g0,a,1x,a,1x,a,a)') &
432  'Coarse-grained material THETA (', theta, ') is less', &
433  'than zero or greater than 1 in cell', trim(adjustl(cellid)), '.'
434  end if
435  end do
436  !
437  ! -- write single message if storage (STO) package has non-zero specific
438  ! storage values
439  if (istoerr /= 0) then
440  write (errmsg, '(a,3(1x,a))') &
441  'Specific storage values in the storage (STO) package must', &
442  'be zero in all active cells when using the', &
443  trim(adjustl(this%packName)), &
444  'package.'
445  call store_error(errmsg)
446  end if
447  !
448  ! -- source interbed data
449  if (this%ninterbeds > 0) then
450  call this%csub_source_packagedata()
451  end if
452  !
453  ! setup package convergence tables
454  call this%csub_initialize_tables()
455  !
456  ! -- calculate the coarse-grained material thickness without the interbeds
457  do node = 1, this%dis%nodes
458  top = this%dis%top(node)
459  bot = this%dis%bot(node)
460  this%cg_thickini(node) = top - bot
461  this%cell_thick(node) = top - bot
462  end do
463  !
464  ! -- subtract the interbed thickness from aquifer thickness
465  do ib = 1, this%ninterbeds
466  node = this%nodelist(ib)
467  idelay = this%idelay(ib)
468  if (idelay == 0) then
469  v = this%thickini(ib)
470  else
471  v = this%rnb(ib) * this%thickini(ib)
472  end if
473  this%cg_thickini(node) = this%cg_thickini(node) - v
474  end do
475  !
476  ! -- evaluate if any cg_thick values are less than 0
477  do node = 1, this%dis%nodes
478  thick = this%cg_thickini(node)
479  if (thick < dzero) then
480  call this%dis%noder_to_string(node, cellid)
481  write (errmsg, '(a,g0,a,1x,a,a)') &
482  'Aquifer thickness is less than zero (', &
483  thick, ') in cell', trim(adjustl(cellid)), '.'
484  call store_error(errmsg)
485  end if
486  end do
487  !
488  ! -- terminate if errors griddata, packagedata blocks, TDIS, or STO data
489  if (count_errors() > 0) then
490  call store_error_filename(this%input_fname)
491  end if
492  !
493  ! -- set current coarse-grained thickness (cg_thick) and
494  ! current coarse-grained porosity (cg_theta). Only needed
495  ! if updating material properties
496  if (this%iupdatematprop /= 0) then
497  do node = 1, this%dis%nodes
498  this%cg_thick(node) = this%cg_thickini(node)
499  this%cg_theta(node) = this%cg_thetaini(node)
500  end do
501  end if
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter linelength
maximum length of a standard line
Definition: Constants.f90:45
This module defines variable data types.
Definition: kind.f90:8
Here is the call graph for this function:

◆ csub_bd()

subroutine gwfcsubmodule::csub_bd ( class(gwfcsubtype this,
integer(i4b), intent(in)  isuppress_output,
type(budgettype), intent(inout)  model_budget 
)

Budget calculation for the CSUB package components. Components include coarse-grained storage, delay and no-delay interbeds, and water compressibility.

Parameters
[in,out]model_budgetmodel budget object
[in,out]model_budgetmodel budget object

Definition at line 3124 of file gwf-csub.f90.

3125  ! -- modules
3126  use tdismodule, only: delt
3127  use constantsmodule, only: lenboundname, dzero, done
3129  ! -- dummy variables
3130  class(GwfCsubType) :: this
3131  integer(I4B), intent(in) :: isuppress_output
3132  type(BudgetType), intent(inout) :: model_budget !< model budget object
3133  ! -- local
3134  real(DP) :: rin
3135  real(DP) :: rout
3136  !
3137  ! -- interbed elastic storage (this%cg_stor)
3138  call rate_accumulator(this%cg_stor, rin, rout)
3139  call model_budget%addentry(rin, rout, delt, budtxt(1), &
3140  isuppress_output, ' CSUB')
3141  if (this%ninterbeds > 0) then
3142  !
3143  ! -- interbed elastic storage (this%storagee)
3144  call rate_accumulator(this%storagee, rin, rout)
3145  call model_budget%addentry(rin, rout, delt, budtxt(2), &
3146  isuppress_output, ' CSUB')
3147  !
3148  ! -- interbed elastic storage (this%storagei)
3149  call rate_accumulator(this%storagei, rin, rout)
3150  call model_budget%addentry(rin, rout, delt, budtxt(3), &
3151  isuppress_output, ' CSUB')
3152  end if
3153  call rate_accumulator(this%cell_wcstor, rin, rout)
3154  call model_budget%addentry(rin, rout, delt, budtxt(4), &
3155  isuppress_output, ' CSUB')
3156  return
This module contains the BudgetModule.
Definition: Budget.f90:20
subroutine, public rate_accumulator(flow, rin, rout)
@ brief Rate accumulator subroutine
Definition: Budget.f90:632
integer(i4b), parameter lenboundname
maximum length of a bound name
Definition: Constants.f90:36
real(dp), parameter dzero
real constant zero
Definition: Constants.f90:65
real(dp), parameter done
real constant 1
Definition: Constants.f90:76
real(dp), pointer, public delt
length of the current time step
Definition: tdis.f90:29
Derived type for the Budget object.
Definition: Budget.f90:39
Here is the call graph for this function:

◆ csub_bd_obs()

subroutine gwfcsubmodule::csub_bd_obs ( class(gwfcsubtype), intent(inout)  this)
private

Method to set the CSUB package observations for this time step.

Definition at line 6549 of file gwf-csub.f90.

6550  ! -- dummy variables
6551  class(GwfCsubType), intent(inout) :: this
6552  ! -- local variables
6553  type(ObserveType), pointer :: obsrv => null()
6554  integer(I4B) :: i
6555  integer(I4B) :: j
6556  integer(I4B) :: n
6557  integer(I4B) :: idelay
6558  integer(I4B) :: ncol
6559  integer(I4B) :: node
6560  real(DP) :: v
6561  real(DP) :: r
6562  real(DP) :: f
6563  real(DP) :: b0
6564  !
6565  ! -- Fill simulated values for all csub observations
6566  if (this%obs%npakobs > 0) then
6567  call this%obs%obs_bd_clear()
6568  do i = 1, this%obs%npakobs
6569  obsrv => this%obs%pakobs(i)%obsrv
6570  if (obsrv%BndFound) then
6571  if (obsrv%ObsTypeId == 'SKE' .or. &
6572  obsrv%ObsTypeId == 'SK' .or. &
6573  obsrv%ObsTypeId == 'SKE-CELL' .or. &
6574  obsrv%ObsTypeId == 'SK-CELL' .or. &
6575  obsrv%ObsTypeId == 'DELAY-HEAD' .or. &
6576  obsrv%ObsTypeId == 'DELAY-PRECONSTRESS' .or. &
6577  obsrv%ObsTypeId == 'DELAY-GSTRESS' .or. &
6578  obsrv%ObsTypeId == 'DELAY-ESTRESS' .or. &
6579  obsrv%ObsTypeId == 'PRECONSTRESS-CELL') then
6580  if (this%gwfiss /= 0) then
6581  call this%obs%SaveOneSimval(obsrv, dnodata)
6582  else
6583  v = dzero
6584  do j = 1, obsrv%indxbnds_count
6585  n = obsrv%indxbnds(j)
6586  select case (obsrv%ObsTypeId)
6587  case ('SKE')
6588  v = this%ske(n)
6589  case ('SK')
6590  v = this%sk(n)
6591  case ('SKE-CELL')
6592  !
6593  ! -- add the coarse component
6594  if (j == 1) then
6595  v = this%cg_ske(n)
6596  else
6597  v = this%ske(n)
6598  end if
6599  case ('SK-CELL')
6600  !
6601  ! -- add the coarse component
6602  if (j == 1) then
6603  v = this%cg_sk(n)
6604  else
6605  v = this%sk(n)
6606  end if
6607  case ('DELAY-HEAD', 'DELAY-PRECONSTRESS', &
6608  'DELAY-GSTRESS', 'DELAY-ESTRESS')
6609  if (n > this%ndelaycells) then
6610  r = real(n - 1, dp) / real(this%ndelaycells, dp)
6611  idelay = int(floor(r)) + 1
6612  ncol = n - int(floor(r)) * this%ndelaycells
6613  else
6614  idelay = 1
6615  ncol = n
6616  end if
6617  select case (obsrv%ObsTypeId)
6618  case ('DELAY-HEAD')
6619  v = this%dbh(ncol, idelay)
6620  case ('DELAY-PRECONSTRESS')
6621  v = this%dbpcs(ncol, idelay)
6622  case ('DELAY-GSTRESS')
6623  v = this%dbgeo(ncol, idelay)
6624  case ('DELAY-ESTRESS')
6625  v = this%dbes(ncol, idelay)
6626  end select
6627  case ('PRECONSTRESS-CELL')
6628  v = this%pcs(n)
6629  case default
6630  errmsg = "Unrecognized observation type '"// &
6631  trim(obsrv%ObsTypeId)//"'."
6632  call store_error(errmsg)
6633  end select
6634  call this%obs%SaveOneSimval(obsrv, v)
6635  end do
6636  end if
6637  else
6638  v = dzero
6639  do j = 1, obsrv%indxbnds_count
6640  n = obsrv%indxbnds(j)
6641  select case (obsrv%ObsTypeId)
6642  case ('CSUB')
6643  v = this%storagee(n) + this%storagei(n)
6644  case ('INELASTIC-CSUB')
6645  v = this%storagei(n)
6646  case ('ELASTIC-CSUB')
6647  v = this%storagee(n)
6648  case ('COARSE-CSUB')
6649  v = this%cg_stor(n)
6650  case ('WCOMP-CSUB-CELL')
6651  v = this%cell_wcstor(n)
6652  case ('CSUB-CELL')
6653  !
6654  ! -- add the coarse component
6655  if (j == 1) then
6656  v = this%cg_stor(n)
6657  else
6658  v = this%storagee(n) + this%storagei(n)
6659  end if
6660  case ('THETA')
6661  v = this%theta(n)
6662  case ('COARSE-THETA')
6663  v = this%cg_theta(n)
6664  case ('THETA-CELL')
6665  !
6666  ! -- add the coarse component
6667  if (j == 1) then
6668  f = this%cg_thick(n) / this%cell_thick(n)
6669  v = f * this%cg_theta(n)
6670  else
6671  node = this%nodelist(n)
6672  f = this%csub_calc_interbed_thickness(n) / this%cell_thick(node)
6673  v = f * this%theta(n)
6674  end if
6675  case ('GSTRESS-CELL')
6676  v = this%cg_gs(n)
6677  case ('ESTRESS-CELL')
6678  v = this%cg_es(n)
6679  case ('INTERBED-COMPACTION')
6680  v = this%tcomp(n)
6681  case ('INTERBED-COMPACTION-PCT')
6682  b0 = this%thickini(n)
6683  if (this%idelay(n) /= 0) then
6684  b0 = b0 * this%rnb(n)
6685  end if
6686  v = dhundred * this%tcomp(n) / b0
6687  case ('INELASTIC-COMPACTION')
6688  v = this%tcompi(n)
6689  case ('ELASTIC-COMPACTION')
6690  v = this%tcompe(n)
6691  case ('COARSE-COMPACTION')
6692  v = this%cg_tcomp(n)
6693  case ('INELASTIC-COMPACTION-CELL')
6694  !
6695  ! -- no coarse inelastic component
6696  if (j > 1) then
6697  v = this%tcompi(n)
6698  end if
6699  case ('ELASTIC-COMPACTION-CELL')
6700  !
6701  ! -- add the coarse component
6702  if (j == 1) then
6703  v = this%cg_tcomp(n)
6704  else
6705  v = this%tcompe(n)
6706  end if
6707  case ('COMPACTION-CELL')
6708  !
6709  ! -- add the coarse component
6710  if (j == 1) then
6711  v = this%cg_tcomp(n)
6712  else
6713  v = this%tcomp(n)
6714  end if
6715  case ('THICKNESS')
6716  idelay = this%idelay(n)
6717  v = this%thick(n)
6718  if (idelay /= 0) then
6719  v = v * this%rnb(n)
6720  end if
6721  case ('COARSE-THICKNESS')
6722  v = this%cg_thick(n)
6723  case ('THICKNESS-CELL')
6724  v = this%cell_thick(n)
6725  case ('DELAY-COMPACTION', 'DELAY-THICKNESS', &
6726  'DELAY-THETA')
6727  if (n > this%ndelaycells) then
6728  r = real(n, dp) / real(this%ndelaycells, dp)
6729  idelay = int(floor(r)) + 1
6730  ncol = mod(n, this%ndelaycells)
6731  else
6732  idelay = 1
6733  ncol = n
6734  end if
6735  select case (obsrv%ObsTypeId)
6736  case ('DELAY-COMPACTION')
6737  v = this%dbtcomp(ncol, idelay)
6738  case ('DELAY-THICKNESS')
6739  v = this%dbdz(ncol, idelay)
6740  case ('DELAY-THETA')
6741  v = this%dbtheta(ncol, idelay)
6742  end select
6743  case ('DELAY-FLOWTOP')
6744  idelay = this%idelay(n)
6745  v = this%dbflowtop(idelay)
6746  case ('DELAY-FLOWBOT')
6747  idelay = this%idelay(n)
6748  v = this%dbflowbot(idelay)
6749  case default
6750  errmsg = "Unrecognized observation type: '"// &
6751  trim(obsrv%ObsTypeId)//"'."
6752  call store_error(errmsg)
6753  end select
6754  call this%obs%SaveOneSimval(obsrv, v)
6755  end do
6756  end if
6757  else
6758  call this%obs%SaveOneSimval(obsrv, dnodata)
6759  end if
6760  end do
6761  !
6762  ! -- write summary of package error messages
6763  if (count_errors() > 0) then
6764  call store_error_filename(this%input_fname)
6765  end if
6766  end if
Here is the call graph for this function:

◆ csub_calc_adjes()

real(dp) function gwfcsubmodule::csub_calc_adjes ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  node,
real(dp), intent(in)  es0,
real(dp), intent(in)  z0,
real(dp), intent(in)  z 
)
private

Function to calculate the effective stress at specified elevation z using the provided effective stress (es0) calculated at elevation z0 (which is <= z)

Returns
es node elevation
Parameters
[in]nodecell node number
[in]es0effective stress at elevation z0
[in]z0elevation effective stress is calculate at
[in]zelevation to calculate effective stress at

Definition at line 5048 of file gwf-csub.f90.

5049  ! -- dummy variables
5050  class(GwfCsubType), intent(inout) :: this
5051  integer(I4B), intent(in) :: node !< cell node number
5052  real(DP), intent(in) :: es0 !< effective stress at elevation z0
5053  real(DP), intent(in) :: z0 !< elevation effective stress is calculate at
5054  real(DP), intent(in) :: z !< elevation to calculate effective stress at
5055  ! -- local variables
5056  real(DP) :: es
5057  !
5058  ! -- adjust effective stress to vertical node position
5059  es = es0 - (z - z0) * (this%sgs(node) - done)

◆ csub_calc_delay_flow()

real(dp) function gwfcsubmodule::csub_calc_delay_flow ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  ib,
integer(i4b), intent(in)  n,
real(dp), intent(in)  hcell 
)
private

Function to calculate the flow from across the top or bottom of a delay interbed.

Returns
q flow across the top or bottom of a delay interbed
Parameters
[in]ibinterbed number
[in]ndelay interbed cell
[in]hcellcurrent head in cell

Definition at line 6318 of file gwf-csub.f90.

6319  ! -- dummy variables
6320  class(GwfCsubType), intent(inout) :: this
6321  integer(I4B), intent(in) :: ib !< interbed number
6322  integer(I4B), intent(in) :: n !< delay interbed cell
6323  real(DP), intent(in) :: hcell !< current head in cell
6324  ! -- local variables
6325  integer(I4B) :: idelay
6326  real(DP) :: q
6327  real(DP) :: c
6328  !
6329  ! -- calculate flow between delay interbed and GWF
6330  idelay = this%idelay(ib)
6331  c = dtwo * this%kv(ib) / this%dbdzini(n, idelay)
6332  q = c * (hcell - this%dbh(n, idelay))

◆ csub_calc_interbed_thickness()

real(dp) function gwfcsubmodule::csub_calc_interbed_thickness ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  ib 
)
private

Function to calculate the interbed thickness.

Returns
thick interbed thickness
Parameters
[in]ibinterbed number

Definition at line 4995 of file gwf-csub.f90.

4996  ! -- dummy variables
4997  class(GwfCsubType), intent(inout) :: this
4998  integer(I4B), intent(in) :: ib !< interbed number
4999  ! -- local variables
5000  integer(I4B) :: idelay
5001  real(DP) :: thick
5002  !
5003  ! -- calculate interbed thickness
5004  idelay = this%idelay(ib)
5005  thick = this%thick(ib)
5006  if (idelay /= 0) then
5007  thick = thick * this%rnb(ib)
5008  end if

◆ csub_calc_sat()

subroutine gwfcsubmodule::csub_calc_sat ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  node,
real(dp), intent(in)  hcell,
real(dp), intent(in)  hcellold,
real(dp), intent(inout)  snnew,
real(dp), intent(inout)  snold 
)
private

Method to calculate the cell saturation for the current and previous time step.

Parameters
[in,out]snnewcurrent saturation
[in,out]snoldprevious saturation
[in]nodecell node number
[in]hcellcurrent head
[in]hcelloldprevious head
[in,out]snnewcurrent saturation
[in,out]snoldprevious saturation

Definition at line 5119 of file gwf-csub.f90.

5120  ! -- dummy variables
5121  class(GwfCsubType), intent(inout) :: this
5122  integer(I4B), intent(in) :: node !< cell node number
5123  real(DP), intent(in) :: hcell !< current head
5124  real(DP), intent(in) :: hcellold !< previous head
5125  real(DP), intent(inout) :: snnew !< current saturation
5126  real(DP), intent(inout) :: snold !< previous saturation
5127  ! -- local variables
5128  real(DP) :: top
5129  real(DP) :: bot
5130  !
5131  ! -- calculate cell saturation
5132  if (this%stoiconv(node) /= 0) then
5133  top = this%dis%top(node)
5134  bot = this%dis%bot(node)
5135  snnew = squadraticsaturation(top, bot, hcell, this%satomega)
5136  snold = squadraticsaturation(top, bot, hcellold, this%satomega)
5137  else
5138  snnew = done
5139  snold = done
5140  end if
5141  if (this%ieslag /= 0) then
5142  snold = snnew
5143  end if
Here is the call graph for this function:

◆ csub_calc_sat_derivative()

real(dp) function gwfcsubmodule::csub_calc_sat_derivative ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  node,
real(dp), intent(in)  hcell 
)
private

Function to calculate the derivative of the saturation with respect to the current head.

Returns
satderv derivative of saturation
Parameters
[in]nodecell node number
[in]hcellcurrent head

Definition at line 5153 of file gwf-csub.f90.

5154  ! -- dummy variables
5155  class(GwfCsubType), intent(inout) :: this
5156  integer(I4B), intent(in) :: node !< cell node number
5157  real(DP), intent(in) :: hcell !< current head
5158  ! -- local variables
5159  real(DP) :: satderv
5160  real(DP) :: top
5161  real(DP) :: bot
5162 
5163  if (this%stoiconv(node) /= 0) then
5164  top = this%dis%top(node)
5165  bot = this%dis%bot(node)
5166  satderv = squadraticsaturationderivative(top, bot, hcell, this%satomega)
5167  else
5168  satderv = dzero
5169  end if
Here is the call graph for this function:

◆ csub_calc_sfacts()

subroutine gwfcsubmodule::csub_calc_sfacts ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  node,
real(dp), intent(in)  bot,
real(dp), intent(in)  znode,
real(dp), intent(in)  theta,
real(dp), intent(in)  es,
real(dp), intent(in)  es0,
real(dp), intent(inout)  fact 
)
private

Method to calculate the factor that is used to calculate skeletal specific storage coefficients. Can be used for coarse-grained materials and interbeds.

Parameters
[in,out]factskeletal storage coefficient factor
[in]nodecell node number
[in]thetaporosity
[in]escurrent effective stress
[in]es0previous effective stress
[in,out]factskeletal storage coefficient factor (1/((1+void_ratio)*bar(es)))

Definition at line 5181 of file gwf-csub.f90.

5182  ! -- dummy variables
5183  class(GwfCsubType), intent(inout) :: this
5184  integer(I4B), intent(in) :: node !< cell node number
5185  real(DP), intent(in) :: bot !
5186  real(DP), intent(in) :: znode
5187  real(DP), intent(in) :: theta !< porosity
5188  real(DP), intent(in) :: es !< current effective stress
5189  real(DP), intent(in) :: es0 !< previous effective stress
5190  real(DP), intent(inout) :: fact !< skeletal storage coefficient factor (1/((1+void_ratio)*bar(es)))
5191  ! -- local variables
5192  real(DP) :: esv
5193  real(DP) :: void_ratio
5194  real(DP) :: denom
5195  !
5196  ! -- initialize variables
5197  fact = dzero
5198  if (this%ieslag /= 0) then
5199  esv = es0
5200  else
5201  esv = es
5202  end if
5203  !
5204  ! -- calculate storage factors for the effective stress case
5205  void_ratio = this%csub_calc_void_ratio(theta)
5206  denom = this%csub_calc_adjes(node, esv, bot, znode)
5207  denom = denom * (done + void_ratio)
5208  if (denom /= dzero) then
5209  fact = done / denom
5210  end if

◆ csub_calc_theta()

real(dp) function gwfcsubmodule::csub_calc_theta ( class(gwfcsubtype), intent(inout)  this,
real(dp), intent(in)  void_ratio 
)
private

Function to calculate the porosity from the void ratio.

Returns
theta porosity

Definition at line 4978 of file gwf-csub.f90.

4979  ! -- dummy variables
4980  class(GwfCsubType), intent(inout) :: this
4981  real(DP), intent(in) :: void_ratio
4982  ! -- local variables
4983  real(DP) :: theta
4984  !
4985  ! -- calculate theta
4986  theta = void_ratio / (done + void_ratio)

◆ csub_calc_void_ratio()

real(dp) function gwfcsubmodule::csub_calc_void_ratio ( class(gwfcsubtype), intent(inout)  this,
real(dp), intent(in)  theta 
)
private

Function to calculate the void ratio from the porosity.

Returns
void void ratio
Parameters
[in]thetaporosity

Definition at line 4962 of file gwf-csub.f90.

4963  ! -- dummy variables
4964  class(GwfCsubType), intent(inout) :: this
4965  real(DP), intent(in) :: theta !< porosity
4966  ! -- local variables
4967  real(DP) :: void_ratio
4968  ! -- calculate void ratio
4969  void_ratio = theta / (done - theta)

◆ csub_calc_znode()

real(dp) function gwfcsubmodule::csub_calc_znode ( class(gwfcsubtype), intent(inout)  this,
real(dp), intent(in)  top,
real(dp), intent(in)  bottom,
real(dp), intent(in)  zbar 
)
private

Function to calculate elevation of the node between the specified corrected elevation zbar and the bottom elevation. If zbar is greater than the top elevation, the node elevation is halfway between the top and bottom elevations. The corrected elevation (zbar) is always greater than or equal to bottom.

Returns
znode node elevation
Parameters
[in]toptop of cell
[in]bottombottom of cell
[in]zbarcorrected elevation

Definition at line 5021 of file gwf-csub.f90.

5022  ! -- dummy variables
5023  class(GwfCsubType), intent(inout) :: this
5024  real(DP), intent(in) :: top !< top of cell
5025  real(DP), intent(in) :: bottom !< bottom of cell
5026  real(DP), intent(in) :: zbar !< corrected elevation
5027  ! -- local variables
5028  real(DP) :: znode
5029  real(DP) :: v
5030  !
5031  ! -- calculate the node elevation
5032  if (zbar > top) then
5033  v = top
5034  else
5035  v = zbar
5036  end if
5037  znode = dhalf * (v + bottom)

◆ csub_cc()

subroutine gwfcsubmodule::csub_cc ( class(gwfcsubtype this,
integer(i4b), intent(in)  innertot,
integer(i4b), intent(in)  kiter,
integer(i4b), intent(in)  iend,
integer(i4b), intent(in)  icnvgmod,
integer(i4b), intent(in)  nodes,
real(dp), dimension(nodes), intent(in)  hnew,
real(dp), dimension(nodes), intent(in)  hold,
character(len=lenpakloc), intent(inout)  cpak,
integer(i4b), intent(inout)  ipak,
real(dp), intent(inout)  dpak 
)
private

Final convergence check for the CSUB package. The final convergence check is only required when the simulation includes delay interbeds. The final convergence check compares the sum of water contributed by storage and water compressibility in the delay bed to the fluid exchange between the delay interbed and the gwf cell.

Parameters
[in,out]cpakstring location of the maximum change in csub package
[in,out]ipaknode with the maximum change in csub package
[in,out]dpakmaximum change in csub package
[in]innertottotal number of inner iterations
[in]kiterouter iteration number
[in]iendflag indicating if it is the last iteration
[in]icnvgmodflag indicating if the solution is considered converged
[in]nodesnumber of active nodes
[in]hnewcurrent gwf head
[in]holdgwf for previous time step
[in,out]cpakstring location of the maximum change in csub package
[in,out]ipaknode with the maximum change in csub package
[in,out]dpakmaximum change in csub package

Definition at line 2639 of file gwf-csub.f90.

2641  ! -- modules
2642  use tdismodule, only: totim, kstp, kper, delt
2643  ! -- dummy variables
2644  class(GwfCsubType) :: this
2645  integer(I4B), intent(in) :: innertot !< total number of inner iterations
2646  integer(I4B), intent(in) :: kiter !< outer iteration number
2647  integer(I4B), intent(in) :: iend !< flag indicating if it is the last iteration
2648  integer(I4B), intent(in) :: icnvgmod !< flag indicating if the solution is considered converged
2649  integer(I4B), intent(in) :: nodes !< number of active nodes
2650  real(DP), dimension(nodes), intent(in) :: hnew !< current gwf head
2651  real(DP), dimension(nodes), intent(in) :: hold !< gwf for previous time step
2652  character(len=LENPAKLOC), intent(inout) :: cpak !< string location of the maximum change in csub package
2653  integer(I4B), intent(inout) :: ipak !< node with the maximum change in csub package
2654  real(DP), intent(inout) :: dpak !< maximum change in csub package
2655  ! local variables
2656  character(len=LENPAKLOC) :: cloc
2657  integer(I4B) :: icheck
2658  integer(I4B) :: ipakfail
2659  integer(I4B) :: ib
2660  integer(I4B) :: node
2661  integer(I4B) :: idelay
2662  integer(I4B) :: locdhmax
2663  integer(I4B) :: locrmax
2664  integer(I4B) :: ifirst
2665  real(DP) :: dhmax
2666  real(DP) :: rmax
2667  real(DP) :: dh
2668  real(DP) :: area
2669  real(DP) :: hcell
2670  real(DP) :: hcellold
2671  real(DP) :: snnew
2672  real(DP) :: snold
2673  real(DP) :: stoe
2674  real(DP) :: stoi
2675  real(DP) :: dwc
2676  real(DP) :: tled
2677  real(DP) :: hcof
2678  real(DP) :: rhs
2679  real(DP) :: v1
2680  real(DP) :: v2
2681  real(DP) :: df
2682  !
2683  ! -- initialize local variables
2684  icheck = this%iconvchk
2685  ipakfail = 0
2686  locdhmax = 0
2687  locrmax = 0
2688  ifirst = 1
2689  dhmax = dzero
2690  rmax = dzero
2691  !
2692  ! -- additional checks to see if convergence needs to be checked
2693  ! -- no convergence check for steady-state stress periods
2694  if (this%gwfiss /= 0) then
2695  icheck = 0
2696  else
2697  if (icnvgmod == 0) then
2698  icheck = 0
2699  end if
2700  end if
2701  !
2702  ! -- perform package convergence check
2703  if (icheck /= 0) then
2704  if (delt > dzero) then
2705  tled = done / delt
2706  else
2707  tled = dzero
2708  end if
2709  final_check: do ib = 1, this%ninterbeds
2710  idelay = this%idelay(ib)
2711  node = this%nodelist(ib)
2712  !
2713  ! -- skip nodelay interbeds
2714  if (idelay == 0) cycle
2715  !
2716  ! -- skip inactive cells
2717  if (this%ibound(node) < 1) cycle
2718  !
2719  ! -- evaluate the maximum head change in the interbed
2720  dh = this%dbdhmax(idelay)
2721  !
2722  ! -- evaluate difference between storage changes
2723  ! in the interbed and exchange between the interbed
2724  ! and the gwf cell
2725  area = this%dis%get_area(node)
2726  hcell = hnew(node)
2727  hcellold = hold(node)
2728  !
2729  ! -- calculate cell saturation
2730  call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
2731  !
2732  ! -- calculate the change in storage
2733  call this%csub_delay_calc_dstor(ib, hcell, stoe, stoi)
2734  v1 = (stoe + stoi) * area * this%rnb(ib) * tled
2735  !
2736  ! -- add water compressibility to storage term
2737  call this%csub_delay_calc_wcomp(ib, dwc)
2738  v1 = v1 + dwc * area * this%rnb(ib)
2739  !
2740  ! -- calculate the flow between the interbed and the cell
2741  call this%csub_delay_fc(ib, hcof, rhs)
2742  v2 = (-hcof * hcell - rhs) * area * this%rnb(ib)
2743  !
2744  ! -- calculate the difference between the interbed change in
2745  ! storage and the flow between the interbed and the cell
2746  df = v2 - v1
2747  !
2748  ! -- normalize by cell area and convert to a depth
2749  df = df * delt / area
2750  !
2751  ! -- evaluate magnitude of differences
2752  if (ifirst == 1) then
2753  ifirst = 0
2754  locdhmax = ib
2755  dhmax = dh
2756  locrmax = ib
2757  rmax = df
2758  else
2759  if (abs(dh) > abs(dhmax)) then
2760  locdhmax = ib
2761  dhmax = dh
2762  end if
2763  if (abs(df) > abs(rmax)) then
2764  locrmax = ib
2765  rmax = df
2766  end if
2767  end if
2768  end do final_check
2769  !
2770  ! -- set dpak and cpak
2771  ! -- update head error
2772  if (abs(dhmax) > abs(dpak)) then
2773  ipak = locdhmax
2774  dpak = dhmax
2775  write (cloc, "(a,'-',a)") trim(this%packName), 'head'
2776  cpak = cloc
2777  end if
2778  !
2779  ! -- update storage error
2780  if (abs(rmax) > abs(dpak)) then
2781  ipak = locrmax
2782  dpak = rmax
2783  write (cloc, "(a,'-',a)") trim(this%packName), 'storage'
2784  cpak = cloc
2785  end if
2786  !
2787  ! -- write convergence data to package csv
2788  if (this%ipakcsv /= 0) then
2789  !
2790  ! -- write the data
2791  call this%pakcsvtab%add_term(innertot)
2792  call this%pakcsvtab%add_term(totim)
2793  call this%pakcsvtab%add_term(kper)
2794  call this%pakcsvtab%add_term(kstp)
2795  call this%pakcsvtab%add_term(kiter)
2796  if (this%ndelaybeds > 0) then
2797  call this%pakcsvtab%add_term(dhmax)
2798  call this%pakcsvtab%add_term(locdhmax)
2799  call this%pakcsvtab%add_term(rmax)
2800  call this%pakcsvtab%add_term(locrmax)
2801  else
2802  call this%pakcsvtab%add_term('--')
2803  call this%pakcsvtab%add_term('--')
2804  call this%pakcsvtab%add_term('--')
2805  call this%pakcsvtab%add_term('--')
2806  end if
2807  !
2808  ! -- finalize the package csv
2809  if (iend == 1) then
2810  call this%pakcsvtab%finalize_table()
2811  end if
2812  end if
2813  end if
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

◆ csub_cg_calc_comp()

subroutine gwfcsubmodule::csub_cg_calc_comp ( class(gwfcsubtype this,
integer(i4b), intent(in)  node,
real(dp), intent(in)  hcell,
real(dp), intent(in)  hcellold,
real(dp), intent(inout)  comp 
)
private

Method calculates coarse-grained compaction in a cell.

Parameters
[in,out]compcoarse-grained compaction
[in]nodecell node number
[in]hcellcurrent head in cell
[in]hcelloldprevious head in cell
[in,out]compcoarse-grained compaction

Definition at line 4666 of file gwf-csub.f90.

4667  ! -- dummy variables
4668  class(GwfCsubType) :: this
4669  integer(I4B), intent(in) :: node !< cell node number
4670  real(DP), intent(in) :: hcell !< current head in cell
4671  real(DP), intent(in) :: hcellold !< previous head in cell
4672  real(DP), intent(inout) :: comp !< coarse-grained compaction
4673  ! -- local variables
4674  real(DP) :: area
4675  real(DP) :: tled
4676  real(DP) :: hcof
4677  real(DP) :: rhs
4678  !
4679  ! -- initialize variables
4680  area = done
4681  tled = done
4682  !
4683  ! -- calculate terms
4684  call this%csub_cg_fc(node, tled, area, hcell, hcellold, hcof, rhs)
4685  !
4686  ! - calculate compaction
4687  comp = hcof * hcell - rhs

◆ csub_cg_calc_sske()

subroutine gwfcsubmodule::csub_cg_calc_sske ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  n,
real(dp), intent(inout)  sske,
real(dp), intent(in)  hcell 
)

Method calculates Sske for coarse-grained materials in a cell.

Parameters
[in,out]sskecoarse-grained Sske
[in]ncell node number
[in,out]sskecoarse grained Sske
[in]hcellcurrent head in cell

Definition at line 4610 of file gwf-csub.f90.

4611  ! -- dummy variables
4612  class(GwfCsubType), intent(inout) :: this
4613  integer(I4B), intent(in) :: n !< cell node number
4614  real(DP), intent(inout) :: sske !< coarse grained Sske
4615  real(DP), intent(in) :: hcell !< current head in cell
4616  ! -- local variables
4617  real(DP) :: top
4618  real(DP) :: bot
4619  real(DP) :: hbar
4620  real(DP) :: znode
4621  real(DP) :: es
4622  real(DP) :: es0
4623  real(DP) :: theta
4624  real(DP) :: f
4625  real(DP) :: f0
4626  !
4627  ! -- initialize variables
4628  sske = dzero
4629  !
4630  ! -- calculate factor for the head-based case
4631  if (this%lhead_based .EQV. .true.) then
4632  f = done
4633  f0 = done
4634  !
4635  ! -- calculate factor for the effective stress case
4636  else
4637  top = this%dis%top(n)
4638  bot = this%dis%bot(n)
4639  !
4640  ! -- calculate corrected head (hbar)
4641  hbar = squadratic0sp(hcell, bot, this%satomega)
4642  !
4643  ! -- calculate znode
4644  znode = this%csub_calc_znode(top, bot, hbar)
4645  !
4646  ! -- calculate effective stress and theta
4647  es = this%cg_es(n)
4648  es0 = this%cg_es0(n)
4649  theta = this%cg_thetaini(n)
4650  !
4651  ! -- calculate the compression index factors for the delay
4652  ! node relative to the center of the cell based on the
4653  ! current and previous head
4654  call this%csub_calc_sfacts(n, bot, znode, theta, es, es0, f)
4655  end if
4656  sske = f * this%cg_ske_cr(n)
Here is the call graph for this function:

◆ csub_cg_calc_stress()

subroutine gwfcsubmodule::csub_cg_calc_stress ( class(gwfcsubtype this,
integer(i4b), intent(in)  nodes,
real(dp), dimension(nodes), intent(in)  hnew 
)
private

Method calculates the geostatic stress, pressure head, and effective stress at the bottom of each cell. The method also applies the overlying geostatic stress (sig0) not represented in the model.

Parameters
[in]nodesnumber of active model nodes
[in]hnewcurrent head

Definition at line 3520 of file gwf-csub.f90.

3521  ! -- dummy variables
3522  class(GwfCsubType) :: this
3523  integer(I4B), intent(in) :: nodes !< number of active model nodes
3524  real(DP), dimension(nodes), intent(in) :: hnew !< current head
3525  ! -- local variables
3526  integer(I4B) :: node
3527  integer(I4B) :: ii
3528  integer(I4B) :: nn
3529  integer(I4B) :: m
3530  integer(I4B) :: idx_conn
3531  real(DP) :: gs
3532  real(DP) :: top
3533  real(DP) :: bot
3534  real(DP) :: thick
3535  real(DP) :: va_scale
3536  real(DP) :: hcell
3537  real(DP) :: hbar
3538  real(DP) :: gs_conn
3539  real(DP) :: es
3540  real(DP) :: phead
3541  real(DP) :: sadd
3542  !
3543  ! -- calculate geostatic stress if necessary
3544  if (this%iupdatestress /= 0) then
3545  do node = 1, this%dis%nodes
3546  !
3547  ! -- calculate geostatic stress for this node
3548  ! this represents the geostatic stress component
3549  ! for the cell
3550  top = this%dis%top(node)
3551  bot = this%dis%bot(node)
3552  thick = top - bot
3553  !
3554  ! -- calculate cell contribution to geostatic stress
3555  if (this%ibound(node) /= 0) then
3556  hcell = hnew(node)
3557  else
3558  hcell = bot
3559  end if
3560  !
3561  ! -- calculate corrected head (hbar)
3562  hbar = squadratic0sp(hcell, bot, this%satomega)
3563  !
3564  ! -- geostatic stress calculation
3565  if (hcell < top) then
3566  gs = (top - hbar) * this%sgm(node) + (hbar - bot) * this%sgs(node)
3567  else
3568  gs = thick * this%sgs(node)
3569  end if
3570  !
3571  ! -- cell contribution to geostatic stress
3572  this%cg_gs(node) = gs
3573  end do
3574  !
3575  ! -- add user specified overlying geostatic stress
3576  do nn = 1, this%nbound
3577  node = this%nodelistsig0(nn)
3578  sadd = this%sig0(nn)
3579  this%cg_gs(node) = this%cg_gs(node) + sadd
3580  end do
3581  !
3582  ! -- calculate geostatic stress above cell
3583  do node = 1, this%dis%nodes
3584  !
3585  ! -- geostatic stress of cell
3586  gs = this%cg_gs(node)
3587  !
3588  ! -- Add geostatic stress of overlying cells (ihc=0)
3589  ! m < node = m is vertically above node
3590  do ii = this%dis%con%ia(node) + 1, this%dis%con%ia(node + 1) - 1
3591  !
3592  ! -- Set the m cell number
3593  m = this%dis%con%ja(ii)
3594  idx_conn = this%dis%con%jas(ii)
3595  !
3596  ! -- vertical connection
3597  if (this%dis%con%ihc(idx_conn) == 0) then
3598  !
3599  ! -- node has an overlying cell
3600  if (m < node) then
3601  !
3602  ! -- dis and disv discretization
3603  if (this%dis%ndim /= 1) then
3604  gs = gs + this%cg_gs(m)
3605  !
3606  ! -- disu discretization
3607  else
3608  va_scale = this%dis%get_area_factor(node, idx_conn)
3609  gs_conn = this%cg_gs(m)
3610  gs = gs + (gs_conn * va_scale)
3611  end if
3612  end if
3613  end if
3614  end do
3615  !
3616  ! -- geostatic stress for cell with geostatic stress
3617  ! of overlying cells
3618  this%cg_gs(node) = gs
3619  end do
3620  end if
3621  !
3622  ! -- save effective stress from the last iteration and
3623  ! calculate the new effective stress for a cell
3624  do node = 1, this%dis%nodes
3625  top = this%dis%top(node)
3626  bot = this%dis%bot(node)
3627  if (this%ibound(node) /= 0) then
3628  hcell = hnew(node)
3629  else
3630  hcell = bot
3631  end if
3632  !
3633  ! -- calculate corrected head (hbar)
3634  hbar = squadratic0sp(hcell, bot, this%satomega)
3635  !
3636  ! -- calculate pressure head
3637  phead = hbar - bot
3638  !
3639  ! -- calculate effective stress
3640  es = this%cg_gs(node) - phead
3641  this%cg_es(node) = es
3642  end do
Here is the call graph for this function:

◆ csub_cg_chk_stress()

subroutine gwfcsubmodule::csub_cg_chk_stress ( class(gwfcsubtype this)
private

Method checks calculated effective stress values to ensure that effective stress values are positive. An error condition and message are issued if calculated effective stress values are less than a small positive value (DEM6).

Definition at line 3653 of file gwf-csub.f90.

3654  ! -- dummy variables
3655  class(GwfCsubType) :: this
3656  ! -- local variables
3657  character(len=20) :: cellid
3658  integer(I4B) :: ierr
3659  integer(I4B) :: node
3660  real(DP) :: gs
3661  real(DP) :: bot
3662  real(DP) :: hcell
3663  real(DP) :: es
3664  real(DP) :: phead
3665  !
3666  ! -- initialize variables
3667  ierr = 0
3668  !
3669  ! -- check geostatic stress if necessary
3670  !
3671  ! -- save effective stress from the last iteration and
3672  ! calculate the new effective stress for a cell
3673  do node = 1, this%dis%nodes
3674  if (this%ibound(node) < 1) cycle
3675  bot = this%dis%bot(node)
3676  gs = this%cg_gs(node)
3677  es = this%cg_es(node)
3678  phead = dzero
3679  if (this%ibound(node) /= 0) then
3680  phead = gs - es
3681  end if
3682  hcell = phead + bot
3683  if (this%lhead_based .EQV. .false.) then
3684  if (es < dem6) then
3685  ierr = ierr + 1
3686  call this%dis%noder_to_string(node, cellid)
3687  write (errmsg, '(a,g0,a,1x,a,1x,a,4(g0,a))') &
3688  'Small to negative effective stress (', es, ') in cell', &
3689  trim(adjustl(cellid)), '. (', es, ' = ', this%cg_gs(node), &
3690  ' - (', hcell, ' - ', bot, ').'
3691  call store_error(errmsg)
3692  end if
3693  end if
3694  end do
3695  !
3696  ! -- write a summary error message
3697  if (ierr > 0) then
3698  write (errmsg, '(a,1x,i0,3(1x,a))') &
3699  'Solution: small to negative effective stress values in', ierr, &
3700  'cells can be eliminated by increasing storage values and/or ', &
3701  'adding/modifying stress boundaries to prevent water-levels from', &
3702  'exceeding the top of the model.'
3703  call store_error(errmsg)
3704  call store_error_filename(this%input_fname)
3705  end if
Here is the call graph for this function:

◆ csub_cg_fc()

subroutine gwfcsubmodule::csub_cg_fc ( class(gwfcsubtype this,
integer(i4b), intent(in)  node,
real(dp), intent(in)  tled,
real(dp), intent(in)  area,
real(dp), intent(in)  hcell,
real(dp), intent(in)  hcellold,
real(dp), intent(inout)  hcof,
real(dp), intent(inout)  rhs 
)
private

Method formulates the coefficient matrix and right-hand side terms for coarse grained materials in a cell.

Parameters
[in,out]hcofcoarse-grained A matrix entry
[in,out]rhscoarse-grained right-hand side entry
[in]nodecell node number
[in]tledrecripicol of the time step length
[in]areahorizontal cell area
[in]hcellcurrent head
[in]hcelloldprevious head
[in,out]hcofcoarse-grained A matrix entry
[in,out]rhscoarse-grained right-hand side entry

Definition at line 4296 of file gwf-csub.f90.

4297  ! -- dummy variables
4298  class(GwfCsubType) :: this
4299  integer(I4B), intent(in) :: node !< cell node number
4300  real(DP), intent(in) :: tled !< recripicol of the time step length
4301  real(DP), intent(in) :: area !< horizontal cell area
4302  real(DP), intent(in) :: hcell !< current head
4303  real(DP), intent(in) :: hcellold !< previous head
4304  real(DP), intent(inout) :: hcof !< coarse-grained A matrix entry
4305  real(DP), intent(inout) :: rhs !< coarse-grained right-hand side entry
4306  ! -- local variables
4307  real(DP) :: top
4308  real(DP) :: bot
4309  real(DP) :: tthk
4310  real(DP) :: snold
4311  real(DP) :: snnew
4312  real(DP) :: hbar
4313  real(DP) :: sske
4314  real(DP) :: rho1
4315  !
4316  ! -- initialize variables
4317  rhs = dzero
4318  hcof = dzero
4319  !
4320  ! -- aquifer elevations and thickness
4321  top = this%dis%top(node)
4322  bot = this%dis%bot(node)
4323  tthk = this%cg_thickini(node)
4324  !
4325  ! -- calculate hcof and rhs terms if coarse-grained materials present
4326  if (tthk > dzero) then
4327  !
4328  ! -- calculate aquifer saturation
4329  call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4330  !
4331  ! -- calculate corrected head (hbar)
4332  hbar = squadratic0sp(hcell, bot, this%satomega)
4333  !
4334  ! -- storage coefficients
4335  call this%csub_cg_calc_sske(node, sske, hcell)
4336  rho1 = sske * area * tthk * tled
4337  !
4338  ! -- update sk and ske
4339  this%cg_ske(node) = sske * tthk * snold
4340  this%cg_sk(node) = sske * tthk * snnew
4341  !
4342  ! -- calculate hcof and rhs term
4343  hcof = -rho1 * snnew
4344  rhs = rho1 * snold * this%cg_es0(node) - &
4345  rho1 * snnew * (this%cg_gs(node) + bot)
4346  !
4347  ! -- calculate and apply the flow correction term
4348  rhs = rhs - rho1 * snnew * (hcell - hbar)
4349  end if
Here is the call graph for this function:

◆ csub_cg_fn()

subroutine gwfcsubmodule::csub_cg_fn ( class(gwfcsubtype this,
integer(i4b), intent(in)  node,
real(dp), intent(in)  tled,
real(dp), intent(in)  area,
real(dp), intent(in)  hcell,
real(dp), intent(inout)  hcof,
real(dp), intent(inout)  rhs 
)
private

Method formulates the coefficient matrix and right-hand side terms for coarse grained materials in a cell when using the Newton-Raphson formulation.

Parameters
[in,out]hcofcoarse-grained A matrix entry
[in,out]rhscoarse-grained right-hand side entry
[in]nodenode number
[in]tledreciprocal of the time step length
[in]areahorizontal cell area
[in]hcellcurrent head in cell
[in,out]hcofcoarse-grained A matrix entry
[in,out]rhscoarse-grained right-hand side entry

Definition at line 4362 of file gwf-csub.f90.

4363  ! -- dummy variables
4364  class(GwfCsubType) :: this
4365  integer(I4B), intent(in) :: node !< node number
4366  real(DP), intent(in) :: tled !< reciprocal of the time step length
4367  real(DP), intent(in) :: area !< horizontal cell area
4368  real(DP), intent(in) :: hcell !< current head in cell
4369  real(DP), intent(inout) :: hcof !< coarse-grained A matrix entry
4370  real(DP), intent(inout) :: rhs !< coarse-grained right-hand side entry
4371  ! -- local variables
4372  real(DP) :: top
4373  real(DP) :: bot
4374  real(DP) :: tthk
4375  real(DP) :: snnew
4376  real(DP) :: snold
4377  real(DP) :: satderv
4378  real(DP) :: hbar
4379  real(DP) :: hbarderv
4380  real(DP) :: sske
4381  real(DP) :: rho1
4382  !
4383  ! -- initialize variables
4384  rhs = dzero
4385  hcof = dzero
4386  !
4387  ! -- aquifer elevations and thickness
4388  top = this%dis%top(node)
4389  bot = this%dis%bot(node)
4390  tthk = this%cg_thickini(node)
4391  !
4392  ! -- calculate newton terms if coarse-grained materials present
4393  if (tthk > dzero) then
4394  !
4395  ! -- calculate aquifer saturation - only need snnew
4396  call this%csub_calc_sat(node, hcell, top, snnew, snold)
4397  !
4398  ! -- calculate saturation derivative
4399  satderv = this%csub_calc_sat_derivative(node, hcell)
4400  !
4401  ! -- calculate corrected head (hbar)
4402  hbar = squadratic0sp(hcell, bot, this%satomega)
4403  !
4404  ! -- calculate the derivative of the hbar functions
4405  hbarderv = squadratic0spderivative(hcell, bot, this%satomega)
4406  !
4407  ! -- storage coefficients
4408  call this%csub_cg_calc_sske(node, sske, hcell)
4409  rho1 = sske * area * tthk * tled
4410  !
4411  ! -- calculate hcof term
4412  hcof = rho1 * snnew * (done - hbarderv) + &
4413  rho1 * (this%cg_gs(node) - hbar + bot) * satderv
4414  !
4415  ! -- Add additional term if using lagged effective stress
4416  if (this%ieslag /= 0) then
4417  hcof = hcof - rho1 * this%cg_es0(node) * satderv
4418  end if
4419  !
4420  ! -- calculate rhs term
4421  rhs = hcof * hcell
4422  end if
Here is the call graph for this function:

◆ csub_cg_update()

subroutine gwfcsubmodule::csub_cg_update ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  node 
)
private

Method updates coarse-grained material properties in a cell.

Parameters
[in]nodecell node number

Definition at line 4695 of file gwf-csub.f90.

4696  ! -- dummy variables
4697  class(GwfCsubType), intent(inout) :: this
4698  integer(I4B), intent(in) :: node !< cell node number
4699  ! -- local variables
4700  character(len=20) :: cellid
4701  real(DP) :: comp
4702  real(DP) :: thick
4703  real(DP) :: theta
4704  !
4705  ! -- update thickness and theta
4706  comp = this%cg_tcomp(node) + this%cg_comp(node)
4707  call this%dis%noder_to_string(node, cellid)
4708  if (abs(comp) > dzero) then
4709  thick = this%cg_thickini(node)
4710  theta = this%cg_thetaini(node)
4711  call this%csub_adj_matprop(comp, thick, theta)
4712  if (thick <= dzero) then
4713  write (errmsg, '(a,1x,a,1x,a,g0,a)') &
4714  'Adjusted thickness for cell', trim(adjustl(cellid)), &
4715  'is less than or equal to 0 (', thick, ').'
4716  call store_error(errmsg)
4717  end if
4718  if (theta <= dzero) then
4719  write (errmsg, '(a,1x,a,1x,a,g0,a)') &
4720  'Adjusted theta for cell', trim(adjustl(cellid)), &
4721  'is less than or equal to 0 (', theta, ').'
4722  call store_error(errmsg)
4723  end if
4724  this%cg_thick(node) = thick
4725  this%cg_theta(node) = theta
4726  end if
Here is the call graph for this function:

◆ csub_cg_wcomp_fc()

subroutine gwfcsubmodule::csub_cg_wcomp_fc ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  node,
real(dp), intent(in)  tled,
real(dp), intent(in)  area,
real(dp), intent(in)  hcell,
real(dp), intent(in)  hcellold,
real(dp), intent(inout)  hcof,
real(dp), intent(inout)  rhs 
)
private

Method formulates the standard formulation coefficient matrix and right-hand side terms for water compressibility in coarse-grained sediments.

Parameters
[in,out]hcofcoarse-grained A matrix entry
[in,out]rhscoarse-grained right-hand side entry
[in]nodecell node number
[in]tledreciprocal of the time step length
[in]areahorizontal cell area
[in]hcellcurrent head in cell
[in]hcelloldprevious head in cell
[in,out]hcofcoarse-grained A matrix entry
[in,out]rhscoarse-grained right-hand side entry

Definition at line 4739 of file gwf-csub.f90.

4741  ! -- dummy variables
4742  class(GwfCsubType), intent(inout) :: this
4743  integer(I4B), intent(in) :: node !< cell node number
4744  real(DP), intent(in) :: tled !< reciprocal of the time step length
4745  real(DP), intent(in) :: area !< horizontal cell area
4746  real(DP), intent(in) :: hcell !< current head in cell
4747  real(DP), intent(in) :: hcellold !< previous head in cell
4748  real(DP), intent(inout) :: hcof !< coarse-grained A matrix entry
4749  real(DP), intent(inout) :: rhs !< coarse-grained right-hand side entry
4750  ! -- local variables
4751  real(DP) :: top
4752  real(DP) :: bot
4753  real(DP) :: tthk
4754  real(DP) :: tthk0
4755  real(DP) :: snold
4756  real(DP) :: snnew
4757  real(DP) :: wc
4758  real(DP) :: wc0
4759  !
4760  ! -- initialize variables
4761  rhs = dzero
4762  hcof = dzero
4763  !
4764  ! -- aquifer elevations and thickness
4765  top = this%dis%top(node)
4766  bot = this%dis%bot(node)
4767  tthk = this%cg_thick(node)
4768  tthk0 = this%cg_thick0(node)
4769  !
4770  ! -- aquifer saturation
4771  call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4772  !
4773  ! -- storage coefficients
4774  wc0 = this%brg * area * tthk0 * this%cg_theta0(node) * tled
4775  wc = this%brg * area * tthk * this%cg_theta(node) * tled
4776  !
4777  ! -- calculate hcof term
4778  hcof = -wc * snnew
4779  !
4780  ! -- calculate rhs term
4781  rhs = -wc0 * snold * hcellold

◆ csub_cg_wcomp_fn()

subroutine gwfcsubmodule::csub_cg_wcomp_fn ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  node,
real(dp), intent(in)  tled,
real(dp), intent(in)  area,
real(dp), intent(in)  hcell,
real(dp), intent(in)  hcellold,
real(dp), intent(inout)  hcof,
real(dp), intent(inout)  rhs 
)
private

Method formulates the Newton-Raphson formulation coefficient matrix and right-hand side terms for water compressibility in coarse-grained sediments.

Parameters
[in,out]hcofcoarse-grained A matrix entry
[in,out]rhscoarse-grained right-hand side entry
[in]nodecell node number
[in]tledreciprocal of the time step length
[in]areahorizontal cell area
[in]hcellcurrent head in cell
[in]hcelloldprevious head in cell
[in,out]hcofcoarse-grained A matrix entry
[in,out]rhscoarse-grained right-hand side entry

Definition at line 4794 of file gwf-csub.f90.

4795  ! -- dummy variables
4796  class(GwfCsubType), intent(inout) :: this
4797  integer(I4B), intent(in) :: node !< cell node number
4798  real(DP), intent(in) :: tled !< reciprocal of the time step length
4799  real(DP), intent(in) :: area !< horizontal cell area
4800  real(DP), intent(in) :: hcell !< current head in cell
4801  real(DP), intent(in) :: hcellold !< previous head in cell
4802  real(DP), intent(inout) :: hcof !< coarse-grained A matrix entry
4803  real(DP), intent(inout) :: rhs !< coarse-grained right-hand side entry
4804  ! -- local variables
4805  real(DP) :: top
4806  real(DP) :: bot
4807  real(DP) :: tthk
4808  real(DP) :: tthk0
4809  real(DP) :: satderv
4810  real(DP) :: f
4811  real(DP) :: wc
4812  real(DP) :: wc0
4813  !
4814  ! -- initialize variables
4815  rhs = dzero
4816  hcof = dzero
4817  !
4818  ! -- aquifer elevations and thickness
4819  top = this%dis%top(node)
4820  bot = this%dis%bot(node)
4821  tthk = this%cg_thick(node)
4822  !
4823  ! -- calculate saturation derivative
4824  satderv = this%csub_calc_sat_derivative(node, hcell)
4825  !
4826  ! -- calculate water compressibility factor
4827  f = this%brg * area * tled
4828  !
4829  ! -- water compressibility coefficient
4830  wc = f * tthk * this%cg_theta(node)
4831  !
4832  ! -- calculate hcof term
4833  hcof = -wc * hcell * satderv
4834  !
4835  ! -- Add additional term if using lagged effective stress
4836  if (this%ieslag /= 0) then
4837  tthk0 = this%cg_thick0(node)
4838  wc0 = f * tthk0 * this%cg_theta0(node)
4839  hcof = hcof + wc * hcellold * satderv
4840  end if
4841  !
4842  ! -- calculate rhs term
4843  rhs = hcof * hcell

◆ csub_cq()

subroutine gwfcsubmodule::csub_cq ( class(gwfcsubtype this,
integer(i4b), intent(in)  nodes,
real(dp), dimension(nodes), intent(in)  hnew,
real(dp), dimension(nodes), intent(in)  hold,
integer(i4b), intent(in)  isuppress_output,
real(dp), dimension(:), intent(inout), contiguous  flowja 
)

Flow calculation for the CSUB package components. Components include coarse-grained storage, delay and no-delay interbeds, and water compressibility.

Parameters
[in,out]model_budgetmodel budget object
[in]nodesnumber of active model nodes
[in]hnewcurrent head
[in]holdhead for the previous time step
[in]isuppress_outputflag indicating if budget output should be suppressed

Definition at line 2825 of file gwf-csub.f90.

2826  ! -- modules
2827  use tdismodule, only: delt
2828  use constantsmodule, only: lenboundname, dzero, done
2829  ! -- dummy variables
2830  class(GwfCsubType) :: this
2831  integer(I4B), intent(in) :: nodes !< number of active model nodes
2832  real(DP), intent(in), dimension(nodes) :: hnew !< current head
2833  real(DP), intent(in), dimension(nodes) :: hold !< head for the previous time step
2834  integer(I4B), intent(in) :: isuppress_output !< flag indicating if budget output should be suppressed
2835  real(DP), dimension(:), contiguous, intent(inout) :: flowja
2836  ! -- local variables
2837  integer(I4B) :: ib
2838  integer(I4B) :: idelay
2839  integer(I4B) :: ielastic
2840  integer(I4B) :: iconvert
2841  integer(I4B) :: node
2842  integer(I4B) :: nn
2843  integer(I4B) :: n
2844  integer(I4B) :: idiag
2845  real(DP) :: es
2846  real(DP) :: pcs
2847  real(DP) :: rho1
2848  real(DP) :: rho2
2849  real(DP) :: tled
2850  real(DP) :: tledm
2851  real(DP) :: es0
2852  real(DP) :: rrate
2853  real(DP) :: ratein
2854  real(DP) :: rateout
2855  real(DP) :: comp
2856  real(DP) :: compi
2857  real(DP) :: compe
2858  real(DP) :: area
2859  real(DP) :: h
2860  real(DP) :: h0
2861  real(DP) :: snnew
2862  real(DP) :: snold
2863  real(DP) :: hcof
2864  real(DP) :: rhs
2865  real(DP) :: stoe
2866  real(DP) :: stoi
2867  real(DP) :: b
2868  real(DP) :: q
2869  real(DP) :: rratewc
2870  ! -- for observations
2871  integer(I4B) :: iprobslocal
2872  ! -- formats
2873  !
2874  ! -- Suppress saving of simulated values; they
2875  ! will be saved at end of this procedure.
2876  iprobslocal = 0
2877  ratein = dzero
2878  rateout = dzero
2879  !
2880  ! -- coarse-grained coarse-grained storage
2881  do node = 1, this%dis%nodes
2882  idiag = this%dis%con%ia(node)
2883  area = this%dis%get_area(node)
2884  comp = dzero
2885  rrate = dzero
2886  rratewc = dzero
2887  if (this%gwfiss == 0) then
2888  if (delt > dzero) then
2889  tled = done / delt
2890  else
2891  tled = dzero
2892  end if
2893  if (this%ibound(node) > 0 .and. this%cg_thickini(node) > dzero) then
2894  !
2895  ! -- calculate coarse-grained storage terms
2896  call this%csub_cg_fc(node, tled, area, hnew(node), hold(node), &
2897  hcof, rhs)
2898  rrate = hcof * hnew(node) - rhs
2899  !
2900  ! -- calculate compaction
2901  call this%csub_cg_calc_comp(node, hnew(node), hold(node), comp)
2902  !
2903  ! -- calculate coarse-grained water compressibility storage terms
2904  call this%csub_cg_wcomp_fc(node, tled, area, hnew(node), hold(node), &
2905  hcof, rhs)
2906  rratewc = hcof * hnew(node) - rhs
2907  end if
2908  end if
2909  !
2910  ! -- update coarse-grained storage and water
2911  ! compression variables
2912  this%cg_stor(node) = rrate
2913  this%cell_wcstor(node) = rratewc
2914  this%cell_thick(node) = this%cg_thick(node)
2915  !
2916  ! -- update incremental coarse-grained compaction
2917  this%cg_comp(node) = comp
2918  !
2919  !
2920  ! -- update states if required
2921  if (isuppress_output == 0) then
2922  !
2923  ! -- calculate strain and change in coarse-grained void ratio and thickness
2924  ! todo: consider moving error check in csub_cg_update to ot()
2925  if (this%iupdatematprop /= 0) then
2926  call this%csub_cg_update(node)
2927  end if
2928  !
2929  ! -- update total compaction
2930  this%cg_tcomp(node) = this%cg_tcomp(node) + comp
2931  end if
2932  !
2933  ! -- update flowja
2934  flowja(idiag) = flowja(idiag) + rrate
2935  flowja(idiag) = flowja(idiag) + rratewc
2936  end do
2937  !
2938  ! -- interbed storage
2939  !
2940  ! -- reset delay bed counters for the current time step
2941  if (this%ndelaybeds > 0) then
2942  this%idb_nconv_count(1) = 0
2943  end if
2944  !
2945  ! -- initialize tled
2946  tled = done
2947  !
2948  ! -- calculate budget terms for each interbed
2949  do ib = 1, this%ninterbeds
2950  rratewc = dzero
2951  idelay = this%idelay(ib)
2952  ielastic = this%ielastic(ib)
2953  !
2954  ! -- calculate interbed thickness
2955  ! -- no delay interbeds
2956  if (idelay == 0) then
2957  b = this%thick(ib)
2958  ! -- delay interbeds
2959  else
2960  b = this%thick(ib) * this%rnb(ib)
2961  end if
2962  !
2963  ! -- set variables required for no-delay and delay interbeds
2964  node = this%nodelist(ib)
2965  idiag = this%dis%con%ia(node)
2966  area = this%dis%get_area(node)
2967  !
2968  ! -- add interbed thickness to cell thickness
2969  this%cell_thick(node) = this%cell_thick(node) + b
2970  !
2971  ! -- update budget terms if transient stress period
2972  if (this%gwfiss == 0) then
2973  if (delt > dzero) then
2974  tledm = done / delt
2975  else
2976  tledm = dzero
2977  end if
2978  !
2979  ! -- skip inactive and constant head cells
2980  if (this%ibound(node) < 1) cycle
2981  !
2982  ! -- no delay interbeds
2983  if (idelay == 0) then
2984  iconvert = this%iconvert(ib)
2985  stoi = dzero
2986  !
2987  ! -- calculate compaction
2988  call this%csub_nodelay_calc_comp(ib, hnew(node), hold(node), comp, &
2989  rho1, rho2)
2990  !
2991  ! -- interbed stresses
2992  es = this%cg_es(node)
2993  pcs = this%pcs(ib)
2994  es0 = this%cg_es0(node)
2995  !
2996  ! -- calculate inelastic and elastic compaction
2997  if (ielastic > 0 .or. iconvert == 0) then
2998  stoe = comp
2999  else
3000  stoi = -pcs * rho2 + (rho2 * es)
3001  stoe = pcs * rho1 - (rho1 * es0)
3002  end if
3003  compe = stoe
3004  compi = stoi
3005  stoe = stoe * area
3006  stoi = stoi * area
3007  this%storagee(ib) = stoe * tledm
3008  this%storagei(ib) = stoi * tledm
3009  !
3010  ! -- update compaction
3011  this%comp(ib) = comp
3012  !
3013  ! -- update states if required
3014  if (isuppress_output == 0) then
3015  !
3016  ! -- calculate strain and change in interbed void ratio and thickness
3017  if (this%iupdatematprop /= 0) then
3018  call this%csub_nodelay_update(ib)
3019  end if
3020  !
3021  ! -- update total compaction
3022  this%tcomp(ib) = this%tcomp(ib) + comp
3023  this%tcompe(ib) = this%tcompe(ib) + compe
3024  this%tcompi(ib) = this%tcompi(ib) + compi
3025  end if
3026  !
3027  ! -- delay interbeds
3028  else
3029  h = hnew(node)
3030  h0 = hold(node)
3031  !
3032  ! -- calculate cell saturation
3033  call this%csub_calc_sat(node, h, h0, snnew, snold)
3034  !
3035  ! -- calculate inelastic and elastic storage contributions
3036  call this%csub_delay_calc_dstor(ib, h, stoe, stoi)
3037  this%storagee(ib) = stoe * area * this%rnb(ib) * tledm
3038  this%storagei(ib) = stoi * area * this%rnb(ib) * tledm
3039  !
3040  ! -- calculate flow across the top and bottom of the delay interbed
3041  q = this%csub_calc_delay_flow(ib, 1, h) * area * this%rnb(ib)
3042  this%dbflowtop(idelay) = q
3043  nn = this%ndelaycells
3044  q = this%csub_calc_delay_flow(ib, nn, h) * area * this%rnb(ib)
3045  this%dbflowbot(idelay) = q
3046  !
3047  ! -- update states if required
3048  if (isuppress_output == 0) then
3049  !
3050  ! -- calculate sum of compaction in delay interbed
3051  call this%csub_delay_calc_comp(ib, h, h0, comp, compi, compe)
3052  !
3053  ! - calculate strain and change in interbed void ratio and thickness
3054  ! todo: consider moving error check in csub_delay_update to ot()
3055  if (this%iupdatematprop /= 0) then
3056  call this%csub_delay_update(ib)
3057  end if
3058  !
3059  ! -- update total compaction for interbed
3060  this%tcomp(ib) = this%tcomp(ib) + comp
3061  this%tcompi(ib) = this%tcompi(ib) + compi
3062  this%tcompe(ib) = this%tcompe(ib) + compe
3063  !
3064  ! -- update total compaction for each delay bed cell
3065  do n = 1, this%ndelaycells
3066  this%dbtcomp(n, idelay) = this%dbtcomp(n, idelay) + &
3067  this%dbcomp(n, idelay)
3068  end do
3069  !
3070  ! -- check delay bed heads relative to the top and bottom of each
3071  ! delay bed cell for convertible and non-convertible gwf cells
3072  call this%csub_delay_head_check(ib)
3073  end if
3074  end if
3075  !
3076  ! -- interbed water compressibility
3077  !
3078  ! -- no-delay interbed
3079  if (idelay == 0) then
3080  call this%csub_nodelay_wcomp_fc(ib, node, tledm, area, &
3081  hnew(node), hold(node), hcof, rhs)
3082  rratewc = hcof * hnew(node) - rhs
3083  !
3084  ! -- delay interbed
3085  else
3086  call this%csub_delay_calc_wcomp(ib, q)
3087  rratewc = q * area * this%rnb(ib)
3088  end if
3089  this%cell_wcstor(node) = this%cell_wcstor(node) + rratewc
3090  !
3091  ! -- flowja
3092  flowja(idiag) = flowja(idiag) + rratewc
3093  else
3094  this%storagee(ib) = dzero
3095  this%storagei(ib) = dzero
3096  if (idelay /= 0) then
3097  this%dbflowtop(idelay) = dzero
3098  this%dbflowbot(idelay) = dzero
3099  end if
3100  end if
3101  !
3102  ! -- flowja
3103  flowja(idiag) = flowja(idiag) + this%storagee(ib)
3104  flowja(idiag) = flowja(idiag) + this%storagei(ib)
3105  end do
3106  !
3107  ! -- terminate if errors encountered when updating material properties
3108  if (this%iupdatematprop /= 0) then
3109  if (count_errors() > 0) then
3110  call store_error_filename(this%input_fname)
3111  end if
3112  end if
Here is the call graph for this function:

◆ csub_cr()

subroutine, public gwfcsubmodule::csub_cr ( type(gwfcsubtype), pointer  csubobj,
character(len=*), intent(in)  name_model,
character(len=*), intent(in)  mempath,
integer(i4b), intent(in)  istounit,
character(len=*), intent(in)  stoPckName,
integer(i4b), intent(in)  inunit,
integer(i4b), intent(in)  iout 
)

Create a new CSUB object

Parameters
csubobjpointer to default package type
[in]name_modelmodel name
[in]mempathinput context mem path
[in]inunitunit number of csub input file
[in]istounitunit number of storage package
[in]stopcknamename of the storage package
[in]ioutunit number of lst output file

Definition at line 317 of file gwf-csub.f90.

319  ! -- dummy variables
320  type(GwfCsubType), pointer :: csubobj !< pointer to default package type
321  character(len=*), intent(in) :: name_model !< model name
322  character(len=*), intent(in) :: mempath !< input context mem path
323  integer(I4B), intent(in) :: inunit !< unit number of csub input file
324  integer(I4B), intent(in) :: istounit !< unit number of storage package
325  character(len=*), intent(in) :: stoPckName !< name of the storage package
326  integer(I4B), intent(in) :: iout !< unit number of lst output file
327  ! -- local variables
328  !
329  ! -- allocate the object and assign values to object variables
330  allocate (csubobj)
331 
332  ! -- create name and memory path
333  call csubobj%set_names(1, name_model, 'CSUB', 'CSUB', mempath)
334  !
335  ! -- Allocate scalars
336  call csubobj%csub_allocate_scalars()
337  !
338  ! -- Create memory path to variables from STO package
339  csubobj%stoMemPath = create_mem_path(name_model, stopckname)
340  !
341  ! -- Set variables
342  csubobj%istounit = istounit
343  csubobj%inunit = inunit
344  csubobj%iout = iout
Here is the call graph for this function:
Here is the caller graph for this function:

◆ csub_da()

subroutine gwfcsubmodule::csub_da ( class(gwfcsubtype this)
private

Deallocate CSUB package scalars and arrays.

Definition at line 1929 of file gwf-csub.f90.

1930  ! -- modules
1932  ! -- dummy variables
1933  class(GwfCsubType) :: this
1934  !
1935  ! -- Deallocate arrays if package is active
1936  if (this%inunit > 0) then
1937  call mem_deallocate(this%unodelist)
1938  call mem_deallocate(this%nodelist)
1939  call mem_deallocate(this%idelay)
1940  call mem_deallocate(this%ielastic)
1941  call mem_deallocate(this%iconvert)
1942  !
1943  ! -- grid-based storage data
1944  call mem_deallocate(this%buff)
1945  call mem_deallocate(this%buffusr)
1946  call mem_deallocate(this%sgm)
1947  call mem_deallocate(this%sgs)
1948  call mem_deallocate(this%cg_ske_cr)
1949  call mem_deallocate(this%cg_gs)
1950  call mem_deallocate(this%cg_es)
1951  call mem_deallocate(this%cg_es0)
1952  call mem_deallocate(this%cg_pcs)
1953  call mem_deallocate(this%cg_comp)
1954  call mem_deallocate(this%cg_tcomp)
1955  call mem_deallocate(this%cg_stor)
1956  call mem_deallocate(this%cg_ske)
1957  call mem_deallocate(this%cg_sk)
1958  if (this%iupdatematprop == 0) then
1959  nullify (this%cg_thick)
1960  nullify (this%cg_thick0)
1961  nullify (this%cg_theta)
1962  nullify (this%cg_theta0)
1963  else
1964  call mem_deallocate(this%cg_thick)
1965  call mem_deallocate(this%cg_thick0)
1966  call mem_deallocate(this%cg_theta)
1967  call mem_deallocate(this%cg_theta0)
1968  end if
1969  call mem_deallocate(this%cg_thickini)
1970  call mem_deallocate(this%cg_thetaini)
1971  !
1972  ! -- cell storage
1973  call mem_deallocate(this%cell_wcstor)
1974  call mem_deallocate(this%cell_thick)
1975  !
1976  ! -- interbed storage
1977  call mem_deallocate(this%boundname, 'BOUNDNAME', this%memoryPath)
1978  call mem_deallocate(this%auxname, 'AUXNAME', this%memoryPath)
1979  call mem_deallocate(this%auxvar)
1980  call mem_deallocate(this%ci)
1981  call mem_deallocate(this%rci)
1982  call mem_deallocate(this%pcs)
1983  call mem_deallocate(this%rnb)
1984  call mem_deallocate(this%kv)
1985  call mem_deallocate(this%h0)
1986  call mem_deallocate(this%comp)
1987  call mem_deallocate(this%tcomp)
1988  call mem_deallocate(this%tcompi)
1989  call mem_deallocate(this%tcompe)
1990  call mem_deallocate(this%storagee)
1991  call mem_deallocate(this%storagei)
1992  call mem_deallocate(this%ske)
1993  call mem_deallocate(this%sk)
1994  if (this%iupdatematprop == 0) then
1995  nullify (this%thick)
1996  nullify (this%thick0)
1997  nullify (this%theta)
1998  nullify (this%theta0)
1999  else
2000  call mem_deallocate(this%thick)
2001  call mem_deallocate(this%thick0)
2002  call mem_deallocate(this%theta)
2003  call mem_deallocate(this%theta0)
2004  end if
2005  call mem_deallocate(this%thickini)
2006  call mem_deallocate(this%thetaini)
2007  !
2008  ! -- delay bed storage
2009  if (this%ndelaybeds > 0) then
2010  if (this%iupdatematprop == 0) then
2011  nullify (this%dbdz)
2012  nullify (this%dbdz0)
2013  nullify (this%dbtheta)
2014  nullify (this%dbtheta0)
2015  else
2016  call mem_deallocate(this%dbdz)
2017  call mem_deallocate(this%dbdz0)
2018  call mem_deallocate(this%dbtheta)
2019  call mem_deallocate(this%dbtheta0)
2020  end if
2021  call mem_deallocate(this%idb_nconv_count)
2022  call mem_deallocate(this%idbconvert)
2023  call mem_deallocate(this%dbdhmax)
2024  call mem_deallocate(this%dbz)
2025  call mem_deallocate(this%dbrelz)
2026  call mem_deallocate(this%dbh)
2027  call mem_deallocate(this%dbh0)
2028  call mem_deallocate(this%dbgeo)
2029  call mem_deallocate(this%dbes)
2030  call mem_deallocate(this%dbes0)
2031  call mem_deallocate(this%dbpcs)
2032  call mem_deallocate(this%dbflowtop)
2033  call mem_deallocate(this%dbflowbot)
2034  call mem_deallocate(this%dbdzini)
2035  call mem_deallocate(this%dbthetaini)
2036  call mem_deallocate(this%dbcomp)
2037  call mem_deallocate(this%dbtcomp)
2038  !
2039  ! -- delay interbed solution arrays
2040  call mem_deallocate(this%dbal)
2041  call mem_deallocate(this%dbad)
2042  call mem_deallocate(this%dbau)
2043  call mem_deallocate(this%dbrhs)
2044  call mem_deallocate(this%dbdh)
2045  call mem_deallocate(this%dbaw)
2046  end if
2047  !
2048  ! -- period data
2049  call mem_deallocate(this%nodelistsig0)
2050  call mem_deallocate(this%sig0, 'SIG0', this%memoryPath)
2051  !
2052  ! -- pointers to gwf variables
2053  nullify (this%gwfiss)
2054  !
2055  ! -- pointers to storage variables
2056  nullify (this%stoiconv)
2057  nullify (this%stoss)
2058  !
2059  ! -- input table
2060  if (this%iprpak > 0) then
2061  call this%inputtab%table_da()
2062  deallocate (this%inputtab)
2063  nullify (this%inputtab)
2064  end if
2065  !
2066  ! -- output table
2067  if (associated(this%outputtab)) then
2068  call this%outputtab%table_da()
2069  deallocate (this%outputtab)
2070  nullify (this%outputtab)
2071  end if
2072  end if
2073  !
2074  ! -- package csv table
2075  if (this%ipakcsv > 0) then
2076  call this%pakcsvtab%table_da()
2077  deallocate (this%pakcsvtab)
2078  nullify (this%pakcsvtab)
2079  end if
2080  !
2081  ! -- deallocate character variables
2082  call mem_deallocate(this%listlabel, 'LISTLABEL', this%memoryPath)
2083  call mem_deallocate(this%stoMemPath, 'STONAME', this%memoryPath)
2084  !
2085  ! -- deallocate scalars
2086  call mem_deallocate(this%istounit)
2087  call mem_deallocate(this%inobspkg)
2088  call mem_deallocate(this%ninterbeds)
2089  call mem_deallocate(this%maxsig0)
2090  call mem_deallocate(this%nbound)
2091  call mem_deallocate(this%iscloc)
2092  call mem_deallocate(this%iauxmultcol)
2093  call mem_deallocate(this%ndelaycells)
2094  call mem_deallocate(this%ndelaybeds)
2095  call mem_deallocate(this%initialized)
2096  call mem_deallocate(this%ieslag)
2097  call mem_deallocate(this%ipch)
2098  call mem_deallocate(this%lhead_based)
2099  call mem_deallocate(this%iupdatestress)
2100  call mem_deallocate(this%ispecified_pcs)
2101  call mem_deallocate(this%ispecified_dbh)
2102  call mem_deallocate(this%inamedbound)
2103  call mem_deallocate(this%iconvchk)
2104  call mem_deallocate(this%naux)
2105  call mem_deallocate(this%istoragec)
2106  call mem_deallocate(this%istrainib)
2107  call mem_deallocate(this%istrainsk)
2108  call mem_deallocate(this%ioutcomp)
2109  call mem_deallocate(this%ioutcompi)
2110  call mem_deallocate(this%ioutcompe)
2111  call mem_deallocate(this%ioutcompib)
2112  call mem_deallocate(this%ioutcomps)
2113  call mem_deallocate(this%ioutzdisp)
2114  call mem_deallocate(this%ipakcsv)
2115  call mem_deallocate(this%iupdatematprop)
2116  call mem_deallocate(this%epsilon)
2117  call mem_deallocate(this%cc_crit)
2118  call mem_deallocate(this%gammaw)
2119  call mem_deallocate(this%beta)
2120  call mem_deallocate(this%brg)
2121  call mem_deallocate(this%satomega)
2122  call mem_deallocate(this%icellf)
2123  call mem_deallocate(this%gwfiss0)
2124  !
2125  ! -- deallocate methods on objects
2126  if (this%inunit > 0) then
2127  call this%obs%obs_da()
2128  !
2129  ! -- deallocate and nullify observations
2130  deallocate (this%obs)
2131  nullify (this%obs)
2132  end if
2133 
2134  !
2135  ! -- deallocate parent
2136  call this%NumericalPackageType%da()

◆ csub_delay_assemble()

subroutine gwfcsubmodule::csub_delay_assemble ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  ib,
real(dp), intent(in)  hcell 
)
private

Method to assemble matrix and right-hand side coefficients for a delay interbed. The method calls the appropriate standard or Newton-Raphson assembly routines and fills all of the entries for a delay interbed.

Parameters
[in]ibinterbed number
[in]hcellcurrent head in a cell

Definition at line 5583 of file gwf-csub.f90.

5584  ! -- dummy variables
5585  class(GwfCsubType), intent(inout) :: this
5586  integer(I4B), intent(in) :: ib !< interbed number
5587  real(DP), intent(in) :: hcell !< current head in a cell
5588  ! -- local variables
5589  integer(I4B) :: n
5590  real(DP) :: aii
5591  real(DP) :: au
5592  real(DP) :: al
5593  real(DP) :: r
5594  !
5595  ! -- calculate matrix terms for each delay bed cell
5596  do n = 1, this%ndelaycells
5597  !
5598  ! -- assemble terms
5599  if (this%inewton == 0) then
5600  call this%csub_delay_assemble_fc(ib, n, hcell, aii, au, al, r)
5601  else
5602  call this%csub_delay_assemble_fn(ib, n, hcell, aii, au, al, r)
5603  end if
5604  !
5605  ! -- add terms
5606  this%dbal(n) = al
5607  this%dbau(n) = au
5608  this%dbad(n) = aii
5609  this%dbrhs(n) = r
5610  end do

◆ csub_delay_assemble_fc()

subroutine gwfcsubmodule::csub_delay_assemble_fc ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  ib,
integer(i4b), intent(in)  n,
real(dp), intent(in)  hcell,
real(dp), intent(inout)  aii,
real(dp), intent(inout)  au,
real(dp), intent(inout)  al,
real(dp), intent(inout)  r 
)
private

Method to assemble standard formulation matrix and right-hand side coefficients for a delay interbed.

Parameters
[in]ibinterbed number
[in]ndelay interbed cell number
[in]hcellcurrent head in a cell
[in,out]aiidiagonal in the A matrix
[in,out]auupper term in the A matrix
[in,out]allower term in the A matrix
[in,out]rright-hand side term

Definition at line 5619 of file gwf-csub.f90.

5620  ! -- modules
5621  use tdismodule, only: delt
5622  ! -- dummy variables
5623  class(GwfCsubType), intent(inout) :: this
5624  integer(I4B), intent(in) :: ib !< interbed number
5625  integer(I4B), intent(in) :: n !< delay interbed cell number
5626  real(DP), intent(in) :: hcell !< current head in a cell
5627  real(DP), intent(inout) :: aii !< diagonal in the A matrix
5628  real(DP), intent(inout) :: au !< upper term in the A matrix
5629  real(DP), intent(inout) :: al !< lower term in the A matrix
5630  real(DP), intent(inout) :: r !< right-hand side term
5631  ! -- local variables
5632  integer(I4B) :: node
5633  integer(I4B) :: idelay
5634  integer(I4B) :: ielastic
5635  real(DP) :: dzini
5636  real(DP) :: dzhalf
5637  real(DP) :: c
5638  real(DP) :: c2
5639  real(DP) :: c3
5640  real(DP) :: tled
5641  real(DP) :: wcf
5642  real(DP) :: smult
5643  real(DP) :: sske
5644  real(DP) :: ssk
5645  real(DP) :: z
5646  real(DP) :: ztop
5647  real(DP) :: zbot
5648  real(DP) :: dz
5649  real(DP) :: dz0
5650  real(DP) :: theta
5651  real(DP) :: theta0
5652  real(DP) :: dsn
5653  real(DP) :: dsn0
5654  real(DP) :: gs
5655  real(DP) :: es0
5656  real(DP) :: pcs
5657  real(DP) :: wc
5658  real(DP) :: wc0
5659  real(DP) :: h
5660  real(DP) :: h0
5661  real(DP) :: hbar
5662  !
5663  ! -- initialize accumulators
5664  aii = dzero
5665  au = dzero
5666  al = dzero
5667  r = dzero
5668  !
5669  ! -- initialize local variables
5670  idelay = this%idelay(ib)
5671  ielastic = this%ielastic(ib)
5672  node = this%nodelist(ib)
5673  dzini = this%dbdzini(1, idelay)
5674  dzhalf = dhalf * dzini
5675  tled = done / delt
5676  c = this%kv(ib) / dzini
5677  c2 = dtwo * c
5678  c3 = dthree * c
5679  !
5680  ! -- add qdb terms
5681  aii = aii - c2
5682  !
5683  ! -- top or bottom cell
5684  if (n == 1 .or. n == this%ndelaycells) then
5685  aii = aii - c
5686  r = r - c2 * hcell
5687  end if
5688  !
5689  ! -- lower qdb term
5690  if (n > 1) then
5691  al = c
5692  end if
5693  !
5694  ! -- upper qdb term
5695  if (n < this%ndelaycells) then
5696  au = c
5697  end if
5698  !
5699  ! -- current and previous delay cell states
5700  z = this%dbz(n, idelay)
5701  ztop = z + dzhalf
5702  zbot = z - dzhalf
5703  h = this%dbh(n, idelay)
5704  h0 = this%dbh0(n, idelay)
5705  dz = this%dbdz(n, idelay)
5706  dz0 = this%dbdz0(n, idelay)
5707  theta = this%dbtheta(n, idelay)
5708  theta0 = this%dbtheta0(n, idelay)
5709  !
5710  ! -- calculate corrected head (hbar)
5711  hbar = squadratic0sp(h, zbot, this%satomega)
5712  !
5713  ! -- calculate saturation
5714  call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
5715  !
5716  ! -- calculate ssk and sske
5717  call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske)
5718  !
5719  ! -- calculate and add storage terms
5720  smult = dzini * tled
5721  gs = this%dbgeo(n, idelay)
5722  es0 = this%dbes0(n, idelay)
5723  pcs = this%dbpcs(n, idelay)
5724  aii = aii - smult * dsn * ssk
5725  if (ielastic /= 0) then
5726  r = r - smult * &
5727  (dsn * ssk * (gs + zbot) - dsn0 * sske * es0)
5728  else
5729  r = r - smult * &
5730  (dsn * ssk * (gs + zbot - pcs) + dsn0 * sske * (pcs - es0))
5731  end if
5732  !
5733  ! -- add storage correction term
5734  r = r + smult * dsn * ssk * (h - hbar)
5735  !
5736  ! -- add water compressibility terms
5737  wcf = this%brg * tled
5738  wc = dz * wcf * theta
5739  wc0 = dz0 * wcf * theta0
5740  aii = aii - dsn * wc
5741  r = r - dsn0 * wc0 * h0
Here is the call graph for this function:

◆ csub_delay_assemble_fn()

subroutine gwfcsubmodule::csub_delay_assemble_fn ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  ib,
integer(i4b), intent(in)  n,
real(dp), intent(in)  hcell,
real(dp), intent(inout)  aii,
real(dp), intent(inout)  au,
real(dp), intent(inout)  al,
real(dp), intent(inout)  r 
)

Method to assemble Newton-Raphson formulation matrix and right-hand side coefficients for a delay interbed.

Parameters
[in]ibinterbed number
[in]ndelay interbed cell number
[in]hcellcurrent head in a cell
[in,out]aiidiagonal in the A matrix
[in,out]auupper term in the A matrix
[in,out]allower term in the A matrix
[in,out]rright-hand side term

Definition at line 5750 of file gwf-csub.f90.

5751  ! -- modules
5752  use tdismodule, only: delt
5753  ! -- dummy variables
5754  class(GwfCsubType), intent(inout) :: this
5755  integer(I4B), intent(in) :: ib !< interbed number
5756  integer(I4B), intent(in) :: n !< delay interbed cell number
5757  real(DP), intent(in) :: hcell !< current head in a cell
5758  real(DP), intent(inout) :: aii !< diagonal in the A matrix
5759  real(DP), intent(inout) :: au !< upper term in the A matrix
5760  real(DP), intent(inout) :: al !< lower term in the A matrix
5761  real(DP), intent(inout) :: r !< right-hand side term
5762  ! -- local variables
5763  integer(I4B) :: node
5764  integer(I4B) :: idelay
5765  integer(I4B) :: ielastic
5766  real(DP) :: dzini
5767  real(DP) :: dzhalf
5768  real(DP) :: c
5769  real(DP) :: c2
5770  real(DP) :: c3
5771  real(DP) :: tled
5772  real(DP) :: wcf
5773  real(DP) :: smult
5774  real(DP) :: sske
5775  real(DP) :: ssk
5776  real(DP) :: z
5777  real(DP) :: ztop
5778  real(DP) :: zbot
5779  real(DP) :: dz
5780  real(DP) :: dz0
5781  real(DP) :: theta
5782  real(DP) :: theta0
5783  real(DP) :: dsn
5784  real(DP) :: dsn0
5785  real(DP) :: dsnderv
5786  real(DP) :: wc
5787  real(DP) :: wc0
5788  real(DP) :: h
5789  real(DP) :: h0
5790  real(DP) :: hbar
5791  real(DP) :: hbarderv
5792  real(DP) :: gs
5793  real(DP) :: es0
5794  real(DP) :: pcs
5795  real(DP) :: qsto
5796  real(DP) :: stoderv
5797  real(DP) :: qwc
5798  real(DP) :: wcderv
5799  !
5800  ! -- initialize accumulators
5801  aii = dzero
5802  au = dzero
5803  al = dzero
5804  r = dzero
5805  !
5806  ! -- initialize local variables
5807  idelay = this%idelay(ib)
5808  ielastic = this%ielastic(ib)
5809  node = this%nodelist(ib)
5810  dzini = this%dbdzini(1, idelay)
5811  dzhalf = dhalf * dzini
5812  tled = done / delt
5813  c = this%kv(ib) / dzini
5814  c2 = dtwo * c
5815  c3 = dthree * c
5816  !
5817  ! -- add qdb terms
5818  aii = aii - c2
5819  !
5820  ! -- top or bottom cell
5821  if (n == 1 .or. n == this%ndelaycells) then
5822  aii = aii - c
5823  r = r - c2 * hcell
5824  end if
5825  !
5826  ! -- lower qdb term
5827  if (n > 1) then
5828  al = c
5829  end if
5830  !
5831  ! -- upper qdb term
5832  if (n < this%ndelaycells) then
5833  au = c
5834  end if
5835  !
5836  ! -- current and previous delay cell states
5837  z = this%dbz(n, idelay)
5838  ztop = z + dzhalf
5839  zbot = z - dzhalf
5840  h = this%dbh(n, idelay)
5841  h0 = this%dbh0(n, idelay)
5842  dz = this%dbdz(n, idelay)
5843  dz0 = this%dbdz0(n, idelay)
5844  theta = this%dbtheta(n, idelay)
5845  theta0 = this%dbtheta0(n, idelay)
5846  !
5847  ! -- calculate corrected head (hbar)
5848  hbar = squadratic0sp(h, zbot, this%satomega)
5849  !
5850  ! -- calculate the derivative of the hbar functions
5851  hbarderv = squadratic0spderivative(h, zbot, this%satomega)
5852  !
5853  ! -- calculate saturation
5854  call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
5855  !
5856  ! -- calculate the derivative of the saturation
5857  dsnderv = this%csub_delay_calc_sat_derivative(node, idelay, n, hcell)
5858  !
5859  ! -- calculate ssk and sske
5860  call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske)
5861  !
5862  ! -- calculate storage terms
5863  smult = dzini * tled
5864  gs = this%dbgeo(n, idelay)
5865  es0 = this%dbes0(n, idelay)
5866  pcs = this%dbpcs(n, idelay)
5867  if (ielastic /= 0) then
5868  qsto = smult * (dsn * ssk * (gs - hbar + zbot) - dsn0 * sske * es0)
5869  stoderv = -smult * dsn * ssk * hbarderv + &
5870  smult * ssk * (gs - hbar + zbot) * dsnderv
5871  else
5872  qsto = smult * (dsn * ssk * (gs - hbar + zbot - pcs) + &
5873  dsn0 * sske * (pcs - es0))
5874  stoderv = -smult * dsn * ssk * hbarderv + &
5875  smult * ssk * (gs - hbar + zbot - pcs) * dsnderv
5876  end if
5877  !
5878  ! -- Add additional term if using lagged effective stress
5879  if (this%ieslag /= 0) then
5880  if (ielastic /= 0) then
5881  stoderv = stoderv - smult * sske * es0 * dsnderv
5882  else
5883  stoderv = stoderv + smult * sske * (pcs - es0) * dsnderv
5884  end if
5885  end if
5886  !
5887  ! -- add newton-raphson storage terms
5888  aii = aii + stoderv
5889  r = r - qsto + stoderv * h
5890  !
5891  ! -- add water compressibility terms
5892  wcf = this%brg * tled
5893  wc = dz * wcf * theta
5894  wc0 = dz0 * wcf * theta0
5895  qwc = dsn0 * wc0 * h0 - dsn * wc * h
5896  wcderv = -dsn * wc - wc * h * dsnderv
5897  !
5898  ! -- Add additional term if using lagged effective stress
5899  if (this%ieslag /= 0) then
5900  wcderv = wcderv + wc0 * h0 * dsnderv
5901  end if
5902  !
5903  ! -- add newton-raphson water compressibility terms
5904  aii = aii + wcderv
5905  r = r - qwc + wcderv * h
Here is the call graph for this function:

◆ csub_delay_calc_comp()

subroutine gwfcsubmodule::csub_delay_calc_comp ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  ib,
real(dp), intent(in)  hcell,
real(dp), intent(in)  hcellold,
real(dp), intent(inout)  comp,
real(dp), intent(inout)  compi,
real(dp), intent(inout)  compe 
)

Method to calculate the compaction in a delay interbed.

Parameters
[in,out]compcompaction in delay interbed
[in,out]compiinelastic compaction in delay interbed
[in,out]compeelastic compaction in delay interbed
[in]ibinterbed number
[in]hcellcurrent head in cell
[in]hcelloldprevious head in cell
[in,out]compcompaction in delay interbed
[in,out]compiinelastic compaction in delay interbed
[in,out]compeelastic compaction in delay interbed

Definition at line 6125 of file gwf-csub.f90.

6126  ! -- dummy variables
6127  class(GwfCsubType), intent(inout) :: this
6128  integer(I4B), intent(in) :: ib !< interbed number
6129  real(DP), intent(in) :: hcell !< current head in cell
6130  real(DP), intent(in) :: hcellold !< previous head in cell
6131  real(DP), intent(inout) :: comp !< compaction in delay interbed
6132  real(DP), intent(inout) :: compi !< inelastic compaction in delay interbed
6133  real(DP), intent(inout) :: compe !< elastic compaction in delay interbed
6134  ! -- local variables
6135  integer(I4B) :: idelay
6136  integer(I4B) :: ielastic
6137  integer(I4B) :: node
6138  integer(I4B) :: n
6139  real(DP) :: snnew
6140  real(DP) :: snold
6141  real(DP) :: sske
6142  real(DP) :: ssk
6143  real(DP) :: fmult
6144  real(DP) :: h
6145  real(DP) :: h0
6146  real(DP) :: dsn
6147  real(DP) :: dsn0
6148  real(DP) :: v
6149  real(DP) :: v1
6150  real(DP) :: v2
6151  !
6152  ! -- initialize variables
6153  idelay = this%idelay(ib)
6154  ielastic = this%ielastic(ib)
6155  node = this%nodelist(ib)
6156  comp = dzero
6157  compi = dzero
6158  compe = dzero
6159  !
6160  ! -- calculate cell saturation
6161  call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
6162  !
6163  ! -- calculate compaction
6164  if (this%thickini(ib) > dzero) then
6165  fmult = this%dbdzini(1, idelay)
6166  do n = 1, this%ndelaycells
6167  h = this%dbh(n, idelay)
6168  h0 = this%dbh0(n, idelay)
6169  call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6170  call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske)
6171  if (ielastic /= 0) then
6172  v1 = dsn * ssk * this%dbes(n, idelay) - sske * this%dbes0(n, idelay)
6173  v2 = dzero
6174  else
6175  v1 = dsn * ssk * (this%dbes(n, idelay) - this%dbpcs(n, idelay))
6176  v2 = dsn0 * sske * (this%dbpcs(n, idelay) - this%dbes0(n, idelay))
6177  end if
6178  v = (v1 + v2) * fmult
6179  comp = comp + v
6180  !
6181  ! -- save compaction data
6182  this%dbcomp(n, idelay) = v * snnew
6183  !
6184  ! -- calculate inelastic and elastic storage components
6185  if (this%idbconvert(n, idelay) /= 0) then
6186  compi = compi + v1 * fmult
6187  compe = compe + v2 * fmult
6188  else
6189  compe = compe + (v1 + v2) * fmult
6190  end if
6191  end do
6192  end if
6193  !
6194  ! -- fill compaction
6195  comp = comp * this%rnb(ib)
6196  compi = compi * this%rnb(ib)
6197  compe = compe * this%rnb(ib)

◆ csub_delay_calc_dstor()

subroutine gwfcsubmodule::csub_delay_calc_dstor ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  ib,
real(dp), intent(in)  hcell,
real(dp), intent(inout)  stoe,
real(dp), intent(inout)  stoi 
)
private

Method to calculate the storage change in a delay interbed.

Parameters
[in,out]stoecurrent elastic storage change in delay interbed
[in,out]stoicurrent inelastic storage changes in delay interbed
[in]ibinterbed number
[in]hcellcurrent head in cell
[in,out]stoeelastic storage change
[in,out]stoiinelastic storage change

Definition at line 5987 of file gwf-csub.f90.

5988  ! -- dummy variables
5989  class(GwfCsubType), intent(inout) :: this
5990  integer(I4B), intent(in) :: ib !< interbed number
5991  real(DP), intent(in) :: hcell !< current head in cell
5992  real(DP), intent(inout) :: stoe !< elastic storage change
5993  real(DP), intent(inout) :: stoi !< inelastic storage change
5994  ! -- local variables
5995  integer(I4B) :: idelay
5996  integer(I4B) :: ielastic
5997  integer(I4B) :: node
5998  integer(I4B) :: n
5999  real(DP) :: sske
6000  real(DP) :: ssk
6001  real(DP) :: fmult
6002  real(DP) :: v1
6003  real(DP) :: v2
6004  real(DP) :: ske
6005  real(DP) :: sk
6006  real(DP) :: z
6007  real(DP) :: zbot
6008  real(DP) :: h
6009  real(DP) :: h0
6010  real(DP) :: dsn
6011  real(DP) :: dsn0
6012  real(DP) :: hbar
6013  real(DP) :: dzhalf
6014  !
6015  ! -- initialize variables
6016  idelay = this%idelay(ib)
6017  ielastic = this%ielastic(ib)
6018  node = this%nodelist(ib)
6019  stoe = dzero
6020  stoi = dzero
6021  ske = dzero
6022  sk = dzero
6023  !
6024  !
6025  if (this%thickini(ib) > dzero) then
6026  fmult = this%dbdzini(1, idelay)
6027  dzhalf = dhalf * this%dbdzini(1, idelay)
6028  do n = 1, this%ndelaycells
6029  call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske)
6030  z = this%dbz(n, idelay)
6031  zbot = z - dzhalf
6032  h = this%dbh(n, idelay)
6033  h0 = this%dbh0(n, idelay)
6034  call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6035  hbar = squadratic0sp(h, zbot, this%satomega)
6036  if (ielastic /= 0) then
6037  v1 = dsn * ssk * (this%dbgeo(n, idelay) - hbar + zbot) - &
6038  dsn0 * sske * this%dbes0(n, idelay)
6039  v2 = dzero
6040  else
6041  v1 = dsn * ssk * (this%dbgeo(n, idelay) - hbar + zbot - &
6042  this%dbpcs(n, idelay))
6043  v2 = dsn0 * sske * (this%dbpcs(n, idelay) - this%dbes0(n, idelay))
6044  end if
6045  !
6046  ! -- calculate inelastic and elastic storage components
6047  if (this%idbconvert(n, idelay) /= 0) then
6048  stoi = stoi + v1 * fmult
6049  stoe = stoe + v2 * fmult
6050  else
6051  stoe = stoe + (v1 + v2) * fmult
6052  end if
6053  !
6054  ! calculate inelastic and elastic storativity
6055  ske = ske + sske * fmult
6056  sk = sk + ssk * fmult
6057  end do
6058  end if
6059  !
6060  ! -- save ske and sk
6061  this%ske(ib) = ske
6062  this%sk(ib) = sk
Here is the call graph for this function:

◆ csub_delay_calc_sat()

subroutine gwfcsubmodule::csub_delay_calc_sat ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  node,
integer(i4b), intent(in)  idelay,
integer(i4b), intent(in)  n,
real(dp), intent(in)  hcell,
real(dp), intent(in)  hcellold,
real(dp), intent(inout)  snnew,
real(dp), intent(inout)  snold 
)

Method to calculate the saturation in a delay interbed cell.

Parameters
[in,out]snnewcurrent saturation in delay interbed cell n
[in,out]snoldprevious saturation in delay interbed cell n
[in]nodecell node number
[in]idelaydelay interbed number
[in]ndelay interbed cell number
[in]hcellcurrent head in delay interbed cell n
[in]hcelloldprevious head in delay interbed cell n
[in,out]snnewcurrent saturation in delay interbed cell n
[in,out]snoldprevious saturation in delay interbed cell n

Definition at line 5916 of file gwf-csub.f90.

5918  ! -- dummy variables
5919  class(GwfCsubType), intent(inout) :: this
5920  integer(I4B), intent(in) :: node !< cell node number
5921  integer(I4B), intent(in) :: idelay !< delay interbed number
5922  integer(I4B), intent(in) :: n !< delay interbed cell number
5923  real(DP), intent(in) :: hcell !< current head in delay interbed cell n
5924  real(DP), intent(in) :: hcellold !< previous head in delay interbed cell n
5925  real(DP), intent(inout) :: snnew !< current saturation in delay interbed cell n
5926  real(DP), intent(inout) :: snold !< previous saturation in delay interbed cell n
5927  ! -- local variables
5928  real(DP) :: dzhalf
5929  real(DP) :: top
5930  real(DP) :: bot
5931  !
5932  ! -- calculate delay interbed cell saturation
5933  if (this%stoiconv(node) /= 0) then
5934  dzhalf = dhalf * this%dbdzini(n, idelay)
5935  top = this%dbz(n, idelay) + dzhalf
5936  bot = this%dbz(n, idelay) - dzhalf
5937  snnew = squadraticsaturation(top, bot, hcell, this%satomega)
5938  snold = squadraticsaturation(top, bot, hcellold, this%satomega)
5939  else
5940  snnew = done
5941  snold = done
5942  end if
5943  if (this%ieslag /= 0) then
5944  snold = snnew
5945  end if
Here is the call graph for this function:

◆ csub_delay_calc_sat_derivative()

real(dp) function gwfcsubmodule::csub_delay_calc_sat_derivative ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  node,
integer(i4b), intent(in)  idelay,
integer(i4b), intent(in)  n,
real(dp), intent(in)  hcell 
)
private

Function to calculate the derivative of the saturation with respect to the current head in delay interbed cell n.

Returns
satderv derivative of saturation
Parameters
[in]nodecell node number
[in]idelaydelay interbed number
[in]ndelay interbed cell number
[in]hcellcurrent head in delay interbed cell n

Definition at line 5955 of file gwf-csub.f90.

5957  ! -- dummy variables
5958  class(GwfCsubType), intent(inout) :: this
5959  integer(I4B), intent(in) :: node !< cell node number
5960  integer(I4B), intent(in) :: idelay !< delay interbed number
5961  integer(I4B), intent(in) :: n !< delay interbed cell number
5962  real(DP), intent(in) :: hcell !< current head in delay interbed cell n
5963  ! -- local variables
5964  real(DP) :: satderv
5965  real(DP) :: dzhalf
5966  real(DP) :: top
5967  real(DP) :: bot
5968 
5969  if (this%stoiconv(node) /= 0) then
5970  dzhalf = dhalf * this%dbdzini(n, idelay)
5971  top = this%dbz(n, idelay) + dzhalf
5972  bot = this%dbz(n, idelay) - dzhalf
5973  satderv = squadraticsaturationderivative(top, bot, hcell, this%satomega)
5974  else
5975  satderv = dzero
5976  end if
Here is the call graph for this function:

◆ csub_delay_calc_ssksske()

subroutine gwfcsubmodule::csub_delay_calc_ssksske ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  ib,
integer(i4b), intent(in)  n,
real(dp), intent(in)  hcell,
real(dp), intent(inout)  ssk,
real(dp), intent(inout)  sske 
)
private

Method to calculate the ssk and sske value for a node in a delay interbed cell.

Parameters
[in,out]sskskeletal specific storage value dependent on the preconsolidation stress
[in,out]sskeelastic skeletal specific storage value
[in]ibinterbed number
[in]ndelay interbed cell number
[in]hcellcurrent head in a cell
[in,out]sskdelay interbed skeletal specific storage
[in,out]sskedelay interbed elastic skeletal specific storage

Definition at line 5481 of file gwf-csub.f90.

5482  ! -- dummy variables
5483  class(GwfCsubType), intent(inout) :: this
5484  integer(I4B), intent(in) :: ib !< interbed number
5485  integer(I4B), intent(in) :: n !< delay interbed cell number
5486  real(DP), intent(in) :: hcell !< current head in a cell
5487  real(DP), intent(inout) :: ssk !< delay interbed skeletal specific storage
5488  real(DP), intent(inout) :: sske !< delay interbed elastic skeletal specific storage
5489  ! -- local variables
5490  integer(I4B) :: idelay
5491  integer(I4B) :: ielastic
5492  integer(I4B) :: node
5493  real(DP) :: topcell
5494  real(DP) :: botcell
5495  real(DP) :: hbarcell
5496  real(DP) :: zcell
5497  real(DP) :: zcenter
5498  real(DP) :: dzhalf
5499  real(DP) :: top
5500  real(DP) :: bot
5501  real(DP) :: h
5502  real(DP) :: hbar
5503  real(DP) :: znode
5504  real(DP) :: zbot
5505  real(DP) :: es
5506  real(DP) :: es0
5507  real(DP) :: theta
5508  real(DP) :: f
5509  real(DP) :: f0
5510  !
5511  ! -- initialize variables
5512  sske = dzero
5513  ssk = dzero
5514  idelay = this%idelay(ib)
5515  ielastic = this%ielastic(ib)
5516  !
5517  ! -- calculate factor for the head-based case
5518  if (this%lhead_based .EQV. .true.) then
5519  f = done
5520  f0 = f
5521  !
5522  ! -- calculate factor for the effective stress case
5523  else
5524  node = this%nodelist(ib)
5525  theta = this%dbthetaini(n, idelay)
5526  !
5527  ! -- set top and bottom of layer
5528  topcell = this%dis%top(node)
5529  botcell = this%dis%bot(node)
5530  !
5531  ! -- calculate corrected head for the cell (hbarcell)
5532  hbarcell = squadratic0sp(hcell, botcell, this%satomega)
5533  !
5534  ! -- set location of delay node relative to the center
5535  ! of the cell based on current head
5536  zcell = this%csub_calc_znode(topcell, botcell, hbarcell)
5537  !
5538  ! -- set variables for delay interbed zcell calculations
5539  zcenter = zcell + this%dbrelz(n, idelay)
5540  dzhalf = dhalf * this%dbdzini(1, idelay)
5541  top = zcenter + dzhalf
5542  bot = zcenter - dzhalf
5543  h = this%dbh(n, idelay)
5544  !
5545  ! -- calculate corrected head for the delay interbed cell (hbar)
5546  hbar = squadratic0sp(h, bot, this%satomega)
5547  !
5548  ! -- calculate the center of the saturated portion of the
5549  ! delay interbed cell
5550  znode = this%csub_calc_znode(top, bot, hbar)
5551  !
5552  ! -- set reference point for bottom of delay interbed cell that is used to
5553  ! scale the effective stress at the bottom of the delay interbed cell
5554  zbot = this%dbz(n, idelay) - dzhalf
5555  !
5556  ! -- set the effective stress
5557  es = this%dbes(n, idelay)
5558  es0 = this%dbes0(n, idelay)
5559  !
5560  ! -- calculate the compression index factors for the delay
5561  ! node relative to the center of the cell based on the
5562  ! current and previous head
5563  call this%csub_calc_sfacts(node, zbot, znode, theta, es, es0, f)
5564  end if
5565  this%idbconvert(n, idelay) = 0
5566  sske = f * this%rci(ib)
5567  ssk = f * this%rci(ib)
5568  if (ielastic == 0) then
5569  if (this%dbes(n, idelay) > this%dbpcs(n, idelay)) then
5570  this%idbconvert(n, idelay) = 1
5571  ssk = f * this%ci(ib)
5572  end if
5573  end if
Here is the call graph for this function:

◆ csub_delay_calc_stress()

subroutine gwfcsubmodule::csub_delay_calc_stress ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  ib,
real(dp), intent(in)  hcell 
)
private

Method to calculate the geostatic and effective stress in delay interbed cells using the passed the current head value in a cell.

Parameters
[in]ibinterbed number
[in]hcellcurrent head in a cell

Definition at line 5401 of file gwf-csub.f90.

5402  ! -- dummy variables
5403  class(GwfCsubType), intent(inout) :: this
5404  integer(I4B), intent(in) :: ib !< interbed number
5405  real(DP), intent(in) :: hcell !< current head in a cell
5406  ! -- local variables
5407  integer(I4B) :: n
5408  integer(I4B) :: idelay
5409  integer(I4B) :: node
5410  real(DP) :: sigma
5411  real(DP) :: topaq
5412  real(DP) :: botaq
5413  real(DP) :: dzhalf
5414  real(DP) :: sadd
5415  real(DP) :: sgm
5416  real(DP) :: sgs
5417  real(DP) :: h
5418  real(DP) :: hbar
5419  real(DP) :: z
5420  real(DP) :: top
5421  real(DP) :: bot
5422  real(DP) :: phead
5423  !
5424  ! -- initialize variables
5425  idelay = this%idelay(ib)
5426  node = this%nodelist(ib)
5427  sigma = this%cg_gs(node)
5428  topaq = this%dis%top(node)
5429  botaq = this%dis%bot(node)
5430  dzhalf = dhalf * this%dbdzini(1, idelay)
5431  top = this%dbz(1, idelay) + dzhalf
5432  !
5433  ! -- calculate corrected head (hbar)
5434  hbar = squadratic0sp(hcell, botaq, this%satomega)
5435  !
5436  ! -- calculate the geostatic load in the cell at the top of the interbed.
5437  sgm = this%sgm(node)
5438  sgs = this%sgs(node)
5439  if (hcell < top) then
5440  sadd = ((top - hbar) * sgm) + ((hbar - botaq) * sgs)
5441  else
5442  sadd = (top - botaq) * sgs
5443  end if
5444  sigma = sigma - sadd
5445  !
5446  ! -- calculate geostatic and effective stress for each interbed node.
5447  do n = 1, this%ndelaycells
5448  h = this%dbh(n, idelay)
5449  !
5450  ! -- geostatic calculated at the bottom of the delay cell
5451  z = this%dbz(n, idelay)
5452  top = z + dzhalf
5453  bot = z - dzhalf
5454  !
5455  ! -- calculate corrected head (hbar)
5456  hbar = squadratic0sp(h, bot, this%satomega)
5457  !
5458  ! -- geostatic stress calculation
5459  if (h < top) then
5460  sadd = ((top - hbar) * sgm) + ((hbar - bot) * sgs)
5461  else
5462  sadd = (top - bot) * sgs
5463  end if
5464  sigma = sigma + sadd
5465  phead = hbar - bot
5466  this%dbgeo(n, idelay) = sigma
5467  this%dbes(n, idelay) = sigma - phead
5468  end do
Here is the call graph for this function:

◆ csub_delay_calc_wcomp()

subroutine gwfcsubmodule::csub_delay_calc_wcomp ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  ib,
real(dp), intent(inout)  dwc 
)
private

Method to calculate the change in water compressibility in a delay interbed.

Parameters
[in,out]dwccurrent water compressibility change in delay interbed
[in]ibinterbed number
[in,out]dwcwater compressibility change

Definition at line 6072 of file gwf-csub.f90.

6073  ! -- modules
6074  use tdismodule, only: delt
6075  ! -- dummy variables
6076  class(GwfCsubType), intent(inout) :: this
6077  integer(I4B), intent(in) :: ib !< interbed number
6078  real(DP), intent(inout) :: dwc !< water compressibility change
6079  ! -- local variables
6080  integer(I4B) :: idelay
6081  integer(I4B) :: node
6082  integer(I4B) :: n
6083  real(DP) :: tled
6084  real(DP) :: h
6085  real(DP) :: h0
6086  real(DP) :: dz
6087  real(DP) :: dz0
6088  real(DP) :: dsn
6089  real(DP) :: dsn0
6090  real(DP) :: wc
6091  real(DP) :: wc0
6092  real(DP) :: v
6093  !
6094  ! -- initialize variables
6095  dwc = dzero
6096  !
6097  !
6098  if (this%thickini(ib) > dzero) then
6099  idelay = this%idelay(ib)
6100  node = this%nodelist(ib)
6101  tled = done / delt
6102  do n = 1, this%ndelaycells
6103  h = this%dbh(n, idelay)
6104  h0 = this%dbh0(n, idelay)
6105  dz = this%dbdz(n, idelay)
6106  dz0 = this%dbdz0(n, idelay)
6107  call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6108  wc = dz * this%brg * this%dbtheta(n, idelay)
6109  wc0 = dz0 * this%brg * this%dbtheta0(n, idelay)
6110  v = dsn0 * wc0 * h0 - dsn * wc * h
6111  dwc = dwc + v * tled
6112  end do
6113  end if

◆ csub_delay_fc()

subroutine gwfcsubmodule::csub_delay_fc ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  ib,
real(dp), intent(inout)  hcof,
real(dp), intent(inout)  rhs 
)
private

Method to calculate the coefficients to calculate the delay interbed contribution to a cell. The product of hcof* h - rhs equals the delay contribution to the cell

Parameters
[in,out]hcofcoefficient dependent on current head
[in,out]rhsright-hand side contributions
[in]ibinterbed number
[in,out]hcofhead dependent coefficient
[in,out]rhsright-hand side

Definition at line 6285 of file gwf-csub.f90.

6286  ! -- dummy variables
6287  class(GwfCsubType), intent(inout) :: this
6288  integer(I4B), intent(in) :: ib !< interbed number
6289  real(DP), intent(inout) :: hcof !< head dependent coefficient
6290  real(DP), intent(inout) :: rhs !< right-hand side
6291  ! -- local variables
6292  integer(I4B) :: idelay
6293  real(DP) :: c1
6294  real(DP) :: c2
6295  !
6296  ! -- initialize variables
6297  idelay = this%idelay(ib)
6298  hcof = dzero
6299  rhs = dzero
6300  if (this%thickini(ib) > dzero) then
6301  ! -- calculate terms for gwf matrix
6302  c1 = dtwo * this%kv(ib) / this%dbdzini(1, idelay)
6303  rhs = -c1 * this%dbh(1, idelay)
6304  c2 = dtwo * &
6305  this%kv(ib) / this%dbdzini(this%ndelaycells, idelay)
6306  rhs = rhs - c2 * this%dbh(this%ndelaycells, idelay)
6307  hcof = c1 + c2
6308  end if

◆ csub_delay_head_check()

subroutine gwfcsubmodule::csub_delay_head_check ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  ib 
)
private

Method to determine if the delay interbed head in any delay cell in a non-convertible gwf cell is less than the top of each delay interbed cell.

Parameters
[in]ibinterbed number

Definition at line 5069 of file gwf-csub.f90.

5070  ! -- dummy variables
5071  class(GwfCsubType), intent(inout) :: this
5072  integer(I4B), intent(in) :: ib !< interbed number
5073  ! -- local variables
5074  integer(I4B) :: iviolate
5075  integer(I4B) :: idelay
5076  integer(I4B) :: node
5077  integer(I4B) :: n
5078  real(DP) :: z
5079  real(DP) :: h
5080  real(DP) :: dzhalf
5081  real(DP) :: ztop
5082  !
5083  ! -- initialize variables
5084  iviolate = 0
5085  idelay = this%idelay(ib)
5086  node = this%nodelist(ib)
5087  !
5088  ! -- evaluate every delay cell
5089  idelaycells: do n = 1, this%ndelaycells
5090  z = this%dbz(n, idelay)
5091  h = this%dbh(n, idelay)
5092  dzhalf = dhalf * this%dbdzini(1, idelay)
5093  !
5094  ! -- non-convertible cell
5095  if (this%stoiconv(node) == 0) then
5096  ztop = z + dzhalf
5097  if (h < ztop) then
5098  this%idb_nconv_count(1) = this%idb_nconv_count(1) + 1
5099  iviolate = 1
5100  end if
5101  end if
5102  !
5103  ! -- terminate the loop
5104  if (iviolate > 0) then
5105  exit idelaycells
5106  end if
5107  end do idelaycells

◆ csub_delay_init_zcell()

subroutine gwfcsubmodule::csub_delay_init_zcell ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  ib 
)
private

Method to calculate the initial center of each delay interbed cell, assuming the delay bed head is equal to the top of the delay interbed. The method also calculates the distance of the center of each delay bed cell from the center of the delay interbed (z_offset) that is used to calculate average skeletal specific storage values for a delay interbed centered on the center of the saturated thickness for a cell.

Parameters
[in]ibinterbed number

Definition at line 5344 of file gwf-csub.f90.

5345  ! -- dummy variables
5346  class(GwfCsubType), intent(inout) :: this
5347  integer(I4B), intent(in) :: ib !< interbed number
5348  ! -- local variables
5349  integer(I4B) :: n
5350  integer(I4B) :: node
5351  integer(I4B) :: idelay
5352  real(DP) :: bot
5353  real(DP) :: top
5354  real(DP) :: hbar
5355  real(DP) :: znode
5356  real(DP) :: dzz
5357  real(DP) :: z
5358  real(DP) :: zr
5359  real(DP) :: b
5360  real(DP) :: dz
5361  !
5362  ! -- initialize variables
5363  idelay = this%idelay(ib)
5364  node = this%nodelist(ib)
5365  b = this%thickini(ib)
5366  bot = this%dis%bot(node)
5367  top = bot + b
5368  hbar = top
5369  !
5370  ! -- calculate znode based on assumption that the delay bed bottom
5371  ! is equal to the cell bottom
5372  znode = this%csub_calc_znode(top, bot, hbar)
5373  dz = dhalf * this%dbdzini(1, idelay)
5374  dzz = dhalf * b
5375  z = znode + dzz
5376  zr = dzz
5377  !
5378  ! -- calculate z and z relative to znode for each delay
5379  ! interbed node
5380  do n = 1, this%ndelaycells
5381  ! z of node relative to bottom of cell
5382  z = z - dz
5383  this%dbz(n, idelay) = z
5384  z = z - dz
5385  ! z relative to znode
5386  zr = zr - dz
5387  if (abs(zr) < dz) then
5388  zr = dzero
5389  end if
5390  this%dbrelz(n, idelay) = zr
5391  zr = zr - dz
5392  end do

◆ csub_delay_sln()

subroutine gwfcsubmodule::csub_delay_sln ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  ib,
real(dp), intent(in)  hcell,
logical(lgp), intent(in), optional  update 
)
private

Method to calculate solve the delay interbed continuity equation for a delay interbed. The method encapsulates the non-linear loop and calls the linear solution.

Parameters
[in]ibinterbed number
[in]hcellcurrent head in a cell
[in]updateoptional logical variable indicating if the maximum head change variable in a delay bed should be updated

Definition at line 5251 of file gwf-csub.f90.

5252  ! -- dummy variables
5253  class(GwfCsubType), intent(inout) :: this
5254  integer(I4B), intent(in) :: ib !< interbed number
5255  real(DP), intent(in) :: hcell !< current head in a cell
5256  logical(LGP), intent(in), optional :: update !< optional logical variable indicating
5257  !! if the maximum head change variable
5258  !! in a delay bed should be updated
5259  ! -- local variables
5260  logical(LGP) :: lupdate
5261  integer(I4B) :: n
5262  integer(I4B) :: icnvg
5263  integer(I4B) :: iter
5264  integer(I4B) :: idelay
5265  real(DP) :: dh
5266  real(DP) :: dhmax
5267  real(DP) :: dhmax0
5268  real(DP), parameter :: dclose = dhundred * dprec
5269  !
5270  ! -- initialize variables
5271  if (present(update)) then
5272  lupdate = update
5273  else
5274  lupdate = .true.
5275  end if
5276  !
5277  ! -- calculate geostatic and effective stress for each delay bed cell
5278  call this%csub_delay_calc_stress(ib, hcell)
5279  !
5280  ! -- terminate if the aquifer head is below the top of delay interbeds
5281  if (count_errors() > 0) then
5282  call store_error_filename(this%input_fname)
5283  end if
5284  !
5285  ! -- solve for delay bed heads
5286  if (this%thickini(ib) > dzero) then
5287  icnvg = 0
5288  iter = 0
5289  idelay = this%idelay(ib)
5290  do
5291  iter = iter + 1
5292  !
5293  ! -- assemble coefficients
5294  call this%csub_delay_assemble(ib, hcell)
5295  !
5296  ! -- solve for head change in delay interbed cells
5297  call ims_misc_thomas(this%ndelaycells, &
5298  this%dbal, this%dbad, this%dbau, &
5299  this%dbrhs, this%dbdh, this%dbaw)
5300  !
5301  ! -- calculate maximum head change and update delay bed heads
5302  dhmax = dzero
5303  do n = 1, this%ndelaycells
5304  dh = this%dbdh(n) - this%dbh(n, idelay)
5305  if (abs(dh) > abs(dhmax)) then
5306  dhmax = dh
5307  if (lupdate) then
5308  this%dbdhmax(idelay) = dhmax
5309  end if
5310  end if
5311  ! -- update delay bed heads
5312  this%dbh(n, idelay) = this%dbdh(n)
5313  end do
5314  !
5315  ! -- update delay bed stresses
5316  call this%csub_delay_calc_stress(ib, hcell)
5317  !
5318  ! -- check delay bed convergence
5319  if (abs(dhmax) < dclose) then
5320  icnvg = 1
5321  else if (iter /= 1) then
5322  if (abs(dhmax) - abs(dhmax0) < dprec) then
5323  icnvg = 1
5324  end if
5325  end if
5326  if (icnvg == 1) then
5327  exit
5328  end if
5329  dhmax0 = dhmax
5330  end do
5331  end if
Here is the call graph for this function:

◆ csub_delay_update()

subroutine gwfcsubmodule::csub_delay_update ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  ib 
)
private

Method to update the thickness and porosity of each delay interbed cell.

Parameters
[in]ibinterbed number

Definition at line 6205 of file gwf-csub.f90.

6206  ! -- dummy variables
6207  class(GwfCsubType), intent(inout) :: this
6208  integer(I4B), intent(in) :: ib !< interbed number
6209  ! -- local variables
6210  integer(I4B) :: idelay
6211  integer(I4B) :: n
6212  real(DP) :: comp
6213  real(DP) :: thick
6214  real(DP) :: theta
6215  real(DP) :: tthick
6216  real(DP) :: wtheta
6217  !
6218  ! -- initialize variables
6219  idelay = this%idelay(ib)
6220  comp = dzero
6221  tthick = dzero
6222  wtheta = dzero
6223  !
6224  !
6225  do n = 1, this%ndelaycells
6226  !
6227  ! -- initialize compaction for delay cell
6228  comp = this%dbtcomp(n, idelay) + this%dbcomp(n, idelay)
6229  !
6230  ! -- scale compaction by rnb to get the compaction for
6231  ! the interbed system (as opposed to the full system)
6232  comp = comp / this%rnb(ib)
6233  !
6234  ! -- update thickness and theta
6235  if (abs(comp) > dzero) then
6236  thick = this%dbdzini(n, idelay)
6237  theta = this%dbthetaini(n, idelay)
6238  call this%csub_adj_matprop(comp, thick, theta)
6239  if (thick <= dzero) then
6240  write (errmsg, '(2(a,i0),a,g0,a)') &
6241  'Adjusted thickness for delay interbed (', ib, &
6242  ') cell (', n, ') is less than or equal to 0 (', thick, ').'
6243  call store_error(errmsg)
6244  end if
6245  if (theta <= dzero) then
6246  write (errmsg, '(2(a,i0),a,g0,a)') &
6247  'Adjusted theta for delay interbed (', ib, &
6248  ') cell (', n, 'is less than or equal to 0 (', theta, ').'
6249  call store_error(errmsg)
6250  end if
6251  this%dbdz(n, idelay) = thick
6252  this%dbtheta(n, idelay) = theta
6253  tthick = tthick + thick
6254  wtheta = wtheta + thick * theta
6255  else
6256  thick = this%dbdz(n, idelay)
6257  theta = this%dbtheta(n, idelay)
6258  tthick = tthick + thick
6259  wtheta = wtheta + thick * theta
6260  end if
6261  end do
6262  !
6263  ! -- calculate thickness weighted theta and save thickness and weighted
6264  ! theta values for delay interbed
6265  if (tthick > dzero) then
6266  wtheta = wtheta / tthick
6267  else
6268  tthick = dzero
6269  wtheta = dzero
6270  end if
6271  this%thick(ib) = tthick
6272  this%theta(ib) = wtheta
Here is the call graph for this function:

◆ csub_df_obs()

subroutine gwfcsubmodule::csub_df_obs ( class(gwfcsubtype this)
private

Method to define the observation types available in the CSUB package.

Definition at line 6357 of file gwf-csub.f90.

6358  ! -- dummy variables
6359  class(GwfCsubType) :: this
6360  ! -- local variables
6361  integer(I4B) :: indx
6362  !
6363  ! -- Store obs type and assign procedure pointer
6364  ! for csub observation type.
6365  call this%obs%StoreObsType('csub', .true., indx)
6366  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6367  !
6368  ! -- Store obs type and assign procedure pointer
6369  ! for inelastic-csub observation type.
6370  call this%obs%StoreObsType('inelastic-csub', .true., indx)
6371  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6372  !
6373  ! -- Store obs type and assign procedure pointer
6374  ! for elastic-csub observation type.
6375  call this%obs%StoreObsType('elastic-csub', .true., indx)
6376  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6377  !
6378  ! -- Store obs type and assign procedure pointer
6379  ! for coarse-csub observation type.
6380  call this%obs%StoreObsType('coarse-csub', .false., indx)
6381  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6382  !
6383  ! -- Store obs type and assign procedure pointer
6384  ! for csub-cell observation type.
6385  call this%obs%StoreObsType('csub-cell', .true., indx)
6386  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6387  !
6388  ! -- Store obs type and assign procedure pointer
6389  ! for watercomp-csub observation type.
6390  call this%obs%StoreObsType('wcomp-csub-cell', .false., indx)
6391  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6392  !
6393  ! -- Store obs type and assign procedure pointer
6394  ! for interbed ske observation type.
6395  call this%obs%StoreObsType('ske', .true., indx)
6396  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6397  !
6398  ! -- Store obs type and assign procedure pointer
6399  ! for interbed sk observation type.
6400  call this%obs%StoreObsType('sk', .true., indx)
6401  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6402  !
6403  ! -- Store obs type and assign procedure pointer
6404  ! for ske-cell observation type.
6405  call this%obs%StoreObsType('ske-cell', .true., indx)
6406  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6407  !
6408  ! -- Store obs type and assign procedure pointer
6409  ! for sk-cell observation type.
6410  call this%obs%StoreObsType('sk-cell', .true., indx)
6411  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6412  !
6413  ! -- Store obs type and assign procedure pointer
6414  ! for geostatic-stress-cell observation type.
6415  call this%obs%StoreObsType('gstress-cell', .false., indx)
6416  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6417  !
6418  ! -- Store obs type and assign procedure pointer
6419  ! for effective-stress-cell observation type.
6420  call this%obs%StoreObsType('estress-cell', .false., indx)
6421  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6422  !
6423  ! -- Store obs type and assign procedure pointer
6424  ! for total-compaction observation type.
6425  call this%obs%StoreObsType('interbed-compaction', .true., indx)
6426  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6427  !
6428  ! -- Store obs type and assign procedure pointer
6429  ! for inelastic-compaction observation type.
6430  call this%obs%StoreObsType('inelastic-compaction', .true., indx)
6431  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6432  !
6433  ! -- Store obs type and assign procedure pointer
6434  ! for inelastic-compaction observation type.
6435  call this%obs%StoreObsType('elastic-compaction', .true., indx)
6436  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6437  !
6438  ! -- Store obs type and assign procedure pointer
6439  ! for coarse-compaction observation type.
6440  call this%obs%StoreObsType('coarse-compaction', .false., indx)
6441  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6442  !
6443  ! -- Store obs type and assign procedure pointer
6444  ! for inelastic-compaction-cell observation type.
6445  call this%obs%StoreObsType('inelastic-compaction-cell', .true., indx)
6446  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6447  !
6448  ! -- Store obs type and assign procedure pointer
6449  ! for elastic-compaction-cell observation type.
6450  call this%obs%StoreObsType('elastic-compaction-cell', .true., indx)
6451  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6452  !
6453  ! -- Store obs type and assign procedure pointer
6454  ! for compaction-cell observation type.
6455  call this%obs%StoreObsType('compaction-cell', .true., indx)
6456  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6457  !
6458  ! -- Store obs type and assign procedure pointer
6459  ! for interbed thickness observation type.
6460  call this%obs%StoreObsType('thickness', .true., indx)
6461  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6462  !
6463  ! -- Store obs type and assign procedure pointer
6464  ! for coarse-thickness observation type.
6465  call this%obs%StoreObsType('coarse-thickness', .false., indx)
6466  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6467  !
6468  ! -- Store obs type and assign procedure pointer
6469  ! for thickness-cell observation type.
6470  call this%obs%StoreObsType('thickness-cell', .false., indx)
6471  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6472  !
6473  ! -- Store obs type and assign procedure pointer
6474  ! for interbed theta observation type.
6475  call this%obs%StoreObsType('theta', .true., indx)
6476  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6477  !
6478  ! -- Store obs type and assign procedure pointer
6479  ! for coarse-theta observation type.
6480  call this%obs%StoreObsType('coarse-theta', .false., indx)
6481  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6482  !
6483  ! -- Store obs type and assign procedure pointer
6484  ! for theta-cell observation type.
6485  call this%obs%StoreObsType('theta-cell', .true., indx)
6486  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6487  !
6488  ! -- Store obs type and assign procedure pointer
6489  ! for preconstress-cell observation type.
6490  call this%obs%StoreObsType('preconstress-cell', .false., indx)
6491  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6492  !
6493  ! -- Store obs type and assign procedure pointer
6494  ! for interbed-compaction-pct observation type.
6495  call this%obs%StoreObsType('interbed-compaction-pct', .false., indx)
6496  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6497  !
6498  ! -- Store obs type and assign procedure pointer
6499  ! for delay-preconstress observation type.
6500  call this%obs%StoreObsType('delay-preconstress', .false., indx)
6501  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6502  !
6503  ! -- Store obs type and assign procedure pointer
6504  ! for delay-head observation type.
6505  call this%obs%StoreObsType('delay-head', .false., indx)
6506  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6507  !
6508  ! -- Store obs type and assign procedure pointer
6509  ! for delay-gstress observation type.
6510  call this%obs%StoreObsType('delay-gstress', .false., indx)
6511  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6512  !
6513  ! -- Store obs type and assign procedure pointer
6514  ! for delay-estress observation type.
6515  call this%obs%StoreObsType('delay-estress', .false., indx)
6516  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6517  !
6518  ! -- Store obs type and assign procedure pointer
6519  ! for delay-compaction observation type.
6520  call this%obs%StoreObsType('delay-compaction', .false., indx)
6521  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6522  !
6523  ! -- Store obs type and assign procedure pointer
6524  ! for delay-thickness observation type.
6525  call this%obs%StoreObsType('delay-thickness', .false., indx)
6526  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6527  !
6528  ! -- Store obs type and assign procedure pointer
6529  ! for delay-theta observation type.
6530  call this%obs%StoreObsType('delay-theta', .false., indx)
6531  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6532  !
6533  ! -- Store obs type and assign procedure pointer
6534  ! for delay-flowtop observation type.
6535  call this%obs%StoreObsType('delay-flowtop', .true., indx)
6536  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6537  !
6538  ! -- Store obs type and assign procedure pointer
6539  ! for delay-flowbot observation type.
6540  call this%obs%StoreObsType('delay-flowbot', .true., indx)
6541  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
Here is the call graph for this function:

◆ csub_fc()

subroutine gwfcsubmodule::csub_fc ( class(gwfcsubtype this,
integer(i4b), intent(in)  kiter,
real(dp), dimension(:), intent(in)  hold,
real(dp), dimension(:), intent(in)  hnew,
class(matrixbasetype), pointer  matrix_sln,
integer(i4b), dimension(:), intent(in)  idxglo,
real(dp), dimension(:), intent(inout)  rhs 
)

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

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

Definition at line 2363 of file gwf-csub.f90.

2364  ! -- modules
2365  use tdismodule, only: delt
2366  ! -- dummy variables
2367  class(GwfCsubType) :: this
2368  integer(I4B), intent(in) :: kiter !< outer iteration numbed
2369  real(DP), intent(in), dimension(:) :: hold !< previous heads
2370  real(DP), intent(in), dimension(:) :: hnew !< current heads
2371  class(MatrixBaseType), pointer :: matrix_sln !< A matrix
2372  integer(I4B), intent(in), dimension(:) :: idxglo !< global index model to solution
2373  real(DP), intent(inout), dimension(:) :: rhs !< right-hand side
2374  ! -- local variables
2375  integer(I4B) :: ib
2376  integer(I4B) :: node
2377  integer(I4B) :: idiag
2378  integer(I4B) :: idelay
2379  real(DP) :: tled
2380  real(DP) :: area
2381  real(DP) :: hcof
2382  real(DP) :: rhsterm
2383  real(DP) :: comp
2384  !
2385  ! -- update geostatic load calculation
2386  call this%csub_cg_calc_stress(this%dis%nodes, hnew)
2387  !
2388  ! -- formulate csub terms
2389  if (this%gwfiss == 0) then
2390  !
2391  ! -- initialize tled
2392  tled = done / delt
2393  !
2394  ! -- coarse-grained storage
2395  do node = 1, this%dis%nodes
2396  idiag = this%dis%con%ia(node)
2397  area = this%dis%get_area(node)
2398  !
2399  ! -- skip inactive cells
2400  if (this%ibound(node) < 1) cycle
2401  !
2402  ! -- update coarse-grained material properties
2403  if (this%iupdatematprop /= 0) then
2404  if (this%ieslag == 0) then
2405  !
2406  ! -- calculate compaction
2407  call this%csub_cg_calc_comp(node, hnew(node), hold(node), comp)
2408  this%cg_comp(node) = comp
2409  !
2410  ! -- update coarse-grained thickness and void ratio
2411  call this%csub_cg_update(node)
2412  end if
2413  end if
2414  !
2415  ! -- calculate coarse-grained storage terms
2416  call this%csub_cg_fc(node, tled, area, hnew(node), hold(node), &
2417  hcof, rhsterm)
2418  !
2419  ! -- add coarse-grained storage terms to amat and rhs for coarse-grained storage
2420  call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2421  rhs(node) = rhs(node) + rhsterm
2422  !
2423  ! -- calculate coarse-grained water compressibility
2424  ! storage terms
2425  if (this%brg /= dzero) then
2426  call this%csub_cg_wcomp_fc(node, tled, area, hnew(node), hold(node), &
2427  hcof, rhsterm)
2428  !
2429  ! -- add water compression storage terms to amat and rhs for
2430  ! coarse-grained storage
2431  call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2432  rhs(node) = rhs(node) + rhsterm
2433  end if
2434  end do
2435  !
2436  ! -- interbed storage
2437  if (this%ninterbeds /= 0) then
2438  !
2439  ! -- calculate the contribution of interbeds to the
2440  ! groundwater flow equation
2441  do ib = 1, this%ninterbeds
2442  node = this%nodelist(ib)
2443  idelay = this%idelay(ib)
2444  idiag = this%dis%con%ia(node)
2445  area = this%dis%get_area(node)
2446  call this%csub_interbed_fc(ib, node, area, hnew(node), hold(node), &
2447  hcof, rhsterm)
2448  call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2449  rhs(node) = rhs(node) + rhsterm
2450  !
2451  ! -- calculate interbed water compressibility terms
2452  if (.not. is_close(this%brg, dzero) .and. idelay == 0) then
2453  call this%csub_nodelay_wcomp_fc(ib, node, tled, area, &
2454  hnew(node), hold(node), &
2455  hcof, rhsterm)
2456  !
2457  ! -- add water compression storage terms to amat and rhs for interbed
2458  call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2459  rhs(node) = rhs(node) + rhsterm
2460  end if
2461  end do
2462  end if
2463  end if
2464  !
2465  ! -- terminate if errors encountered when updating material properties
2466  if (count_errors() > 0) then
2467  call store_error_filename(this%input_fname)
2468  end if
Here is the call graph for this function:

◆ csub_fn()

subroutine gwfcsubmodule::csub_fn ( class(gwfcsubtype this,
integer(i4b), intent(in)  kiter,
real(dp), dimension(:), intent(in)  hold,
real(dp), dimension(:), intent(in)  hnew,
class(matrixbasetype), pointer  matrix_sln,
integer(i4b), dimension(:), intent(in)  idxglo,
real(dp), dimension(:), intent(inout)  rhs 
)

Fill the coefficient matrix and right-hand side with CSUB package with Newton-Raphson terms.

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

Definition at line 2480 of file gwf-csub.f90.

2481  ! -- modules
2482  use tdismodule, only: delt
2483  ! -- dummy variables
2484  class(GwfCsubType) :: this
2485  integer(I4B), intent(in) :: kiter !< outer iteration number
2486  real(DP), intent(in), dimension(:) :: hold !< previous heads
2487  real(DP), intent(in), dimension(:) :: hnew !< current heads
2488  class(MatrixBaseType), pointer :: matrix_sln !< A matrix
2489  integer(I4B), intent(in), dimension(:) :: idxglo !< global index model to solution
2490  real(DP), intent(inout), dimension(:) :: rhs !< right-hand side
2491  ! -- local variables
2492  integer(I4B) :: idelay
2493  integer(I4B) :: node
2494  integer(I4B) :: idiag
2495  integer(I4B) :: ib
2496  real(DP) :: tled
2497  real(DP) :: area
2498  real(DP) :: hcof
2499  real(DP) :: rhsterm
2500  !
2501  ! -- formulate csub terms
2502  if (this%gwfiss == 0) then
2503  tled = done / delt
2504  !
2505  ! -- coarse-grained storage
2506  do node = 1, this%dis%nodes
2507  idiag = this%dis%con%ia(node)
2508  area = this%dis%get_area(node)
2509  !
2510  ! -- skip inactive cells
2511  if (this%ibound(node) < 1) cycle
2512  !
2513  ! -- calculate coarse-grained storage newton terms
2514  call this%csub_cg_fn(node, tled, area, &
2515  hnew(node), hcof, rhsterm)
2516  !
2517  ! -- add coarse-grained storage newton terms to amat and rhs for
2518  ! coarse-grained storage
2519  call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2520  rhs(node) = rhs(node) + rhsterm
2521  !
2522  ! -- calculate coarse-grained water compressibility storage
2523  ! newton terms
2524  if (this%brg /= dzero) then
2525  call this%csub_cg_wcomp_fn(node, tled, area, hnew(node), hold(node), &
2526  hcof, rhsterm)
2527  !
2528  ! -- add water compression storage newton terms to amat and rhs for
2529  ! coarse-grained storage
2530  call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2531  rhs(node) = rhs(node) + rhsterm
2532  end if
2533  end do
2534  !
2535  ! -- interbed storage
2536  if (this%ninterbeds /= 0) then
2537  !
2538  ! -- calculate the interbed newton terms for the
2539  ! groundwater flow equation
2540  do ib = 1, this%ninterbeds
2541  idelay = this%idelay(ib)
2542  node = this%nodelist(ib)
2543  !
2544  ! -- skip inactive cells
2545  if (this%ibound(node) < 1) cycle
2546  !
2547  ! -- calculate interbed newton terms
2548  idiag = this%dis%con%ia(node)
2549  area = this%dis%get_area(node)
2550  call this%csub_interbed_fn(ib, node, hnew(node), hold(node), &
2551  hcof, rhsterm)
2552  !
2553  ! -- add interbed newton terms to amat and rhs
2554  call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2555  rhs(node) = rhs(node) + rhsterm
2556  !
2557  ! -- calculate interbed water compressibility terms
2558  if (this%brg /= dzero .and. idelay == 0) then
2559  call this%csub_nodelay_wcomp_fn(ib, node, tled, area, &
2560  hnew(node), hold(node), &
2561  hcof, rhsterm)
2562  !
2563  ! -- add interbed water compression newton terms to amat and rhs
2564  call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2565  rhs(node) = rhs(node) + rhsterm
2566  end if
2567  end do
2568  end if
2569  end if

◆ csub_fp()

subroutine gwfcsubmodule::csub_fp ( class(gwfcsubtype this)

Final processing for the CSUB package. This method generates the final strain tables that are output so that the user can evaluate if calculated strain rates in coarse-grained sediments and interbeds exceed 1 percent.

Definition at line 1520 of file gwf-csub.f90.

1521  ! -- dummy variables
1522  class(GwfCsubType) :: this
1523  ! -- local variables
1524  character(len=LINELENGTH) :: title
1525  character(len=LINELENGTH) :: tag
1526  character(len=LINELENGTH) :: msg
1527  character(len=10) :: ctype
1528  character(len=20) :: cellid
1529  character(len=10) :: cflag
1530  integer(I4B) :: i
1531  integer(I4B) :: ib
1532  integer(I4B) :: i0
1533  integer(I4B) :: i1
1534  integer(I4B) :: node
1535  integer(I4B) :: nn
1536  integer(I4B) :: idelay
1537  integer(I4B) :: iexceed
1538  integer(I4B), parameter :: ncells = 20
1539  integer(I4B) :: nlen
1540  integer(I4B) :: ntabrows
1541  integer(I4B) :: ntabcols
1542  integer(I4B) :: ipos
1543  real(DP) :: b0
1544  real(DP) :: b1
1545  real(DP) :: strain
1546  real(DP) :: pctcomp
1547  integer(I4B), dimension(:), allocatable :: imap_sel
1548  integer(I4B), dimension(:), allocatable :: locs
1549  real(DP), dimension(:), allocatable :: pctcomp_arr
1550  !
1551  ! -- initialize locs
1552  allocate (locs(this%dis%ndim))
1553  !
1554  ! -- calculate and report strain for interbeds
1555  if (this%ninterbeds > 0) then
1556  nlen = min(ncells, this%ninterbeds)
1557  allocate (imap_sel(nlen))
1558  allocate (pctcomp_arr(this%ninterbeds))
1559  iexceed = 0
1560  do ib = 1, this%ninterbeds
1561  idelay = this%idelay(ib)
1562  b0 = this%thickini(ib)
1563  strain = this%tcomp(ib) / b0
1564  pctcomp = dhundred * strain
1565  pctcomp_arr(ib) = pctcomp
1566  if (pctcomp >= done) then
1567  iexceed = iexceed + 1
1568  end if
1569  end do
1570  call selectn(imap_sel, pctcomp_arr, reverse=.true.)
1571  !
1572  ! -- summary interbed strain table
1573  i0 = max(1, this%ninterbeds - ncells + 1)
1574  i1 = this%ninterbeds
1575  msg = ''
1576  if (iexceed /= 0) then
1577  write (msg, '(1x,a,1x,i0,1x,a,1x,i0,1x,a)') &
1578  'LARGEST', (i1 - i0 + 1), 'OF', this%ninterbeds, &
1579  'INTERBED STRAIN VALUES SHOWN'
1580  call write_message(msg, this%iout, skipbefore=1)
1581  !
1582  ! -- interbed strain data
1583  ! -- set title
1584  title = trim(adjustl(this%packName))//' PACKAGE INTERBED STRAIN SUMMARY'
1585  !
1586  ! -- determine the number of columns and rows
1587  ntabrows = nlen
1588  ntabcols = 9
1589  !
1590  ! -- setup table
1591  call table_cr(this%outputtab, this%packName, title)
1592  call this%outputtab%table_df(ntabrows, ntabcols, this%iout)
1593  !
1594  ! add columns
1595  tag = 'INTERBED NUMBER'
1596  call this%outputtab%initialize_column(tag, 10, alignment=tabcenter)
1597  tag = 'INTERBED TYPE'
1598  call this%outputtab%initialize_column(tag, 10, alignment=tabcenter)
1599  tag = 'CELLID'
1600  call this%outputtab%initialize_column(tag, 20, alignment=tableft)
1601  tag = 'INITIAL THICKNESS'
1602  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
1603  tag = 'FINAL THICKNESS'
1604  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
1605  tag = 'TOTAL COMPACTION'
1606  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
1607  tag = 'FINAL STRAIN'
1608  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
1609  tag = 'PERCENT COMPACTION'
1610  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
1611  tag = 'FLAG'
1612  call this%outputtab%initialize_column(tag, 10, alignment=tabcenter)
1613  !
1614  ! -- write data
1615  do i = 1, nlen
1616  ib = imap_sel(i)
1617  idelay = this%idelay(ib)
1618  b0 = this%thickini(ib)
1619  b1 = this%csub_calc_interbed_thickness(ib)
1620  if (idelay == 0) then
1621  ctype = 'no-delay'
1622  else
1623  ctype = 'delay'
1624  b0 = b0 * this%rnb(ib)
1625  end if
1626  strain = this%tcomp(ib) / b0
1627  pctcomp = dhundred * strain
1628  if (pctcomp >= 5.0_dp) then
1629  cflag = '**>=5%'
1630  else if (pctcomp >= done) then
1631  cflag = '*>=1%'
1632  else
1633  cflag = ''
1634  end if
1635  node = this%nodelist(ib)
1636  call this%dis%noder_to_string(node, cellid)
1637  !
1638  ! -- fill table line
1639  call this%outputtab%add_term(ib)
1640  call this%outputtab%add_term(ctype)
1641  call this%outputtab%add_term(cellid)
1642  call this%outputtab%add_term(b0)
1643  call this%outputtab%add_term(b1)
1644  call this%outputtab%add_term(this%tcomp(ib))
1645  call this%outputtab%add_term(strain)
1646  call this%outputtab%add_term(pctcomp)
1647  call this%outputtab%add_term(cflag)
1648  end do
1649  write (this%iout, '(/1X,A,1X,I0,1X,A,1X,I0,1X,A,/1X,A,/1X,A)') &
1650  'PERCENT COMPACTION IS GREATER THAN OR EQUAL TO 1 PERCENT IN', &
1651  iexceed, 'OF', this%ninterbeds, 'INTERBED(S).', &
1652  'USE THE STRAIN_CSV_INTERBED OPTION TO OUTPUT A CSV '// &
1653  'FILE WITH PERCENT COMPACTION ', 'VALUES FOR ALL INTERBEDS.'
1654  else
1655  msg = 'PERCENT COMPACTION WAS LESS THAN 1 PERCENT IN ALL INTERBEDS'
1656  write (this%iout, '(/1X,A)') trim(adjustl(msg))
1657  end if
1658  !
1659  ! -- write csv file
1660  if (this%istrainib /= 0) then
1661  !
1662  ! -- determine the number of columns and rows
1663  ntabrows = this%ninterbeds
1664  ntabcols = 7
1665  if (this%dis%ndim > 1) then
1666  ntabcols = ntabcols + 1
1667  end if
1668  ntabcols = ntabcols + this%dis%ndim
1669  !
1670  ! -- setup table
1671  call table_cr(this%outputtab, this%packName, '')
1672  call this%outputtab%table_df(ntabrows, ntabcols, this%istrainib, &
1673  lineseparator=.false., separator=',')
1674  !
1675  ! add columns
1676  tag = 'INTERBED_NUMBER'
1677  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
1678  tag = 'INTERBED_TYPE'
1679  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
1680  tag = 'NODE'
1681  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
1682  if (this%dis%ndim == 2) then
1683  tag = 'LAYER'
1684  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
1685  tag = 'ICELL2D'
1686  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
1687  else
1688  tag = 'LAYER'
1689  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
1690  tag = 'ROW'
1691  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
1692  tag = 'COLUMN'
1693  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
1694  end if
1695  tag = 'INITIAL_THICKNESS'
1696  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
1697  tag = 'FINAL_THICKNESS'
1698  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
1699  tag = 'TOTAL_COMPACTION'
1700  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
1701  tag = 'TOTAL_STRAIN'
1702  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
1703  tag = 'PERCENT_COMPACTION'
1704  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
1705  !
1706  ! -- write data
1707  do ib = 1, this%ninterbeds
1708  idelay = this%idelay(ib)
1709  b0 = this%thickini(ib)
1710  b1 = this%csub_calc_interbed_thickness(ib)
1711  if (idelay == 0) then
1712  ctype = 'no-delay'
1713  else
1714  ctype = 'delay'
1715  b0 = b0 * this%rnb(ib)
1716  end if
1717  strain = this%tcomp(ib) / b0
1718  pctcomp = dhundred * strain
1719  node = this%nodelist(ib)
1720  call this%dis%noder_to_array(node, locs)
1721  !
1722  ! -- fill table line
1723  call this%outputtab%add_term(ib)
1724  call this%outputtab%add_term(ctype)
1725  if (this%dis%ndim > 1) then
1726  call this%outputtab%add_term(this%dis%get_nodeuser(node))
1727  end if
1728  do ipos = 1, this%dis%ndim
1729  call this%outputtab%add_term(locs(ipos))
1730  end do
1731  call this%outputtab%add_term(b0)
1732  call this%outputtab%add_term(b1)
1733  call this%outputtab%add_term(this%tcomp(ib))
1734  call this%outputtab%add_term(strain)
1735  call this%outputtab%add_term(pctcomp)
1736  end do
1737  end if
1738  !
1739  ! -- deallocate temporary storage
1740  deallocate (imap_sel)
1741  deallocate (pctcomp_arr)
1742  end if
1743  !
1744  ! -- calculate and report strain for coarse-grained materials
1745  nlen = min(ncells, this%dis%nodes)
1746  allocate (imap_sel(nlen))
1747  allocate (pctcomp_arr(this%dis%nodes))
1748  iexceed = 0
1749  do node = 1, this%dis%nodes
1750  strain = dzero
1751  if (this%cg_thickini(node) > dzero) then
1752  strain = this%cg_tcomp(node) / this%cg_thickini(node)
1753  end if
1754  pctcomp = dhundred * strain
1755  pctcomp_arr(node) = pctcomp
1756  if (pctcomp >= done) then
1757  iexceed = iexceed + 1
1758  end if
1759  end do
1760  call selectn(imap_sel, pctcomp_arr, reverse=.true.)
1761  !
1762  ! -- summary coarse-grained strain table
1763  i0 = max(1, this%dis%nodes - ncells + 1)
1764  i1 = this%dis%nodes
1765  msg = ''
1766  if (iexceed /= 0) then
1767  write (msg, '(a,1x,i0,1x,a,1x,i0,1x,a)') &
1768  'LARGEST ', (i1 - i0 + 1), 'OF', this%dis%nodes, &
1769  'CELL COARSE-GRAINED VALUES SHOWN'
1770  call write_message(msg, this%iout, skipbefore=1)
1771  !
1772  ! -- set title
1773  title = trim(adjustl(this%packName))// &
1774  ' PACKAGE COARSE-GRAINED STRAIN SUMMARY'
1775  !
1776  ! -- determine the number of columns and rows
1777  ntabrows = nlen
1778  ntabcols = 7
1779  !
1780  ! -- setup table
1781  call table_cr(this%outputtab, this%packName, title)
1782  call this%outputtab%table_df(ntabrows, ntabcols, this%iout)
1783  !
1784  ! add columns
1785  tag = 'CELLID'
1786  call this%outputtab%initialize_column(tag, 20, alignment=tableft)
1787  tag = 'INITIAL THICKNESS'
1788  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
1789  tag = 'FINAL THICKNESS'
1790  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
1791  tag = 'TOTAL COMPACTION'
1792  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
1793  tag = 'FINAL STRAIN'
1794  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
1795  tag = 'PERCENT COMPACTION'
1796  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
1797  tag = 'FLAG'
1798  call this%outputtab%initialize_column(tag, 10, alignment=tabcenter)
1799  ! -- write data
1800  do nn = 1, nlen
1801  node = imap_sel(nn)
1802  if (this%cg_thickini(node) > dzero) then
1803  strain = this%cg_tcomp(node) / this%cg_thickini(node)
1804  else
1805  strain = dzero
1806  end if
1807  pctcomp = dhundred * strain
1808  if (pctcomp >= 5.0_dp) then
1809  cflag = '**>=5%'
1810  else if (pctcomp >= done) then
1811  cflag = '*>=1%'
1812  else
1813  cflag = ''
1814  end if
1815  call this%dis%noder_to_string(node, cellid)
1816  !
1817  ! -- fill table line
1818  call this%outputtab%add_term(cellid)
1819  call this%outputtab%add_term(this%cg_thickini(node))
1820  call this%outputtab%add_term(this%cg_thick(node))
1821  call this%outputtab%add_term(this%cg_tcomp(node))
1822  call this%outputtab%add_term(strain)
1823  call this%outputtab%add_term(pctcomp)
1824  call this%outputtab%add_term(cflag)
1825  end do
1826  write (this%iout, '(/1X,A,1X,I0,1X,A,1X,I0,1X,A,/1X,A,/1X,A)') &
1827  'COARSE-GRAINED STORAGE PERCENT COMPACTION IS GREATER THAN OR '// &
1828  'EQUAL TO 1 PERCENT IN', iexceed, 'OF', this%dis%nodes, 'CELL(S).', &
1829  'USE THE STRAIN_CSV_COARSE OPTION TO OUTPUT A CSV '// &
1830  'FILE WITH PERCENT COMPACTION ', 'VALUES FOR ALL CELLS.'
1831  else
1832  msg = 'COARSE-GRAINED STORAGE PERCENT COMPACTION WAS LESS THAN '// &
1833  '1 PERCENT IN ALL CELLS '
1834  write (this%iout, '(/1X,A)') trim(adjustl(msg))
1835  end if
1836  !
1837  ! -- write csv file
1838  if (this%istrainsk /= 0) then
1839  !
1840  ! -- determine the number of columns and rows
1841  ntabrows = this%dis%nodes
1842  ntabcols = 5
1843  if (this%dis%ndim > 1) then
1844  ntabcols = ntabcols + 1
1845  end if
1846  ntabcols = ntabcols + this%dis%ndim
1847  !
1848  ! -- setup table
1849  call table_cr(this%outputtab, this%packName, '')
1850  call this%outputtab%table_df(ntabrows, ntabcols, this%istrainsk, &
1851  lineseparator=.false., separator=',')
1852  !
1853  ! add columns
1854  tag = 'NODE'
1855  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
1856  if (this%dis%ndim == 2) then
1857  tag = 'LAYER'
1858  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
1859  tag = 'ICELL2D'
1860  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
1861  else
1862  tag = 'LAYER'
1863  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
1864  tag = 'ROW'
1865  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
1866  tag = 'COLUMN'
1867  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
1868  end if
1869  tag = 'INITIAL_THICKNESS'
1870  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
1871  tag = 'FINAL_THICKNESS'
1872  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
1873  tag = 'TOTAL_COMPACTION'
1874  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
1875  tag = 'TOTAL_STRAIN'
1876  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
1877  tag = 'PERCENT_COMPACTION'
1878  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
1879  !
1880  ! -- write data
1881  do node = 1, this%dis%nodes
1882  if (this%cg_thickini(node) > dzero) then
1883  strain = this%cg_tcomp(node) / this%cg_thickini(node)
1884  else
1885  strain = dzero
1886  end if
1887  pctcomp = dhundred * strain
1888  call this%dis%noder_to_array(node, locs)
1889  !
1890  ! -- fill table line
1891  if (this%dis%ndim > 1) then
1892  call this%outputtab%add_term(this%dis%get_nodeuser(node))
1893  end if
1894  do ipos = 1, this%dis%ndim
1895  call this%outputtab%add_term(locs(ipos))
1896  end do
1897  call this%outputtab%add_term(this%cg_thickini(node))
1898  call this%outputtab%add_term(this%cg_thick(node))
1899  call this%outputtab%add_term(this%cg_tcomp(node))
1900  call this%outputtab%add_term(strain)
1901  call this%outputtab%add_term(pctcomp)
1902  end do
1903  end if
1904  !
1905  ! -- write a warning message for delay interbeds in non-convertible gwf
1906  ! cells that violate minimum head assumptions
1907  if (this%ndelaybeds > 0) then
1908  if (this%idb_nconv_count(2) > 0) then
1909  write (warnmsg, '(a,1x,a,1x,i0,1x,a,1x,a)') &
1910  'Delay interbed cell heads were less than the top of the interbed', &
1911  'cell in', this%idb_nconv_count(2), 'interbed cells in ', &
1912  'non-convertible GWF cells for at least one time step during '// &
1913  'the simulation.'
1914  call store_warning(warnmsg)
1915  end if
1916  end if
1917  !
1918  ! -- deallocate temporary storage
1919  deallocate (imap_sel)
1920  deallocate (locs)
1921  deallocate (pctcomp_arr)
Here is the call graph for this function:

◆ csub_initialize_tables()

subroutine gwfcsubmodule::csub_initialize_tables ( class(gwfcsubtype this)

Subroutine to initialize optional tables. Tables include: o delay interbeds convergence tables

Definition at line 2578 of file gwf-csub.f90.

2579  class(GwfCsubType) :: this
2580 
2581  character(len=LINELENGTH) :: tag
2582  integer(I4B) :: ntabrows
2583  integer(I4B) :: ntabcols
2584 
2585  if (this%ipakcsv > 0) then
2586  if (this%ndelaybeds < 1) then
2587  write (warnmsg, '(a,1x,3a)') &
2588  'Package convergence data is requested but delay interbeds', &
2589  'are not included in package (', &
2590  trim(adjustl(this%packName)), ').'
2591  call store_warning(warnmsg)
2592  end if
2593 
2594  ntabrows = 1
2595  ntabcols = 9
2596 
2597  ! setup table
2598  call table_cr(this%pakcsvtab, this%packName, '')
2599  call this%pakcsvtab%table_df(ntabrows, ntabcols, this%ipakcsv, &
2600  lineseparator=.false., separator=',', &
2601  finalize=.false.)
2602 
2603  ! add columns to package csv
2604  tag = 'total_inner_iterations'
2605  call this%pakcsvtab%initialize_column(tag, 10, alignment=tableft)
2606  tag = 'totim'
2607  call this%pakcsvtab%initialize_column(tag, 10, alignment=tableft)
2608  tag = 'kper'
2609  call this%pakcsvtab%initialize_column(tag, 10, alignment=tableft)
2610  tag = 'kstp'
2611  call this%pakcsvtab%initialize_column(tag, 10, alignment=tableft)
2612  tag = 'nouter'
2613  call this%pakcsvtab%initialize_column(tag, 10, alignment=tableft)
2614  tag = 'dvmax'
2615  call this%pakcsvtab%initialize_column(tag, 15, alignment=tableft)
2616  tag = 'dvmax_loc'
2617  call this%pakcsvtab%initialize_column(tag, 15, alignment=tableft)
2618  tag = 'dstoragemax'
2619  call this%pakcsvtab%initialize_column(tag, 15, alignment=tableft)
2620  tag = 'dstoragemax_loc'
2621  call this%pakcsvtab%initialize_column(tag, 15, alignment=tableft)
2622  end if
2623 
Here is the call graph for this function:

◆ csub_interbed_fc()

subroutine gwfcsubmodule::csub_interbed_fc ( class(gwfcsubtype this,
integer(i4b), intent(in)  ib,
integer(i4b), intent(in)  node,
real(dp), intent(in)  area,
real(dp), intent(in)  hcell,
real(dp), intent(in)  hcellold,
real(dp), intent(inout)  hcof,
real(dp), intent(inout)  rhs 
)
private

Method formulates the coefficient matrix and right-hand side terms for a interbed in a cell.

Parameters
[in,out]hcofinterbed A matrix entry
[in,out]rhsinterbed right-hand side entry
[in]ibinterbed number
[in]nodecell node number
[in]areahorizontal cell area
[in]hcellcurrent head in cell
[in]hcelloldprevious head in cell
[in,out]hcofinterbed A matrix entry
[in,out]rhsinterbed right-hand side

Definition at line 4434 of file gwf-csub.f90.

4435  ! -- dummy variables
4436  class(GwfCsubType) :: this
4437  integer(I4B), intent(in) :: ib !< interbed number
4438  integer(I4B), intent(in) :: node !< cell node number
4439  real(DP), intent(in) :: area !< horizontal cell area
4440  real(DP), intent(in) :: hcell !< current head in cell
4441  real(DP), intent(in) :: hcellold !< previous head in cell
4442  real(DP), intent(inout) :: hcof !< interbed A matrix entry
4443  real(DP), intent(inout) :: rhs !< interbed right-hand side
4444  ! -- local variables
4445  real(DP) :: snnew
4446  real(DP) :: snold
4447  real(DP) :: comp
4448  real(DP) :: compi
4449  real(DP) :: compe
4450  real(DP) :: rho1
4451  real(DP) :: rho2
4452  real(DP) :: f
4453  !
4454  ! -- initialize variables
4455  rhs = dzero
4456  hcof = dzero
4457  comp = dzero
4458  compi = dzero
4459  compe = dzero
4460  !
4461  ! -- skip inactive and constant head cells
4462  if (this%ibound(node) > 0) then
4463  if (this%idelay(ib) == 0) then
4464  !
4465  ! -- update material properties
4466  if (this%iupdatematprop /= 0) then
4467  if (this%ieslag == 0) then
4468  !
4469  ! -- calculate compaction
4470  call this%csub_nodelay_calc_comp(ib, hcell, hcellold, comp, &
4471  rho1, rho2)
4472  this%comp(ib) = comp
4473  !
4474  ! -- update thickness and void ratio
4475  call this%csub_nodelay_update(ib)
4476  end if
4477  end if
4478  !
4479  ! -- calculate no-delay interbed rho1 and rho2
4480  call this%csub_nodelay_fc(ib, hcell, hcellold, rho1, hcof, rhs)
4481  f = area
4482  else
4483  !
4484  ! -- calculate cell saturation
4485  call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4486  !
4487  ! -- update material properties
4488  if (this%iupdatematprop /= 0) then
4489  if (this%ieslag == 0) then
4490  !
4491  ! -- calculate compaction
4492  call this%csub_delay_calc_comp(ib, hcell, hcellold, &
4493  comp, compi, compe)
4494  this%comp(ib) = comp
4495  !
4496  ! -- update thickness and void ratio
4497  call this%csub_delay_update(ib)
4498  end if
4499  end if
4500  !
4501  ! -- calculate delay interbed hcof and rhs
4502  call this%csub_delay_sln(ib, hcell)
4503  call this%csub_delay_fc(ib, hcof, rhs)
4504  f = area * this%rnb(ib)
4505  end if
4506  rhs = rhs * f
4507  hcof = -hcof * f
4508  end if

◆ csub_interbed_fn()

subroutine gwfcsubmodule::csub_interbed_fn ( class(gwfcsubtype this,
integer(i4b), intent(in)  ib,
integer(i4b), intent(in)  node,
real(dp), intent(in)  hcell,
real(dp), intent(in)  hcellold,
real(dp), intent(inout)  hcof,
real(dp), intent(inout)  rhs 
)
private

Method formulates the Newton-Raphson formulation coefficient matrix and right-hand side terms for a interbed in a cell.

Parameters
[in,out]hcofinterbed A matrix entry
[in,out]rhsinterbed right-hand side entry
[in]ibinterbed number
[in]nodecell node number
[in]hcellcurrent head in a cell
[in]hcelloldprevious head in a cell
[in,out]hcofinterbed A matrix entry
[in,out]rhsinterbed right-hand side entry

Definition at line 4520 of file gwf-csub.f90.

4521  ! -- modules
4522  use tdismodule, only: delt
4523  ! -- dummy variables
4524  class(GwfCsubType) :: this
4525  integer(I4B), intent(in) :: ib !< interbed number
4526  integer(I4B), intent(in) :: node !< cell node number
4527  real(DP), intent(in) :: hcell !< current head in a cell
4528  real(DP), intent(in) :: hcellold !< previous head in a cell
4529  real(DP), intent(inout) :: hcof !< interbed A matrix entry
4530  real(DP), intent(inout) :: rhs !< interbed right-hand side entry
4531  ! -- local variables
4532  integer(I4B) :: idelay
4533  real(DP) :: hcofn
4534  real(DP) :: rhsn
4535  real(DP) :: top
4536  real(DP) :: bot
4537  real(DP) :: tled
4538  real(DP) :: tthk
4539  real(DP) :: snnew
4540  real(DP) :: snold
4541  real(DP) :: f
4542  real(DP) :: satderv
4543  real(DP) :: hbar
4544  real(DP) :: hbarderv
4545  real(DP) :: rho1
4546  real(DP) :: rho2
4547  !
4548  ! -- initialize variables
4549  rhs = dzero
4550  hcof = dzero
4551  rhsn = dzero
4552  hcofn = dzero
4553  satderv = dzero
4554  idelay = this%idelay(ib)
4555  top = this%dis%top(node)
4556  bot = this%dis%bot(node)
4557  !
4558  ! -- skip inactive and constant head cells
4559  if (this%ibound(node) > 0) then
4560  tled = done / delt
4561  tthk = this%thickini(ib)
4562  !
4563  ! -- calculate cell saturation
4564  call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4565  !
4566  ! -- no-delay interbeds
4567  if (idelay == 0) then
4568  !
4569  ! -- initialize factor
4570  f = done
4571  !
4572  ! -- calculate the saturation derivative
4573  satderv = this%csub_calc_sat_derivative(node, hcell)
4574  !
4575  ! -- calculate corrected head (hbar)
4576  hbar = squadratic0sp(hcell, bot, this%satomega)
4577  !
4578  ! -- calculate the derivative of the hbar functions
4579  hbarderv = squadratic0spderivative(hcell, bot, this%satomega)
4580  !
4581  ! -- calculate storage coefficient
4582  call this%csub_nodelay_fc(ib, hcell, hcellold, rho1, rho2, rhsn)
4583  !
4584  ! -- calculate hcofn term
4585  hcofn = rho2 * (done - hbarderv) * snnew + &
4586  rho2 * (this%cg_gs(node) - hbar + bot) * satderv
4587  if (this%ielastic(ib) == 0) then
4588  hcofn = hcofn - rho2 * this%pcs(ib) * satderv
4589  end if
4590  !
4591  ! -- Add additional term if using lagged effective stress
4592  if (this%ieslag /= 0) then
4593  if (this%ielastic(ib) /= 0) then
4594  hcofn = hcofn - rho1 * this%cg_es0(node) * satderv
4595  else
4596  hcofn = hcofn - rho1 * (this%pcs(ib) - this%cg_es0(node)) * satderv
4597  end if
4598  end if
4599  end if
4600  end if
Here is the call graph for this function:

◆ csub_nodelay_calc_comp()

subroutine gwfcsubmodule::csub_nodelay_calc_comp ( class(gwfcsubtype this,
integer(i4b), intent(in)  ib,
real(dp), intent(in)  hcell,
real(dp), intent(in)  hcellold,
real(dp), intent(inout)  comp,
real(dp), intent(inout)  rho1,
real(dp), intent(inout)  rho2 
)

Method calculates the compaction for a no-delay interbed. The method also calculates the storage coefficients for the no-delay interbed.

Parameters
[in,out]compno-delay compaction
[in,out]rho1no-delay storage value using Sske
[in,out]rho2no-delay storage value using Ssk
[in]ibinterbed number
[in]hcellcurrent head for the cell
[in]hcelloldprevious head for the cell
[in,out]compno-delay interbed compaction
[in,out]rho1current storage coefficient based on Sske
[in,out]rho2current storage coefficient based on Ssk

Definition at line 3866 of file gwf-csub.f90.

3867  ! -- dummy variables
3868  class(GwfCsubType) :: this
3869  integer(I4B), intent(in) :: ib !< interbed number
3870  real(DP), intent(in) :: hcell !< current head for the cell
3871  real(DP), intent(in) :: hcellold !< previous head for the cell
3872  real(DP), intent(inout) :: comp !< no-delay interbed compaction
3873  real(DP), intent(inout) :: rho1 !< current storage coefficient based on Sske
3874  real(DP), intent(inout) :: rho2 !< current storage coefficient based on Ssk
3875  ! -- local variables
3876  integer(I4B) :: node
3877  real(DP) :: es
3878  real(DP) :: es0
3879  real(DP) :: pcs
3880  real(DP) :: tled
3881  real(DP) :: rhs
3882  !
3883  ! -- initialize variables
3884  node = this%nodelist(ib)
3885  tled = done
3886  es = this%cg_es(node)
3887  es0 = this%cg_es0(node)
3888  pcs = this%pcs(ib)
3889  !
3890  ! -- calculate no-delay interbed rho1 and rho2
3891  call this%csub_nodelay_fc(ib, hcell, hcellold, rho1, rho2, rhs, argtled=tled)
3892  !
3893  ! -- calculate no-delay interbed compaction
3894  if (this%ielastic(ib) /= 0) then
3895  comp = rho2 * es - rho1 * es0
3896  else
3897  comp = -pcs * (rho2 - rho1) - (rho1 * es0) + (rho2 * es)
3898  end if

◆ csub_nodelay_fc()

subroutine gwfcsubmodule::csub_nodelay_fc ( class(gwfcsubtype this,
integer(i4b), intent(in)  ib,
real(dp), intent(in)  hcell,
real(dp), intent(in)  hcellold,
real(dp), intent(inout)  rho1,
real(dp), intent(inout)  rho2,
real(dp), intent(inout)  rhs,
real(dp), intent(in), optional  argtled 
)
private

Method calculates the skeletal storage coefficients for a no-delay interbed. The method also calculates the contribution of the no-delay interbed to the right-hand side of the groundwater flow equation for the cell.

Parameters
[in,out]rho1no-delay storage value using Sske
[in,out]rho2no-delay storage value using Ssk
[in,out]rhsno-delay right-hand side contribution
[in]ibinterbed number
[in]hcellcurrent head in the cell
[in]hcelloldprevious head in the cell
[in,out]rho1current storage coefficient value using Sske
[in,out]rho2current storage coefficient value based on Ssk
[in,out]rhsno-delay interbed contribution to the right-hand side
[in]argtledoptional reciprocal of the time step length

Definition at line 3758 of file gwf-csub.f90.

3760  ! -- modules
3761  use tdismodule, only: delt
3762  ! -- dummy variables
3763  class(GwfCsubType) :: this
3764  integer(I4B), intent(in) :: ib !< interbed number
3765  real(DP), intent(in) :: hcell !< current head in the cell
3766  real(DP), intent(in) :: hcellold !< previous head in the cell
3767  real(DP), intent(inout) :: rho1 !< current storage coefficient value using Sske
3768  real(DP), intent(inout) :: rho2 !< current storage coefficient value based on Ssk
3769  real(DP), intent(inout) :: rhs !< no-delay interbed contribution to the right-hand side
3770  real(DP), intent(in), optional :: argtled !< optional reciprocal of the time step length
3771  ! -- local variables
3772  integer(I4B) :: node
3773  real(DP) :: tled
3774  real(DP) :: top
3775  real(DP) :: bot
3776  real(DP) :: thick
3777  real(DP) :: hbar
3778  real(DP) :: znode
3779  real(DP) :: snold
3780  real(DP) :: snnew
3781  real(DP) :: sto_fac
3782  real(DP) :: sto_fac0
3783  real(DP) :: area
3784  real(DP) :: theta
3785  real(DP) :: es
3786  real(DP) :: es0
3787  real(DP) :: f
3788  real(DP) :: f0
3789  real(DP) :: rcorr
3790  !
3791  ! -- process optional variables
3792  if (present(argtled)) then
3793  tled = argtled
3794  else
3795  tled = done / delt
3796  end if
3797  node = this%nodelist(ib)
3798  area = this%dis%get_area(node)
3799  bot = this%dis%bot(node)
3800  top = this%dis%top(node)
3801  thick = this%thickini(ib)
3802  !
3803  ! -- calculate corrected head (hbar)
3804  hbar = squadratic0sp(hcell, bot, this%satomega)
3805  !
3806  ! -- set iconvert
3807  this%iconvert(ib) = 0
3808  !
3809  ! -- aquifer saturation
3810  call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
3811  if (this%lhead_based .EQV. .true.) then
3812  f = done
3813  f0 = done
3814  else
3815  znode = this%csub_calc_znode(top, bot, hbar)
3816  es = this%cg_es(node)
3817  es0 = this%cg_es0(node)
3818  theta = this%thetaini(ib)
3819  !
3820  ! -- calculate the compression index factors for the delay
3821  ! node relative to the center of the cell based on the
3822  ! current and previous head
3823  call this%csub_calc_sfacts(node, bot, znode, theta, es, es0, f)
3824  end if
3825  sto_fac = tled * snnew * thick * f
3826  sto_fac0 = tled * snold * thick * f
3827  !
3828  ! -- calculate rho1 and rho2
3829  rho1 = this%rci(ib) * sto_fac0
3830  rho2 = this%rci(ib) * sto_fac
3831  if (this%cg_es(node) > this%pcs(ib)) then
3832  this%iconvert(ib) = 1
3833  rho2 = this%ci(ib) * sto_fac
3834  end if
3835  !
3836  ! -- calculate correction term
3837  rcorr = rho2 * (hcell - hbar)
3838  !
3839  ! -- fill right-hand side
3840  if (this%ielastic(ib) /= 0) then
3841  rhs = rho1 * this%cg_es0(node) - &
3842  rho2 * (this%cg_gs(node) + bot) - &
3843  rcorr
3844  else
3845  rhs = -rho2 * (this%cg_gs(node) + bot) + &
3846  (this%pcs(ib) * (rho2 - rho1)) + &
3847  (rho1 * this%cg_es0(node)) - &
3848  rcorr
3849  end if
3850  !
3851  ! -- save ske and sk
3852  this%ske(ib) = rho1
3853  this%sk(ib) = rho2
Here is the call graph for this function:

◆ csub_nodelay_update()

subroutine gwfcsubmodule::csub_nodelay_update ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  i 
)
private

Method updates no-delay material properties based on the current compaction value.

Definition at line 3714 of file gwf-csub.f90.

3715  ! -- dummy variables
3716  class(GwfCsubType), intent(inout) :: this
3717  integer(I4B), intent(in) :: i
3718  ! -- local variables
3719  real(DP) :: comp
3720  real(DP) :: thick
3721  real(DP) :: theta
3722  !
3723  ! -- update thickness and theta
3724  comp = this%tcomp(i) + this%comp(i)
3725  if (abs(comp) > dzero) then
3726  thick = this%thickini(i)
3727  theta = this%thetaini(i)
3728  call this%csub_adj_matprop(comp, thick, theta)
3729  if (thick <= dzero) then
3730  write (errmsg, '(a,1x,i0,1x,a,g0,a)') &
3731  'Adjusted thickness for no-delay interbed', i, &
3732  'is less than or equal to 0 (', thick, ').'
3733  call store_error(errmsg)
3734  end if
3735  if (theta <= dzero) then
3736  write (errmsg, '(a,1x,i0,1x,a,g0,a)') &
3737  'Adjusted theta for no-delay interbed', i, &
3738  'is less than or equal to 0 (', theta, ').'
3739  call store_error(errmsg)
3740  end if
3741  this%thick(i) = thick
3742  this%theta(i) = theta
3743  end if
Here is the call graph for this function:

◆ csub_nodelay_wcomp_fc()

subroutine gwfcsubmodule::csub_nodelay_wcomp_fc ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  ib,
integer(i4b), intent(in)  node,
real(dp), intent(in)  tled,
real(dp), intent(in)  area,
real(dp), intent(in)  hcell,
real(dp), intent(in)  hcellold,
real(dp), intent(inout)  hcof,
real(dp), intent(inout)  rhs 
)
private

Method formulates the standard formulation coefficient matrix and right-hand side terms for water compressibility in no-delay interbeds.

Parameters
[in,out]hcofno-delay A matrix entry
[in,out]rhsno-delay right-hand side entry
[in]ibinterbed number
[in]nodecell node number
[in]tledreciprocal of time step length
[in]areahorizontal cell area
[in]hcellcurrent head in cell
[in]hcelloldprevious head in cell
[in,out]hcofno-delay A matrix entry
[in,out]rhsno-delay right-hand side entry

Definition at line 4856 of file gwf-csub.f90.

4858  ! -- dummy variables
4859  class(GwfCsubType), intent(inout) :: this
4860  integer(I4B), intent(in) :: ib !< interbed number
4861  integer(I4B), intent(in) :: node !< cell node number
4862  real(DP), intent(in) :: tled !< reciprocal of time step length
4863  real(DP), intent(in) :: area !< horizontal cell area
4864  real(DP), intent(in) :: hcell !< current head in cell
4865  real(DP), intent(in) :: hcellold !< previous head in cell
4866  real(DP), intent(inout) :: hcof !< no-delay A matrix entry
4867  real(DP), intent(inout) :: rhs !< no-delay right-hand side entry
4868  ! -- local variables
4869  real(DP) :: top
4870  real(DP) :: bot
4871  real(DP) :: snold
4872  real(DP) :: snnew
4873  real(DP) :: f
4874  real(DP) :: wc
4875  real(DP) :: wc0
4876  !
4877  ! -- initialize variables
4878  rhs = dzero
4879  hcof = dzero
4880  !
4881  ! -- aquifer elevations and thickness
4882  top = this%dis%top(node)
4883  bot = this%dis%bot(node)
4884  !
4885  ! -- calculate cell saturation
4886  call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4887  !
4888  !
4889  f = this%brg * area * tled
4890  wc0 = f * this%theta0(ib) * this%thick0(ib)
4891  wc = f * this%theta(ib) * this%thick(ib)
4892  hcof = -wc * snnew
4893  rhs = -wc0 * snold * hcellold

◆ csub_nodelay_wcomp_fn()

subroutine gwfcsubmodule::csub_nodelay_wcomp_fn ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  ib,
integer(i4b), intent(in)  node,
real(dp), intent(in)  tled,
real(dp), intent(in)  area,
real(dp), intent(in)  hcell,
real(dp), intent(in)  hcellold,
real(dp), intent(inout)  hcof,
real(dp), intent(inout)  rhs 
)
private

Method formulates the Newton-Raphson formulation coefficient matrix and right-hand side terms for water compressibility in no-delay interbeds.

Parameters
[in,out]hcofno-delay A matrix entry
[in,out]rhsno-delay right-hand side entry
[in]ibinterbed number
[in]nodecell node number
[in]tledreciprocal of time step length
[in]areahorizontal cell area
[in]hcellcurrent head in cell
[in]hcelloldprevious head in cell
[in,out]hcofno-delay A matrix entry
[in,out]rhsno-delay right-hand side entry

Definition at line 4906 of file gwf-csub.f90.

4908  ! -- dummy variables
4909  class(GwfCsubType), intent(inout) :: this
4910  integer(I4B), intent(in) :: ib !< interbed number
4911  integer(I4B), intent(in) :: node !< cell node number
4912  real(DP), intent(in) :: tled !< reciprocal of time step length
4913  real(DP), intent(in) :: area !< horizontal cell area
4914  real(DP), intent(in) :: hcell !< current head in cell
4915  real(DP), intent(in) :: hcellold !< previous head in cell
4916  real(DP), intent(inout) :: hcof !< no-delay A matrix entry
4917  real(DP), intent(inout) :: rhs !< no-delay right-hand side entry
4918  ! -- local variables
4919  real(DP) :: top
4920  real(DP) :: bot
4921  real(DP) :: f
4922  real(DP) :: wc
4923  real(DP) :: wc0
4924  real(DP) :: satderv
4925  !
4926  ! -- initialize variables
4927  rhs = dzero
4928  hcof = dzero
4929  !
4930  ! -- aquifer elevations and thickness
4931  top = this%dis%top(node)
4932  bot = this%dis%bot(node)
4933  !
4934  !
4935  f = this%brg * area * tled
4936  !
4937  ! -- calculate saturation derivative
4938  satderv = this%csub_calc_sat_derivative(node, hcell)
4939  !
4940  ! -- calculate the current water compressibility factor
4941  wc = f * this%theta(ib) * this%thick(ib)
4942  !
4943  ! -- calculate derivative term
4944  hcof = -wc * hcell * satderv
4945  !
4946  ! -- Add additional term if using lagged effective stress
4947  if (this%ieslag /= 0) then
4948  wc0 = f * this%theta0(ib) * this%thick0(ib)
4949  hcof = hcof + wc0 * hcellold * satderv
4950  end if
4951  !
4952  ! -- set rhs
4953  rhs = hcof * hcell

◆ csub_obs_supported()

logical function gwfcsubmodule::csub_obs_supported ( class(gwfcsubtype this)
private

Function to determine if observations are supported by the CSUB package. Observations are supported by the CSUB package.

Definition at line 6344 of file gwf-csub.f90.

6345  ! -- dummy variables
6346  class(GwfCsubType) :: this
6347  !
6348  ! -- initialize variables
6349  csub_obs_supported = .true.

◆ csub_ot_dv()

subroutine gwfcsubmodule::csub_ot_dv ( class(gwfcsubtype this,
integer(i4b), intent(in)  idvfl,
integer(i4b), intent(in)  idvprint 
)
private

Method saves cell-by-cell compaction and z-displacement terms. The method also calls the method to process observation output.

Parameters
[in]idvflflag to save dependent variable data
[in]idvprintflag to print dependent variable data

Definition at line 3255 of file gwf-csub.f90.

3256  ! -- dummy variables
3257  class(GwfCsubType) :: this
3258  integer(I4B), intent(in) :: idvfl !< flag to save dependent variable data
3259  integer(I4B), intent(in) :: idvprint !< flag to print dependent variable data
3260  ! -- local variables
3261  character(len=1) :: cdatafmp = ' '
3262  character(len=1) :: editdesc = ' '
3263  integer(I4B) :: ibinun
3264  integer(I4B) :: iprint
3265  integer(I4B) :: nvaluesp
3266  integer(I4B) :: nwidthp
3267  integer(I4B) :: ib
3268  integer(I4B) :: node
3269  integer(I4B) :: nodem
3270  integer(I4B) :: nodeu
3271  integer(I4B) :: i
3272  integer(I4B) :: ii
3273  integer(I4B) :: idx_conn
3274  integer(I4B) :: k
3275  integer(I4B) :: ncpl
3276  integer(I4B) :: nlay
3277  integer(I4B) :: ihc
3278  real(DP) :: dinact
3279  real(DP) :: va_scale
3280  ! -- formats
3281  character(len=*), parameter :: fmtnconv = &
3282  "(/4x, 'DELAY INTERBED CELL HEADS IN ', i0, ' INTERBEDS IN', &
3283  &' NON-CONVERTIBLE GWF CELLS WERE LESS THAN THE TOP OF THE INTERBED CELL')"
3284  !
3285  ! -- Save compaction results
3286  !
3287  ! -- Set unit number for binary compaction and z-displacement output
3288  if (this%ioutcomp /= 0 .or. this%ioutzdisp /= 0) then
3289  ibinun = 1
3290  else
3291  ibinun = 0
3292  end if
3293  if (idvfl == 0) ibinun = 0
3294  !
3295  ! -- save compaction results
3296  if (ibinun /= 0) then
3297  iprint = 0
3298  dinact = dhnoflo
3299  !
3300  ! -- fill buff with total compaction
3301  do node = 1, this%dis%nodes
3302  this%buff(node) = this%cg_tcomp(node)
3303  end do
3304  do ib = 1, this%ninterbeds
3305  node = this%nodelist(ib)
3306  this%buff(node) = this%buff(node) + this%tcomp(ib)
3307  end do
3308  !
3309  ! -- write compaction data to binary file
3310  if (this%ioutcomp /= 0) then
3311  ibinun = this%ioutcomp
3312  call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3313  comptxt(1), cdatafmp, nvaluesp, &
3314  nwidthp, editdesc, dinact)
3315  end if
3316  !
3317  ! -- calculate z-displacement (subsidence) and write data to binary file
3318  if (this%ioutzdisp /= 0) then
3319  ibinun = this%ioutzdisp
3320  !
3321  ! -- initialize buffusr
3322  do nodeu = 1, this%dis%nodesuser
3323  this%buffusr(nodeu) = dzero
3324  end do
3325  !
3326  ! -- fill buffusr with buff
3327  do node = 1, this%dis%nodes
3328  nodeu = this%dis%get_nodeuser(node)
3329  this%buffusr(nodeu) = this%buff(node)
3330  end do
3331  !
3332  ! -- calculate z-displacement
3333  ncpl = this%dis%get_ncpl()
3334  !
3335  ! -- disu
3336  if (this%dis%ndim == 1) then
3337  do node = this%dis%nodes, 1, -1
3338  do ii = this%dis%con%ia(node) + 1, this%dis%con%ia(node + 1) - 1
3339  !
3340  ! -- Set the m cell number
3341  nodem = this%dis%con%ja(ii)
3342  idx_conn = this%dis%con%jas(ii)
3343  !
3344  ! -- vertical connection
3345  ihc = this%dis%con%ihc(idx_conn)
3346  if (ihc == 0) then
3347  !
3348  ! -- node has an underlying cell
3349  if (node < nodem) then
3350  va_scale = this%dis%get_area_factor(node, idx_conn)
3351  this%buffusr(node) = this%buffusr(node) + &
3352  va_scale * this%buffusr(nodem)
3353  end if
3354  end if
3355  end do
3356  end do
3357  ! -- disv or dis
3358  else
3359  nlay = this%dis%nodesuser / ncpl
3360  do k = nlay - 1, 1, -1
3361  do i = 1, ncpl
3362  node = (k - 1) * ncpl + i
3363  nodem = k * ncpl + i
3364  this%buffusr(node) = this%buffusr(node) + this%buffusr(nodem)
3365  end do
3366  end do
3367  end if
3368  !
3369  ! -- fill buff with data from buffusr
3370  do nodeu = 1, this%dis%nodesuser
3371  node = this%dis%get_nodenumber_idx1(nodeu, 1)
3372  if (node > 0) then
3373  this%buff(node) = this%buffusr(nodeu)
3374  end if
3375  end do
3376  !
3377  ! -- write z-displacement
3378  call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3379  comptxt(6), cdatafmp, nvaluesp, &
3380  nwidthp, editdesc, dinact)
3381 
3382  end if
3383  end if
3384  !
3385  ! -- Set unit number for binary inelastic interbed compaction
3386  if (this%ioutcompi /= 0) then
3387  ibinun = this%ioutcompi
3388  else
3389  ibinun = 0
3390  end if
3391  if (idvfl == 0) ibinun = 0
3392  !
3393  ! -- save inelastic interbed compaction results
3394  if (ibinun /= 0) then
3395  iprint = 0
3396  dinact = dhnoflo
3397  !
3398  ! -- fill buff with inelastic interbed compaction
3399  do node = 1, this%dis%nodes
3400  this%buff(node) = dzero
3401  end do
3402  do ib = 1, this%ninterbeds
3403  node = this%nodelist(ib)
3404  this%buff(node) = this%buff(node) + this%tcompi(ib)
3405  end do
3406  !
3407  ! -- write inelastic interbed compaction data to binary file
3408  call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3409  comptxt(2), cdatafmp, nvaluesp, &
3410  nwidthp, editdesc, dinact)
3411  end if
3412  !
3413  ! -- Set unit number for binary elastic interbed compaction
3414  if (this%ioutcompe /= 0) then
3415  ibinun = this%ioutcompe
3416  else
3417  ibinun = 0
3418  end if
3419  if (idvfl == 0) ibinun = 0
3420  !
3421  ! -- save elastic interbed compaction results
3422  if (ibinun /= 0) then
3423  iprint = 0
3424  dinact = dhnoflo
3425  !
3426  ! -- fill buff with elastic interbed compaction
3427  do node = 1, this%dis%nodes
3428  this%buff(node) = dzero
3429  end do
3430  do ib = 1, this%ninterbeds
3431  node = this%nodelist(ib)
3432  this%buff(node) = this%buff(node) + this%tcompe(ib)
3433  end do
3434  !
3435  ! -- write elastic interbed compaction data to binary file
3436  call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3437  comptxt(3), cdatafmp, nvaluesp, &
3438  nwidthp, editdesc, dinact)
3439  end if
3440  !
3441  ! -- Set unit number for binary interbed compaction
3442  if (this%ioutcompib /= 0) then
3443  ibinun = this%ioutcompib
3444  else
3445  ibinun = 0
3446  end if
3447  if (idvfl == 0) ibinun = 0
3448  !
3449  ! -- save interbed compaction results
3450  if (ibinun /= 0) then
3451  iprint = 0
3452  dinact = dhnoflo
3453  !
3454  ! -- fill buff with interbed compaction
3455  do node = 1, this%dis%nodes
3456  this%buff(node) = dzero
3457  end do
3458  do ib = 1, this%ninterbeds
3459  node = this%nodelist(ib)
3460  this%buff(node) = this%buff(node) + this%tcompe(ib) + this%tcompi(ib)
3461  end do
3462  !
3463  ! -- write interbed compaction data to binary file
3464  call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3465  comptxt(4), cdatafmp, nvaluesp, &
3466  nwidthp, editdesc, dinact)
3467  end if
3468  !
3469  ! -- Set unit number for binary coarse-grained compaction
3470  if (this%ioutcomps /= 0) then
3471  ibinun = this%ioutcomps
3472  else
3473  ibinun = 0
3474  end if
3475  if (idvfl == 0) ibinun = 0
3476  !
3477  ! -- save coarse-grained compaction results
3478  if (ibinun /= 0) then
3479  iprint = 0
3480  dinact = dhnoflo
3481  !
3482  ! -- fill buff with coarse-grained compaction
3483  do node = 1, this%dis%nodes
3484  this%buff(node) = this%cg_tcomp(node)
3485  end do
3486  !
3487  ! -- write coarse-grained compaction data to binary file
3488  call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3489  comptxt(5), cdatafmp, nvaluesp, &
3490  nwidthp, editdesc, dinact)
3491  end if
3492  !
3493  ! -- check that final effective stress values for the time step
3494  ! are greater than zero
3495  if (this%gwfiss == 0) then
3496  call this%csub_cg_chk_stress()
3497  end if
3498  !
3499  ! -- update maximum count of delay interbeds that violate
3500  ! basic head assumptions for delay beds and write a message
3501  ! for delay interbeds in non-convertible gwf cells that
3502  ! violate these head assumptions
3503  if (this%ndelaybeds > 0) then
3504  if (this%idb_nconv_count(1) > this%idb_nconv_count(2)) then
3505  this%idb_nconv_count(2) = this%idb_nconv_count(1)
3506  end if
3507  if (this%idb_nconv_count(1) > 0) then
3508  write (this%iout, fmtnconv) this%idb_nconv_count(1)
3509  end if
3510  end if

◆ csub_process_obsid()

subroutine gwfcsubmodule::csub_process_obsid ( type(observetype), intent(inout)  obsrv,
class(disbasetype), intent(in)  dis,
integer(i4b), intent(in)  inunitobs,
integer(i4b), intent(in)  iout 
)

Method to process the observation IDs for the CSUB package. This procedure is pointed to by ObsDataTypeProcesssIdPtr. It processes the ID string of an observation definition for csub-package observations.

Parameters
[in,out]obsrvobservation type
[in]dispointer to the model discretization
[in]inunitobsunit number of the observation file
[in]ioutunit number to the model listing file

Definition at line 6946 of file gwf-csub.f90.

6947  ! -- dummy variables
6948  type(ObserveType), intent(inout) :: obsrv !< observation type
6949  class(DisBaseType), intent(in) :: dis !< pointer to the model discretization
6950  integer(I4B), intent(in) :: inunitobs !< unit number of the observation file
6951  integer(I4B), intent(in) :: iout !< unit number to the model listing file
6952  ! -- local variables
6953  integer(I4B) :: nn1
6954  integer(I4B) :: nn2
6955  integer(I4B) :: icol, istart, istop
6956  character(len=LINELENGTH) :: string
6957  character(len=LENBOUNDNAME) :: bndname
6958  logical(LGP) :: flag_string
6959  logical(LGP) :: flag_idcellno
6960  logical(LGP) :: flag_error
6961  !
6962  ! -- initialize variables
6963  string = obsrv%IDstring
6964  flag_string = .true.
6965  flag_idcellno = .false.
6966  flag_error = .false.
6967  if (obsrv%ObsTypeId(1:5) == "DELAY" .AND. &
6968  obsrv%ObsTypeId(1:10) /= "DELAY-FLOW") then
6969  flag_idcellno = .true.
6970  end if
6971  !
6972  ! -- Extract reach number from string and store it.
6973  ! If 1st item is not an integer(I4B), it should be a
6974  ! boundary name--deal with it.
6975  icol = 1
6976  !
6977  ! -- get icsubno number or boundary name
6978  if (obsrv%ObsTypeId == 'CSUB' .or. &
6979  obsrv%ObsTypeId == 'INELASTIC-CSUB' .or. &
6980  obsrv%ObsTypeId == 'ELASTIC-CSUB' .or. &
6981  obsrv%ObsTypeId == 'SK' .or. &
6982  obsrv%ObsTypeId == 'SKE' .or. &
6983  obsrv%ObsTypeId == 'THETA' .or. &
6984  obsrv%ObsTypeId == 'THICKNESS' .or. &
6985  obsrv%ObsTypeId == 'INTERBED-COMPACTION' .or. &
6986  obsrv%ObsTypeId == 'INTERBED-COMPACTION-PCT' .or. &
6987  obsrv%ObsTypeId == 'INELASTIC-COMPACTION' .or. &
6988  obsrv%ObsTypeId == 'ELASTIC-COMPACTION' .or. &
6989  obsrv%ObsTypeId == 'DELAY-HEAD' .or. &
6990  obsrv%ObsTypeId == 'DELAY-GSTRESS' .or. &
6991  obsrv%ObsTypeId == 'DELAY-ESTRESS' .or. &
6992  obsrv%ObsTypeId == 'DELAY-PRECONSTRESS' .or. &
6993  obsrv%ObsTypeId == 'DELAY-COMPACTION' .or. &
6994  obsrv%ObsTypeId == 'DELAY-THICKNESS' .or. &
6995  obsrv%ObsTypeId == 'DELAY-THETA' .or. &
6996  obsrv%ObsTypeId == 'DELAY-FLOWTOP' .or. &
6997  obsrv%ObsTypeId == 'DELAY-FLOWBOT') then
6998  call extract_idnum_or_bndname(string, icol, istart, istop, nn1, bndname)
6999  ! read cellid
7000  else
7001  nn1 = dis%noder_from_string(icol, istart, istop, inunitobs, &
7002  iout, string, flag_string)
7003  end if
7004  ! boundnames are not allowed for these observation types
7005  if (obsrv%ObsTypeId == 'SK' .or. &
7006  obsrv%ObsTypeId == 'SKE' .or. &
7007  obsrv%ObsTypeId == 'THETA' .or. &
7008  obsrv%ObsTypeId == 'THICKNESS' .or. &
7009  obsrv%ObsTypeId == 'INTERBED-COMPACTION' .or. &
7010  obsrv%ObsTypeId == 'INELASTIC-COMPACTION' .or. &
7011  obsrv%ObsTypeId == 'ELASTIC-COMPACTION' .or. &
7012  obsrv%ObsTypeId == 'DELAY-HEAD' .or. &
7013  obsrv%ObsTypeId == 'DELAY-GSTRESS' .or. &
7014  obsrv%ObsTypeId == 'DELAY-ESTRESS' .or. &
7015  obsrv%ObsTypeId == 'DELAY-PRECONSTRESS' .or. &
7016  obsrv%ObsTypeId == 'DELAY-COMPACTION' .or. &
7017  obsrv%ObsTypeId == 'DELAY-THICKNESS' .or. &
7018  obsrv%ObsTypeId == 'DELAY-THETA') then
7019  if (nn1 == namedboundflag) then
7020  write (errmsg, '(5a)') &
7021  "BOUNDNAME ('", trim(adjustl(bndname)), &
7022  "') not allowed for CSUB observation type '", &
7023  trim(adjustl(obsrv%ObsTypeId)), "'."
7024  call store_error(errmsg)
7025  flag_error = .true.
7026  end if
7027  ! boundnames are allowed for these observation types
7028  else if (obsrv%ObsTypeId == 'CSUB' .or. &
7029  obsrv%ObsTypeId == 'INELASTIC-CSUB' .or. &
7030  obsrv%ObsTypeId == 'ELASTIC-CSUB' .or. &
7031  ! obsrv%ObsTypeId == 'INTERBED-COMPACTION' .or. &
7032  ! obsrv%ObsTypeId == 'INELASTIC-COMPACTION' .or. &
7033  ! obsrv%ObsTypeId == 'ELASTIC-COMPACTION' .or. &
7034  obsrv%ObsTypeId == 'DELAY-FLOWTOP' .or. &
7035  obsrv%ObsTypeId == 'DELAY-FLOWBOT') then
7036  if (nn1 == namedboundflag) then
7037  obsrv%FeatureName = bndname
7038  end if
7039  end if
7040  ! read idcellno for delay observations
7041  if (flag_idcellno .EQV. .true. .AND. flag_error .EQV. .false.) then
7042  if (nn1 /= namedboundflag) then
7043  call extract_idnum_or_bndname(string, icol, istart, istop, nn2, bndname)
7044  if (nn2 == namedboundflag) then
7045  write (errmsg, '(5a)') &
7046  "BOUNDNAME ('", trim(adjustl(bndname)), &
7047  "') not allowed for CSUB observation type '", &
7048  trim(adjustl(obsrv%ObsTypeId)), "' idcellno."
7049  call store_error(errmsg)
7050  else
7051  obsrv%NodeNumber2 = nn2
7052  end if
7053  end if
7054  end if
7055  !
7056  ! -- store reach number (NodeNumber)
7057  obsrv%NodeNumber = nn1
Here is the call graph for this function:
Here is the caller graph for this function:

◆ csub_rp()

subroutine gwfcsubmodule::csub_rp ( class(gwfcsubtype), intent(inout)  this)

Method reads and prepares stress period data for the CSUB package. The overlying geostatic stress (sig0) is the only stress period data read by the CSUB package.

Definition at line 2146 of file gwf-csub.f90.

2147  ! -- modules
2148  use tdismodule, only: kper
2149  use constantsmodule, only: linelength
2150  use memorymanagermodule, only: mem_setptr
2152  ! -- dummy variables
2153  class(GwfCsubType), intent(inout) :: this
2154  ! -- local variables
2155  integer(I4B), dimension(:, :), pointer, contiguous :: cellids
2156  integer(I4B), dimension(:), pointer, contiguous :: cellid
2157  integer(I4B), pointer :: iper
2158  integer(I4B) :: n, nodeu, noder
2159  character(len=LINELENGTH) :: title, text
2160  character(len=20) :: cellstr
2161  logical(LGP) :: found
2162  ! -- formats
2163  character(len=*), parameter :: fmtlsp = &
2164  &"(1X,/1X,'REUSING ',a,'S FROM LAST STRESS PERIOD')"
2165 
2166  call mem_setptr(iper, 'IPER', this%input_mempath)
2167  if (iper /= kper) then
2168  write (this%iout, fmtlsp) trim(this%filtyp)
2169  call this%csub_rp_obs()
2170  return
2171  end if
2172 
2173  call mem_setptr(cellids, 'CELLID', this%input_mempath)
2174  call mem_set_value(this%nbound, 'NBOUND', this%input_mempath, &
2175  found)
2176 
2177  ! -- setup table for period data
2178  if (this%iprpak /= 0) then
2179  ! -- reset the input table object
2180  title = 'CSUB'//' PACKAGE ('// &
2181  trim(adjustl(this%packName))//') DATA FOR PERIOD'
2182  write (title, '(a,1x,i6)') trim(adjustl(title)), kper
2183  call table_cr(this%inputtab, this%packName, title)
2184  call this%inputtab%table_df(1, 2, this%iout, finalize=.false.)
2185  text = 'CELLID'
2186  call this%inputtab%initialize_column(text, 20)
2187  text = 'SIG0'
2188  call this%inputtab%initialize_column(text, 15, alignment=tableft)
2189  end if
2190 
2191  ! -- update nodelist
2192  do n = 1, this%nbound
2193 
2194  ! -- set cellid
2195  cellid => cellids(:, n)
2196 
2197  ! -- set user node number
2198  if (this%dis%ndim == 1) then
2199  nodeu = cellid(1)
2200  elseif (this%dis%ndim == 2) then
2201  nodeu = get_node(cellid(1), 1, cellid(2), &
2202  this%dis%mshape(1), 1, &
2203  this%dis%mshape(2))
2204  else
2205  nodeu = get_node(cellid(1), cellid(2), cellid(3), &
2206  this%dis%mshape(1), &
2207  this%dis%mshape(2), &
2208  this%dis%mshape(3))
2209  end if
2210 
2211  ! -- set noder
2212  noder = this%dis%get_nodenumber(nodeu, 1)
2213  if (noder <= 0) then
2214  cycle
2215  end if
2216 
2217  this%nodelistsig0(n) = noder
2218 
2219  ! -- write line to table
2220  if (this%iprpak /= 0) then
2221  call this%dis%noder_to_string(noder, cellstr)
2222  call this%inputtab%add_term(cellstr)
2223  call this%inputtab%add_term(this%sig0(n))
2224  end if
2225  end do
2226  !
2227  ! -- terminate if errors encountered
2228  if (count_errors() > 0) then
2229  call store_error_filename(this%input_fname)
2230  end if
2231  !
2232  ! -- finalize the table
2233  if (this%iprpak /= 0) then
2234  call this%inputtab%finalize_table()
2235  end if
2236  !
2237  ! -- read observations
2238  call this%csub_rp_obs()
Here is the call graph for this function:

◆ csub_rp_obs()

subroutine gwfcsubmodule::csub_rp_obs ( class(gwfcsubtype), intent(inout)  this)
private

Method to read and prepare the observations for the CSUB package.

Definition at line 6774 of file gwf-csub.f90.

6775  ! -- modules
6776  use tdismodule, only: kper
6777  ! -- dummy variables
6778  class(GwfCsubType), intent(inout) :: this
6779  ! -- local variables
6780  class(ObserveType), pointer :: obsrv => null()
6781  character(len=LENBOUNDNAME) :: bname
6782  integer(I4B) :: i
6783  integer(I4B) :: j
6784  integer(I4B) :: n
6785  integer(I4B) :: n2
6786  integer(I4B) :: idelay
6787  !
6788  ! -- return if observations are not supported
6789  if (.not. this%csub_obs_supported()) then
6790  return
6791  end if
6792  !
6793  ! -- process each package observation
6794  ! only done the first stress period since boundaries are fixed
6795  ! for the simulation
6796  if (kper == 1) then
6797  do i = 1, this%obs%npakobs
6798  obsrv => this%obs%pakobs(i)%obsrv
6799  !
6800  ! -- initialize BndFound to .false.
6801  obsrv%BndFound = .false.
6802  !
6803  bname = obsrv%FeatureName
6804  if (bname /= '') then
6805  !
6806  ! -- Observation location(s) is(are) based on a boundary name.
6807  ! Iterate through all boundaries to identify and store
6808  ! corresponding index(indices) in bound array.
6809  do j = 1, this%ninterbeds
6810  if (this%boundname(j) == bname) then
6811  obsrv%BndFound = .true.
6812  obsrv%CurrentTimeStepEndValue = dzero
6813  call obsrv%AddObsIndex(j)
6814  end if
6815  end do
6816  !
6817  ! -- one value per cell
6818  else if (obsrv%ObsTypeId == 'GSTRESS-CELL' .or. &
6819  obsrv%ObsTypeId == 'ESTRESS-CELL' .or. &
6820  obsrv%ObsTypeId == 'THICKNESS-CELL' .or. &
6821  obsrv%ObsTypeId == 'COARSE-CSUB' .or. &
6822  obsrv%ObsTypeId == 'WCOMP-CSUB-CELL' .or. &
6823  obsrv%ObsTypeId == 'COARSE-COMPACTION' .or. &
6824  obsrv%ObsTypeId == 'COARSE-THETA' .or. &
6825  obsrv%ObsTypeId == 'COARSE-THICKNESS') then
6826  obsrv%BndFound = .true.
6827  obsrv%CurrentTimeStepEndValue = dzero
6828  call obsrv%AddObsIndex(obsrv%NodeNumber)
6829  else if (obsrv%ObsTypeId == 'DELAY-PRECONSTRESS' .or. &
6830  obsrv%ObsTypeId == 'DELAY-HEAD' .or. &
6831  obsrv%ObsTypeId == 'DELAY-GSTRESS' .or. &
6832  obsrv%ObsTypeId == 'DELAY-ESTRESS' .or. &
6833  obsrv%ObsTypeId == 'DELAY-COMPACTION' .or. &
6834  obsrv%ObsTypeId == 'DELAY-THICKNESS' .or. &
6835  obsrv%ObsTypeId == 'DELAY-THETA') then
6836  if (this%ninterbeds > 0) then
6837  n = obsrv%NodeNumber
6838  idelay = this%idelay(n)
6839  if (idelay /= 0) then
6840  j = (idelay - 1) * this%ndelaycells + 1
6841  n2 = obsrv%NodeNumber2
6842  if (n2 < 1 .or. n2 > this%ndelaycells) then
6843  write (errmsg, '(a,2(1x,a),1x,i0,1x,a,i0,a)') &
6844  trim(adjustl(obsrv%ObsTypeId)), 'interbed cell must be ', &
6845  'greater than 0 and less than or equal to', this%ndelaycells, &
6846  '(specified value is ', n2, ').'
6847  call store_error(errmsg)
6848  else
6849  j = (idelay - 1) * this%ndelaycells + n2
6850  end if
6851  obsrv%BndFound = .true.
6852  call obsrv%AddObsIndex(j)
6853  end if
6854  end if
6855  !
6856  ! -- interbed value
6857  else if (obsrv%ObsTypeId == 'CSUB' .or. &
6858  obsrv%ObsTypeId == 'INELASTIC-CSUB' .or. &
6859  obsrv%ObsTypeId == 'ELASTIC-CSUB' .or. &
6860  obsrv%ObsTypeId == 'SK' .or. &
6861  obsrv%ObsTypeId == 'SKE' .or. &
6862  obsrv%ObsTypeId == 'THICKNESS' .or. &
6863  obsrv%ObsTypeId == 'THETA' .or. &
6864  obsrv%ObsTypeId == 'INTERBED-COMPACTION' .or. &
6865  obsrv%ObsTypeId == 'INELASTIC-COMPACTION' .or. &
6866  obsrv%ObsTypeId == 'ELASTIC-COMPACTION' .or. &
6867  obsrv%ObsTypeId == 'INTERBED-COMPACTION-PCT') then
6868  if (this%ninterbeds > 0) then
6869  j = obsrv%NodeNumber
6870  if (j < 1 .or. j > this%ninterbeds) then
6871  write (errmsg, '(a,2(1x,a),1x,i0,1x,a,i0,a)') &
6872  trim(adjustl(obsrv%ObsTypeId)), 'interbed cell must be greater', &
6873  'than 0 and less than or equal to', this%ninterbeds, &
6874  '(specified value is ', j, ').'
6875  call store_error(errmsg)
6876  else
6877  obsrv%BndFound = .true.
6878  obsrv%CurrentTimeStepEndValue = dzero
6879  call obsrv%AddObsIndex(j)
6880  end if
6881  end if
6882  else if (obsrv%ObsTypeId == 'DELAY-FLOWTOP' .or. &
6883  obsrv%ObsTypeId == 'DELAY-FLOWBOT') then
6884  if (this%ninterbeds > 0) then
6885  j = obsrv%NodeNumber
6886  if (j < 1 .or. j > this%ninterbeds) then
6887  write (errmsg, '(a,2(1x,a),1x,i0,1x,a,i0,a)') &
6888  trim(adjustl(obsrv%ObsTypeId)), &
6889  'interbed cell must be greater ', &
6890  'than 0 and less than or equal to', this%ninterbeds, &
6891  '(specified value is ', j, ').'
6892  call store_error(errmsg)
6893  end if
6894  idelay = this%idelay(j)
6895  if (idelay /= 0) then
6896  obsrv%BndFound = .true.
6897  obsrv%CurrentTimeStepEndValue = dzero
6898  call obsrv%AddObsIndex(j)
6899  end if
6900  end if
6901  else
6902  !
6903  ! -- Accumulate values in a single cell
6904  ! -- Observation location is a single node number
6905  ! -- save node number in first position
6906  if (obsrv%ObsTypeId == 'CSUB-CELL' .or. &
6907  obsrv%ObsTypeId == 'SKE-CELL' .or. &
6908  obsrv%ObsTypeId == 'SK-CELL' .or. &
6909  obsrv%ObsTypeId == 'THETA-CELL' .or. &
6910  obsrv%ObsTypeId == 'INELASTIC-COMPACTION-CELL' .or. &
6911  obsrv%ObsTypeId == 'ELASTIC-COMPACTION-CELL' .or. &
6912  obsrv%ObsTypeId == 'COMPACTION-CELL') then
6913  if (.NOT. obsrv%BndFound) then
6914  obsrv%BndFound = .true.
6915  obsrv%CurrentTimeStepEndValue = dzero
6916  call obsrv%AddObsIndex(obsrv%NodeNumber)
6917  end if
6918  end if
6919  jloop: do j = 1, this%ninterbeds
6920  if (this%nodelist(j) == obsrv%NodeNumber) then
6921  obsrv%BndFound = .true.
6922  obsrv%CurrentTimeStepEndValue = dzero
6923  call obsrv%AddObsIndex(j)
6924  end if
6925  end do jloop
6926  end if
6927  end do
6928  !
6929  ! -- evaluate if there are any observation errors
6930  if (count_errors() > 0) then
6931  call store_error_filename(this%input_fname)
6932  end if
6933  end if
Here is the call graph for this function:

◆ csub_save_model_flows()

subroutine gwfcsubmodule::csub_save_model_flows ( class(gwfcsubtype this,
integer(i4b), intent(in)  icbcfl,
integer(i4b), intent(in)  icbcun 
)

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

Parameters
[in]icbcflflag to output budget data
[in]icbcununit number for cell-by-cell file

Definition at line 3164 of file gwf-csub.f90.

3165  ! -- dummy variables
3166  class(GwfCsubType) :: this
3167  integer(I4B), intent(in) :: icbcfl !< flag to output budget data
3168  integer(I4B), intent(in) :: icbcun !< unit number for cell-by-cell file
3169  ! -- local variables
3170  character(len=1) :: cdatafmp = ' '
3171  character(len=1) :: editdesc = ' '
3172  integer(I4B) :: ibinun
3173  integer(I4B) :: iprint
3174  integer(I4B) :: nvaluesp
3175  integer(I4B) :: nwidthp
3176  integer(I4B) :: ib
3177  integer(I4B) :: node
3178  integer(I4B) :: naux
3179  real(DP) :: dinact
3180  real(DP) :: Q
3181  ! -- formats
3182  !
3183  ! -- Set unit number for binary output
3184  if (this%ipakcb < 0) then
3185  ibinun = icbcun
3186  elseif (this%ipakcb == 0) then
3187  ibinun = 0
3188  else
3189  ibinun = this%ipakcb
3190  end if
3191  if (icbcfl == 0) ibinun = 0
3192  !
3193  ! -- Record the storage rates if requested
3194  if (ibinun /= 0) then
3195  iprint = 0
3196  dinact = dzero
3197  !
3198  ! -- coarse-grained storage (sske)
3199  call this%dis%record_array(this%cg_stor, this%iout, iprint, -ibinun, &
3200  budtxt(1), cdatafmp, nvaluesp, &
3201  nwidthp, editdesc, dinact)
3202  if (this%ninterbeds > 0) then
3203  naux = 0
3204  !
3205  ! -- interbed elastic storage
3206  call this%dis%record_srcdst_list_header(budtxt(2), &
3207  this%name_model, &
3208  this%name_model, &
3209  this%name_model, &
3210  this%packName, &
3211  naux, &
3212  this%auxname, &
3213  ibinun, &
3214  this%ninterbeds, &
3215  this%iout)
3216  do ib = 1, this%ninterbeds
3217  q = this%storagee(ib)
3218  node = this%nodelist(ib)
3219  call this%dis%record_mf6_list_entry(ibinun, node, node, q, naux, &
3220  this%auxvar(:, ib))
3221  end do
3222  !
3223  ! -- interbed inelastic storage
3224  call this%dis%record_srcdst_list_header(budtxt(3), &
3225  this%name_model, &
3226  this%name_model, &
3227  this%name_model, &
3228  this%packName, &
3229  naux, &
3230  this%auxname, &
3231  ibinun, &
3232  this%ninterbeds, &
3233  this%iout)
3234  do ib = 1, this%ninterbeds
3235  q = this%storagei(ib)
3236  node = this%nodelist(ib)
3237  call this%dis%record_mf6_list_entry(ibinun, node, node, q, naux, &
3238  this%auxvar(:, ib))
3239  end do
3240  end if
3241  !
3242  ! -- water compressibility
3243  call this%dis%record_array(this%cell_wcstor, this%iout, iprint, -ibinun, &
3244  budtxt(4), cdatafmp, nvaluesp, &
3245  nwidthp, editdesc, dinact)
3246  end if

◆ csub_set_initial_state()

subroutine gwfcsubmodule::csub_set_initial_state ( class(gwfcsubtype this,
integer(i4b), intent(in)  nodes,
real(dp), dimension(nodes), intent(in)  hnew 
)
private

Method sets the initial states for coarse-grained materials and fine- grained sediments in the interbeds.

Parameters
[in]nodesnumber of active model nodes
[in]hnewcurrent heads

Definition at line 3907 of file gwf-csub.f90.

3908  ! -- dummy variables
3909  class(GwfCsubType) :: this
3910  ! -- dummy variables
3911  integer(I4B), intent(in) :: nodes !< number of active model nodes
3912  real(DP), dimension(nodes), intent(in) :: hnew !< current heads
3913  ! -- local variables
3914  character(len=LINELENGTH) :: title
3915  character(len=LINELENGTH) :: tag
3916  character(len=20) :: cellid
3917  integer(I4B) :: ib
3918  integer(I4B) :: node
3919  integer(I4B) :: n
3920  integer(I4B) :: idelay
3921  integer(I4B) :: ntabrows
3922  integer(I4B) :: ntabcols
3923  real(DP) :: pcs0
3924  real(DP) :: pcs
3925  real(DP) :: fact
3926  real(DP) :: top
3927  real(DP) :: bot
3928  real(DP) :: void_ratio
3929  real(DP) :: es
3930  real(DP) :: znode
3931  real(DP) :: hcell
3932  real(DP) :: hbar
3933  real(DP) :: dzhalf
3934  real(DP) :: zbot
3935  real(DP) :: dbpcs
3936  !
3937  ! -- update geostatic load calculation
3938  call this%csub_cg_calc_stress(nodes, hnew)
3939  !
3940  ! -- initialize coarse-grained material effective stress
3941  ! for the previous time step and the previous iteration
3942  do node = 1, nodes
3943  this%cg_es0(node) = this%cg_es(node)
3944  end do
3945  !
3946  ! -- initialize interbed initial states
3947  do ib = 1, this%ninterbeds
3948  idelay = this%idelay(ib)
3949  node = this%nodelist(ib)
3950  top = this%dis%top(node)
3951  bot = this%dis%bot(node)
3952  hcell = hnew(node)
3953  pcs = this%pcs(ib)
3954  pcs0 = pcs
3955  if (this%ispecified_pcs == 0) then
3956  ! relative pcs...subtract head (u) from sigma'
3957  if (this%ipch /= 0) then
3958  pcs = this%cg_es(node) - pcs0
3959  else
3960  pcs = this%cg_es(node) + pcs0
3961  end if
3962  else
3963  ! specified pcs...subtract head (u) from sigma
3964  if (this%ipch /= 0) then
3965  pcs = this%cg_gs(node) - (pcs0 - bot)
3966  end if
3967  if (pcs < this%cg_es(node)) then
3968  pcs = this%cg_es(node)
3969  end if
3970  end if
3971  this%pcs(ib) = pcs
3972  !
3973  ! -- delay bed initial states
3974  if (idelay /= 0) then
3975  dzhalf = dhalf * this%dbdzini(1, idelay)
3976  !
3977  ! -- fill delay bed head with aquifer head or offset from aquifer head
3978  ! heads need to be filled first since used to calculate
3979  ! the effective stress for each delay bed
3980  do n = 1, this%ndelaycells
3981  if (this%ispecified_dbh == 0) then
3982  this%dbh(n, idelay) = hcell + this%dbh(n, idelay)
3983  else
3984  this%dbh(n, idelay) = hcell
3985  end if
3986  this%dbh0(n, idelay) = this%dbh(n, idelay)
3987  end do
3988  !
3989  ! -- fill delay bed effective stress
3990  call this%csub_delay_calc_stress(ib, hcell)
3991  !
3992  ! -- fill delay bed pcs
3993  pcs = this%pcs(ib)
3994  do n = 1, this%ndelaycells
3995  zbot = this%dbz(n, idelay) - dzhalf
3996  ! -- adjust pcs to bottom of each delay bed cell
3997  ! not using csub_calc_adjes() since smoothing not required
3998  dbpcs = pcs - (zbot - bot) * (this%sgs(node) - done)
3999  this%dbpcs(n, idelay) = dbpcs
4000  !
4001  ! -- initialize effective stress for previous time step
4002  this%dbes0(n, idelay) = this%dbes(n, idelay)
4003  end do
4004  end if
4005  end do
4006  !
4007  ! -- scale coarse-grained materials cr
4008  do node = 1, nodes
4009  top = this%dis%top(node)
4010  bot = this%dis%bot(node)
4011  !
4012  ! -- user-specified specific storage
4013  if (this%istoragec == 1) then
4014  !
4015  ! -- retain specific storage values since they are constant
4016  if (this%lhead_based .EQV. .true.) then
4017  fact = done
4018  !
4019  ! -- convert specific storage values since they are simulated to
4020  ! be a function of the average effective stress
4021  else
4022  void_ratio = this%csub_calc_void_ratio(this%cg_theta(node))
4023  es = this%cg_es(node)
4024  hcell = hnew(node)
4025  !
4026  ! -- calculate corrected head (hbar)
4027  hbar = squadratic0sp(hcell, bot, this%satomega)
4028  !
4029  ! -- calculate znode and factor
4030  znode = this%csub_calc_znode(top, bot, hbar)
4031  fact = this%csub_calc_adjes(node, es, bot, znode)
4032  fact = fact * (done + void_ratio)
4033  end if
4034  !
4035  ! -- user-specified compression indices - multiply by dlog10es
4036  else
4037  fact = dlog10es
4038  end if
4039  this%cg_ske_cr(node) = this%cg_ske_cr(node) * fact
4040  !
4041  ! -- write error message if negative compression indices
4042  if (fact <= dzero) then
4043  call this%dis%noder_to_string(node, cellid)
4044  write (errmsg, '(a,1x,a,a)') &
4045  'Negative recompression index calculated for cell', &
4046  trim(adjustl(cellid)), '.'
4047  call store_error(errmsg)
4048  end if
4049  end do
4050  !
4051  ! -- scale interbed cc and cr
4052  do ib = 1, this%ninterbeds
4053  idelay = this%idelay(ib)
4054  node = this%nodelist(ib)
4055  top = this%dis%top(node)
4056  bot = this%dis%bot(node)
4057  !
4058  ! -- user-specified specific storage
4059  if (this%istoragec == 1) then
4060  !
4061  ! -- retain specific storage values since they are constant
4062  if (this%lhead_based .EQV. .true.) then
4063  fact = done
4064  !
4065  ! -- convert specific storage values since they are simulated to
4066  ! be a function of the average effective stress
4067  else
4068  void_ratio = this%csub_calc_void_ratio(this%theta(ib))
4069  es = this%cg_es(node)
4070  hcell = hnew(node)
4071  !
4072  ! -- calculate corrected head (hbar)
4073  hbar = squadratic0sp(hcell, bot, this%satomega)
4074  !
4075  ! -- calculate zone and factor
4076  znode = this%csub_calc_znode(top, bot, hbar)
4077  fact = this%csub_calc_adjes(node, es, bot, znode)
4078  fact = fact * (done + void_ratio)
4079  end if
4080  !
4081  ! -- user-specified compression indices - multiply by dlog10es
4082  else
4083  fact = dlog10es
4084  end if
4085  this%ci(ib) = this%ci(ib) * fact
4086  this%rci(ib) = this%rci(ib) * fact
4087  !
4088  ! -- write error message if negative compression indices
4089  if (fact <= dzero) then
4090  call this%dis%noder_to_string(node, cellid)
4091  write (errmsg, '(a,1x,i0,2(1x,a),a)') &
4092  'Negative compression indices calculated for interbed', ib, &
4093  'in cell', trim(adjustl(cellid)), '.'
4094  call store_error(errmsg)
4095  end if
4096  end do
4097  !
4098  ! -- write current stress and initial preconsolidation stress
4099  if (this%iprpak == 1) then
4100  ! -- set title
4101  title = trim(adjustl(this%packName))// &
4102  ' PACKAGE CALCULATED INITIAL INTERBED STRESSES AT THE CELL BOTTOM'
4103  !
4104  ! -- determine the number of columns and rows
4105  ntabrows = this%ninterbeds
4106  ntabcols = 5
4107  if (this%inamedbound /= 0) then
4108  ntabcols = ntabcols + 1
4109  end if
4110  !
4111  ! -- setup table
4112  call table_cr(this%inputtab, this%packName, title)
4113  call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
4114  !
4115  ! add columns
4116  tag = 'INTERBED NUMBER'
4117  call this%inputtab%initialize_column(tag, 10, alignment=tableft)
4118  tag = 'CELLID'
4119  call this%inputtab%initialize_column(tag, 20)
4120  tag = 'GEOSTATIC STRESS'
4121  call this%inputtab%initialize_column(tag, 16)
4122  tag = 'EFFECTIVE STRESS'
4123  call this%inputtab%initialize_column(tag, 16)
4124  tag = 'PRECONSOLIDATION STRESS'
4125  call this%inputtab%initialize_column(tag, 16)
4126  if (this%inamedbound /= 0) then
4127  tag = 'BOUNDNAME'
4128  call this%inputtab%initialize_column(tag, lenboundname, &
4129  alignment=tableft)
4130  end if
4131  !
4132  ! -- write the data
4133  do ib = 1, this%ninterbeds
4134  node = this%nodelist(ib)
4135  call this%dis%noder_to_string(node, cellid)
4136  !
4137  ! -- write the columns
4138  call this%inputtab%add_term(ib)
4139  call this%inputtab%add_term(cellid)
4140  call this%inputtab%add_term(this%cg_gs(node))
4141  call this%inputtab%add_term(this%cg_es(node))
4142  call this%inputtab%add_term(this%pcs(ib))
4143  if (this%inamedbound /= 0) then
4144  call this%inputtab%add_term(this%boundname(ib))
4145  end if
4146  end do
4147  !
4148  ! -- write effective stress and preconsolidation stress
4149  ! for delay beds
4150  ! -- set title
4151  title = trim(adjustl(this%packName))// &
4152  ' PACKAGE CALCULATED INITIAL DELAY INTERBED STRESSES'
4153  !
4154  ! -- determine the number of columns and rows
4155  ntabrows = 0
4156  do ib = 1, this%ninterbeds
4157  idelay = this%idelay(ib)
4158  if (idelay /= 0) then
4159  ntabrows = ntabrows + this%ndelaycells
4160  end if
4161  end do
4162  ntabcols = 6
4163  if (this%inamedbound /= 0) then
4164  ntabcols = ntabcols + 1
4165  end if
4166  !
4167  ! -- setup table
4168  call table_cr(this%inputtab, this%packName, title)
4169  call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
4170  !
4171  ! add columns
4172  tag = 'INTERBED NUMBER'
4173  call this%inputtab%initialize_column(tag, 10, alignment=tableft)
4174  tag = 'CELLID'
4175  call this%inputtab%initialize_column(tag, 20)
4176  tag = 'DELAY CELL'
4177  call this%inputtab%initialize_column(tag, 10, alignment=tableft)
4178  tag = 'GEOSTATIC STRESS'
4179  call this%inputtab%initialize_column(tag, 16)
4180  tag = 'EFFECTIVE STRESS'
4181  call this%inputtab%initialize_column(tag, 16)
4182  tag = 'PRECONSOLIDATION STRESS'
4183  call this%inputtab%initialize_column(tag, 16)
4184  if (this%inamedbound /= 0) then
4185  tag = 'BOUNDNAME'
4186  call this%inputtab%initialize_column(tag, lenboundname, &
4187  alignment=tableft)
4188  end if
4189  !
4190  ! -- write the data
4191  do ib = 1, this%ninterbeds
4192  idelay = this%idelay(ib)
4193  if (idelay /= 0) then
4194  node = this%nodelist(ib)
4195  call this%dis%noder_to_string(node, cellid)
4196  !
4197  ! -- write the columns
4198  do n = 1, this%ndelaycells
4199  if (n == 1) then
4200  call this%inputtab%add_term(ib)
4201  call this%inputtab%add_term(cellid)
4202  else
4203  call this%inputtab%add_term(' ')
4204  call this%inputtab%add_term(' ')
4205  end if
4206  call this%inputtab%add_term(n)
4207  call this%inputtab%add_term(this%dbgeo(n, idelay))
4208  call this%inputtab%add_term(this%dbes(n, idelay))
4209  call this%inputtab%add_term(this%dbpcs(n, idelay))
4210  if (this%inamedbound /= 0) then
4211  if (n == 1) then
4212  call this%inputtab%add_term(this%boundname(ib))
4213  else
4214  call this%inputtab%add_term(' ')
4215  end if
4216  end if
4217  end do
4218  end if
4219  end do
4220  !
4221  ! -- write calculated compression indices
4222  if (this%istoragec == 1) then
4223  if (this%lhead_based .EQV. .false.) then
4224  ! -- set title
4225  title = trim(adjustl(this%packName))// &
4226  ' PACKAGE COMPRESSION INDICES'
4227  !
4228  ! -- determine the number of columns and rows
4229  ntabrows = this%ninterbeds
4230  ntabcols = 4
4231  if (this%inamedbound /= 0) then
4232  ntabcols = ntabcols + 1
4233  end if
4234  !
4235  ! -- setup table
4236  call table_cr(this%inputtab, this%packName, title)
4237  call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
4238  !
4239  ! add columns
4240  tag = 'INTERBED NUMBER'
4241  call this%inputtab%initialize_column(tag, 10, alignment=tableft)
4242  tag = 'CELLID'
4243  call this%inputtab%initialize_column(tag, 20)
4244  tag = 'CC'
4245  call this%inputtab%initialize_column(tag, 16)
4246  tag = 'CR'
4247  call this%inputtab%initialize_column(tag, 16)
4248  if (this%inamedbound /= 0) then
4249  tag = 'BOUNDNAME'
4250  call this%inputtab%initialize_column(tag, lenboundname, &
4251  alignment=tableft)
4252  end if
4253  !
4254  ! -- write the data
4255  do ib = 1, this%ninterbeds
4256  fact = done / dlog10es
4257  node = this%nodelist(ib)
4258  call this%dis%noder_to_string(node, cellid)
4259  !
4260  ! -- write the columns
4261  call this%inputtab%add_term(ib)
4262  call this%inputtab%add_term(cellid)
4263  call this%inputtab%add_term(this%ci(ib) * fact)
4264  call this%inputtab%add_term(this%rci(ib) * fact)
4265  if (this%inamedbound /= 0) then
4266  call this%inputtab%add_term(this%boundname(ib))
4267  end if
4268  end do
4269  end if
4270  end if
4271  end if
4272  !
4273  ! -- terminate if any initialization errors have been detected
4274  if (count_errors() > 0) then
4275  call store_error_filename(this%input_fname)
4276  end if
4277  !
4278  ! -- set initialized
4279  this%initialized = 1
4280  !
4281  ! -- set flag to retain initial stresses for entire simulation
4282  if (this%lhead_based .EQV. .true.) then
4283  this%iupdatestress = 0
4284  end if
Here is the call graph for this function:

◆ csub_source_dimensions()

subroutine gwfcsubmodule::csub_source_dimensions ( class(gwfcsubtype), intent(inout)  this)
private

Read the number of interbeds and maximum number of cells with a specified overlying geostatic stress.

Definition at line 796 of file gwf-csub.f90.

797  ! -- modules
800  ! -- dummy variables
801  class(GwfCsubType), intent(inout) :: this
802  ! -- local variables
803  type(GwfCsubParamFoundType) :: found
804 
805  ! -- initialize dimensions to -1
806  this%ninterbeds = -1
807 
808  ! -- update defaults from input context
809  call mem_set_value(this%ninterbeds, 'NINTERBEDS', this%input_mempath, &
810  found%ninterbeds)
811  call mem_set_value(this%maxsig0, 'MAXBOUND', this%input_mempath, &
812  found%maxbound)
813 
814  ! - log dimensions
815  write (this%iout, '(/1x,a)') 'PROCESSING '//trim(adjustl(this%packName))// &
816  ' DIMENSIONS'
817  write (this%iout, '(4x,a,i0)') 'NINTERBEDS = ', this%ninterbeds
818  write (this%iout, '(4x,a,i0)') 'MAXSIG0 = ', this%maxsig0
819  write (this%iout, '(1x,a)') &
820  'END OF '//trim(adjustl(this%packName))//' DIMENSIONS'
821 
822  ! -- verify dimensions were set correctly
823  if (.not. found%ninterbeds) then
824  write (errmsg, '(a)') &
825  'NINTERBEDS is a required dimension.'
826  call store_error(errmsg)
827  call store_error_filename(this%input_mempath)
828  end if
829 
830  ! -- Call define_listlabel to construct the list label that is written
831  ! when PRINT_INPUT option is used.
832  call this%define_listlabel()
Here is the call graph for this function:

◆ csub_source_griddata()

subroutine gwfcsubmodule::csub_source_griddata ( class(gwfcsubtype), intent(inout)  this)

Definition at line 1121 of file gwf-csub.f90.

1122  ! -- modules
1125  ! -- dummy variables
1126  class(GwfCsubType), intent(inout) :: this
1127  ! -- locals
1128  integer(I4B) :: node
1129  type(GwfCsubParamFoundType) :: found
1130  integer(I4B), dimension(:), pointer, contiguous :: map
1131 
1132  ! -- set map to convert user input data into reduced data
1133  map => null()
1134  if (this%dis%nodes < this%dis%nodesuser) map => this%dis%nodeuser
1135 
1136  ! -- update defaults from input context
1137  call mem_set_value(this%cg_ske_cr, 'CG_SKE_CR', this%input_mempath, &
1138  map, found%cg_ske_cr)
1139  call mem_set_value(this%cg_thetaini, 'CG_THETA', this%input_mempath, &
1140  map, found%cg_theta)
1141  call mem_set_value(this%sgm, 'SGM', this%input_mempath, map, found%sgm)
1142  call mem_set_value(this%sgs, 'SGS', this%input_mempath, map, found%sgs)
1143 
1144  ! -- cg_ske and cg_theta are required input params
1145  if (.not. found%cg_ske_cr) then
1146  call store_error('CG_SKE GRIDDATA must be specified.')
1147  call store_error_filename(this%input_fname)
1148  end if
1149  if (.not. found%cg_theta) then
1150  call store_error('CG_THETA GRIDDATA must be specified.')
1151  call store_error_filename(this%input_fname)
1152  end if
1153 
1154  ! -- if sgm and sgs have not been specified assign default values
1155  if (.not. found%sgm) then
1156  do node = 1, this%dis%nodes
1157  this%sgm(node) = 1.7d0
1158  end do
1159  end if
1160  if (.not. found%sgs) then
1161  do node = 1, this%dis%nodes
1162  this%sgs(node) = 2.0d0
1163  end do
1164  end if
Here is the call graph for this function:

◆ csub_source_packagedata()

subroutine gwfcsubmodule::csub_source_packagedata ( class(gwfcsubtype), intent(inout)  this)

Read delay and no-delay interbed input data for the CSUB package. Method also validates interbed input data.

Definition at line 1173 of file gwf-csub.f90.

1174  ! -- modules
1178  ! -- dummy variables
1179  class(GwfCsubType), intent(inout) :: this
1180  integer(I4B), dimension(:), pointer, contiguous :: icsubno
1181  integer(I4B), dimension(:, :), pointer, contiguous :: cellid_pkgdata
1182  integer(I4B), dimension(:), pointer :: cellid
1183  type(CharacterStringType), dimension(:), pointer, &
1184  contiguous :: cdelay
1185  type(CharacterStringType), dimension(:), pointer, &
1186  contiguous :: boundname
1187  real(DP), dimension(:), pointer, contiguous :: pcs, thick_frac, rnb
1188  real(DP), dimension(:), pointer, contiguous :: ssv_cc, sse_cr, theta, kv, h0
1189  character(len=LINELENGTH) :: cdelaystr
1190  character(len=LENBOUNDNAME) :: bndname
1191  real(DP) :: top, botm, baq, q, thick, rval
1192  integer(I4B) :: idelay, ndelaybeds, csubno
1193  integer(I4B) :: ib, n, nodeu, noder
1194 
1195  ! -- set input context pointers
1196  call mem_setptr(icsubno, 'ICSUBNO', this%input_mempath)
1197  call mem_setptr(cellid_pkgdata, 'CELLID_PKGDATA', this%input_mempath)
1198  call mem_setptr(cdelay, 'CDELAY', this%input_mempath)
1199  call mem_setptr(pcs, 'PCS0', this%input_mempath)
1200  call mem_setptr(thick_frac, 'THICK_FRAC', this%input_mempath)
1201  call mem_setptr(rnb, 'RNB', this%input_mempath)
1202  call mem_setptr(ssv_cc, 'SSV_CC', this%input_mempath)
1203  call mem_setptr(sse_cr, 'SSE_CR', this%input_mempath)
1204  call mem_setptr(theta, 'THETA', this%input_mempath)
1205  call mem_setptr(kv, 'KV', this%input_mempath)
1206  call mem_setptr(h0, 'H0', this%input_mempath)
1207  call mem_setptr(boundname, 'BOUNDNAME', this%input_mempath)
1208 
1209  ! initialize ndelaybeds
1210  ndelaybeds = 0
1211 
1212  ! -- update state
1213  do n = 1, size(icsubno)
1214 
1215  ! -- set cubno
1216  csubno = icsubno(n)
1217 
1218  ! -- check csubno
1219  if (csubno < 1 .or. csubno > this%ninterbeds) then
1220  write (errmsg, '(a,1x,i0,2(1x,a),1x,i0,a)') &
1221  'Interbed number (', csubno, ') must be greater than 0 and ', &
1222  'less than or equal to', this%ninterbeds, '.'
1223  call store_error(errmsg)
1224  cycle
1225  end if
1226 
1227  ! -- set cellid
1228  cellid => cellid_pkgdata(:, n)
1229 
1230  ! -- set node user
1231  if (this%dis%ndim == 1) then
1232  nodeu = cellid(1)
1233  elseif (this%dis%ndim == 2) then
1234  nodeu = get_node(cellid(1), 1, cellid(2), &
1235  this%dis%mshape(1), 1, &
1236  this%dis%mshape(2))
1237  else
1238  nodeu = get_node(cellid(1), cellid(2), cellid(3), &
1239  this%dis%mshape(1), &
1240  this%dis%mshape(2), &
1241  this%dis%mshape(3))
1242  end if
1243 
1244  ! -- set node reduced
1245  noder = this%dis%get_nodenumber(nodeu, 1)
1246  if (noder <= 0) then
1247  cycle
1248  end if
1249 
1250  ! -- update nodelists
1251  this%nodelist(csubno) = noder
1252  this%unodelist(csubno) = nodeu
1253 
1254  ! -- set top, botm, baq
1255  top = this%dis%top(noder)
1256  botm = this%dis%bot(noder)
1257  baq = top - botm
1258 
1259  ! -- set cdelay
1260  cdelaystr = cdelay(n)
1261  select case (cdelaystr)
1262  case ('NODELAY')
1263  idelay = 0
1264  case ('DELAY')
1265  ndelaybeds = ndelaybeds + 1
1266  idelay = ndelaybeds
1267  case default
1268  write (errmsg, '(a,1x,a,1x,i0,1x,a)') &
1269  'Invalid CDELAY ', trim(adjustl(cdelaystr)), &
1270  'for packagedata entry', csubno, '.'
1271  call store_error(errmsg)
1272  cycle
1273  end select
1274  this%idelay(csubno) = idelay
1275 
1276  ! -- set initial preconsolidation stress
1277  this%pcs(csubno) = pcs(n)
1278 
1279  ! -- set thickness
1280  if (this%icellf == 0) then
1281  if (thick_frac(n) < dzero .or. thick_frac(n) > baq) then
1282  write (errmsg, '(a,g0,2(a,1x),g0,1x,a,1x,i0,a)') &
1283  'THICK (', thick_frac(n), ') MUST BE greater than or equal to 0 ', &
1284  'and less than or equal to than', baq, &
1285  'for packagedata entry', csubno, '.'
1286  call store_error(errmsg)
1287  end if
1288  thick = thick_frac(n)
1289  else
1290  if (thick_frac(n) < dzero .or. thick_frac(n) > done) then
1291  write (errmsg, '(a,1x,a,1x,i0,a)') &
1292  'FRAC MUST BE greater than 0 and less than or equal to 1', &
1293  'for packagedata entry', csubno, '.'
1294  call store_error(errmsg)
1295  end if
1296  thick = thick_frac(n) * baq
1297  end if
1298  this%thickini(csubno) = thick
1299  if (this%iupdatematprop /= 0) then
1300  this%thick(csubno) = thick
1301  end if
1302 
1303  ! -- set rnb
1304  if (idelay > 0) then
1305  if (rnb(n) < done) then
1306  write (errmsg, '(a,g0,a,1x,a,1x,i0,a)') &
1307  'RNB (', rnb(n), ') must be greater than or equal to 1', &
1308  'for packagedata entry', csubno, '.'
1309  call store_error(errmsg)
1310  end if
1311  this%rnb(csubno) = rnb(n)
1312  else
1313  this%rnb(csubno) = done
1314  end if
1315 
1316  ! -- set skv or ci
1317  if (ssv_cc(n) < dzero) then
1318  write (errmsg, '(2(a,1x),i0,a)') &
1319  '(SKV,CI) must be greater than or equal to 0', &
1320  'for packagedata entry', csubno, '.'
1321  call store_error(errmsg)
1322  end if
1323  this%ci(csubno) = ssv_cc(n)
1324 
1325  ! -- set ske or rci
1326  if (sse_cr(n) < dzero) then
1327  write (errmsg, '(2(a,1x),i0,a)') &
1328  '(SKE,RCI) must be greater than or equal to 0', &
1329  'for packagedata entry', csubno, '.'
1330  call store_error(errmsg)
1331  end if
1332  this%rci(csubno) = sse_cr(n)
1333 
1334  ! -- set ielastic
1335  if (this%ci(csubno) == this%rci(csubno)) then
1336  this%ielastic(csubno) = 1
1337  else
1338  this%ielastic(csubno) = 0
1339  end if
1340 
1341  ! -- set porosity
1342  if (theta(n) <= dzero .or. theta(n) > done) then
1343  write (errmsg, '(a,1x,a,1x,i0,a)') &
1344  'THETA must be greater than 0 and less than or equal to 1', &
1345  'for packagedata entry', csubno, '.'
1346  call store_error(errmsg)
1347  end if
1348  this%thetaini(csubno) = theta(n)
1349  if (this%iupdatematprop /= 0) then
1350  this%theta(csubno) = theta(n)
1351  end if
1352 
1353  ! -- set kv
1354  if (idelay > 0) then
1355  if (kv(n) <= 0.0) then
1356  write (errmsg, '(a,1x,i0,a)') &
1357  'KV must be greater than 0 for packagedata entry', csubno, '.'
1358  call store_error(errmsg)
1359  end if
1360  end if
1361  this%kv(csubno) = kv(n)
1362 
1363  ! -- set h0
1364  this%h0(csubno) = h0(n)
1365 
1366  ! -- set bound name
1367  if (this%inamedbound /= 0) then
1368  bndname = boundname(n)
1369  if (len_trim(bndname) < 1) then
1370  write (errmsg, '(a,1x,i0,a)') &
1371  'BOUNDNAME must be specified for packagedata entry', csubno, '.'
1372  call store_error(errmsg)
1373  end if
1374  this%boundname(csubno) = bndname
1375  end if
1376  end do
1377 
1378  !
1379  ! -- set the number of delay interbeds
1380  this%ndelaybeds = ndelaybeds
1381  !
1382  ! -- process delay interbeds
1383  if (ndelaybeds > 0) then
1384  !
1385  ! -- reallocate and initialize delay interbed arrays
1386  call mem_allocate(this%idb_nconv_count, 2, &
1387  'IDB_NCONV_COUNT', trim(this%memoryPath))
1388  call mem_allocate(this%idbconvert, this%ndelaycells, ndelaybeds, &
1389  'IDBCONVERT', trim(this%memoryPath))
1390  call mem_allocate(this%dbdhmax, ndelaybeds, &
1391  'DBDHMAX', trim(this%memoryPath))
1392  call mem_allocate(this%dbz, this%ndelaycells, ndelaybeds, &
1393  'DBZ', trim(this%memoryPath))
1394  call mem_allocate(this%dbrelz, this%ndelaycells, ndelaybeds, &
1395  'DBRELZ', trim(this%memoryPath))
1396  call mem_allocate(this%dbh, this%ndelaycells, ndelaybeds, &
1397  'DBH', trim(this%memoryPath))
1398  call mem_allocate(this%dbh0, this%ndelaycells, ndelaybeds, &
1399  'DBH0', trim(this%memoryPath))
1400  call mem_allocate(this%dbgeo, this%ndelaycells, ndelaybeds, &
1401  'DBGEO', trim(this%memoryPath))
1402  call mem_allocate(this%dbes, this%ndelaycells, ndelaybeds, &
1403  'DBES', trim(this%memoryPath))
1404  call mem_allocate(this%dbes0, this%ndelaycells, ndelaybeds, &
1405  'DBES0', trim(this%memoryPath))
1406  call mem_allocate(this%dbpcs, this%ndelaycells, ndelaybeds, &
1407  'DBPCS', trim(this%memoryPath))
1408  call mem_allocate(this%dbflowtop, ndelaybeds, &
1409  'DBFLOWTOP', trim(this%memoryPath))
1410  call mem_allocate(this%dbflowbot, ndelaybeds, &
1411  'DBFLOWBOT', trim(this%memoryPath))
1412  call mem_allocate(this%dbdzini, this%ndelaycells, ndelaybeds, &
1413  'DBDZINI', trim(this%memoryPath))
1414  call mem_allocate(this%dbthetaini, this%ndelaycells, ndelaybeds, &
1415  'DBTHETAINI', trim(this%memoryPath))
1416  call mem_allocate(this%dbcomp, this%ndelaycells, ndelaybeds, &
1417  'DBCOMP', trim(this%memoryPath))
1418  call mem_allocate(this%dbtcomp, this%ndelaycells, ndelaybeds, &
1419  'DBTCOMP', trim(this%memoryPath))
1420  !
1421  ! -- allocate delay bed arrays
1422  if (this%iupdatematprop == 0) then
1423  call mem_setptr(this%dbdz, 'DBDZINI', trim(this%memoryPath))
1424  call mem_setptr(this%dbdz0, 'DBDZINI', trim(this%memoryPath))
1425  call mem_setptr(this%dbtheta, 'DBTHETAINI', trim(this%memoryPath))
1426  call mem_setptr(this%dbtheta0, 'DBTHETAINI', trim(this%memoryPath))
1427  else
1428  call mem_allocate(this%dbdz, this%ndelaycells, ndelaybeds, &
1429  'DBDZ', trim(this%memoryPath))
1430  call mem_allocate(this%dbdz0, this%ndelaycells, ndelaybeds, &
1431  'DBDZ0', trim(this%memoryPath))
1432  call mem_allocate(this%dbtheta, this%ndelaycells, ndelaybeds, &
1433  'DBTHETA', trim(this%memoryPath))
1434  call mem_allocate(this%dbtheta0, this%ndelaycells, ndelaybeds, &
1435  'DBTHETA0', trim(this%memoryPath))
1436  end if
1437  !
1438  ! -- allocate delay interbed solution arrays
1439  call mem_allocate(this%dbal, this%ndelaycells, &
1440  'DBAL', trim(this%memoryPath))
1441  call mem_allocate(this%dbad, this%ndelaycells, &
1442  'DBAD', trim(this%memoryPath))
1443  call mem_allocate(this%dbau, this%ndelaycells, &
1444  'DBAU', trim(this%memoryPath))
1445  call mem_allocate(this%dbrhs, this%ndelaycells, &
1446  'DBRHS', trim(this%memoryPath))
1447  call mem_allocate(this%dbdh, this%ndelaycells, &
1448  'DBDH', trim(this%memoryPath))
1449  call mem_allocate(this%dbaw, this%ndelaycells, &
1450  'DBAW', trim(this%memoryPath))
1451  !
1452  ! -- initialize delay bed counters
1453  do n = 1, 2
1454  this%idb_nconv_count(n) = 0
1455  end do
1456  !
1457  ! -- initialize delay bed storage
1458  do ib = 1, this%ninterbeds
1459  idelay = this%idelay(ib)
1460  if (idelay == 0) then
1461  cycle
1462  end if
1463  !
1464  ! -- initialize delay interbed variables
1465  do n = 1, this%ndelaycells
1466  rval = this%thickini(ib) / real(this%ndelaycells, dp)
1467  this%dbdzini(n, idelay) = rval
1468  this%dbh(n, idelay) = this%h0(ib)
1469  this%dbh0(n, idelay) = this%h0(ib)
1470  this%dbthetaini(n, idelay) = this%thetaini(ib)
1471  this%dbgeo(n, idelay) = dzero
1472  this%dbes(n, idelay) = dzero
1473  this%dbes0(n, idelay) = dzero
1474  this%dbpcs(n, idelay) = this%pcs(ib)
1475  this%dbcomp(n, idelay) = dzero
1476  this%dbtcomp(n, idelay) = dzero
1477  if (this%iupdatematprop /= 0) then
1478  this%dbdz(n, idelay) = this%dbdzini(n, idelay)
1479  this%dbdz0(n, idelay) = this%dbdzini(n, idelay)
1480  this%dbtheta(n, idelay) = this%theta(ib)
1481  this%dbtheta0(n, idelay) = this%theta(ib)
1482  end if
1483  end do
1484  !
1485  ! -- initialize elevation of delay bed cells
1486  call this%csub_delay_init_zcell(ib)
1487  end do
1488  !
1489  ! -- initialize delay bed solution arrays
1490  do n = 1, this%ndelaycells
1491  this%dbal(n) = dzero
1492  this%dbad(n) = dzero
1493  this%dbau(n) = dzero
1494  this%dbrhs(n) = dzero
1495  this%dbdh(n) = dzero
1496  this%dbaw(n) = dzero
1497  end do
1498  end if
1499  !
1500  ! -- check that ndelaycells is odd when using
1501  ! the effective stress formulation
1502  if (ndelaybeds > 0) then
1503  q = mod(real(this%ndelaycells, dp), dtwo)
1504  if (q == dzero) then
1505  write (errmsg, '(a,i0,a,1x,a)') &
1506  'NDELAYCELLS (', this%ndelaycells, ') must be an', &
1507  'odd number when using the effective stress formulation.'
1508  call store_error(errmsg)
1509  end if
1510  end if
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:

◆ define_listlabel()

subroutine gwfcsubmodule::define_listlabel ( class(gwfcsubtype), intent(inout)  this)
private

Method defined the list label for the CSUB package. The list label is the heading that is written to iout when PRINT_INPUT option is used.

Definition at line 7066 of file gwf-csub.f90.

7067  ! -- dummy variables
7068  class(GwfCsubType), intent(inout) :: this
7069  !
7070  ! -- create the header list label
7071  this%listlabel = trim(this%filtyp)//' NO.'
7072  if (this%dis%ndim == 3) then
7073  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'LAYER'
7074  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'ROW'
7075  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'COL'
7076  elseif (this%dis%ndim == 2) then
7077  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'LAYER'
7078  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'CELL2D'
7079  else
7080  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'NODE'
7081  end if
7082  write (this%listlabel, '(a, a16)') trim(this%listlabel), 'SIG0'
7083  if (this%inamedbound == 1) then
7084  write (this%listlabel, '(a, a16)') trim(this%listlabel), 'BOUNDARY NAME'
7085  end if

◆ log_options()

subroutine gwfcsubmodule::log_options ( class(gwfcsubtype), intent(inout)  this,
logical(lgp), intent(in)  warn_estress_lag 
)

log options block for CSUB package.

Definition at line 673 of file gwf-csub.f90.

674  ! -- modules
675  ! -- dummy variables
676  class(GwfCsubType), intent(inout) :: this
677  logical(LGP), intent(in) :: warn_estress_lag
678  ! -- local variables
679  ! -- formats
680  character(len=*), parameter :: fmtts = &
681  &"(4x,'TIME-SERIES DATA WILL BE READ FROM FILE: ',a)"
682  character(len=*), parameter :: fmtflow = &
683  &"(4x,'FLOWS WILL BE SAVED TO FILE: ',a,/4x,'OPENED ON UNIT: ',I7)"
684  character(len=*), parameter :: fmtflow2 = &
685  &"(4x,'FLOWS WILL BE SAVED TO BUDGET FILE SPECIFIED IN OUTPUT CONTROL')"
686  character(len=*), parameter :: fmtssessv = &
687  &"(4x,'USING SSE AND SSV INSTEAD OF CR AND CC.')"
688  character(len=*), parameter :: fmtoffset = &
689  &"(4x,'INITIAL_STRESS TREATED AS AN OFFSET.')"
690  character(len=*), parameter :: fmtopt = &
691  &"(4x,A)"
692  character(len=*), parameter :: fmtopti = &
693  &"(4x,A,1X,I0)"
694  character(len=*), parameter :: fmtoptr = &
695  &"(4x,A,1X,G0)"
696  character(len=*), parameter :: fmtfileout = &
697  "(4x,'CSUB ',1x,a,1x,' WILL BE SAVED TO FILE: ',a,/4x,&
698  &'OPENED ON UNIT: ',I7)"
699  !
700  ! -- write messages for options
701  write (this%iout, '(//2(1X,A))') trim(adjustl(this%packName)), &
702  'PACKAGE SETTINGS'
703  write (this%iout, fmtopti) 'NUMBER OF DELAY CELLS =', &
704  this%ndelaycells
705  if (this%lhead_based .EQV. .true.) then
706  write (this%iout, '(4x,a)') &
707  'HEAD-BASED FORMULATION'
708  else
709  write (this%iout, '(4x,a)') &
710  'EFFECTIVE-STRESS FORMULATION'
711  end if
712  if (this%istoragec == 0) then
713  write (this%iout, '(4x,a,1(/,6x,a))') &
714  'COMPRESSION INDICES WILL BE SPECIFIED INSTEAD OF ELASTIC AND', &
715  'INELASTIC SPECIFIC STORAGE COEFFICIENTS'
716  else
717  write (this%iout, '(4x,a,1(/,6x,a))') &
718  'ELASTIC AND INELASTIC SPECIFIC STORAGE COEFFICIENTS WILL BE ', &
719  'SPECIFIED'
720  end if
721  if (this%iupdatematprop /= 1) then
722  write (this%iout, '(4x,a,1(/,6x,a))') &
723  'THICKNESS AND VOID RATIO WILL NOT BE ADJUSTED DURING THE', &
724  'SIMULATION'
725  else
726  write (this%iout, '(4x,a)') &
727  'THICKNESS AND VOID RATIO WILL BE ADJUSTED DURING THE SIMULATION'
728  end if
729  if (this%icellf /= 1) then
730  write (this%iout, '(4x,a)') &
731  'INTERBED THICKNESS WILL BE SPECIFIED AS A THICKNESS'
732  else
733  write (this%iout, '(4x,a,1(/,6x,a))') &
734  'INTERBED THICKNESS WILL BE SPECIFIED AS A AS A CELL FRACTION'
735  end if
736  if (this%ispecified_pcs /= 1) then
737  if (this%ipch /= 0) then
738  write (this%iout, '(4x,a,1(/,6x,a))') &
739  'PRECONSOLIDATION HEAD WILL BE SPECIFIED RELATIVE TO INITIAL', &
740  'STRESS CONDITIONS'
741  else
742  write (this%iout, '(4x,a,1(/,6x,a))') &
743  'PRECONSOLIDATION STRESS WILL BE SPECIFIED RELATIVE TO INITIAL', &
744  'STRESS CONDITIONS'
745  end if
746  else
747  if (this%ipch /= 0) then
748  write (this%iout, '(4x,a,1(/,6x,a))') &
749  'PRECONSOLIDATION HEAD WILL BE SPECIFIED AS ABSOLUTE VALUES', &
750  'INSTEAD OF RELATIVE TO INITIAL HEAD CONDITIONS'
751  else
752  write (this%iout, '(4x,a,1(/,6x,a))') &
753  'PRECONSOLIDATION STRESS WILL BE SPECIFIED AS ABSOLUTE VALUES', &
754  'INSTEAD OF RELATIVE TO INITIAL STRESS CONDITIONS'
755  end if
756  end if
757  if (this%ispecified_dbh /= 1) then
758  write (this%iout, '(4x,a,1(/,6x,a))') &
759  'DELAY INTERBED HEADS WILL BE SPECIFIED RELATIVE TO INITIAL ', &
760  'GWF HEADS'
761  else
762  write (this%iout, '(4x,a,1(/,6x,a))') &
763  'DELAY INTERBED HEADS WILL BE SPECIFIED AS ABSOLUTE VALUES INSTEAD', &
764  'OF RELATIVE TO INITIAL GWF HEADS'
765  end if
766  !
767  if (this%lhead_based .EQV. .false.) then
768  if (this%ieslag /= 0) then
769  write (this%iout, '(4x,a,1(/,6x,a))') &
770  'SPECIFIC STORAGE VALUES WILL BE CALCULATED USING THE EFFECTIVE', &
771  'STRESS FROM THE PREVIOUS TIME STEP'
772  else
773  write (this%iout, '(4x,a,1(/,6x,a))') &
774  'SPECIFIC STORAGE VALUES WILL BE CALCULATED USING THE CURRENT', &
775  'EFFECTIVE STRESS'
776  end if
777  else if (warn_estress_lag) then
778  write (this%iout, '(4x,a,2(/,6x,a))') &
779  'EFFECTIVE_STRESS_LAG HAS BEEN SPECIFIED BUT HAS NO EFFECT WHEN', &
780  'USING THE HEAD-BASED FORMULATION (HEAD_BASED HAS BEEN SPECIFIED', &
781  'IN THE OPTIONS BLOCK)'
782  end if
783  !
784  write (this%iout, fmtoptr) 'GAMMAW =', this%gammaw
785  write (this%iout, fmtoptr) 'BETA =', this%beta
786  write (this%iout, fmtoptr) 'GAMMAW * BETA =', this%brg
787  write (this%iout, '((1X,A))') 'END PACKAGE SETTINGS'

◆ source_options()

subroutine gwfcsubmodule::source_options ( class(gwfcsubtype), intent(inout)  this)

Source options for CSUB package.

Definition at line 509 of file gwf-csub.f90.

510  ! -- modules
514  use openspecmodule, only: access, form
518  ! -- dummy variables
519  class(GwfCsubType), intent(inout) :: this
520  ! -- local variables
521  integer(I4B), pointer :: ibs
522  integer(I4B) :: inobs
523  character(len=LINELENGTH) :: csv_interbed, csv_coarse
524  character(len=LINELENGTH) :: cmp_fn, ecmp_fn, iecmp_fn, ibcmp_fn, cmpcoarse_fn
525  character(len=LINELENGTH) :: zdisp_fn, pkg_converge_fn
526  type(GwfCsubParamFoundType) :: found
527  logical(LGP) :: warn_estress_lag = .false.
528 
529  ! -- allocate and initialize variables
530  allocate (ibs)
531  ibs = 0
532 
533  ! -- update defaults from input context
534  call mem_set_value(this%inamedbound, 'BOUNDNAMES', this%input_mempath, &
535  found%boundnames)
536  call mem_set_value(this%iprpak, 'PRINT_INPUT', this%input_mempath, &
537  found%print_input)
538  call mem_set_value(this%ipakcb, 'SAVE_FLOWS', this%input_mempath, &
539  found%save_flows)
540  call mem_set_value(this%gammaw, 'GAMMAW', this%input_mempath, found%gammaw)
541  call mem_set_value(this%beta, 'BETA', this%input_mempath, found%beta)
542  call mem_set_value(this%ipch, 'HEAD_BASED', this%input_mempath, &
543  found%head_based)
544  call mem_set_value(this%ipch, 'PRECON_HEAD', this%input_mempath, &
545  found%precon_head)
546  call mem_set_value(this%ndelaycells, 'NDELAYCELLS', this%input_mempath, &
547  found%ndelaycells)
548  call mem_set_value(this%istoragec, 'ICOMPRESS', this%input_mempath, &
549  found%icompress)
550  call mem_set_value(this%iupdatematprop, 'MATPROP', this%input_mempath, &
551  found%matprop)
552  call mem_set_value(this%icellf, 'CELL_FRACTION', this%input_mempath, &
553  found%cell_fraction)
554  call mem_set_value(ibs, 'INTERBED_STATE', this%input_mempath, &
555  found%interbed_state)
556  call mem_set_value(this%ispecified_pcs, 'PRECON_STRESS', this%input_mempath, &
557  found%precon_stress)
558  call mem_set_value(this%ispecified_dbh, 'DELAY_HEAD', this%input_mempath, &
559  found%delay_head)
560  call mem_set_value(this%ieslag, 'STRESS_LAG', this%input_mempath, &
561  found%stress_lag)
562  call mem_set_value(csv_interbed, 'INTERBEDSTRAINFN', this%input_mempath, &
563  found%interbedstrainfn)
564  call mem_set_value(csv_coarse, 'COARSESTRAINFN', this%input_mempath, &
565  found%coarsestrainfn)
566  call mem_set_value(cmp_fn, 'CMPFN', this%input_mempath, found%cmpfn)
567  call mem_set_value(ecmp_fn, 'ELASTICCMPFN', this%input_mempath, &
568  found%elasticcmpfn)
569  call mem_set_value(iecmp_fn, 'INELASTICCMPFN', this%input_mempath, &
570  found%inelasticcmpfn)
571  call mem_set_value(ibcmp_fn, 'INTERBEDCMPFN', this%input_mempath, &
572  found%interbedcmpfn)
573  call mem_set_value(cmpcoarse_fn, 'CMPCOARSEFN', this%input_mempath, &
574  found%cmpcoarsefn)
575  call mem_set_value(zdisp_fn, 'ZDISPFN', this%input_mempath, found%zdispfn)
576  call mem_set_value(pkg_converge_fn, 'PKGCONVERGEFN', this%input_mempath, &
577  found%pkgconvergefn)
578 
579  ! -- enforce 0 or 1 OBS6_FILENAME entries in option block
580  if (filein_fname(this%obs%inputFilename, 'OBS6_FILENAME', &
581  this%input_mempath, this%input_fname)) then
582  this%obs%active = .true.
583  inobs = getunit()
584  call openfile(inobs, this%iout, this%obs%inputFilename, 'OBS')
585  this%obs%inUnitObs = inobs
586  this%inobspkg = inobs
587  call this%obs%obs_df(this%iout, this%packName, this%filtyp, this%dis)
588  call this%csub_df_obs()
589  end if
590 
591  ! -- update input dependent internal state
592  if (found%save_flows) this%ipakcb = -1
593  if (found%head_based) then
594  this%lhead_based = .true.
595  if (this%ieslag /= 0) then
596  this%ieslag = 0
597  warn_estress_lag = .true.
598  end if
599  end if
600  if (found%icompress) this%istoragec = 0
601  if (found%interbed_state) then
602  this%ispecified_pcs = 1
603  this%ispecified_dbh = 1
604  end if
605  if (found%gammaw .or. found%beta) then
606  this%brg = this%gammaw * this%beta
607  end if
608 
609  ! fileout options
610  if (found%interbedstrainfn) then
611  this%istrainib = getunit()
612  call openfile(this%istrainib, this%iout, csv_interbed, 'CSV_OUTPUT', &
613  filstat_opt='REPLACE', mode_opt=mnormal)
614  end if
615  if (found%coarsestrainfn) then
616  this%istrainsk = getunit()
617  call openfile(this%istrainsk, this%iout, csv_coarse, 'CSV_OUTPUT', &
618  filstat_opt='REPLACE', mode_opt=mnormal)
619  end if
620  if (found%cmpfn) then
621  this%ioutcomp = getunit()
622  call openfile(this%ioutcomp, this%iout, cmp_fn, 'DATA(BINARY)', &
623  form, access, 'REPLACE', mode_opt=mnormal)
624  end if
625  if (found%elasticcmpfn) then
626  this%ioutcompe = getunit()
627  call openfile(this%ioutcompe, this%iout, ecmp_fn, &
628  'DATA(BINARY)', form, access, 'REPLACE', &
629  mode_opt=mnormal)
630  end if
631  if (found%inelasticcmpfn) then
632  this%ioutcompi = getunit()
633  call openfile(this%ioutcompi, this%iout, iecmp_fn, &
634  'DATA(BINARY)', form, access, 'REPLACE', &
635  mode_opt=mnormal)
636  end if
637  if (found%interbedcmpfn) then
638  this%ioutcompib = getunit()
639  call openfile(this%ioutcompib, this%iout, ibcmp_fn, &
640  'DATA(BINARY)', form, access, 'REPLACE', &
641  mode_opt=mnormal)
642  end if
643  if (found%cmpcoarsefn) then
644  this%ioutcomps = getunit()
645  call openfile(this%ioutcomps, this%iout, cmpcoarse_fn, &
646  'DATA(BINARY)', form, access, 'REPLACE', &
647  mode_opt=mnormal)
648  end if
649  if (found%zdispfn) then
650  this%ioutzdisp = getunit()
651  call openfile(this%ioutzdisp, this%iout, zdisp_fn, &
652  'DATA(BINARY)', form, access, 'REPLACE', &
653  mode_opt=mnormal)
654  end if
655  if (found%pkgconvergefn) then
656  this%ipakcsv = getunit()
657  call openfile(this%ipakcsv, this%iout, pkg_converge_fn, 'CSV', &
658  filstat_opt='REPLACE', mode_opt=mnormal)
659  end if
660 
661  ! -- log user options
662  call this%log_options(warn_estress_lag)
663 
664  ! -- cleanup
665  deallocate (ibs)
@ mnormal
normal output mode
Definition: Constants.f90:206
integer(i4b), parameter maxcharlen
maximum length of char string
Definition: Constants.f90:47
subroutine, public urdaux(naux, inunit, iout, lloc, istart, istop, auxname, line, text)
Read auxiliary variables from an input line.
integer(i4b) function, public getunit()
Get a free unit number.
subroutine, public openfile(iu, iout, fname, ftype, fmtarg_opt, accarg_opt, filstat_opt, mode_opt)
Open a file.
Definition: InputOutput.f90:30
character(len=20) access
Definition: OpenSpec.f90:7
character(len=20) form
Definition: OpenSpec.f90:7
This module contains the SourceCommonModule.
Definition: SourceCommon.f90:7
logical(lgp) function, public filein_fname(filename, tagname, input_mempath, input_fname)
enforce and set a single input filename provided via FILEIN keyword
Here is the call graph for this function:

Variable Documentation

◆ budtxt

character(len=lenbudtxt), dimension(4) gwfcsubmodule::budtxt = [' CSUB-CGELASTIC', ' CSUB-ELASTIC', ' CSUB-INELASTIC', ' CSUB-WATERCOMP']
private

Definition at line 49 of file gwf-csub.f90.

49  character(len=LENBUDTXT), dimension(4) :: budtxt = & !< text labels for budget terms
50  [' CSUB-CGELASTIC', &
51  ' CSUB-ELASTIC', &
52  ' CSUB-INELASTIC', &
53  ' CSUB-WATERCOMP']

◆ comptxt

character(len=lenbudtxt), dimension(6) gwfcsubmodule::comptxt = ['CSUB-COMPACTION', ' CSUB-INELASTIC', ' CSUB-ELASTIC', ' CSUB-INTERBED', ' CSUB-COARSE', ' CSUB-ZDISPLACE']
private

Definition at line 54 of file gwf-csub.f90.

54  character(len=LENBUDTXT), dimension(6) :: comptxt = & !< text labels for compaction terms
55  ['CSUB-COMPACTION', &
56  ' CSUB-INELASTIC', &
57  ' CSUB-ELASTIC', &
58  ' CSUB-INTERBED', &
59  ' CSUB-COARSE', &
60  ' CSUB-ZDISPLACE']

◆ dlog10es

real(dp), parameter gwfcsubmodule::dlog10es = 0.4342942_DP
private

Definition at line 64 of file gwf-csub.f90.

64  real(DP), parameter :: dlog10es = 0.4342942_dp !< derivative of the log of effective stress