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

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

Data Types

type  gwfcsubtype
 

Functions/Subroutines

subroutine, public csub_cr (csubobj, name_model, 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 read_options (this)
 @ brief Read options for package More...
 
subroutine csub_read_dimensions (this)
 @ brief Read 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_read_packagedata (this)
 @ brief Read 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_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 2669 of file gwf-csub.f90.

2670  ! -- modules
2671  use tdismodule, only: nper, kper
2672  ! -- dummy variables
2673  class(GwfCsubType) :: this
2674  integer(I4B), intent(in) :: nodes !< number of active model nodes
2675  real(DP), dimension(nodes), intent(in) :: hnew !< current head
2676  ! -- local variables
2677  integer(I4B) :: ib
2678  integer(I4B) :: n
2679  integer(I4B) :: idelay
2680  integer(I4B) :: node
2681  real(DP) :: h
2682  real(DP) :: es
2683  real(DP) :: pcs
2684  !
2685  ! -- evaluate if steady-state stress periods are specified for more
2686  ! than the first and last stress period if interbeds are simulated
2687  if (this%ninterbeds > 0) then
2688  if (kper > 1 .and. kper < nper) then
2689  if (this%gwfiss /= 0) then
2690  write (errmsg, '(a,i0,a,1x,a,1x,a,1x,i0,1x,a)') &
2691  'Only the first and last (', nper, ')', &
2692  'stress period can be steady if interbeds are simulated.', &
2693  'Stress period', kper, 'has been defined to be steady state.'
2694  call store_error(errmsg, terminate=.true.)
2695  end if
2696  end if
2697  end if
2698  !
2699  ! -- set initial states
2700  if (this%initialized == 0) then
2701  if (this%gwfiss == 0) then
2702  call this%csub_set_initial_state(nodes, hnew)
2703  end if
2704  end if
2705  !
2706  ! -- update state variables
2707  !
2708  ! -- coarse-grained materials
2709  do node = 1, nodes
2710  this%cg_comp(node) = dzero
2711  this%cg_es0(node) = this%cg_es(node)
2712  if (this%iupdatematprop /= 0) then
2713  this%cg_thick0(node) = this%cg_thick(node)
2714  this%cg_theta0(node) = this%cg_theta(node)
2715  end if
2716  end do
2717  !
2718  ! -- interbeds
2719  do ib = 1, this%ninterbeds
2720  idelay = this%idelay(ib)
2721  !
2722  ! -- update common terms for no-delay and delay interbeds
2723  this%comp(ib) = dzero
2724  node = this%nodelist(ib)
2725  if (this%initialized /= 0) then
2726  es = this%cg_es(node)
2727  pcs = this%pcs(ib)
2728  if (es > pcs) then
2729  this%pcs(ib) = es
2730  end if
2731  end if
2732  if (this%iupdatematprop /= 0) then
2733  this%thick0(ib) = this%thick(ib)
2734  this%theta0(ib) = this%theta(ib)
2735  end if
2736  !
2737  ! -- update delay interbed terms
2738  if (idelay /= 0) then
2739  !
2740  ! -- update state if previous period was steady state
2741  if (kper > 1) then
2742  if (this%gwfiss0 /= 0) then
2743  node = this%nodelist(ib)
2744  h = hnew(node)
2745  do n = 1, this%ndelaycells
2746  this%dbh(n, idelay) = h
2747  end do
2748  end if
2749  end if
2750  !
2751  ! -- update preconsolidation stress, stresses, head, dbdz0, and theta0
2752  do n = 1, this%ndelaycells
2753  ! update preconsolidation stress
2754  if (this%initialized /= 0) then
2755  if (this%dbes(n, idelay) > this%dbpcs(n, idelay)) then
2756  this%dbpcs(n, idelay) = this%dbes(n, idelay)
2757  end if
2758  end if
2759  this%dbh0(n, idelay) = this%dbh(n, idelay)
2760  this%dbes0(n, idelay) = this%dbes(n, idelay)
2761  if (this%iupdatematprop /= 0) then
2762  this%dbdz0(n, idelay) = this%dbdz(n, idelay)
2763  this%dbtheta0(n, idelay) = this%dbtheta(n, idelay)
2764  end if
2765  end do
2766  end if
2767  end do
2768  !
2769  ! -- set gwfiss0
2770  this%gwfiss0 = this%gwfiss
2771  !
2772  ! -- Advance the time series managers
2773  call this%TsManager%ad()
2774  !
2775  ! -- For each observation, push simulated value and corresponding
2776  ! simulation time from "current" to "preceding" and reset
2777  ! "current" value.
2778  call this%obs%obs_ad()
2779  !
2780  ! -- return
2781  return
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 5730 of file gwf-csub.f90.

5731  ! -- dummy variables
5732  class(GwfCsubType), intent(inout) :: this
5733  real(DP), intent(in) :: comp !< compaction
5734  real(DP), intent(inout) :: thick !< thickness
5735  real(DP), intent(inout) :: theta !< porosity
5736  ! -- local variables
5737  real(DP) :: strain
5738  real(DP) :: void_ratio
5739  !
5740  ! -- initialize variables
5741  strain = dzero
5742  void_ratio = this%csub_calc_void_ratio(theta)
5743  !
5744  ! -- calculate strain
5745  if (thick > dzero) strain = -comp / thick
5746  !
5747  ! -- update void ratio, theta, and thickness
5748  void_ratio = void_ratio + strain * (done + void_ratio)
5749  theta = this%csub_calc_theta(void_ratio)
5750  thick = thick - comp
5751  !
5752  ! -- return
5753  return

◆ csub_allocate_arrays()

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

Allocate and initialize CSUB package arrays.

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

1231  ! -- modules
1233  ! -- dummy variables
1234  class(GwfCsubType), intent(inout) :: this
1235  ! -- local variables
1236  integer(I4B) :: j
1237  integer(I4B) :: n
1238  integer(I4B) :: iblen
1239  integer(I4B) :: ilen
1240  integer(I4B) :: naux
1241  !
1242  ! -- grid based data
1243  if (this%ioutcomp == 0 .and. this%ioutcompi == 0 .and. &
1244  this%ioutcompe == 0 .and. this%ioutcompib == 0 .and. &
1245  this%ioutcomps == 0 .and. this%ioutzdisp == 0) then
1246  call mem_allocate(this%buff, 1, 'BUFF', trim(this%memoryPath))
1247  else
1248  call mem_allocate(this%buff, this%dis%nodes, 'BUFF', trim(this%memoryPath))
1249  end if
1250  if (this%ioutcomp == 0 .and. this%ioutzdisp == 0) then
1251  call mem_allocate(this%buffusr, 1, 'BUFFUSR', trim(this%memoryPath))
1252  else
1253  call mem_allocate(this%buffusr, this%dis%nodesuser, 'BUFFUSR', &
1254  trim(this%memoryPath))
1255  end if
1256  call mem_allocate(this%sgm, this%dis%nodes, 'SGM', trim(this%memoryPath))
1257  call mem_allocate(this%sgs, this%dis%nodes, 'SGS', trim(this%memoryPath))
1258  call mem_allocate(this%cg_ske_cr, this%dis%nodes, 'CG_SKE_CR', &
1259  trim(this%memoryPath))
1260  call mem_allocate(this%cg_es, this%dis%nodes, 'CG_ES', &
1261  trim(this%memoryPath))
1262  call mem_allocate(this%cg_es0, this%dis%nodes, 'CG_ES0', &
1263  trim(this%memoryPath))
1264  call mem_allocate(this%cg_pcs, this%dis%nodes, 'CG_PCS', &
1265  trim(this%memoryPath))
1266  call mem_allocate(this%cg_comp, this%dis%nodes, 'CG_COMP', &
1267  trim(this%memoryPath))
1268  call mem_allocate(this%cg_tcomp, this%dis%nodes, 'CG_TCOMP', &
1269  trim(this%memoryPath))
1270  call mem_allocate(this%cg_stor, this%dis%nodes, 'CG_STOR', &
1271  trim(this%memoryPath))
1272  call mem_allocate(this%cg_ske, this%dis%nodes, 'CG_SKE', &
1273  trim(this%memoryPath))
1274  call mem_allocate(this%cg_sk, this%dis%nodes, 'CG_SK', &
1275  trim(this%memoryPath))
1276  call mem_allocate(this%cg_thickini, this%dis%nodes, 'CG_THICKINI', &
1277  trim(this%memoryPath))
1278  call mem_allocate(this%cg_thetaini, this%dis%nodes, 'CG_THETAINI', &
1279  trim(this%memoryPath))
1280  if (this%iupdatematprop == 0) then
1281  call mem_setptr(this%cg_thick, 'CG_THICKINI', trim(this%memoryPath))
1282  call mem_setptr(this%cg_thick0, 'CG_THICKINI', trim(this%memoryPath))
1283  call mem_setptr(this%cg_theta, 'CG_THETAINI', trim(this%memoryPath))
1284  call mem_setptr(this%cg_theta0, 'CG_THETAINI', trim(this%memoryPath))
1285  else
1286  call mem_allocate(this%cg_thick, this%dis%nodes, 'CG_THICK', &
1287  trim(this%memoryPath))
1288  call mem_allocate(this%cg_thick0, this%dis%nodes, 'CG_THICK0', &
1289  trim(this%memoryPath))
1290  call mem_allocate(this%cg_theta, this%dis%nodes, 'CG_THETA', &
1291  trim(this%memoryPath))
1292  call mem_allocate(this%cg_theta0, this%dis%nodes, 'CG_THETA0', &
1293  trim(this%memoryPath))
1294  end if
1295  !
1296  ! -- cell storage data
1297  call mem_allocate(this%cell_wcstor, this%dis%nodes, 'CELL_WCSTOR', &
1298  trim(this%memoryPath))
1299  call mem_allocate(this%cell_thick, this%dis%nodes, 'CELL_THICK', &
1300  trim(this%memoryPath))
1301  !
1302  ! -- interbed data
1303  iblen = 1
1304  if (this%ninterbeds > 0) then
1305  iblen = this%ninterbeds
1306  end if
1307  naux = 1
1308  if (this%naux > 0) then
1309  naux = this%naux
1310  end if
1311  call mem_allocate(this%auxvar, naux, iblen, 'AUXVAR', this%memoryPath)
1312  do n = 1, iblen
1313  do j = 1, naux
1314  this%auxvar(j, n) = dzero
1315  end do
1316  end do
1317  call mem_allocate(this%unodelist, iblen, 'UNODELIST', trim(this%memoryPath))
1318  call mem_allocate(this%nodelist, iblen, 'NODELIST', trim(this%memoryPath))
1319  call mem_allocate(this%cg_gs, this%dis%nodes, 'CG_GS', trim(this%memoryPath))
1320  call mem_allocate(this%pcs, iblen, 'PCS', trim(this%memoryPath))
1321  call mem_allocate(this%rnb, iblen, 'RNB', trim(this%memoryPath))
1322  call mem_allocate(this%kv, iblen, 'KV', trim(this%memoryPath))
1323  call mem_allocate(this%h0, iblen, 'H0', trim(this%memoryPath))
1324  call mem_allocate(this%ci, iblen, 'CI', trim(this%memoryPath))
1325  call mem_allocate(this%rci, iblen, 'RCI', trim(this%memoryPath))
1326  call mem_allocate(this%idelay, iblen, 'IDELAY', trim(this%memoryPath))
1327  call mem_allocate(this%ielastic, iblen, 'IELASTIC', trim(this%memoryPath))
1328  call mem_allocate(this%iconvert, iblen, 'ICONVERT', trim(this%memoryPath))
1329  call mem_allocate(this%comp, iblen, 'COMP', trim(this%memoryPath))
1330  call mem_allocate(this%tcomp, iblen, 'TCOMP', trim(this%memoryPath))
1331  call mem_allocate(this%tcompi, iblen, 'TCOMPI', trim(this%memoryPath))
1332  call mem_allocate(this%tcompe, iblen, 'TCOMPE', trim(this%memoryPath))
1333  call mem_allocate(this%storagee, iblen, 'STORAGEE', trim(this%memoryPath))
1334  call mem_allocate(this%storagei, iblen, 'STORAGEI', trim(this%memoryPath))
1335  call mem_allocate(this%ske, iblen, 'SKE', trim(this%memoryPath))
1336  call mem_allocate(this%sk, iblen, 'SK', trim(this%memoryPath))
1337  call mem_allocate(this%thickini, iblen, 'THICKINI', trim(this%memoryPath))
1338  call mem_allocate(this%thetaini, iblen, 'THETAINI', trim(this%memoryPath))
1339  if (this%iupdatematprop == 0) then
1340  call mem_setptr(this%thick, 'THICKINI', trim(this%memoryPath))
1341  call mem_setptr(this%thick0, 'THICKINI', trim(this%memoryPath))
1342  call mem_setptr(this%theta, 'THETAINI', trim(this%memoryPath))
1343  call mem_setptr(this%theta0, 'THETAINI', trim(this%memoryPath))
1344  else
1345  call mem_allocate(this%thick, iblen, 'THICK', trim(this%memoryPath))
1346  call mem_allocate(this%thick0, iblen, 'THICK0', trim(this%memoryPath))
1347  call mem_allocate(this%theta, iblen, 'THETA', trim(this%memoryPath))
1348  call mem_allocate(this%theta0, iblen, 'THETA0', trim(this%memoryPath))
1349  end if
1350  !
1351  ! -- delay bed storage - allocated in csub_read_packagedata
1352  ! after number of delay beds is defined
1353  !
1354  ! -- allocate boundname
1355  if (this%inamedbound /= 0) then
1356  call mem_allocate(this%boundname, lenboundname, this%ninterbeds, &
1357  'BOUNDNAME', trim(this%memoryPath))
1358  else
1359  call mem_allocate(this%boundname, lenboundname, 1, &
1360  'BOUNDNAME', trim(this%memoryPath))
1361 
1362  end if
1363  !
1364  ! -- allocate the nodelist and bound arrays
1365  if (this%maxsig0 > 0) then
1366  ilen = this%maxsig0
1367  else
1368  ilen = 1
1369  end if
1370  call mem_allocate(this%nodelistsig0, ilen, 'NODELISTSIG0', this%memoryPath)
1371  call mem_allocate(this%sig0, ilen, 'SIG0', this%memoryPath)
1372  !
1373  ! -- set pointers to gwf variables
1374  call mem_setptr(this%gwfiss, 'ISS', trim(this%name_model))
1375  !
1376  ! -- set pointers to variables in the storage package
1377  call mem_setptr(this%stoiconv, 'ICONVERT', this%stoMemPath)
1378  call mem_setptr(this%stoss, 'SS', this%stoMemPath)
1379  !
1380  ! -- initialize variables that are not specified by user
1381  do n = 1, this%dis%nodes
1382  this%cg_gs(n) = dzero
1383  this%cg_es(n) = dzero
1384  this%cg_comp(n) = dzero
1385  this%cg_tcomp(n) = dzero
1386  this%cell_wcstor(n) = dzero
1387  end do
1388  do n = 1, this%ninterbeds
1389  this%theta(n) = dzero
1390  this%tcomp(n) = dzero
1391  this%tcompi(n) = dzero
1392  this%tcompe(n) = dzero
1393  end do
1394  do n = 1, max(1, this%maxsig0)
1395  this%nodelistsig0(n) = 0
1396  this%sig0(n) = dzero
1397  end do
1398  !
1399  ! -- return
1400  return
1401 

◆ 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 1114 of file gwf-csub.f90.

1115  ! -- modules
1117  ! -- dummy variables
1118  class(GwfCsubType), intent(inout) :: this
1119  !
1120  ! -- call standard NumericalPackageType allocate scalars
1121  call this%NumericalPackageType%allocate_scalars()
1122  !
1123  ! -- allocate character variables
1124  call mem_allocate(this%listlabel, lenlistlabel, 'LISTLABEL', this%memoryPath)
1125  call mem_allocate(this%stoMemPath, lenmempath, 'STONAME', this%memoryPath)
1126  !
1127  ! -- allocate the object and assign values to object variables
1128  call mem_allocate(this%istounit, 'ISTOUNIT', this%memoryPath)
1129  call mem_allocate(this%inobspkg, 'INOBSPKG', this%memoryPath)
1130  call mem_allocate(this%ninterbeds, 'NINTERBEDS', this%memoryPath)
1131  call mem_allocate(this%maxsig0, 'MAXSIG0', this%memoryPath)
1132  call mem_allocate(this%nbound, 'NBOUND', this%memoryPath)
1133  call mem_allocate(this%iscloc, 'ISCLOC', this%memoryPath)
1134  call mem_allocate(this%iauxmultcol, 'IAUXMULTCOL', this%memoryPath)
1135  call mem_allocate(this%ndelaycells, 'NDELAYCELLS', this%memoryPath)
1136  call mem_allocate(this%ndelaybeds, 'NDELAYBEDS', this%memoryPath)
1137  call mem_allocate(this%initialized, 'INITIALIZED', this%memoryPath)
1138  call mem_allocate(this%ieslag, 'IESLAG', this%memoryPath)
1139  call mem_allocate(this%ipch, 'IPCH', this%memoryPath)
1140  call mem_allocate(this%lhead_based, 'LHEAD_BASED', this%memoryPath)
1141  call mem_allocate(this%iupdatestress, 'IUPDATESTRESS', this%memoryPath)
1142  call mem_allocate(this%ispecified_pcs, 'ISPECIFIED_PCS', this%memoryPath)
1143  call mem_allocate(this%ispecified_dbh, 'ISPECIFIED_DBH', this%memoryPath)
1144  call mem_allocate(this%inamedbound, 'INAMEDBOUND', this%memoryPath)
1145  call mem_allocate(this%iconvchk, 'ICONVCHK', this%memoryPath)
1146  call mem_allocate(this%naux, 'NAUX', this%memoryPath)
1147  call mem_allocate(this%istoragec, 'ISTORAGEC', this%memoryPath)
1148  call mem_allocate(this%istrainib, 'ISTRAINIB', this%memoryPath)
1149  call mem_allocate(this%istrainsk, 'ISTRAINSK', this%memoryPath)
1150  call mem_allocate(this%ioutcomp, 'IOUTCOMP', this%memoryPath)
1151  call mem_allocate(this%ioutcompi, 'IOUTCOMPI', this%memoryPath)
1152  call mem_allocate(this%ioutcompe, 'IOUTCOMPE', this%memoryPath)
1153  call mem_allocate(this%ioutcompib, 'IOUTCOMPIB', this%memoryPath)
1154  call mem_allocate(this%ioutcomps, 'IOUTCOMPS', this%memoryPath)
1155  call mem_allocate(this%ioutzdisp, 'IOUTZDISP', this%memoryPath)
1156  call mem_allocate(this%ipakcsv, 'IPAKCSV', this%memoryPath)
1157  call mem_allocate(this%iupdatematprop, 'IUPDATEMATPROP', this%memoryPath)
1158  call mem_allocate(this%epsilon, 'EPSILON', this%memoryPath)
1159  call mem_allocate(this%cc_crit, 'CC_CRIT', this%memoryPath)
1160  call mem_allocate(this%gammaw, 'GAMMAW', this%memoryPath)
1161  call mem_allocate(this%beta, 'BETA', this%memoryPath)
1162  call mem_allocate(this%brg, 'BRG', this%memoryPath)
1163  call mem_allocate(this%satomega, 'SATOMEGA', this%memoryPath)
1164  call mem_allocate(this%icellf, 'ICELLF', this%memoryPath)
1165  call mem_allocate(this%gwfiss0, 'GWFISS0', this%memoryPath)
1166  !
1167  ! -- allocate TS object
1168  allocate (this%TsManager)
1169  !
1170  ! -- allocate text strings
1171  call mem_allocate(this%auxname, lenauxname, 0, 'AUXNAME', this%memoryPath)
1172  !
1173  ! -- initialize values
1174  this%istounit = 0
1175  this%inobspkg = 0
1176  this%ninterbeds = 0
1177  this%maxsig0 = 0
1178  this%nbound = 0
1179  this%iscloc = 0
1180  this%iauxmultcol = 0
1181  this%ndelaycells = 19
1182  this%ndelaybeds = 0
1183  this%initialized = 0
1184  this%ieslag = 0
1185  this%ipch = 0
1186  this%lhead_based = .false.
1187  this%iupdatestress = 1
1188  this%ispecified_pcs = 0
1189  this%ispecified_dbh = 0
1190  this%inamedbound = 0
1191  this%iconvchk = 1
1192  this%naux = 0
1193  this%istoragec = 1
1194  this%istrainib = 0
1195  this%istrainsk = 0
1196  this%ioutcomp = 0
1197  this%ioutcompi = 0
1198  this%ioutcompe = 0
1199  this%ioutcompib = 0
1200  this%ioutcomps = 0
1201  this%ioutzdisp = 0
1202  this%ipakcsv = 0
1203  this%iupdatematprop = 0
1204  this%epsilon = dzero
1205  this%cc_crit = dem7
1206  this%gammaw = dgravity * 1000._dp
1207  this%beta = 4.6512e-10_dp
1208  this%brg = this%gammaw * this%beta
1209  !
1210  ! -- set omega value used for saturation calculations
1211  if (this%inewton /= 0) then
1212  this%satomega = dem6
1213  this%epsilon = dhalf * dem6
1214  else
1215  this%satomega = dzero
1216  end if
1217  this%icellf = 0
1218  this%ninterbeds = 0
1219  this%gwfiss0 = 0
1220  !
1221  ! -- return
1222  return

◆ 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 360 of file gwf-csub.f90.

361  ! -- modules
363  use constantsmodule, only: linelength
364  use kindmodule, only: i4b
365  ! -- dummy variables
366  class(GwfCsubType), intent(inout) :: this
367  class(DisBaseType), pointer, intent(in) :: dis !< model discretization
368  integer(I4B), dimension(:), pointer, contiguous :: ibound !< model ibound array
369  ! -- local variables
370  logical :: isfound, endOfBlock
371  character(len=:), allocatable :: line
372  character(len=LINELENGTH) :: keyword
373  character(len=20) :: cellid
374  integer(I4B) :: iske
375  integer(I4B) :: istheta
376  integer(I4B) :: isgm
377  integer(I4B) :: isgs
378  integer(I4B) :: idelay
379  integer(I4B) :: ierr
380  integer(I4B) :: lloc
381  integer(I4B) :: istart
382  integer(I4B) :: istop
383  integer(I4B) :: ib
384  integer(I4B) :: node
385  integer(I4B) :: istoerr
386  real(DP) :: top
387  real(DP) :: bot
388  real(DP) :: thick
389  real(DP) :: cg_ske_cr
390  real(DP) :: theta
391  real(DP) :: v
392  ! -- format
393  character(len=*), parameter :: fmtcsub = &
394  "(1x,/1x,'CSUB -- COMPACTION PACKAGE, VERSION 1, 12/15/2019', &
395  &' INPUT READ FROM UNIT ', i0, //)"
396  !
397  ! --print a message identifying the csub package.
398  write (this%iout, fmtcsub) this%inunit
399  !
400  ! -- store pointers to arguments that were passed in
401  this%dis => dis
402  this%ibound => ibound
403  !
404  ! -- Create time series managers
405  call tsmanager_cr(this%TsManager, this%iout)
406  !
407  ! -- create obs package
408  call obs_cr(this%obs, this%inobspkg)
409  !
410  ! -- Read csub options
411  call this%read_options()
412  !
413  ! -- Now that time series will have been read, need to call the df
414  ! routine to define the manager
415  call this%tsmanager%tsmanager_df()
416  !
417  ! -- Read the csub dimensions
418  call this%read_dimensions()
419  !
420  ! - observation data
421  call this%obs%obs_ar()
422  !
423  ! -- terminate if errors dimensions block data
424  if (count_errors() > 0) then
425  call this%parser%StoreErrorUnit()
426  end if
427 
428  ! -- Allocate arrays in
429  call this%csub_allocate_arrays()
430  !
431  ! -- initialize local variables
432  iske = 0
433  istheta = 0
434  isgm = 0
435  isgs = 0
436  !
437  ! -- read griddata block
438  call this%parser%GetBlock('GRIDDATA', isfound, ierr)
439  if (isfound) then
440  do
441  call this%parser%GetNextLine(endofblock)
442  if (endofblock) exit
443  call this%parser%GetStringCaps(keyword)
444  call this%parser%GetRemainingLine(line)
445  lloc = 1
446  select case (keyword)
447  case ('CG_SKE_CR')
448  call this%dis%read_grid_array(line, lloc, istart, istop, &
449  this%iout, this%parser%iuactive, &
450  this%cg_ske_cr, 'CG_SKE_CR')
451  iske = 1
452  case ('CG_THETA')
453  call this%dis%read_grid_array(line, lloc, istart, istop, &
454  this%iout, this%parser%iuactive, &
455  this%cg_thetaini, 'CG_THETA')
456  istheta = 1
457  case ('SGM')
458  call this%dis%read_grid_array(line, lloc, istart, istop, &
459  this%iout, this%parser%iuactive, &
460  this%sgm, 'SGM')
461  isgm = 1
462  case ('SGS')
463  call this%dis%read_grid_array(line, lloc, istart, istop, &
464  this%iout, this%parser%iuactive, &
465  this%sgs, 'SGS')
466  isgs = 1
467  case default
468  write (errmsg, '(a,1x,a,a)') &
469  "Unknown GRIDDATA tag '", trim(keyword), "'."
470  call store_error(errmsg)
471  end select
472  end do
473  else
474  call store_error('Required GRIDDATA block not found.')
475  end if
476  !
477  ! -- determine if cg_ske and cg_theta have been specified
478  if (iske == 0) then
479  write (errmsg, '(a)') 'CG_SKE GRIDDATA must be specified.'
480  call store_error(errmsg)
481  end if
482  if (istheta == 0) then
483  write (errmsg, '(a)') 'CG_THETA GRIDDATA must be specified.'
484  call store_error(errmsg)
485  end if
486  !
487  ! -- determine if sgm and sgs have been specified, if not assign default values
488  if (isgm == 0) then
489  do node = 1, this%dis%nodes
490  this%sgm(node) = 1.7d0
491  end do
492  end if
493  if (isgs == 0) then
494  do node = 1, this%dis%nodes
495  this%sgs(node) = 2.0d0
496  end do
497  end if
498  !
499  ! -- evaluate the coarse-grained material properties and if
500  ! non-zero specific storage values are specified in the
501  ! STO package
502  istoerr = 0
503  do node = 1, this%dis%nodes
504  call this%dis%noder_to_string(node, cellid)
505  cg_ske_cr = this%cg_ske_cr(node)
506  theta = this%cg_thetaini(node)
507  !
508  ! -- coarse-grained storage error condition
509  if (cg_ske_cr < dzero) then
510  write (errmsg, '(a,g0,a,1x,a,1x,a,a)') &
511  'Coarse-grained material CG_SKE_CR (', cg_ske_cr, ') is less', &
512  'than zero in cell', trim(adjustl(cellid)), '.'
513  end if
514  !
515  ! -- storage (STO) package error condition
516  if (this%stoss(node) /= dzero) then
517  istoerr = 1
518  end if
519  !
520  ! -- porosity error condition
521  if (theta > done .or. theta < dzero) then
522  write (errmsg, '(a,g0,a,1x,a,1x,a,a)') &
523  'Coarse-grained material THETA (', theta, ') is less', &
524  'than zero or greater than 1 in cell', trim(adjustl(cellid)), '.'
525  end if
526  end do
527  !
528  ! -- write single message if storage (STO) package has non-zero specific
529  ! storage values
530  if (istoerr /= 0) then
531  write (errmsg, '(a,3(1x,a))') &
532  'Specific storage values in the storage (STO) package must', &
533  'be zero in all active cells when using the', &
534  trim(adjustl(this%packName)), &
535  'package.'
536  call store_error(errmsg)
537  end if
538  !
539  ! -- read interbed data
540  if (this%ninterbeds > 0) then
541  call this%csub_read_packagedata()
542  end if
543  !
544  ! -- calculate the coarse-grained material thickness without the interbeds
545  do node = 1, this%dis%nodes
546  top = this%dis%top(node)
547  bot = this%dis%bot(node)
548  this%cg_thickini(node) = top - bot
549  this%cell_thick(node) = top - bot
550  end do
551  !
552  ! -- subtract the interbed thickness from aquifer thickness
553  do ib = 1, this%ninterbeds
554  node = this%nodelist(ib)
555  idelay = this%idelay(ib)
556  if (idelay == 0) then
557  v = this%thickini(ib)
558  else
559  v = this%rnb(ib) * this%thickini(ib)
560  end if
561  this%cg_thickini(node) = this%cg_thickini(node) - v
562  end do
563  !
564  ! -- evaluate if any cg_thick values are less than 0
565  do node = 1, this%dis%nodes
566  thick = this%cg_thickini(node)
567  if (thick < dzero) then
568  call this%dis%noder_to_string(node, cellid)
569  write (errmsg, '(a,g0,a,1x,a,a)') &
570  'Aquifer thickness is less than zero (', &
571  thick, ') in cell', trim(adjustl(cellid)), '.'
572  call store_error(errmsg)
573  end if
574  end do
575  !
576  ! -- terminate if errors griddata, packagedata blocks, TDIS, or STO data
577  if (count_errors() > 0) then
578  call this%parser%StoreErrorUnit()
579  end if
580  !
581  ! -- set current coarse-grained thickness (cg_thick) and
582  ! current coarse-grained porosity (cg_theta). Only needed
583  ! if updating material properties
584  if (this%iupdatematprop /= 0) then
585  do node = 1, this%dis%nodes
586  this%cg_thick(node) = this%cg_thickini(node)
587  this%cg_theta(node) = this%cg_thetaini(node)
588  end do
589  end if
590  !
591  ! -- return
592  return
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter linelength
maximum length of a standard line
Definition: Constants.f90:44
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 3545 of file gwf-csub.f90.

3546  ! -- modules
3547  use tdismodule, only: delt
3548  use constantsmodule, only: lenboundname, dzero, done
3550  ! -- dummy variables
3551  class(GwfCsubType) :: this
3552  integer(I4B), intent(in) :: isuppress_output
3553  type(BudgetType), intent(inout) :: model_budget !< model budget object
3554  ! -- local
3555  real(DP) :: rin
3556  real(DP) :: rout
3557  !
3558  ! -- interbed elastic storage (this%cg_stor)
3559  call rate_accumulator(this%cg_stor, rin, rout)
3560  call model_budget%addentry(rin, rout, delt, budtxt(1), &
3561  isuppress_output, ' CSUB')
3562  if (this%ninterbeds > 0) then
3563  !
3564  ! -- interbed elastic storage (this%storagee)
3565  call rate_accumulator(this%storagee, rin, rout)
3566  call model_budget%addentry(rin, rout, delt, budtxt(2), &
3567  isuppress_output, ' CSUB')
3568  !
3569  ! -- interbed elastic storage (this%storagei)
3570  call rate_accumulator(this%storagei, rin, rout)
3571  call model_budget%addentry(rin, rout, delt, budtxt(3), &
3572  isuppress_output, ' CSUB')
3573  end if
3574  call rate_accumulator(this%cell_wcstor, rin, rout)
3575  call model_budget%addentry(rin, rout, delt, budtxt(4), &
3576  isuppress_output, ' CSUB')
3577  return
This module contains the BudgetModule.
Definition: Budget.f90:20
subroutine, public rate_accumulator(flow, rin, rout)
@ brief Rate accumulator subroutine
Definition: Budget.f90:664
integer(i4b), parameter lenboundname
maximum length of a bound name
Definition: Constants.f90:35
real(dp), parameter dzero
real constant zero
Definition: Constants.f90:64
real(dp), parameter done
real constant 1
Definition: Constants.f90:75
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 7110 of file gwf-csub.f90.

7111  ! -- dummy variables
7112  class(GwfCsubType), intent(inout) :: this
7113  ! -- local variables
7114  type(ObserveType), pointer :: obsrv => null()
7115  integer(I4B) :: i
7116  integer(I4B) :: j
7117  integer(I4B) :: n
7118  integer(I4B) :: idelay
7119  integer(I4B) :: ncol
7120  integer(I4B) :: node
7121  real(DP) :: v
7122  real(DP) :: r
7123  real(DP) :: f
7124  !
7125  ! -- Fill simulated values for all csub observations
7126  if (this%obs%npakobs > 0) then
7127  call this%obs%obs_bd_clear()
7128  do i = 1, this%obs%npakobs
7129  obsrv => this%obs%pakobs(i)%obsrv
7130  if (obsrv%BndFound) then
7131  if (obsrv%ObsTypeId == 'SKE' .or. &
7132  obsrv%ObsTypeId == 'SK' .or. &
7133  obsrv%ObsTypeId == 'SKE-CELL' .or. &
7134  obsrv%ObsTypeId == 'SK-CELL' .or. &
7135  obsrv%ObsTypeId == 'DELAY-HEAD' .or. &
7136  obsrv%ObsTypeId == 'DELAY-PRECONSTRESS' .or. &
7137  obsrv%ObsTypeId == 'DELAY-GSTRESS' .or. &
7138  obsrv%ObsTypeId == 'DELAY-ESTRESS' .or. &
7139  obsrv%ObsTypeId == 'PRECONSTRESS-CELL') then
7140  if (this%gwfiss /= 0) then
7141  call this%obs%SaveOneSimval(obsrv, dnodata)
7142  else
7143  v = dzero
7144  do j = 1, obsrv%indxbnds_count
7145  n = obsrv%indxbnds(j)
7146  select case (obsrv%ObsTypeId)
7147  case ('SKE')
7148  v = this%ske(n)
7149  case ('SK')
7150  v = this%sk(n)
7151  case ('SKE-CELL')
7152  !
7153  ! -- add the coarse component
7154  if (j == 1) then
7155  v = this%cg_ske(n)
7156  else
7157  v = this%ske(n)
7158  end if
7159  case ('SK-CELL')
7160  !
7161  ! -- add the coarse component
7162  if (j == 1) then
7163  v = this%cg_sk(n)
7164  else
7165  v = this%sk(n)
7166  end if
7167  case ('DELAY-HEAD', 'DELAY-PRECONSTRESS', &
7168  'DELAY-GSTRESS', 'DELAY-ESTRESS')
7169  if (n > this%ndelaycells) then
7170  r = real(n - 1, dp) / real(this%ndelaycells, dp)
7171  idelay = int(floor(r)) + 1
7172  ncol = n - int(floor(r)) * this%ndelaycells
7173  else
7174  idelay = 1
7175  ncol = n
7176  end if
7177  select case (obsrv%ObsTypeId)
7178  case ('DELAY-HEAD')
7179  v = this%dbh(ncol, idelay)
7180  case ('DELAY-PRECONSTRESS')
7181  v = this%dbpcs(ncol, idelay)
7182  case ('DELAY-GSTRESS')
7183  v = this%dbgeo(ncol, idelay)
7184  case ('DELAY-ESTRESS')
7185  v = this%dbes(ncol, idelay)
7186  end select
7187  case ('PRECONSTRESS-CELL')
7188  v = this%pcs(n)
7189  case default
7190  errmsg = "Unrecognized observation type '"// &
7191  trim(obsrv%ObsTypeId)//"'."
7192  call store_error(errmsg)
7193  end select
7194  call this%obs%SaveOneSimval(obsrv, v)
7195  end do
7196  end if
7197  else
7198  v = dzero
7199  do j = 1, obsrv%indxbnds_count
7200  n = obsrv%indxbnds(j)
7201  select case (obsrv%ObsTypeId)
7202  case ('CSUB')
7203  v = this%storagee(n) + this%storagei(n)
7204  case ('INELASTIC-CSUB')
7205  v = this%storagei(n)
7206  case ('ELASTIC-CSUB')
7207  v = this%storagee(n)
7208  case ('COARSE-CSUB')
7209  v = this%cg_stor(n)
7210  case ('WCOMP-CSUB-CELL')
7211  v = this%cell_wcstor(n)
7212  case ('CSUB-CELL')
7213  !
7214  ! -- add the coarse component
7215  if (j == 1) then
7216  v = this%cg_stor(n)
7217  else
7218  v = this%storagee(n) + this%storagei(n)
7219  end if
7220  case ('THETA')
7221  v = this%theta(n)
7222  case ('COARSE-THETA')
7223  v = this%cg_theta(n)
7224  case ('THETA-CELL')
7225  !
7226  ! -- add the coarse component
7227  if (j == 1) then
7228  f = this%cg_thick(n) / this%cell_thick(n)
7229  v = f * this%cg_theta(n)
7230  else
7231  node = this%nodelist(n)
7232  f = this%csub_calc_interbed_thickness(n) / this%cell_thick(node)
7233  v = f * this%theta(n)
7234  end if
7235  case ('GSTRESS-CELL')
7236  v = this%cg_gs(n)
7237  case ('ESTRESS-CELL')
7238  v = this%cg_es(n)
7239  case ('INTERBED-COMPACTION')
7240  v = this%tcomp(n)
7241  case ('INELASTIC-COMPACTION')
7242  v = this%tcompi(n)
7243  case ('ELASTIC-COMPACTION')
7244  v = this%tcompe(n)
7245  case ('COARSE-COMPACTION')
7246  v = this%cg_tcomp(n)
7247  case ('INELASTIC-COMPACTION-CELL')
7248  !
7249  ! -- no coarse inelastic component
7250  if (j > 1) then
7251  v = this%tcompi(n)
7252  end if
7253  case ('ELASTIC-COMPACTION-CELL')
7254  !
7255  ! -- add the coarse component
7256  if (j == 1) then
7257  v = this%cg_tcomp(n)
7258  else
7259  v = this%tcompe(n)
7260  end if
7261  case ('COMPACTION-CELL')
7262  !
7263  ! -- add the coarse component
7264  if (j == 1) then
7265  v = this%cg_tcomp(n)
7266  else
7267  v = this%tcomp(n)
7268  end if
7269  case ('THICKNESS')
7270  idelay = this%idelay(n)
7271  v = this%thick(n)
7272  if (idelay /= 0) then
7273  v = v * this%rnb(n)
7274  end if
7275  case ('COARSE-THICKNESS')
7276  v = this%cg_thick(n)
7277  case ('THICKNESS-CELL')
7278  v = this%cell_thick(n)
7279  case ('DELAY-COMPACTION', 'DELAY-THICKNESS', &
7280  'DELAY-THETA')
7281  if (n > this%ndelaycells) then
7282  r = real(n, dp) / real(this%ndelaycells, dp)
7283  idelay = int(floor(r)) + 1
7284  ncol = mod(n, this%ndelaycells)
7285  else
7286  idelay = 1
7287  ncol = n
7288  end if
7289  select case (obsrv%ObsTypeId)
7290  case ('DELAY-COMPACTION')
7291  v = this%dbtcomp(ncol, idelay)
7292  case ('DELAY-THICKNESS')
7293  v = this%dbdz(ncol, idelay)
7294  case ('DELAY-THETA')
7295  v = this%dbtheta(ncol, idelay)
7296  end select
7297  case ('DELAY-FLOWTOP')
7298  idelay = this%idelay(n)
7299  v = this%dbflowtop(idelay)
7300  case ('DELAY-FLOWBOT')
7301  idelay = this%idelay(n)
7302  v = this%dbflowbot(idelay)
7303  case default
7304  errmsg = "Unrecognized observation type: '"// &
7305  trim(obsrv%ObsTypeId)//"'."
7306  call store_error(errmsg)
7307  end select
7308  call this%obs%SaveOneSimval(obsrv, v)
7309  end do
7310  end if
7311  else
7312  call this%obs%SaveOneSimval(obsrv, dnodata)
7313  end if
7314  end do
7315  !
7316  ! -- write summary of package error messages
7317  if (count_errors() > 0) then
7318  call this%parser%StoreErrorUnit()
7319  end if
7320  end if
7321  !
7322  return
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 5542 of file gwf-csub.f90.

5543  ! -- dummy variables
5544  class(GwfCsubType), intent(inout) :: this
5545  integer(I4B), intent(in) :: node !< cell node number
5546  real(DP), intent(in) :: es0 !< effective stress at elevation z0
5547  real(DP), intent(in) :: z0 !< elevation effective stress is calculate at
5548  real(DP), intent(in) :: z !< elevation to calculate effective stress at
5549  ! -- local variables
5550  real(DP) :: es
5551  !
5552  ! -- adjust effective stress to vertical node position
5553  es = es0 - (z - z0) * (this%sgs(node) - done)
5554  !
5555  ! -- return
5556  return

◆ 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 6876 of file gwf-csub.f90.

6877  ! -- dummy variables
6878  class(GwfCsubType), intent(inout) :: this
6879  integer(I4B), intent(in) :: ib !< interbed number
6880  integer(I4B), intent(in) :: n !< delay interbed cell
6881  real(DP), intent(in) :: hcell !< current head in cell
6882  ! -- local variables
6883  integer(I4B) :: idelay
6884  real(DP) :: q
6885  real(DP) :: c
6886  !
6887  ! -- calculate flow between delay interbed and GWF
6888  idelay = this%idelay(ib)
6889  c = dtwo * this%kv(ib) / this%dbdzini(n, idelay)
6890  q = c * (hcell - this%dbh(n, idelay))
6891  !
6892  ! -- return
6893  return

◆ 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 5483 of file gwf-csub.f90.

5484  ! -- dummy variables
5485  class(GwfCsubType), intent(inout) :: this
5486  integer(I4B), intent(in) :: ib !< interbed number
5487  ! -- local variables
5488  integer(I4B) :: idelay
5489  real(DP) :: thick
5490  !
5491  ! -- calculate interbed thickness
5492  idelay = this%idelay(ib)
5493  thick = this%thick(ib)
5494  if (idelay /= 0) then
5495  thick = thick * this%rnb(ib)
5496  end if
5497  !
5498  ! -- return
5499  return

◆ 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 5619 of file gwf-csub.f90.

5620  ! -- dummy variables
5621  class(GwfCsubType), intent(inout) :: this
5622  integer(I4B), intent(in) :: node !< cell node number
5623  real(DP), intent(in) :: hcell !< current head
5624  real(DP), intent(in) :: hcellold !< previous head
5625  real(DP), intent(inout) :: snnew !< current saturation
5626  real(DP), intent(inout) :: snold !< previous saturation
5627  ! -- local variables
5628  real(DP) :: top
5629  real(DP) :: bot
5630  !
5631  ! -- calculate cell saturation
5632  if (this%stoiconv(node) /= 0) then
5633  top = this%dis%top(node)
5634  bot = this%dis%bot(node)
5635  snnew = squadraticsaturation(top, bot, hcell, this%satomega)
5636  snold = squadraticsaturation(top, bot, hcellold, this%satomega)
5637  else
5638  snnew = done
5639  snold = done
5640  end if
5641  if (this%ieslag /= 0) then
5642  snold = snnew
5643  end if
5644  !
5645  ! -- return
5646  return
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 5656 of file gwf-csub.f90.

5657  ! -- dummy variables
5658  class(GwfCsubType), intent(inout) :: this
5659  integer(I4B), intent(in) :: node !< cell node number
5660  real(DP), intent(in) :: hcell !< current head
5661  ! -- local variables
5662  real(DP) :: satderv
5663  real(DP) :: top
5664  real(DP) :: bot
5665 ! ------------------------------------------------------------------------------
5666  if (this%stoiconv(node) /= 0) then
5667  top = this%dis%top(node)
5668  bot = this%dis%bot(node)
5669  satderv = squadraticsaturationderivative(top, bot, hcell, this%satomega)
5670  else
5671  satderv = dzero
5672  end if
5673  !
5674  ! -- return
5675  return
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 5687 of file gwf-csub.f90.

5688  ! -- dummy variables
5689  class(GwfCsubType), intent(inout) :: this
5690  integer(I4B), intent(in) :: node !< cell node number
5691  real(DP), intent(in) :: bot !
5692  real(DP), intent(in) :: znode
5693  real(DP), intent(in) :: theta !< porosity
5694  real(DP), intent(in) :: es !< current effective stress
5695  real(DP), intent(in) :: es0 !< previous effective stress
5696  real(DP), intent(inout) :: fact !< skeletal storage coefficient factor (1/((1+void_ratio)*bar(es)))
5697  ! -- local variables
5698  real(DP) :: esv
5699  real(DP) :: void_ratio
5700  real(DP) :: denom
5701  !
5702  ! -- initialize variables
5703  fact = dzero
5704  if (this%ieslag /= 0) then
5705  esv = es0
5706  else
5707  esv = es
5708  end if
5709  !
5710  ! -- calculate storage factors for the effective stress case
5711  void_ratio = this%csub_calc_void_ratio(theta)
5712  denom = this%csub_calc_adjes(node, esv, bot, znode)
5713  denom = denom * (done + void_ratio)
5714  if (denom /= dzero) then
5715  fact = done / denom
5716  end if
5717  !
5718  ! -- return
5719  return

◆ 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 5463 of file gwf-csub.f90.

5464  ! -- dummy variables
5465  class(GwfCsubType), intent(inout) :: this
5466  real(DP), intent(in) :: void_ratio
5467  ! -- local variables
5468  real(DP) :: theta
5469  !
5470  ! -- calculate theta
5471  theta = void_ratio / (done + void_ratio)
5472  !
5473  ! -- return
5474  return

◆ 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 5444 of file gwf-csub.f90.

5445  ! -- dummy variables
5446  class(GwfCsubType), intent(inout) :: this
5447  real(DP), intent(in) :: theta !< porosity
5448  ! -- local variables
5449  real(DP) :: void_ratio
5450  ! -- calculate void ratio
5451  void_ratio = theta / (done - theta)
5452  !
5453  ! -- return
5454  return

◆ 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 5512 of file gwf-csub.f90.

5513  ! -- dummy variables
5514  class(GwfCsubType), intent(inout) :: this
5515  real(DP), intent(in) :: top !< top of cell
5516  real(DP), intent(in) :: bottom !< bottom of cell
5517  real(DP), intent(in) :: zbar !< corrected elevation
5518  ! -- local variables
5519  real(DP) :: znode
5520  real(DP) :: v
5521  !
5522  ! -- calculate the node elevation
5523  if (zbar > top) then
5524  v = top
5525  else
5526  v = zbar
5527  end if
5528  znode = dhalf * (v + bottom)
5529  !
5530  ! -- return
5531  return

◆ 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 
)

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 3017 of file gwf-csub.f90.

3019  ! -- modules
3020  use tdismodule, only: totim, kstp, kper, delt
3021  ! -- dummy variables
3022  class(GwfCsubType) :: this
3023  integer(I4B), intent(in) :: innertot !< total number of inner iterations
3024  integer(I4B), intent(in) :: kiter !< outer iteration number
3025  integer(I4B), intent(in) :: iend !< flag indicating if it is the last iteration
3026  integer(I4B), intent(in) :: icnvgmod !< flag indicating if the solution is considered converged
3027  integer(I4B), intent(in) :: nodes !< number of active nodes
3028  real(DP), dimension(nodes), intent(in) :: hnew !< current gwf head
3029  real(DP), dimension(nodes), intent(in) :: hold !< gwf for previous time step
3030  character(len=LENPAKLOC), intent(inout) :: cpak !< string location of the maximum change in csub package
3031  integer(I4B), intent(inout) :: ipak !< node with the maximum change in csub package
3032  real(DP), intent(inout) :: dpak !< maximum change in csub package
3033  ! -- local variables
3034  character(len=LINELENGTH) :: tag
3035  character(len=LENPAKLOC) :: cloc
3036  integer(I4B) :: icheck
3037  integer(I4B) :: ipakfail
3038  integer(I4B) :: ntabrows
3039  integer(I4B) :: ntabcols
3040  integer(I4B) :: ib
3041  integer(I4B) :: node
3042  integer(I4B) :: idelay
3043  integer(I4B) :: locdhmax
3044  integer(I4B) :: locrmax
3045  integer(I4B) :: ifirst
3046  real(DP) :: dhmax
3047  real(DP) :: rmax
3048  real(DP) :: dh
3049  real(DP) :: area
3050  real(DP) :: hcell
3051  real(DP) :: hcellold
3052  real(DP) :: snnew
3053  real(DP) :: snold
3054  real(DP) :: stoe
3055  real(DP) :: stoi
3056  real(DP) :: dwc
3057  real(DP) :: tled
3058  real(DP) :: hcof
3059  real(DP) :: rhs
3060  real(DP) :: v1
3061  real(DP) :: v2
3062  real(DP) :: df
3063  !
3064  ! -- initialize local variables
3065  icheck = this%iconvchk
3066  ipakfail = 0
3067  locdhmax = 0
3068  locrmax = 0
3069  dhmax = dzero
3070  rmax = dzero
3071  ifirst = 1
3072  !
3073  ! -- additional checks to see if convergence needs to be checked
3074  ! -- no convergence check for steady-state stress periods
3075  if (this%gwfiss /= 0) then
3076  icheck = 0
3077  else
3078  !
3079  ! -- if not saving package convergence data on check convergence if
3080  ! the model is considered converged
3081  if (this%ipakcsv == 0) then
3082  if (icnvgmod == 0) then
3083  icheck = 0
3084  end if
3085  else
3086  !
3087  ! -- header for package csv
3088  if (.not. associated(this%pakcsvtab)) then
3089  !
3090  ! -- determine the number of columns and rows
3091  ntabrows = 1
3092  ntabcols = 9
3093  !
3094  ! -- setup table
3095  call table_cr(this%pakcsvtab, this%packName, '')
3096  call this%pakcsvtab%table_df(ntabrows, ntabcols, this%ipakcsv, &
3097  lineseparator=.false., separator=',', &
3098  finalize=.false.)
3099  !
3100  ! -- add columns to package csv
3101  tag = 'total_inner_iterations'
3102  call this%pakcsvtab%initialize_column(tag, 10, alignment=tableft)
3103  tag = 'totim'
3104  call this%pakcsvtab%initialize_column(tag, 10, alignment=tableft)
3105  tag = 'kper'
3106  call this%pakcsvtab%initialize_column(tag, 10, alignment=tableft)
3107  tag = 'kstp'
3108  call this%pakcsvtab%initialize_column(tag, 10, alignment=tableft)
3109  tag = 'nouter'
3110  call this%pakcsvtab%initialize_column(tag, 10, alignment=tableft)
3111  tag = 'dvmax'
3112  call this%pakcsvtab%initialize_column(tag, 15, alignment=tableft)
3113  tag = 'dvmax_loc'
3114  call this%pakcsvtab%initialize_column(tag, 15, alignment=tableft)
3115  tag = 'dstoragemax'
3116  call this%pakcsvtab%initialize_column(tag, 15, alignment=tableft)
3117  tag = 'dstoragemax_loc'
3118  call this%pakcsvtab%initialize_column(tag, 15, alignment=tableft)
3119  end if
3120  end if
3121  end if
3122  !
3123  ! -- perform package convergence check
3124  if (icheck /= 0) then
3125  if (delt > dzero) then
3126  tled = done / delt
3127  else
3128  tled = dzero
3129  end if
3130  final_check: do ib = 1, this%ninterbeds
3131  idelay = this%idelay(ib)
3132  node = this%nodelist(ib)
3133  !
3134  ! -- skip nodelay interbeds
3135  if (idelay == 0) cycle
3136  !
3137  ! -- skip inactive cells
3138  if (this%ibound(node) < 1) cycle
3139  !
3140  ! -- evaluate the maximum head change in the interbed
3141  dh = this%dbdhmax(idelay)
3142  !
3143  ! -- evaluate difference between storage changes
3144  ! in the interbed and exchange between the interbed
3145  ! and the gwf cell
3146  area = this%dis%get_area(node)
3147  hcell = hnew(node)
3148  hcellold = hold(node)
3149  !
3150  ! -- calculate cell saturation
3151  call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
3152  !
3153  ! -- calculate the change in storage
3154  call this%csub_delay_calc_dstor(ib, hcell, stoe, stoi)
3155  v1 = (stoe + stoi) * area * this%rnb(ib) * tled
3156  !
3157  ! -- add water compressibility to storage term
3158  call this%csub_delay_calc_wcomp(ib, dwc)
3159  v1 = v1 + dwc * area * this%rnb(ib)
3160  !
3161  ! -- calculate the flow between the interbed and the cell
3162  call this%csub_delay_fc(ib, hcof, rhs)
3163  v2 = (-hcof * hcell - rhs) * area * this%rnb(ib)
3164  !
3165  ! -- calculate the difference between the interbed change in
3166  ! storage and the flow between the interbed and the cell
3167  df = v2 - v1
3168  !
3169  ! -- normalize by cell area and convert to a depth
3170  df = df * delt / area
3171  !
3172  ! -- evaluate magnitude of differences
3173  if (ifirst == 1) then
3174  ifirst = 0
3175  locdhmax = ib
3176  dhmax = dh
3177  locrmax = ib
3178  rmax = df
3179  else
3180  if (abs(dh) > abs(dhmax)) then
3181  locdhmax = ib
3182  dhmax = dh
3183  end if
3184  if (abs(df) > abs(rmax)) then
3185  locrmax = ib
3186  rmax = df
3187  end if
3188  end if
3189  end do final_check
3190  !
3191  ! -- set dpak and cpak
3192  ! -- update head error
3193  if (abs(dhmax) > abs(dpak)) then
3194  ipak = locdhmax
3195  dpak = dhmax
3196  write (cloc, "(a,'-',a)") trim(this%packName), 'head'
3197  cpak = cloc
3198  end if
3199  !
3200  ! -- update storage error
3201  if (abs(rmax) > abs(dpak)) then
3202  ipak = locrmax
3203  dpak = rmax
3204  write (cloc, "(a,'-',a)") trim(this%packName), 'storage'
3205  cpak = cloc
3206  end if
3207  !
3208  ! -- write convergence data to package csv
3209  if (this%ipakcsv /= 0) then
3210  !
3211  ! -- write the data
3212  call this%pakcsvtab%add_term(innertot)
3213  call this%pakcsvtab%add_term(totim)
3214  call this%pakcsvtab%add_term(kper)
3215  call this%pakcsvtab%add_term(kstp)
3216  call this%pakcsvtab%add_term(kiter)
3217  call this%pakcsvtab%add_term(dhmax)
3218  call this%pakcsvtab%add_term(locdhmax)
3219  call this%pakcsvtab%add_term(rmax)
3220  call this%pakcsvtab%add_term(locrmax)
3221  !
3222  ! -- finalize the package csv
3223  if (iend == 1) then
3224  call this%pakcsvtab%finalize_table()
3225  end if
3226  end if
3227  end if
3228  !
3229  ! -- return
3230  return
real(dp), pointer, public totim
time relative to start of simulation
Definition: tdis.f90:32
integer(i4b), pointer, public kstp
current time step number
Definition: tdis.f90:24
Here is the call graph for this function:

◆ 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 5130 of file gwf-csub.f90.

5131  ! -- dummy variables
5132  class(GwfCsubType) :: this
5133  integer(I4B), intent(in) :: node !< cell node number
5134  real(DP), intent(in) :: hcell !< current head in cell
5135  real(DP), intent(in) :: hcellold !< previous head in cell
5136  real(DP), intent(inout) :: comp !< coarse-grained compaction
5137  ! -- local variables
5138  real(DP) :: area
5139  real(DP) :: tled
5140  real(DP) :: hcof
5141  real(DP) :: rhs
5142  !
5143  ! -- initialize variables
5144  area = done
5145  tled = done
5146  !
5147  ! -- calculate terms
5148  call this%csub_cg_fc(node, tled, area, hcell, hcellold, hcof, rhs)
5149  !
5150  ! - calculate compaction
5151  comp = hcof * hcell - rhs
5152  !
5153  ! -- return
5154  return

◆ 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 5071 of file gwf-csub.f90.

5072  ! -- dummy variables
5073  class(GwfCsubType), intent(inout) :: this
5074  integer(I4B), intent(in) :: n !< cell node number
5075  real(DP), intent(inout) :: sske !< coarse grained Sske
5076  real(DP), intent(in) :: hcell !< current head in cell
5077  ! -- local variables
5078  real(DP) :: top
5079  real(DP) :: bot
5080  real(DP) :: hbar
5081  real(DP) :: znode
5082  real(DP) :: es
5083  real(DP) :: es0
5084  real(DP) :: theta
5085  real(DP) :: f
5086  real(DP) :: f0
5087  !
5088  ! -- initialize variables
5089  sske = dzero
5090  !
5091  ! -- calculate factor for the head-based case
5092  if (this%lhead_based .EQV. .true.) then
5093  f = done
5094  f0 = done
5095  !
5096  ! -- calculate factor for the effective stress case
5097  else
5098  top = this%dis%top(n)
5099  bot = this%dis%bot(n)
5100  !
5101  ! -- calculate corrected head (hbar)
5102  hbar = squadratic0sp(hcell, bot, this%satomega)
5103  !
5104  ! -- calculate znode
5105  znode = this%csub_calc_znode(top, bot, hbar)
5106  !
5107  ! -- calculate effective stress and theta
5108  es = this%cg_es(n)
5109  es0 = this%cg_es0(n)
5110  theta = this%cg_thetaini(n)
5111  !
5112  ! -- calculate the compression index factors for the delay
5113  ! node relative to the center of the cell based on the
5114  ! current and previous head
5115  call this%csub_calc_sfacts(n, bot, znode, theta, es, es0, f)
5116  end if
5117  sske = f * this%cg_ske_cr(n)
5118  !
5119  ! -- return
5120  return
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 3947 of file gwf-csub.f90.

3948  ! -- dummy variables
3949  class(GwfCsubType) :: this
3950  integer(I4B), intent(in) :: nodes !< number of active model nodes
3951  real(DP), dimension(nodes), intent(in) :: hnew !< current head
3952  ! -- local variables
3953  integer(I4B) :: node
3954  integer(I4B) :: ii
3955  integer(I4B) :: nn
3956  integer(I4B) :: m
3957  integer(I4B) :: idx_conn
3958  real(DP) :: gs
3959  real(DP) :: top
3960  real(DP) :: bot
3961  real(DP) :: thick
3962  real(DP) :: va_scale
3963  real(DP) :: hcell
3964  real(DP) :: hbar
3965  real(DP) :: gs_conn
3966  real(DP) :: es
3967  real(DP) :: phead
3968  real(DP) :: sadd
3969  !
3970  ! -- calculate geostatic stress if necessary
3971  if (this%iupdatestress /= 0) then
3972  do node = 1, this%dis%nodes
3973  !
3974  ! -- calculate geostatic stress for this node
3975  ! this represents the geostatic stress component
3976  ! for the cell
3977  top = this%dis%top(node)
3978  bot = this%dis%bot(node)
3979  thick = top - bot
3980  !
3981  ! -- calculate cell contribution to geostatic stress
3982  if (this%ibound(node) /= 0) then
3983  hcell = hnew(node)
3984  else
3985  hcell = bot
3986  end if
3987  !
3988  ! -- calculate corrected head (hbar)
3989  hbar = squadratic0sp(hcell, bot, this%satomega)
3990  !
3991  ! -- geostatic stress calculation
3992  if (hcell < top) then
3993  gs = (top - hbar) * this%sgm(node) + (hbar - bot) * this%sgs(node)
3994  else
3995  gs = thick * this%sgs(node)
3996  end if
3997  !
3998  ! -- cell contribution to geostatic stress
3999  this%cg_gs(node) = gs
4000  end do
4001  !
4002  ! -- add user specified overlying geostatic stress
4003  do nn = 1, this%nbound
4004  node = this%nodelistsig0(nn)
4005  sadd = this%sig0(nn)
4006  this%cg_gs(node) = this%cg_gs(node) + sadd
4007  end do
4008  !
4009  ! -- calculate geostatic stress above cell
4010  do node = 1, this%dis%nodes
4011  !
4012  ! -- geostatic stress of cell
4013  gs = this%cg_gs(node)
4014  !
4015  ! -- Add geostatic stress of overlying cells (ihc=0)
4016  ! m < node = m is vertically above node
4017  do ii = this%dis%con%ia(node) + 1, this%dis%con%ia(node + 1) - 1
4018  !
4019  ! -- Set the m cell number
4020  m = this%dis%con%ja(ii)
4021  idx_conn = this%dis%con%jas(ii)
4022  !
4023  ! -- vertical connection
4024  if (this%dis%con%ihc(idx_conn) == 0) then
4025  !
4026  ! -- node has an overlying cell
4027  if (m < node) then
4028  !
4029  ! -- dis and disv discretization
4030  if (this%dis%ndim /= 1) then
4031  gs = gs + this%cg_gs(m)
4032  !
4033  ! -- disu discretization
4034  else
4035  va_scale = this%dis%get_area_factor(node, idx_conn)
4036  gs_conn = this%cg_gs(m)
4037  gs = gs + (gs_conn * va_scale)
4038  end if
4039  end if
4040  end if
4041  end do
4042  !
4043  ! -- geostatic stress for cell with geostatic stress
4044  ! of overlying cells
4045  this%cg_gs(node) = gs
4046  end do
4047  end if
4048  !
4049  ! -- save effective stress from the last iteration and
4050  ! calculate the new effective stress for a cell
4051  do node = 1, this%dis%nodes
4052  top = this%dis%top(node)
4053  bot = this%dis%bot(node)
4054  if (this%ibound(node) /= 0) then
4055  hcell = hnew(node)
4056  else
4057  hcell = bot
4058  end if
4059  !
4060  ! -- calculate corrected head (hbar)
4061  hbar = squadratic0sp(hcell, bot, this%satomega)
4062  !
4063  ! -- calculate pressure head
4064  phead = hbar - bot
4065  !
4066  ! -- calculate effective stress
4067  es = this%cg_gs(node) - phead
4068  this%cg_es(node) = es
4069  end do
4070  !
4071  ! -- return
4072  return
4073 
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 4084 of file gwf-csub.f90.

4085  ! -- dummy variables
4086  class(GwfCsubType) :: this
4087  ! -- local variables
4088  character(len=20) :: cellid
4089  integer(I4B) :: ierr
4090  integer(I4B) :: node
4091  real(DP) :: gs
4092  real(DP) :: bot
4093  real(DP) :: hcell
4094  real(DP) :: es
4095  real(DP) :: phead
4096  !
4097  ! -- initialize variables
4098  ierr = 0
4099  !
4100  ! -- check geostatic stress if necessary
4101  !
4102  ! -- save effective stress from the last iteration and
4103  ! calculate the new effective stress for a cell
4104  do node = 1, this%dis%nodes
4105  if (this%ibound(node) < 1) cycle
4106  bot = this%dis%bot(node)
4107  gs = this%cg_gs(node)
4108  es = this%cg_es(node)
4109  phead = dzero
4110  if (this%ibound(node) /= 0) then
4111  phead = gs - es
4112  end if
4113  hcell = phead + bot
4114  if (this%lhead_based .EQV. .false.) then
4115  if (es < dem6) then
4116  ierr = ierr + 1
4117  call this%dis%noder_to_string(node, cellid)
4118  write (errmsg, '(a,g0,a,1x,a,1x,a,4(g0,a))') &
4119  'Small to negative effective stress (', es, ') in cell', &
4120  trim(adjustl(cellid)), '. (', es, ' = ', this%cg_gs(node), &
4121  ' - (', hcell, ' - ', bot, ').'
4122  call store_error(errmsg)
4123  end if
4124  end if
4125  end do
4126  !
4127  ! -- write a summary error message
4128  if (ierr > 0) then
4129  write (errmsg, '(a,1x,i0,3(1x,a))') &
4130  'Solution: small to negative effective stress values in', ierr, &
4131  'cells can be eliminated by increasing storage values and/or ', &
4132  'adding/modifying stress boundaries to prevent water-levels from', &
4133  'exceeding the top of the model.'
4134  call store_error(errmsg)
4135  call this%parser%StoreErrorUnit()
4136  end if
4137  !
4138  ! -- return
4139  return
4140 
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 4745 of file gwf-csub.f90.

4746  ! -- dummy variables
4747  class(GwfCsubType) :: this
4748  integer(I4B), intent(in) :: node !< cell node number
4749  real(DP), intent(in) :: tled !< recripicol of the time step length
4750  real(DP), intent(in) :: area !< horizontal cell area
4751  real(DP), intent(in) :: hcell !< current head
4752  real(DP), intent(in) :: hcellold !< previous head
4753  real(DP), intent(inout) :: hcof !< coarse-grained A matrix entry
4754  real(DP), intent(inout) :: rhs !< coarse-grained right-hand side entry
4755  ! -- local variables
4756  real(DP) :: top
4757  real(DP) :: bot
4758  real(DP) :: tthk
4759  real(DP) :: snold
4760  real(DP) :: snnew
4761  real(DP) :: hbar
4762  real(DP) :: sske
4763  real(DP) :: rho1
4764  !
4765  ! -- initialize variables
4766  rhs = dzero
4767  hcof = dzero
4768  !
4769  ! -- aquifer elevations and thickness
4770  top = this%dis%top(node)
4771  bot = this%dis%bot(node)
4772  tthk = this%cg_thickini(node)
4773  !
4774  ! -- calculate hcof and rhs terms if coarse-grained materials present
4775  if (tthk > dzero) then
4776  !
4777  ! -- calculate aquifer saturation
4778  call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4779  !
4780  ! -- calculate corrected head (hbar)
4781  hbar = squadratic0sp(hcell, bot, this%satomega)
4782  !
4783  ! -- storage coefficients
4784  call this%csub_cg_calc_sske(node, sske, hcell)
4785  rho1 = sske * area * tthk * tled
4786  !
4787  ! -- update sk and ske
4788  this%cg_ske(node) = sske * tthk * snold
4789  this%cg_sk(node) = sske * tthk * snnew
4790  !
4791  ! -- calculate hcof and rhs term
4792  hcof = -rho1 * snnew
4793  rhs = rho1 * snold * this%cg_es0(node) - &
4794  rho1 * snnew * (this%cg_gs(node) + bot)
4795  !
4796  ! -- calculate and apply the flow correction term
4797  rhs = rhs - rho1 * snnew * (hcell - hbar)
4798  end if
4799  !
4800  ! -- return
4801  return
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 4814 of file gwf-csub.f90.

4815  ! -- dummy variables
4816  class(GwfCsubType) :: this
4817  integer(I4B), intent(in) :: node !< node number
4818  real(DP), intent(in) :: tled !< reciprocal of the time step length
4819  real(DP), intent(in) :: area !< horizontal cell area
4820  real(DP), intent(in) :: hcell !< current head in cell
4821  real(DP), intent(inout) :: hcof !< coarse-grained A matrix entry
4822  real(DP), intent(inout) :: rhs !< coarse-grained right-hand side entry
4823  ! -- local variables
4824  real(DP) :: top
4825  real(DP) :: bot
4826  real(DP) :: tthk
4827  real(DP) :: snnew
4828  real(DP) :: snold
4829  real(DP) :: satderv
4830  real(DP) :: hbar
4831  real(DP) :: hbarderv
4832  real(DP) :: sske
4833  real(DP) :: rho1
4834  !
4835  ! -- initialize variables
4836  rhs = dzero
4837  hcof = dzero
4838  !
4839  ! -- aquifer elevations and thickness
4840  top = this%dis%top(node)
4841  bot = this%dis%bot(node)
4842  tthk = this%cg_thickini(node)
4843  !
4844  ! -- calculate newton terms if coarse-grained materials present
4845  if (tthk > dzero) then
4846  !
4847  ! -- calculate aquifer saturation - only need snnew
4848  call this%csub_calc_sat(node, hcell, top, snnew, snold)
4849  !
4850  ! -- calculate saturation derivative
4851  satderv = this%csub_calc_sat_derivative(node, hcell)
4852  !
4853  ! -- calculate corrected head (hbar)
4854  hbar = squadratic0sp(hcell, bot, this%satomega)
4855  !
4856  ! -- calculate the derivative of the hbar functions
4857  hbarderv = squadratic0spderivative(hcell, bot, this%satomega)
4858  !
4859  ! -- storage coefficients
4860  call this%csub_cg_calc_sske(node, sske, hcell)
4861  rho1 = sske * area * tthk * tled
4862  !
4863  ! -- calculate hcof term
4864  hcof = rho1 * snnew * (done - hbarderv) + &
4865  rho1 * (this%cg_gs(node) - hbar + bot) * satderv
4866  !
4867  ! -- Add additional term if using lagged effective stress
4868  if (this%ieslag /= 0) then
4869  hcof = hcof - rho1 * this%cg_es0(node) * satderv
4870  end if
4871  !
4872  ! -- calculate rhs term
4873  rhs = hcof * hcell
4874  end if
4875  !
4876  ! -- return
4877  return
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 5162 of file gwf-csub.f90.

5163  ! -- dummy variables
5164  class(GwfCsubType), intent(inout) :: this
5165  integer(I4B), intent(in) :: node !< cell node number
5166  ! -- local variables
5167  character(len=20) :: cellid
5168  real(DP) :: comp
5169  real(DP) :: thick
5170  real(DP) :: theta
5171  !
5172  ! -- update thickness and theta
5173  comp = this%cg_tcomp(node) + this%cg_comp(node)
5174  call this%dis%noder_to_string(node, cellid)
5175  if (abs(comp) > dzero) then
5176  thick = this%cg_thickini(node)
5177  theta = this%cg_thetaini(node)
5178  call this%csub_adj_matprop(comp, thick, theta)
5179  if (thick <= dzero) then
5180  write (errmsg, '(a,1x,a,1x,a,g0,a)') &
5181  'Adjusted thickness for cell', trim(adjustl(cellid)), &
5182  'is less than or equal to 0 (', thick, ').'
5183  call store_error(errmsg)
5184  end if
5185  if (theta <= dzero) then
5186  write (errmsg, '(a,1x,a,1x,a,g0,a)') &
5187  'Adjusted theta for cell', trim(adjustl(cellid)), &
5188  'is less than or equal to 0 (', theta, ').'
5189  call store_error(errmsg)
5190  end if
5191  this%cg_thick(node) = thick
5192  this%cg_theta(node) = theta
5193  end if
5194  !
5195  ! -- return
5196  return
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 5209 of file gwf-csub.f90.

5211  ! -- dummy variables
5212  class(GwfCsubType), intent(inout) :: this
5213  integer(I4B), intent(in) :: node !< cell node number
5214  real(DP), intent(in) :: tled !< reciprocal of the time step length
5215  real(DP), intent(in) :: area !< horizontal cell area
5216  real(DP), intent(in) :: hcell !< current head in cell
5217  real(DP), intent(in) :: hcellold !< previous head in cell
5218  real(DP), intent(inout) :: hcof !< coarse-grained A matrix entry
5219  real(DP), intent(inout) :: rhs !< coarse-grained right-hand side entry
5220  ! -- local variables
5221  real(DP) :: top
5222  real(DP) :: bot
5223  real(DP) :: tthk
5224  real(DP) :: tthk0
5225  real(DP) :: snold
5226  real(DP) :: snnew
5227  real(DP) :: wc
5228  real(DP) :: wc0
5229  !
5230  ! -- initialize variables
5231  rhs = dzero
5232  hcof = dzero
5233  !
5234  ! -- aquifer elevations and thickness
5235  top = this%dis%top(node)
5236  bot = this%dis%bot(node)
5237  tthk = this%cg_thick(node)
5238  tthk0 = this%cg_thick0(node)
5239  !
5240  ! -- aquifer saturation
5241  call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
5242  !
5243  ! -- storage coefficients
5244  wc0 = this%brg * area * tthk0 * this%cg_theta0(node) * tled
5245  wc = this%brg * area * tthk * this%cg_theta(node) * tled
5246  !
5247  ! -- calculate hcof term
5248  hcof = -wc * snnew
5249  !
5250  ! -- calculate rhs term
5251  rhs = -wc0 * snold * hcellold
5252  !
5253  ! -- return
5254  return

◆ 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 5267 of file gwf-csub.f90.

5268  ! -- dummy variables
5269  class(GwfCsubType), intent(inout) :: this
5270  integer(I4B), intent(in) :: node !< cell node number
5271  real(DP), intent(in) :: tled !< reciprocal of the time step length
5272  real(DP), intent(in) :: area !< horizontal cell area
5273  real(DP), intent(in) :: hcell !< current head in cell
5274  real(DP), intent(in) :: hcellold !< previous head in cell
5275  real(DP), intent(inout) :: hcof !< coarse-grained A matrix entry
5276  real(DP), intent(inout) :: rhs !< coarse-grained right-hand side entry
5277  ! -- local variables
5278  real(DP) :: top
5279  real(DP) :: bot
5280  real(DP) :: tthk
5281  real(DP) :: tthk0
5282  real(DP) :: satderv
5283  real(DP) :: f
5284  real(DP) :: wc
5285  real(DP) :: wc0
5286  !
5287  ! -- initialize variables
5288  rhs = dzero
5289  hcof = dzero
5290  !
5291  ! -- aquifer elevations and thickness
5292  top = this%dis%top(node)
5293  bot = this%dis%bot(node)
5294  tthk = this%cg_thick(node)
5295  !
5296  ! -- calculate saturation derivative
5297  satderv = this%csub_calc_sat_derivative(node, hcell)
5298  !
5299  ! -- calculate water compressibility factor
5300  f = this%brg * area * tled
5301  !
5302  ! -- water compressibility coefficient
5303  wc = f * tthk * this%cg_theta(node)
5304  !
5305  ! -- calculate hcof term
5306  hcof = -wc * hcell * satderv
5307  !
5308  ! -- Add additional term if using lagged effective stress
5309  if (this%ieslag /= 0) then
5310  tthk0 = this%cg_thick0(node)
5311  wc0 = f * tthk0 * this%cg_theta0(node)
5312  hcof = hcof + wc * hcellold * satderv
5313  end if
5314  !
5315  ! -- calculate rhs term
5316  rhs = hcof * hcell
5317  !
5318  ! -- return
5319  return

◆ 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 3242 of file gwf-csub.f90.

3243  ! -- modules
3244  use tdismodule, only: delt
3245  use constantsmodule, only: lenboundname, dzero, done
3246  ! -- dummy variables
3247  class(GwfCsubType) :: this
3248  integer(I4B), intent(in) :: nodes !< number of active model nodes
3249  real(DP), intent(in), dimension(nodes) :: hnew !< current head
3250  real(DP), intent(in), dimension(nodes) :: hold !< head for the previous time step
3251  integer(I4B), intent(in) :: isuppress_output !< flag indicating if budget output should be suppressed
3252  real(DP), dimension(:), contiguous, intent(inout) :: flowja
3253  ! -- local variables
3254  integer(I4B) :: ib
3255  integer(I4B) :: idelay
3256  integer(I4B) :: ielastic
3257  integer(I4B) :: iconvert
3258  integer(I4B) :: node
3259  integer(I4B) :: nn
3260  integer(I4B) :: n
3261  integer(I4B) :: idiag
3262  real(DP) :: es
3263  real(DP) :: pcs
3264  real(DP) :: rho1
3265  real(DP) :: rho2
3266  real(DP) :: tled
3267  real(DP) :: tledm
3268  real(DP) :: es0
3269  real(DP) :: rrate
3270  real(DP) :: ratein
3271  real(DP) :: rateout
3272  real(DP) :: comp
3273  real(DP) :: compi
3274  real(DP) :: compe
3275  real(DP) :: area
3276  real(DP) :: h
3277  real(DP) :: h0
3278  real(DP) :: snnew
3279  real(DP) :: snold
3280  real(DP) :: hcof
3281  real(DP) :: rhs
3282  real(DP) :: stoe
3283  real(DP) :: stoi
3284  real(DP) :: b
3285  real(DP) :: q
3286  real(DP) :: rratewc
3287  ! -- for observations
3288  integer(I4B) :: iprobslocal
3289  ! -- formats
3290  !
3291  ! -- Suppress saving of simulated values; they
3292  ! will be saved at end of this procedure.
3293  iprobslocal = 0
3294  ratein = dzero
3295  rateout = dzero
3296  !
3297  ! -- coarse-grained coarse-grained storage
3298  do node = 1, this%dis%nodes
3299  idiag = this%dis%con%ia(node)
3300  area = this%dis%get_area(node)
3301  comp = dzero
3302  rrate = dzero
3303  rratewc = dzero
3304  if (this%gwfiss == 0) then
3305  if (delt > dzero) then
3306  tled = done / delt
3307  else
3308  tled = dzero
3309  end if
3310  if (this%ibound(node) > 0 .and. this%cg_thickini(node) > dzero) then
3311  !
3312  ! -- calculate coarse-grained storage terms
3313  call this%csub_cg_fc(node, tled, area, hnew(node), hold(node), &
3314  hcof, rhs)
3315  rrate = hcof * hnew(node) - rhs
3316  !
3317  ! -- calculate compaction
3318  call this%csub_cg_calc_comp(node, hnew(node), hold(node), comp)
3319  !
3320  ! -- calculate coarse-grained water compressibility storage terms
3321  call this%csub_cg_wcomp_fc(node, tled, area, hnew(node), hold(node), &
3322  hcof, rhs)
3323  rratewc = hcof * hnew(node) - rhs
3324  end if
3325  end if
3326  !
3327  ! -- update coarse-grained storage and water
3328  ! compression variables
3329  this%cg_stor(node) = rrate
3330  this%cell_wcstor(node) = rratewc
3331  this%cell_thick(node) = this%cg_thick(node)
3332  !
3333  ! -- update incremental coarse-grained compaction
3334  this%cg_comp(node) = comp
3335  !
3336  !
3337  ! -- update states if required
3338  if (isuppress_output == 0) then
3339  !
3340  ! -- calculate strain and change in coarse-grained void ratio and thickness
3341  ! todo: consider moving error check in csub_cg_update to ot()
3342  if (this%iupdatematprop /= 0) then
3343  call this%csub_cg_update(node)
3344  end if
3345  !
3346  ! -- update total compaction
3347  this%cg_tcomp(node) = this%cg_tcomp(node) + comp
3348  end if
3349  !
3350  ! -- update flowja
3351  flowja(idiag) = flowja(idiag) + rrate
3352  flowja(idiag) = flowja(idiag) + rratewc
3353  end do
3354  !
3355  ! -- interbed storage
3356  !
3357  ! -- reset delay bed counters for the current time step
3358  if (this%ndelaybeds > 0) then
3359  this%idb_nconv_count(1) = 0
3360  end if
3361  !
3362  ! -- initialize tled
3363  tled = done
3364  !
3365  ! -- calculate budget terms for each interbed
3366  do ib = 1, this%ninterbeds
3367  rratewc = dzero
3368  idelay = this%idelay(ib)
3369  ielastic = this%ielastic(ib)
3370  !
3371  ! -- calculate interbed thickness
3372  ! -- no delay interbeds
3373  if (idelay == 0) then
3374  b = this%thick(ib)
3375  ! -- delay interbeds
3376  else
3377  b = this%thick(ib) * this%rnb(ib)
3378  end if
3379  !
3380  ! -- set variables required for no-delay and delay interbeds
3381  node = this%nodelist(ib)
3382  idiag = this%dis%con%ia(node)
3383  area = this%dis%get_area(node)
3384  !
3385  ! -- add interbed thickness to cell thickness
3386  this%cell_thick(node) = this%cell_thick(node) + b
3387  !
3388  ! -- update budget terms if transient stress period
3389  if (this%gwfiss == 0) then
3390  if (delt > dzero) then
3391  tledm = done / delt
3392  else
3393  tledm = dzero
3394  end if
3395  !
3396  ! -- skip inactive and constant head cells
3397  if (this%ibound(node) < 1) cycle
3398  !
3399  ! -- no delay interbeds
3400  if (idelay == 0) then
3401  iconvert = this%iconvert(ib)
3402  stoi = dzero
3403  !
3404  ! -- calculate compaction
3405  call this%csub_nodelay_calc_comp(ib, hnew(node), hold(node), comp, &
3406  rho1, rho2)
3407  !
3408  ! -- interbed stresses
3409  es = this%cg_es(node)
3410  pcs = this%pcs(ib)
3411  es0 = this%cg_es0(node)
3412  !
3413  ! -- calculate inelastic and elastic compaction
3414  if (ielastic > 0 .or. iconvert == 0) then
3415  stoe = comp
3416  else
3417  stoi = -pcs * rho2 + (rho2 * es)
3418  stoe = pcs * rho1 - (rho1 * es0)
3419  end if
3420  compe = stoe
3421  compi = stoi
3422  stoe = stoe * area
3423  stoi = stoi * area
3424  this%storagee(ib) = stoe * tledm
3425  this%storagei(ib) = stoi * tledm
3426  !
3427  ! -- update compaction
3428  this%comp(ib) = comp
3429  !
3430  ! -- update states if required
3431  if (isuppress_output == 0) then
3432  !
3433  ! -- calculate strain and change in interbed void ratio and thickness
3434  if (this%iupdatematprop /= 0) then
3435  call this%csub_nodelay_update(ib)
3436  end if
3437  !
3438  ! -- update total compaction
3439  this%tcomp(ib) = this%tcomp(ib) + comp
3440  this%tcompe(ib) = this%tcompe(ib) + compe
3441  this%tcompi(ib) = this%tcompi(ib) + compi
3442  end if
3443  !
3444  ! -- delay interbeds
3445  else
3446  h = hnew(node)
3447  h0 = hold(node)
3448  !
3449  ! -- calculate cell saturation
3450  call this%csub_calc_sat(node, h, h0, snnew, snold)
3451  !
3452  ! -- calculate inelastic and elastic storage contributions
3453  call this%csub_delay_calc_dstor(ib, h, stoe, stoi)
3454  this%storagee(ib) = stoe * area * this%rnb(ib) * tledm
3455  this%storagei(ib) = stoi * area * this%rnb(ib) * tledm
3456  !
3457  ! -- calculate flow across the top and bottom of the delay interbed
3458  q = this%csub_calc_delay_flow(ib, 1, h) * area * this%rnb(ib)
3459  this%dbflowtop(idelay) = q
3460  nn = this%ndelaycells
3461  q = this%csub_calc_delay_flow(ib, nn, h) * area * this%rnb(ib)
3462  this%dbflowbot(idelay) = q
3463  !
3464  ! -- update states if required
3465  if (isuppress_output == 0) then
3466  !
3467  ! -- calculate sum of compaction in delay interbed
3468  call this%csub_delay_calc_comp(ib, h, h0, comp, compi, compe)
3469  !
3470  ! - calculate strain and change in interbed void ratio and thickness
3471  ! todo: consider moving error check in csub_delay_update to ot()
3472  if (this%iupdatematprop /= 0) then
3473  call this%csub_delay_update(ib)
3474  end if
3475  !
3476  ! -- update total compaction for interbed
3477  this%tcomp(ib) = this%tcomp(ib) + comp
3478  this%tcompi(ib) = this%tcompi(ib) + compi
3479  this%tcompe(ib) = this%tcompe(ib) + compe
3480  !
3481  ! -- update total compaction for each delay bed cell
3482  do n = 1, this%ndelaycells
3483  this%dbtcomp(n, idelay) = this%dbtcomp(n, idelay) + &
3484  this%dbcomp(n, idelay)
3485  end do
3486  !
3487  ! -- check delay bed heads relative to the top and bottom of each
3488  ! delay bed cell for convertible and non-convertible gwf cells
3489  call this%csub_delay_head_check(ib)
3490  end if
3491  end if
3492  !
3493  ! -- interbed water compressibility
3494  !
3495  ! -- no-delay interbed
3496  if (idelay == 0) then
3497  call this%csub_nodelay_wcomp_fc(ib, node, tledm, area, &
3498  hnew(node), hold(node), hcof, rhs)
3499  rratewc = hcof * hnew(node) - rhs
3500  !
3501  ! -- delay interbed
3502  else
3503  call this%csub_delay_calc_wcomp(ib, q)
3504  rratewc = q * area * this%rnb(ib)
3505  end if
3506  this%cell_wcstor(node) = this%cell_wcstor(node) + rratewc
3507  !
3508  ! -- flowja
3509  flowja(idiag) = flowja(idiag) + rratewc
3510  else
3511  this%storagee(ib) = dzero
3512  this%storagei(ib) = dzero
3513  if (idelay /= 0) then
3514  this%dbflowtop(idelay) = dzero
3515  this%dbflowbot(idelay) = dzero
3516  end if
3517  end if
3518  !
3519  ! -- flowja
3520  flowja(idiag) = flowja(idiag) + this%storagee(ib)
3521  flowja(idiag) = flowja(idiag) + this%storagei(ib)
3522  end do
3523  !
3524  ! -- terminate if errors encountered when updating material properties
3525  if (this%iupdatematprop /= 0) then
3526  if (count_errors() > 0) then
3527  call this%parser%StoreErrorUnit()
3528  end if
3529  end if
3530  !
3531  ! -- return
3532  return
3533 
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,
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]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 321 of file gwf-csub.f90.

322  ! -- dummy variables
323  type(GwfCsubType), pointer :: csubobj !< pointer to default package type
324  character(len=*), intent(in) :: name_model !< model name
325  integer(I4B), intent(in) :: inunit !< unit number of csub input file
326  integer(I4B), intent(in) :: istounit !< unit number of storage package
327  character(len=*), intent(in) :: stoPckName !< name of the storage package
328  integer(I4B), intent(in) :: iout !< unit number of lst output file
329  ! -- local variables
330  !
331  ! -- allocate the object and assign values to object variables
332  allocate (csubobj)
333 
334  ! -- create name and memory path
335  call csubobj%set_names(1, name_model, 'CSUB', 'CSUB')
336  !
337  ! -- Allocate scalars
338  call csubobj%csub_allocate_scalars()
339  !
340  ! -- Create memory path to variables from STO package
341  csubobj%stoMemPath = create_mem_path(name_model, stopckname)
342  !
343  ! -- Set variables
344  csubobj%istounit = istounit
345  csubobj%inunit = inunit
346  csubobj%iout = iout
347  !
348  ! -- Initialize block parser
349  call csubobj%parser%Initialize(csubobj%inunit, csubobj%iout)
350  !
351  ! -- return
352  return
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 2280 of file gwf-csub.f90.

2281  ! -- modules
2283  ! -- dummy variables
2284  class(GwfCsubType) :: this
2285  !
2286  ! -- Deallocate arrays if package is active
2287  if (this%inunit > 0) then
2288  call mem_deallocate(this%unodelist)
2289  call mem_deallocate(this%nodelist)
2290  call mem_deallocate(this%idelay)
2291  call mem_deallocate(this%ielastic)
2292  call mem_deallocate(this%iconvert)
2293  !
2294  ! -- grid-based storage data
2295  call mem_deallocate(this%buff)
2296  call mem_deallocate(this%buffusr)
2297  call mem_deallocate(this%sgm)
2298  call mem_deallocate(this%sgs)
2299  call mem_deallocate(this%cg_ske_cr)
2300  call mem_deallocate(this%cg_gs)
2301  call mem_deallocate(this%cg_es)
2302  call mem_deallocate(this%cg_es0)
2303  call mem_deallocate(this%cg_pcs)
2304  call mem_deallocate(this%cg_comp)
2305  call mem_deallocate(this%cg_tcomp)
2306  call mem_deallocate(this%cg_stor)
2307  call mem_deallocate(this%cg_ske)
2308  call mem_deallocate(this%cg_sk)
2309  if (this%iupdatematprop == 0) then
2310  nullify (this%cg_thick)
2311  nullify (this%cg_thick0)
2312  nullify (this%cg_theta)
2313  nullify (this%cg_theta0)
2314  else
2315  call mem_deallocate(this%cg_thick)
2316  call mem_deallocate(this%cg_thick0)
2317  call mem_deallocate(this%cg_theta)
2318  call mem_deallocate(this%cg_theta0)
2319  end if
2320  call mem_deallocate(this%cg_thickini)
2321  call mem_deallocate(this%cg_thetaini)
2322  !
2323  ! -- cell storage
2324  call mem_deallocate(this%cell_wcstor)
2325  call mem_deallocate(this%cell_thick)
2326  !
2327  ! -- interbed storage
2328  call mem_deallocate(this%boundname, 'BOUNDNAME', this%memoryPath)
2329  call mem_deallocate(this%auxname, 'AUXNAME', this%memoryPath)
2330  call mem_deallocate(this%auxvar)
2331  call mem_deallocate(this%ci)
2332  call mem_deallocate(this%rci)
2333  call mem_deallocate(this%pcs)
2334  call mem_deallocate(this%rnb)
2335  call mem_deallocate(this%kv)
2336  call mem_deallocate(this%h0)
2337  call mem_deallocate(this%comp)
2338  call mem_deallocate(this%tcomp)
2339  call mem_deallocate(this%tcompi)
2340  call mem_deallocate(this%tcompe)
2341  call mem_deallocate(this%storagee)
2342  call mem_deallocate(this%storagei)
2343  call mem_deallocate(this%ske)
2344  call mem_deallocate(this%sk)
2345  if (this%iupdatematprop == 0) then
2346  nullify (this%thick)
2347  nullify (this%thick0)
2348  nullify (this%theta)
2349  nullify (this%theta0)
2350  else
2351  call mem_deallocate(this%thick)
2352  call mem_deallocate(this%thick0)
2353  call mem_deallocate(this%theta)
2354  call mem_deallocate(this%theta0)
2355  end if
2356  call mem_deallocate(this%thickini)
2357  call mem_deallocate(this%thetaini)
2358  !
2359  ! -- delay bed storage
2360  if (this%ndelaybeds > 0) then
2361  if (this%iupdatematprop == 0) then
2362  nullify (this%dbdz)
2363  nullify (this%dbdz0)
2364  nullify (this%dbtheta)
2365  nullify (this%dbtheta0)
2366  else
2367  call mem_deallocate(this%dbdz)
2368  call mem_deallocate(this%dbdz0)
2369  call mem_deallocate(this%dbtheta)
2370  call mem_deallocate(this%dbtheta0)
2371  end if
2372  call mem_deallocate(this%idb_nconv_count)
2373  call mem_deallocate(this%idbconvert)
2374  call mem_deallocate(this%dbdhmax)
2375  call mem_deallocate(this%dbz)
2376  call mem_deallocate(this%dbrelz)
2377  call mem_deallocate(this%dbh)
2378  call mem_deallocate(this%dbh0)
2379  call mem_deallocate(this%dbgeo)
2380  call mem_deallocate(this%dbes)
2381  call mem_deallocate(this%dbes0)
2382  call mem_deallocate(this%dbpcs)
2383  call mem_deallocate(this%dbflowtop)
2384  call mem_deallocate(this%dbflowbot)
2385  call mem_deallocate(this%dbdzini)
2386  call mem_deallocate(this%dbthetaini)
2387  call mem_deallocate(this%dbcomp)
2388  call mem_deallocate(this%dbtcomp)
2389  !
2390  ! -- delay interbed solution arrays
2391  call mem_deallocate(this%dbal)
2392  call mem_deallocate(this%dbad)
2393  call mem_deallocate(this%dbau)
2394  call mem_deallocate(this%dbrhs)
2395  call mem_deallocate(this%dbdh)
2396  call mem_deallocate(this%dbaw)
2397  end if
2398  !
2399  ! -- period data
2400  call mem_deallocate(this%nodelistsig0)
2401  call mem_deallocate(this%sig0)
2402  !
2403  ! -- pointers to gwf variables
2404  nullify (this%gwfiss)
2405  !
2406  ! -- pointers to storage variables
2407  nullify (this%stoiconv)
2408  nullify (this%stoss)
2409  !
2410  ! -- input table
2411  if (this%iprpak > 0) then
2412  call this%inputtab%table_da()
2413  deallocate (this%inputtab)
2414  nullify (this%inputtab)
2415  end if
2416  !
2417  ! -- output table
2418  if (this%istrainib > 0 .or. this%istrainsk > 0) then
2419  call this%outputtab%table_da()
2420  deallocate (this%outputtab)
2421  nullify (this%outputtab)
2422  end if
2423  end if
2424  !
2425  ! -- package csv table
2426  if (this%ipakcsv > 0) then
2427  call this%pakcsvtab%table_da()
2428  deallocate (this%pakcsvtab)
2429  nullify (this%pakcsvtab)
2430  end if
2431  !
2432  ! -- deallocate character variables
2433  call mem_deallocate(this%listlabel, 'LISTLABEL', this%memoryPath)
2434  call mem_deallocate(this%stoMemPath, 'STONAME', this%memoryPath)
2435  !
2436  ! -- deallocate scalars
2437  call mem_deallocate(this%istounit)
2438  call mem_deallocate(this%inobspkg)
2439  call mem_deallocate(this%ninterbeds)
2440  call mem_deallocate(this%maxsig0)
2441  call mem_deallocate(this%nbound)
2442  call mem_deallocate(this%iscloc)
2443  call mem_deallocate(this%iauxmultcol)
2444  call mem_deallocate(this%ndelaycells)
2445  call mem_deallocate(this%ndelaybeds)
2446  call mem_deallocate(this%initialized)
2447  call mem_deallocate(this%ieslag)
2448  call mem_deallocate(this%ipch)
2449  call mem_deallocate(this%lhead_based)
2450  call mem_deallocate(this%iupdatestress)
2451  call mem_deallocate(this%ispecified_pcs)
2452  call mem_deallocate(this%ispecified_dbh)
2453  call mem_deallocate(this%inamedbound)
2454  call mem_deallocate(this%iconvchk)
2455  call mem_deallocate(this%naux)
2456  call mem_deallocate(this%istoragec)
2457  call mem_deallocate(this%istrainib)
2458  call mem_deallocate(this%istrainsk)
2459  call mem_deallocate(this%ioutcomp)
2460  call mem_deallocate(this%ioutcompi)
2461  call mem_deallocate(this%ioutcompe)
2462  call mem_deallocate(this%ioutcompib)
2463  call mem_deallocate(this%ioutcomps)
2464  call mem_deallocate(this%ioutzdisp)
2465  call mem_deallocate(this%ipakcsv)
2466  call mem_deallocate(this%iupdatematprop)
2467  call mem_deallocate(this%epsilon)
2468  call mem_deallocate(this%cc_crit)
2469  call mem_deallocate(this%gammaw)
2470  call mem_deallocate(this%beta)
2471  call mem_deallocate(this%brg)
2472  call mem_deallocate(this%satomega)
2473  call mem_deallocate(this%icellf)
2474  call mem_deallocate(this%gwfiss0)
2475  !
2476  ! -- deallocate methods on objects
2477  if (this%inunit > 0) then
2478  call this%obs%obs_da()
2479  call this%TsManager%da()
2480  !
2481  ! -- deallocate and nullify observations
2482  deallocate (this%obs)
2483  nullify (this%obs)
2484  end if
2485  !
2486  ! -- deallocate TsManager
2487  deallocate (this%TsManager)
2488  nullify (this%TsManager)
2489 
2490  !
2491  ! -- deallocate parent
2492  call this%NumericalPackageType%da()
2493  !
2494  ! -- return
2495  return

◆ 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 6108 of file gwf-csub.f90.

6109  ! -- dummy variables
6110  class(GwfCsubType), intent(inout) :: this
6111  integer(I4B), intent(in) :: ib !< interbed number
6112  real(DP), intent(in) :: hcell !< current head in a cell
6113  ! -- local variables
6114  integer(I4B) :: n
6115  real(DP) :: aii
6116  real(DP) :: au
6117  real(DP) :: al
6118  real(DP) :: r
6119  !
6120  ! -- calculate matrix terms for each delay bed cell
6121  do n = 1, this%ndelaycells
6122  !
6123  ! -- assemble terms
6124  if (this%inewton == 0) then
6125  call this%csub_delay_assemble_fc(ib, n, hcell, aii, au, al, r)
6126  else
6127  call this%csub_delay_assemble_fn(ib, n, hcell, aii, au, al, r)
6128  end if
6129  !
6130  ! -- add terms
6131  this%dbal(n) = al
6132  this%dbau(n) = au
6133  this%dbad(n) = aii
6134  this%dbrhs(n) = r
6135  end do
6136  !
6137  ! -- return
6138  return
6139 

◆ 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 6148 of file gwf-csub.f90.

6149  ! -- modules
6150  use tdismodule, only: delt
6151  ! -- dummy variables
6152  class(GwfCsubType), intent(inout) :: this
6153  integer(I4B), intent(in) :: ib !< interbed number
6154  integer(I4B), intent(in) :: n !< delay interbed cell number
6155  real(DP), intent(in) :: hcell !< current head in a cell
6156  real(DP), intent(inout) :: aii !< diagonal in the A matrix
6157  real(DP), intent(inout) :: au !< upper term in the A matrix
6158  real(DP), intent(inout) :: al !< lower term in the A matrix
6159  real(DP), intent(inout) :: r !< right-hand side term
6160  ! -- local variables
6161  integer(I4B) :: node
6162  integer(I4B) :: idelay
6163  integer(I4B) :: ielastic
6164  real(DP) :: dzini
6165  real(DP) :: dzhalf
6166  real(DP) :: c
6167  real(DP) :: c2
6168  real(DP) :: c3
6169  real(DP) :: tled
6170  real(DP) :: wcf
6171  real(DP) :: smult
6172  real(DP) :: sske
6173  real(DP) :: ssk
6174  real(DP) :: z
6175  real(DP) :: ztop
6176  real(DP) :: zbot
6177  real(DP) :: dz
6178  real(DP) :: dz0
6179  real(DP) :: theta
6180  real(DP) :: theta0
6181  real(DP) :: dsn
6182  real(DP) :: dsn0
6183  real(DP) :: gs
6184  real(DP) :: es0
6185  real(DP) :: pcs
6186  real(DP) :: wc
6187  real(DP) :: wc0
6188  real(DP) :: h
6189  real(DP) :: h0
6190  real(DP) :: hbar
6191  !
6192  ! -- initialize accumulators
6193  aii = dzero
6194  au = dzero
6195  al = dzero
6196  r = dzero
6197  !
6198  ! -- initialize local variables
6199  idelay = this%idelay(ib)
6200  ielastic = this%ielastic(ib)
6201  node = this%nodelist(ib)
6202  dzini = this%dbdzini(1, idelay)
6203  dzhalf = dhalf * dzini
6204  tled = done / delt
6205  c = this%kv(ib) / dzini
6206  c2 = dtwo * c
6207  c3 = dthree * c
6208  !
6209  ! -- add qdb terms
6210  aii = aii - c2
6211  !
6212  ! -- top or bottom cell
6213  if (n == 1 .or. n == this%ndelaycells) then
6214  aii = aii - c
6215  r = r - c2 * hcell
6216  end if
6217  !
6218  ! -- lower qdb term
6219  if (n > 1) then
6220  al = c
6221  end if
6222  !
6223  ! -- upper qdb term
6224  if (n < this%ndelaycells) then
6225  au = c
6226  end if
6227  !
6228  ! -- current and previous delay cell states
6229  z = this%dbz(n, idelay)
6230  ztop = z + dzhalf
6231  zbot = z - dzhalf
6232  h = this%dbh(n, idelay)
6233  h0 = this%dbh0(n, idelay)
6234  dz = this%dbdz(n, idelay)
6235  dz0 = this%dbdz0(n, idelay)
6236  theta = this%dbtheta(n, idelay)
6237  theta0 = this%dbtheta0(n, idelay)
6238  !
6239  ! -- calculate corrected head (hbar)
6240  hbar = squadratic0sp(h, zbot, this%satomega)
6241  !
6242  ! -- calculate saturation
6243  call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6244  !
6245  ! -- calculate ssk and sske
6246  call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske)
6247  !
6248  ! -- calculate and add storage terms
6249  smult = dzini * tled
6250  gs = this%dbgeo(n, idelay)
6251  es0 = this%dbes0(n, idelay)
6252  pcs = this%dbpcs(n, idelay)
6253  aii = aii - smult * dsn * ssk
6254  if (ielastic /= 0) then
6255  r = r - smult * &
6256  (dsn * ssk * (gs + zbot) - dsn0 * sske * es0)
6257  else
6258  r = r - smult * &
6259  (dsn * ssk * (gs + zbot - pcs) + dsn0 * sske * (pcs - es0))
6260  end if
6261  !
6262  ! -- add storage correction term
6263  r = r + smult * dsn * ssk * (h - hbar)
6264  !
6265  ! -- add water compressibility terms
6266  wcf = this%brg * tled
6267  wc = dz * wcf * theta
6268  wc0 = dz0 * wcf * theta0
6269  aii = aii - dsn * wc
6270  r = r - dsn0 * wc0 * h0
6271  !
6272  ! -- return
6273  return
6274 
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 6283 of file gwf-csub.f90.

6284  ! -- modules
6285  use tdismodule, only: delt
6286  ! -- dummy variables
6287  class(GwfCsubType), intent(inout) :: this
6288  integer(I4B), intent(in) :: ib !< interbed number
6289  integer(I4B), intent(in) :: n !< delay interbed cell number
6290  real(DP), intent(in) :: hcell !< current head in a cell
6291  real(DP), intent(inout) :: aii !< diagonal in the A matrix
6292  real(DP), intent(inout) :: au !< upper term in the A matrix
6293  real(DP), intent(inout) :: al !< lower term in the A matrix
6294  real(DP), intent(inout) :: r !< right-hand side term
6295  ! -- local variables
6296  integer(I4B) :: node
6297  integer(I4B) :: idelay
6298  integer(I4B) :: ielastic
6299  real(DP) :: dzini
6300  real(DP) :: dzhalf
6301  real(DP) :: c
6302  real(DP) :: c2
6303  real(DP) :: c3
6304  real(DP) :: tled
6305  real(DP) :: wcf
6306  real(DP) :: smult
6307  real(DP) :: sske
6308  real(DP) :: ssk
6309  real(DP) :: z
6310  real(DP) :: ztop
6311  real(DP) :: zbot
6312  real(DP) :: dz
6313  real(DP) :: dz0
6314  real(DP) :: theta
6315  real(DP) :: theta0
6316  real(DP) :: dsn
6317  real(DP) :: dsn0
6318  real(DP) :: dsnderv
6319  real(DP) :: wc
6320  real(DP) :: wc0
6321  real(DP) :: h
6322  real(DP) :: h0
6323  real(DP) :: hbar
6324  real(DP) :: hbarderv
6325  real(DP) :: gs
6326  real(DP) :: es0
6327  real(DP) :: pcs
6328  real(DP) :: qsto
6329  real(DP) :: stoderv
6330  real(DP) :: qwc
6331  real(DP) :: wcderv
6332  !
6333  ! -- initialize accumulators
6334  aii = dzero
6335  au = dzero
6336  al = dzero
6337  r = dzero
6338  !
6339  ! -- initialize local variables
6340  idelay = this%idelay(ib)
6341  ielastic = this%ielastic(ib)
6342  node = this%nodelist(ib)
6343  dzini = this%dbdzini(1, idelay)
6344  dzhalf = dhalf * dzini
6345  tled = done / delt
6346  c = this%kv(ib) / dzini
6347  c2 = dtwo * c
6348  c3 = dthree * c
6349  !
6350  ! -- add qdb terms
6351  aii = aii - c2
6352  !
6353  ! -- top or bottom cell
6354  if (n == 1 .or. n == this%ndelaycells) then
6355  aii = aii - c
6356  r = r - c2 * hcell
6357  end if
6358  !
6359  ! -- lower qdb term
6360  if (n > 1) then
6361  al = c
6362  end if
6363  !
6364  ! -- upper qdb term
6365  if (n < this%ndelaycells) then
6366  au = c
6367  end if
6368  !
6369  ! -- current and previous delay cell states
6370  z = this%dbz(n, idelay)
6371  ztop = z + dzhalf
6372  zbot = z - dzhalf
6373  h = this%dbh(n, idelay)
6374  h0 = this%dbh0(n, idelay)
6375  dz = this%dbdz(n, idelay)
6376  dz0 = this%dbdz0(n, idelay)
6377  theta = this%dbtheta(n, idelay)
6378  theta0 = this%dbtheta0(n, idelay)
6379  !
6380  ! -- calculate corrected head (hbar)
6381  hbar = squadratic0sp(h, zbot, this%satomega)
6382  !
6383  ! -- calculate the derivative of the hbar functions
6384  hbarderv = squadratic0spderivative(h, zbot, this%satomega)
6385  !
6386  ! -- calculate saturation
6387  call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6388  !
6389  ! -- calculate the derivative of the saturation
6390  dsnderv = this%csub_delay_calc_sat_derivative(node, idelay, n, hcell)
6391  !
6392  ! -- calculate ssk and sske
6393  call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske)
6394  !
6395  ! -- calculate storage terms
6396  smult = dzini * tled
6397  gs = this%dbgeo(n, idelay)
6398  es0 = this%dbes0(n, idelay)
6399  pcs = this%dbpcs(n, idelay)
6400  if (ielastic /= 0) then
6401  qsto = smult * (dsn * ssk * (gs - hbar + zbot) - dsn0 * sske * es0)
6402  stoderv = -smult * dsn * ssk * hbarderv + &
6403  smult * ssk * (gs - hbar + zbot) * dsnderv
6404  else
6405  qsto = smult * (dsn * ssk * (gs - hbar + zbot - pcs) + &
6406  dsn0 * sske * (pcs - es0))
6407  stoderv = -smult * dsn * ssk * hbarderv + &
6408  smult * ssk * (gs - hbar + zbot - pcs) * dsnderv
6409  end if
6410  !
6411  ! -- Add additional term if using lagged effective stress
6412  if (this%ieslag /= 0) then
6413  if (ielastic /= 0) then
6414  stoderv = stoderv - smult * sske * es0 * dsnderv
6415  else
6416  stoderv = stoderv + smult * sske * (pcs - es0) * dsnderv
6417  end if
6418  end if
6419  !
6420  ! -- add newton-raphson storage terms
6421  aii = aii + stoderv
6422  r = r - qsto + stoderv * h
6423  !
6424  ! -- add water compressibility terms
6425  wcf = this%brg * tled
6426  wc = dz * wcf * theta
6427  wc0 = dz0 * wcf * theta0
6428  qwc = dsn0 * wc0 * h0 - dsn * wc * h
6429  wcderv = -dsn * wc - wc * h * dsnderv
6430  !
6431  ! -- Add additional term if using lagged effective stress
6432  if (this%ieslag /= 0) then
6433  wcderv = wcderv + wc0 * h0 * dsnderv
6434  end if
6435  !
6436  ! -- add newton-raphson water compressibility terms
6437  aii = aii + wcderv
6438  r = r - qwc + wcderv * h
6439  !
6440  ! -- return
6441  return
6442 
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 6674 of file gwf-csub.f90.

6675  ! -- dummy variables
6676  class(GwfCsubType), intent(inout) :: this
6677  integer(I4B), intent(in) :: ib !< interbed number
6678  real(DP), intent(in) :: hcell !< current head in cell
6679  real(DP), intent(in) :: hcellold !< previous head in cell
6680  real(DP), intent(inout) :: comp !< compaction in delay interbed
6681  real(DP), intent(inout) :: compi !< inelastic compaction in delay interbed
6682  real(DP), intent(inout) :: compe !< elastic compaction in delay interbed
6683  ! -- local variables
6684  integer(I4B) :: idelay
6685  integer(I4B) :: ielastic
6686  integer(I4B) :: node
6687  integer(I4B) :: n
6688  real(DP) :: snnew
6689  real(DP) :: snold
6690  real(DP) :: sske
6691  real(DP) :: ssk
6692  real(DP) :: fmult
6693  real(DP) :: h
6694  real(DP) :: h0
6695  real(DP) :: dsn
6696  real(DP) :: dsn0
6697  real(DP) :: v
6698  real(DP) :: v1
6699  real(DP) :: v2
6700  !
6701  ! -- initialize variables
6702  idelay = this%idelay(ib)
6703  ielastic = this%ielastic(ib)
6704  node = this%nodelist(ib)
6705  comp = dzero
6706  compi = dzero
6707  compe = dzero
6708  !
6709  ! -- calculate cell saturation
6710  call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
6711  !
6712  ! -- calculate compaction
6713  if (this%thickini(ib) > dzero) then
6714  fmult = this%dbdzini(1, idelay)
6715  do n = 1, this%ndelaycells
6716  h = this%dbh(n, idelay)
6717  h0 = this%dbh0(n, idelay)
6718  call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6719  call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske)
6720  if (ielastic /= 0) then
6721  v1 = dsn * ssk * this%dbes(n, idelay) - sske * this%dbes0(n, idelay)
6722  v2 = dzero
6723  else
6724  v1 = dsn * ssk * (this%dbes(n, idelay) - this%dbpcs(n, idelay))
6725  v2 = dsn0 * sske * (this%dbpcs(n, idelay) - this%dbes0(n, idelay))
6726  end if
6727  v = (v1 + v2) * fmult
6728  comp = comp + v
6729  !
6730  ! -- save compaction data
6731  this%dbcomp(n, idelay) = v * snnew
6732  !
6733  ! -- calculate inelastic and elastic storage components
6734  if (this%idbconvert(n, idelay) /= 0) then
6735  compi = compi + v1 * fmult
6736  compe = compe + v2 * fmult
6737  else
6738  compe = compe + (v1 + v2) * fmult
6739  end if
6740  end do
6741  end if
6742  !
6743  ! -- fill compaction
6744  comp = comp * this%rnb(ib)
6745  compi = compi * this%rnb(ib)
6746  compe = compe * this%rnb(ib)
6747  !
6748  ! -- return
6749  return

◆ 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 6530 of file gwf-csub.f90.

6531  ! -- dummy variables
6532  class(GwfCsubType), intent(inout) :: this
6533  integer(I4B), intent(in) :: ib !< interbed number
6534  real(DP), intent(in) :: hcell !< current head in cell
6535  real(DP), intent(inout) :: stoe !< elastic storage change
6536  real(DP), intent(inout) :: stoi !< inelastic storage change
6537  ! -- local variables
6538  integer(I4B) :: idelay
6539  integer(I4B) :: ielastic
6540  integer(I4B) :: node
6541  integer(I4B) :: n
6542  real(DP) :: sske
6543  real(DP) :: ssk
6544  real(DP) :: fmult
6545  real(DP) :: v1
6546  real(DP) :: v2
6547  real(DP) :: ske
6548  real(DP) :: sk
6549  real(DP) :: z
6550  real(DP) :: zbot
6551  real(DP) :: h
6552  real(DP) :: h0
6553  real(DP) :: dsn
6554  real(DP) :: dsn0
6555  real(DP) :: hbar
6556  real(DP) :: dzhalf
6557  !
6558  ! -- initialize variables
6559  idelay = this%idelay(ib)
6560  ielastic = this%ielastic(ib)
6561  node = this%nodelist(ib)
6562  stoe = dzero
6563  stoi = dzero
6564  ske = dzero
6565  sk = dzero
6566  !
6567  !
6568  if (this%thickini(ib) > dzero) then
6569  fmult = this%dbdzini(1, idelay)
6570  dzhalf = dhalf * this%dbdzini(1, idelay)
6571  do n = 1, this%ndelaycells
6572  call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske)
6573  z = this%dbz(n, idelay)
6574  zbot = z - dzhalf
6575  h = this%dbh(n, idelay)
6576  h0 = this%dbh0(n, idelay)
6577  call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6578  hbar = squadratic0sp(h, zbot, this%satomega)
6579  if (ielastic /= 0) then
6580  v1 = dsn * ssk * (this%dbgeo(n, idelay) - hbar + zbot) - &
6581  dsn0 * sske * this%dbes0(n, idelay)
6582  v2 = dzero
6583  else
6584  v1 = dsn * ssk * (this%dbgeo(n, idelay) - hbar + zbot - &
6585  this%dbpcs(n, idelay))
6586  v2 = dsn0 * sske * (this%dbpcs(n, idelay) - this%dbes0(n, idelay))
6587  end if
6588  !
6589  ! -- calculate inelastic and elastic storage components
6590  if (this%idbconvert(n, idelay) /= 0) then
6591  stoi = stoi + v1 * fmult
6592  stoe = stoe + v2 * fmult
6593  else
6594  stoe = stoe + (v1 + v2) * fmult
6595  end if
6596  !
6597  ! calculate inelastic and elastic storativity
6598  ske = ske + sske * fmult
6599  sk = sk + ssk * fmult
6600  end do
6601  end if
6602  !
6603  ! -- save ske and sk
6604  this%ske(ib) = ske
6605  this%sk(ib) = sk
6606  !
6607  ! -- return
6608  return
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 6453 of file gwf-csub.f90.

6455  ! -- dummy variables
6456  class(GwfCsubType), intent(inout) :: this
6457  integer(I4B), intent(in) :: node !< cell node number
6458  integer(I4B), intent(in) :: idelay !< delay interbed number
6459  integer(I4B), intent(in) :: n !< delay interbed cell number
6460  real(DP), intent(in) :: hcell !< current head in delay interbed cell n
6461  real(DP), intent(in) :: hcellold !< previous head in delay interbed cell n
6462  real(DP), intent(inout) :: snnew !< current saturation in delay interbed cell n
6463  real(DP), intent(inout) :: snold !< previous saturation in delay interbed cell n
6464  ! -- local variables
6465  real(DP) :: dzhalf
6466  real(DP) :: top
6467  real(DP) :: bot
6468  !
6469  ! -- calculate delay interbed cell saturation
6470  if (this%stoiconv(node) /= 0) then
6471  dzhalf = dhalf * this%dbdzini(n, idelay)
6472  top = this%dbz(n, idelay) + dzhalf
6473  bot = this%dbz(n, idelay) - dzhalf
6474  snnew = squadraticsaturation(top, bot, hcell, this%satomega)
6475  snold = squadraticsaturation(top, bot, hcellold, this%satomega)
6476  else
6477  snnew = done
6478  snold = done
6479  end if
6480  if (this%ieslag /= 0) then
6481  snold = snnew
6482  end if
6483  !
6484  ! -- return
6485  return
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 6495 of file gwf-csub.f90.

6497  ! -- dummy variables
6498  class(GwfCsubType), intent(inout) :: this
6499  integer(I4B), intent(in) :: node !< cell node number
6500  integer(I4B), intent(in) :: idelay !< delay interbed number
6501  integer(I4B), intent(in) :: n !< delay interbed cell number
6502  real(DP), intent(in) :: hcell !< current head in delay interbed cell n
6503  ! -- local variables
6504  real(DP) :: satderv
6505  real(DP) :: dzhalf
6506  real(DP) :: top
6507  real(DP) :: bot
6508 ! ------------------------------------------------------------------------------
6509  if (this%stoiconv(node) /= 0) then
6510  dzhalf = dhalf * this%dbdzini(n, idelay)
6511  top = this%dbz(n, idelay) + dzhalf
6512  bot = this%dbz(n, idelay) - dzhalf
6513  satderv = squadraticsaturationderivative(top, bot, hcell, this%satomega)
6514  else
6515  satderv = dzero
6516  end if
6517  !
6518  ! -- return
6519  return
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 6003 of file gwf-csub.f90.

6004  ! -- dummy variables
6005  class(GwfCsubType), intent(inout) :: this
6006  integer(I4B), intent(in) :: ib !< interbed number
6007  integer(I4B), intent(in) :: n !< delay interbed cell number
6008  real(DP), intent(in) :: hcell !< current head in a cell
6009  real(DP), intent(inout) :: ssk !< delay interbed skeletal specific storage
6010  real(DP), intent(inout) :: sske !< delay interbed elastic skeletal specific storage
6011  ! -- local variables
6012  integer(I4B) :: idelay
6013  integer(I4B) :: ielastic
6014  integer(I4B) :: node
6015  real(DP) :: topcell
6016  real(DP) :: botcell
6017  real(DP) :: hbarcell
6018  real(DP) :: zcell
6019  real(DP) :: zcenter
6020  real(DP) :: dzhalf
6021  real(DP) :: top
6022  real(DP) :: bot
6023  real(DP) :: h
6024  real(DP) :: hbar
6025  real(DP) :: znode
6026  real(DP) :: zbot
6027  real(DP) :: es
6028  real(DP) :: es0
6029  real(DP) :: theta
6030  real(DP) :: f
6031  real(DP) :: f0
6032  !
6033  ! -- initialize variables
6034  sske = dzero
6035  ssk = dzero
6036  idelay = this%idelay(ib)
6037  ielastic = this%ielastic(ib)
6038  !
6039  ! -- calculate factor for the head-based case
6040  if (this%lhead_based .EQV. .true.) then
6041  f = done
6042  f0 = f
6043  !
6044  ! -- calculate factor for the effective stress case
6045  else
6046  node = this%nodelist(ib)
6047  theta = this%dbthetaini(n, idelay)
6048  !
6049  ! -- set top and bottom of layer
6050  topcell = this%dis%top(node)
6051  botcell = this%dis%bot(node)
6052  !
6053  ! -- calculate corrected head for the cell (hbarcell)
6054  hbarcell = squadratic0sp(hcell, botcell, this%satomega)
6055  !
6056  ! -- set location of delay node relative to the center
6057  ! of the cell based on current head
6058  zcell = this%csub_calc_znode(topcell, botcell, hbarcell)
6059  !
6060  ! -- set variables for delay interbed zcell calculations
6061  zcenter = zcell + this%dbrelz(n, idelay)
6062  dzhalf = dhalf * this%dbdzini(1, idelay)
6063  top = zcenter + dzhalf
6064  bot = zcenter - dzhalf
6065  h = this%dbh(n, idelay)
6066  !
6067  ! -- calculate corrected head for the delay interbed cell (hbar)
6068  hbar = squadratic0sp(h, bot, this%satomega)
6069  !
6070  ! -- calculate the center of the saturated portion of the
6071  ! delay interbed cell
6072  znode = this%csub_calc_znode(top, bot, hbar)
6073  !
6074  ! -- set reference point for bottom of delay interbed cell that is used to
6075  ! scale the effective stress at the bottom of the delay interbed cell
6076  zbot = this%dbz(n, idelay) - dzhalf
6077  !
6078  ! -- set the effective stress
6079  es = this%dbes(n, idelay)
6080  es0 = this%dbes0(n, idelay)
6081  !
6082  ! -- calculate the compression index factors for the delay
6083  ! node relative to the center of the cell based on the
6084  ! current and previous head
6085  call this%csub_calc_sfacts(node, zbot, znode, theta, es, es0, f)
6086  end if
6087  this%idbconvert(n, idelay) = 0
6088  sske = f * this%rci(ib)
6089  ssk = f * this%rci(ib)
6090  if (ielastic == 0) then
6091  if (this%dbes(n, idelay) > this%dbpcs(n, idelay)) then
6092  this%idbconvert(n, idelay) = 1
6093  ssk = f * this%ci(ib)
6094  end if
6095  end if
6096  !
6097  ! -- return
6098  return
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 5920 of file gwf-csub.f90.

5921  ! -- dummy variables
5922  class(GwfCsubType), intent(inout) :: this
5923  integer(I4B), intent(in) :: ib !< interbed number
5924  real(DP), intent(in) :: hcell !< current head in a cell
5925  ! -- local variables
5926  integer(I4B) :: n
5927  integer(I4B) :: idelay
5928  integer(I4B) :: node
5929  real(DP) :: sigma
5930  real(DP) :: topaq
5931  real(DP) :: botaq
5932  real(DP) :: dzhalf
5933  real(DP) :: sadd
5934  real(DP) :: sgm
5935  real(DP) :: sgs
5936  real(DP) :: h
5937  real(DP) :: hbar
5938  real(DP) :: z
5939  real(DP) :: top
5940  real(DP) :: bot
5941  real(DP) :: phead
5942  !
5943  ! -- initialize variables
5944  idelay = this%idelay(ib)
5945  node = this%nodelist(ib)
5946  sigma = this%cg_gs(node)
5947  topaq = this%dis%top(node)
5948  botaq = this%dis%bot(node)
5949  dzhalf = dhalf * this%dbdzini(1, idelay)
5950  top = this%dbz(1, idelay) + dzhalf
5951  !
5952  ! -- calculate corrected head (hbar)
5953  hbar = squadratic0sp(hcell, botaq, this%satomega)
5954  !
5955  ! -- calculate the geostatic load in the cell at the top of the interbed.
5956  sgm = this%sgm(node)
5957  sgs = this%sgs(node)
5958  if (hcell < top) then
5959  sadd = ((top - hbar) * sgm) + ((hbar - botaq) * sgs)
5960  else
5961  sadd = (top - botaq) * sgs
5962  end if
5963  sigma = sigma - sadd
5964  !
5965  ! -- calculate geostatic and effective stress for each interbed node.
5966  do n = 1, this%ndelaycells
5967  h = this%dbh(n, idelay)
5968  !
5969  ! -- geostatic calculated at the bottom of the delay cell
5970  z = this%dbz(n, idelay)
5971  top = z + dzhalf
5972  bot = z - dzhalf
5973  !
5974  ! -- calculate corrected head (hbar)
5975  hbar = squadratic0sp(h, bot, this%satomega)
5976  !
5977  ! -- geostatic stress calculation
5978  if (h < top) then
5979  sadd = ((top - hbar) * sgm) + ((hbar - bot) * sgs)
5980  else
5981  sadd = (top - bot) * sgs
5982  end if
5983  sigma = sigma + sadd
5984  phead = hbar - bot
5985  this%dbgeo(n, idelay) = sigma
5986  this%dbes(n, idelay) = sigma - phead
5987  end do
5988  !
5989  ! -- return
5990  return
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 6618 of file gwf-csub.f90.

6619  ! -- modules
6620  use tdismodule, only: delt
6621  ! -- dummy variables
6622  class(GwfCsubType), intent(inout) :: this
6623  integer(I4B), intent(in) :: ib !< interbed number
6624  real(DP), intent(inout) :: dwc !< water compressibility change
6625  ! -- local variables
6626  integer(I4B) :: idelay
6627  integer(I4B) :: node
6628  integer(I4B) :: n
6629  real(DP) :: tled
6630  real(DP) :: h
6631  real(DP) :: h0
6632  real(DP) :: dz
6633  real(DP) :: dz0
6634  real(DP) :: dsn
6635  real(DP) :: dsn0
6636  real(DP) :: wc
6637  real(DP) :: wc0
6638  real(DP) :: v
6639  !
6640  ! -- initialize variables
6641  dwc = dzero
6642  !
6643  !
6644  if (this%thickini(ib) > dzero) then
6645  idelay = this%idelay(ib)
6646  node = this%nodelist(ib)
6647  tled = done / delt
6648  do n = 1, this%ndelaycells
6649  h = this%dbh(n, idelay)
6650  h0 = this%dbh0(n, idelay)
6651  dz = this%dbdz(n, idelay)
6652  dz0 = this%dbdz0(n, idelay)
6653  call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6654  wc = dz * this%brg * this%dbtheta(n, idelay)
6655  wc0 = dz0 * this%brg * this%dbtheta0(n, idelay)
6656  v = dsn0 * wc0 * h0 - dsn * wc * h
6657  dwc = dwc + v * tled
6658  end do
6659  end if
6660  !
6661  ! -- return
6662  return

◆ 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 6840 of file gwf-csub.f90.

6841  ! -- dummy variables
6842  class(GwfCsubType), intent(inout) :: this
6843  integer(I4B), intent(in) :: ib !< interbed number
6844  real(DP), intent(inout) :: hcof !< head dependent coefficient
6845  real(DP), intent(inout) :: rhs !< right-hand side
6846  ! -- local variables
6847  integer(I4B) :: idelay
6848  real(DP) :: c1
6849  real(DP) :: c2
6850  !
6851  ! -- initialize variables
6852  idelay = this%idelay(ib)
6853  hcof = dzero
6854  rhs = dzero
6855  if (this%thickini(ib) > dzero) then
6856  ! -- calculate terms for gwf matrix
6857  c1 = dtwo * this%kv(ib) / this%dbdzini(1, idelay)
6858  rhs = -c1 * this%dbh(1, idelay)
6859  c2 = dtwo * &
6860  this%kv(ib) / this%dbdzini(this%ndelaycells, idelay)
6861  rhs = rhs - c2 * this%dbh(this%ndelaycells, idelay)
6862  hcof = c1 + c2
6863  end if
6864  !
6865  ! -- return
6866  return

◆ 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 5566 of file gwf-csub.f90.

5567  ! -- dummy variables
5568  class(GwfCsubType), intent(inout) :: this
5569  integer(I4B), intent(in) :: ib !< interbed number
5570  ! -- local variables
5571  integer(I4B) :: iviolate
5572  integer(I4B) :: idelay
5573  integer(I4B) :: node
5574  integer(I4B) :: n
5575  real(DP) :: z
5576  real(DP) :: h
5577  real(DP) :: dzhalf
5578  real(DP) :: ztop
5579  !
5580  ! -- initialize variables
5581  iviolate = 0
5582  idelay = this%idelay(ib)
5583  node = this%nodelist(ib)
5584  !
5585  ! -- evaluate every delay cell
5586  idelaycells: do n = 1, this%ndelaycells
5587  z = this%dbz(n, idelay)
5588  h = this%dbh(n, idelay)
5589  dzhalf = dhalf * this%dbdzini(1, idelay)
5590  !
5591  ! -- non-convertible cell
5592  if (this%stoiconv(node) == 0) then
5593  ztop = z + dzhalf
5594  if (h < ztop) then
5595  this%idb_nconv_count(1) = this%idb_nconv_count(1) + 1
5596  iviolate = 1
5597  end if
5598  end if
5599  !
5600  ! -- terminate the loop
5601  if (iviolate > 0) then
5602  exit idelaycells
5603  end if
5604  end do idelaycells
5605  !
5606  ! -- return
5607  return

◆ 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 5859 of file gwf-csub.f90.

5860  ! -- dummy variables
5861  class(GwfCsubType), intent(inout) :: this
5862  integer(I4B), intent(in) :: ib !< interbed number
5863  ! -- local variables
5864  integer(I4B) :: n
5865  integer(I4B) :: node
5866  integer(I4B) :: idelay
5867  real(DP) :: bot
5868  real(DP) :: top
5869  real(DP) :: hbar
5870  real(DP) :: znode
5871  real(DP) :: dzz
5872  real(DP) :: z
5873  real(DP) :: zr
5874  real(DP) :: b
5875  real(DP) :: dz
5876  !
5877  ! -- initialize variables
5878  idelay = this%idelay(ib)
5879  node = this%nodelist(ib)
5880  b = this%thickini(ib)
5881  bot = this%dis%bot(node)
5882  top = bot + b
5883  hbar = top
5884  !
5885  ! -- calculate znode based on assumption that the delay bed bottom
5886  ! is equal to the cell bottom
5887  znode = this%csub_calc_znode(top, bot, hbar)
5888  dz = dhalf * this%dbdzini(1, idelay)
5889  dzz = dhalf * b
5890  z = znode + dzz
5891  zr = dzz
5892  !
5893  ! -- calculate z and z relative to znode for each delay
5894  ! interbed node
5895  do n = 1, this%ndelaycells
5896  ! z of node relative to bottom of cell
5897  z = z - dz
5898  this%dbz(n, idelay) = z
5899  z = z - dz
5900  ! z relative to znode
5901  zr = zr - dz
5902  if (abs(zr) < dz) then
5903  zr = dzero
5904  end if
5905  this%dbrelz(n, idelay) = zr
5906  zr = zr - dz
5907  end do
5908  !
5909  ! -- return
5910  return
5911 

◆ csub_delay_sln()

subroutine gwfcsubmodule::csub_delay_sln ( class(gwfcsubtype), intent(inout)  this,
integer(i4b), intent(in)  ib,
real(dp), intent(in)  hcell,
logical, 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 5763 of file gwf-csub.f90.

5764  ! -- dummy variables
5765  class(GwfCsubType), intent(inout) :: this
5766  integer(I4B), intent(in) :: ib !< interbed number
5767  real(DP), intent(in) :: hcell !< current head in a cell
5768  logical, intent(in), optional :: update !< optional logical variable indicating
5769  !! if the maximum head change variable
5770  !! in a delay bed should be updated
5771  ! -- local variables
5772  logical :: lupdate
5773  integer(I4B) :: n
5774  integer(I4B) :: icnvg
5775  integer(I4B) :: iter
5776  integer(I4B) :: idelay
5777  real(DP) :: dh
5778  real(DP) :: dhmax
5779  real(DP) :: dhmax0
5780  real(DP), parameter :: dclose = dhundred * dprec
5781  !
5782  ! -- initialize variables
5783  if (present(update)) then
5784  lupdate = update
5785  else
5786  lupdate = .true.
5787  end if
5788  !
5789  ! -- calculate geostatic and effective stress for each delay bed cell
5790  call this%csub_delay_calc_stress(ib, hcell)
5791  !
5792  ! -- terminate if the aquifer head is below the top of delay interbeds
5793  if (count_errors() > 0) then
5794  call this%parser%StoreErrorUnit()
5795  end if
5796  !
5797  ! -- solve for delay bed heads
5798  if (this%thickini(ib) > dzero) then
5799  icnvg = 0
5800  iter = 0
5801  idelay = this%idelay(ib)
5802  do
5803  iter = iter + 1
5804  !
5805  ! -- assemble coefficients
5806  call this%csub_delay_assemble(ib, hcell)
5807  !
5808  ! -- solve for head change in delay interbed cells
5809  call ims_misc_thomas(this%ndelaycells, &
5810  this%dbal, this%dbad, this%dbau, &
5811  this%dbrhs, this%dbdh, this%dbaw)
5812  !
5813  ! -- calculate maximum head change and update delay bed heads
5814  dhmax = dzero
5815  do n = 1, this%ndelaycells
5816  dh = this%dbdh(n) - this%dbh(n, idelay)
5817  if (abs(dh) > abs(dhmax)) then
5818  dhmax = dh
5819  if (lupdate) then
5820  this%dbdhmax(idelay) = dhmax
5821  end if
5822  end if
5823  ! -- update delay bed heads
5824  this%dbh(n, idelay) = this%dbdh(n)
5825  end do
5826  !
5827  ! -- update delay bed stresses
5828  call this%csub_delay_calc_stress(ib, hcell)
5829  !
5830  ! -- check delay bed convergence
5831  if (abs(dhmax) < dclose) then
5832  icnvg = 1
5833  else if (iter /= 1) then
5834  if (abs(dhmax) - abs(dhmax0) < dprec) then
5835  icnvg = 1
5836  end if
5837  end if
5838  if (icnvg == 1) then
5839  exit
5840  end if
5841  dhmax0 = dhmax
5842  end do
5843  end if
5844  !
5845  ! -- return
5846  return
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 6757 of file gwf-csub.f90.

6758  ! -- dummy variables
6759  class(GwfCsubType), intent(inout) :: this
6760  integer(I4B), intent(in) :: ib !< interbed number
6761  ! -- local variables
6762  integer(I4B) :: idelay
6763  integer(I4B) :: n
6764  real(DP) :: comp
6765  real(DP) :: thick
6766  real(DP) :: theta
6767  real(DP) :: tthick
6768  real(DP) :: wtheta
6769  !
6770  ! -- initialize variables
6771  idelay = this%idelay(ib)
6772  comp = dzero
6773  tthick = dzero
6774  wtheta = dzero
6775  !
6776  !
6777  do n = 1, this%ndelaycells
6778  !
6779  ! -- initialize compaction for delay cell
6780  comp = this%dbtcomp(n, idelay) + this%dbcomp(n, idelay)
6781  !
6782  ! -- scale compaction by rnb to get the compaction for
6783  ! the interbed system (as opposed to the full system)
6784  comp = comp / this%rnb(ib)
6785  !
6786  ! -- update thickness and theta
6787  if (abs(comp) > dzero) then
6788  thick = this%dbdzini(n, idelay)
6789  theta = this%dbthetaini(n, idelay)
6790  call this%csub_adj_matprop(comp, thick, theta)
6791  if (thick <= dzero) then
6792  write (errmsg, '(2(a,i0),a,g0,a)') &
6793  'Adjusted thickness for delay interbed (', ib, &
6794  ') cell (', n, ') is less than or equal to 0 (', thick, ').'
6795  call store_error(errmsg)
6796  end if
6797  if (theta <= dzero) then
6798  write (errmsg, '(2(a,i0),a,g0,a)') &
6799  'Adjusted theta for delay interbed (', ib, &
6800  ') cell (', n, 'is less than or equal to 0 (', theta, ').'
6801  call store_error(errmsg)
6802  end if
6803  this%dbdz(n, idelay) = thick
6804  this%dbtheta(n, idelay) = theta
6805  tthick = tthick + thick
6806  wtheta = wtheta + thick * theta
6807  else
6808  thick = this%dbdz(n, idelay)
6809  theta = this%dbtheta(n, idelay)
6810  tthick = tthick + thick
6811  wtheta = wtheta + thick * theta
6812  end if
6813  end do
6814  !
6815  ! -- calculate thickness weighted theta and save thickness and weighted
6816  ! theta values for delay interbed
6817  if (tthick > dzero) then
6818  wtheta = wtheta / tthick
6819  else
6820  tthick = dzero
6821  wtheta = dzero
6822  end if
6823  this%thick(ib) = tthick
6824  this%theta(ib) = wtheta
6825  !
6826  ! -- return
6827  return
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 6921 of file gwf-csub.f90.

6922  ! -- dummy variables
6923  class(GwfCsubType) :: this
6924  ! -- local variables
6925  integer(I4B) :: indx
6926  !
6927  ! -- Store obs type and assign procedure pointer
6928  ! for csub observation type.
6929  call this%obs%StoreObsType('csub', .true., indx)
6930  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6931  !
6932  ! -- Store obs type and assign procedure pointer
6933  ! for inelastic-csub observation type.
6934  call this%obs%StoreObsType('inelastic-csub', .true., indx)
6935  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6936  !
6937  ! -- Store obs type and assign procedure pointer
6938  ! for elastic-csub observation type.
6939  call this%obs%StoreObsType('elastic-csub', .true., indx)
6940  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6941  !
6942  ! -- Store obs type and assign procedure pointer
6943  ! for coarse-csub observation type.
6944  call this%obs%StoreObsType('coarse-csub', .false., indx)
6945  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6946  !
6947  ! -- Store obs type and assign procedure pointer
6948  ! for csub-cell observation type.
6949  call this%obs%StoreObsType('csub-cell', .true., indx)
6950  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6951  !
6952  ! -- Store obs type and assign procedure pointer
6953  ! for watercomp-csub observation type.
6954  call this%obs%StoreObsType('wcomp-csub-cell', .false., indx)
6955  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6956  !
6957  ! -- Store obs type and assign procedure pointer
6958  ! for interbed ske observation type.
6959  call this%obs%StoreObsType('ske', .true., indx)
6960  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6961  !
6962  ! -- Store obs type and assign procedure pointer
6963  ! for interbed sk observation type.
6964  call this%obs%StoreObsType('sk', .true., indx)
6965  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6966  !
6967  ! -- Store obs type and assign procedure pointer
6968  ! for ske-cell observation type.
6969  call this%obs%StoreObsType('ske-cell', .true., indx)
6970  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6971  !
6972  ! -- Store obs type and assign procedure pointer
6973  ! for sk-cell observation type.
6974  call this%obs%StoreObsType('sk-cell', .true., indx)
6975  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6976  !
6977  ! -- Store obs type and assign procedure pointer
6978  ! for geostatic-stress-cell observation type.
6979  call this%obs%StoreObsType('gstress-cell', .false., indx)
6980  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6981  !
6982  ! -- Store obs type and assign procedure pointer
6983  ! for effective-stress-cell observation type.
6984  call this%obs%StoreObsType('estress-cell', .false., indx)
6985  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6986  !
6987  ! -- Store obs type and assign procedure pointer
6988  ! for total-compaction observation type.
6989  call this%obs%StoreObsType('interbed-compaction', .true., indx)
6990  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6991  !
6992  ! -- Store obs type and assign procedure pointer
6993  ! for inelastic-compaction observation type.
6994  call this%obs%StoreObsType('inelastic-compaction', .true., indx)
6995  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
6996  !
6997  ! -- Store obs type and assign procedure pointer
6998  ! for inelastic-compaction observation type.
6999  call this%obs%StoreObsType('elastic-compaction', .true., indx)
7000  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7001  !
7002  ! -- Store obs type and assign procedure pointer
7003  ! for coarse-compaction observation type.
7004  call this%obs%StoreObsType('coarse-compaction', .false., indx)
7005  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7006  !
7007  ! -- Store obs type and assign procedure pointer
7008  ! for inelastic-compaction-cell observation type.
7009  call this%obs%StoreObsType('inelastic-compaction-cell', .true., indx)
7010  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7011  !
7012  ! -- Store obs type and assign procedure pointer
7013  ! for elastic-compaction-cell observation type.
7014  call this%obs%StoreObsType('elastic-compaction-cell', .true., indx)
7015  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7016  !
7017  ! -- Store obs type and assign procedure pointer
7018  ! for compaction-cell observation type.
7019  call this%obs%StoreObsType('compaction-cell', .true., indx)
7020  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7021  !
7022  ! -- Store obs type and assign procedure pointer
7023  ! for interbed thickness observation type.
7024  call this%obs%StoreObsType('thickness', .true., indx)
7025  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7026  !
7027  ! -- Store obs type and assign procedure pointer
7028  ! for coarse-thickness observation type.
7029  call this%obs%StoreObsType('coarse-thickness', .false., indx)
7030  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7031  !
7032  ! -- Store obs type and assign procedure pointer
7033  ! for thickness-cell observation type.
7034  call this%obs%StoreObsType('thickness-cell', .false., indx)
7035  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7036  !
7037  ! -- Store obs type and assign procedure pointer
7038  ! for interbed theta observation type.
7039  call this%obs%StoreObsType('theta', .true., indx)
7040  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7041  !
7042  ! -- Store obs type and assign procedure pointer
7043  ! for coarse-theta observation type.
7044  call this%obs%StoreObsType('coarse-theta', .false., indx)
7045  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7046  !
7047  ! -- Store obs type and assign procedure pointer
7048  ! for theta-cell observation type.
7049  call this%obs%StoreObsType('theta-cell', .true., indx)
7050  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7051  !
7052  ! -- Store obs type and assign procedure pointer
7053  ! for preconstress-cell observation type.
7054  call this%obs%StoreObsType('preconstress-cell', .false., indx)
7055  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7056  !
7057  ! -- Store obs type and assign procedure pointer
7058  ! for delay-preconstress observation type.
7059  call this%obs%StoreObsType('delay-preconstress', .false., indx)
7060  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7061  !
7062  ! -- Store obs type and assign procedure pointer
7063  ! for delay-head observation type.
7064  call this%obs%StoreObsType('delay-head', .false., indx)
7065  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7066  !
7067  ! -- Store obs type and assign procedure pointer
7068  ! for delay-gstress observation type.
7069  call this%obs%StoreObsType('delay-gstress', .false., indx)
7070  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7071  !
7072  ! -- Store obs type and assign procedure pointer
7073  ! for delay-estress observation type.
7074  call this%obs%StoreObsType('delay-estress', .false., indx)
7075  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7076  !
7077  ! -- Store obs type and assign procedure pointer
7078  ! for delay-compaction observation type.
7079  call this%obs%StoreObsType('delay-compaction', .false., indx)
7080  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7081  !
7082  ! -- Store obs type and assign procedure pointer
7083  ! for delay-thickness observation type.
7084  call this%obs%StoreObsType('delay-thickness', .false., indx)
7085  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7086  !
7087  ! -- Store obs type and assign procedure pointer
7088  ! for delay-theta observation type.
7089  call this%obs%StoreObsType('delay-theta', .false., indx)
7090  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7091  !
7092  ! -- Store obs type and assign procedure pointer
7093  ! for delay-flowtop observation type.
7094  call this%obs%StoreObsType('delay-flowtop', .true., indx)
7095  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7096  !
7097  ! -- Store obs type and assign procedure pointer
7098  ! for delay-flowbot observation type.
7099  call this%obs%StoreObsType('delay-flowbot', .true., indx)
7100  this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
7101  !
7102  return
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 2789 of file gwf-csub.f90.

2790  ! -- modules
2791  use tdismodule, only: delt
2792  ! -- dummy variables
2793  class(GwfCsubType) :: this
2794  integer(I4B), intent(in) :: kiter !< outer iteration numbed
2795  real(DP), intent(in), dimension(:) :: hold !< previous heads
2796  real(DP), intent(in), dimension(:) :: hnew !< current heads
2797  class(MatrixBaseType), pointer :: matrix_sln !< A matrix
2798  integer(I4B), intent(in), dimension(:) :: idxglo !< global index model to solution
2799  real(DP), intent(inout), dimension(:) :: rhs !< right-hand side
2800  ! -- local variables
2801  integer(I4B) :: ib
2802  integer(I4B) :: node
2803  integer(I4B) :: idiag
2804  integer(I4B) :: idelay
2805  real(DP) :: tled
2806  real(DP) :: area
2807  real(DP) :: hcof
2808  real(DP) :: rhsterm
2809  real(DP) :: comp
2810  !
2811  ! -- update geostatic load calculation
2812  call this%csub_cg_calc_stress(this%dis%nodes, hnew)
2813  !
2814  ! -- formulate csub terms
2815  if (this%gwfiss == 0) then
2816  !
2817  ! -- initialize tled
2818  tled = done / delt
2819  !
2820  ! -- coarse-grained storage
2821  do node = 1, this%dis%nodes
2822  idiag = this%dis%con%ia(node)
2823  area = this%dis%get_area(node)
2824  !
2825  ! -- skip inactive cells
2826  if (this%ibound(node) < 1) cycle
2827  !
2828  ! -- update coarse-grained material properties
2829  if (this%iupdatematprop /= 0) then
2830  if (this%ieslag == 0) then
2831  !
2832  ! -- calculate compaction
2833  call this%csub_cg_calc_comp(node, hnew(node), hold(node), comp)
2834  this%cg_comp(node) = comp
2835  !
2836  ! -- update coarse-grained thickness and void ratio
2837  call this%csub_cg_update(node)
2838  end if
2839  end if
2840  !
2841  ! -- calculate coarse-grained storage terms
2842  call this%csub_cg_fc(node, tled, area, hnew(node), hold(node), &
2843  hcof, rhsterm)
2844  !
2845  ! -- add coarse-grained storage terms to amat and rhs for coarse-grained storage
2846  call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2847  rhs(node) = rhs(node) + rhsterm
2848  !
2849  ! -- calculate coarse-grained water compressibility
2850  ! storage terms
2851  if (this%brg /= dzero) then
2852  call this%csub_cg_wcomp_fc(node, tled, area, hnew(node), hold(node), &
2853  hcof, rhsterm)
2854  !
2855  ! -- add water compression storage terms to amat and rhs for
2856  ! coarse-grained storage
2857  call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2858  rhs(node) = rhs(node) + rhsterm
2859  end if
2860  end do
2861  !
2862  ! -- interbed storage
2863  if (this%ninterbeds /= 0) then
2864  !
2865  ! -- calculate the contribution of interbeds to the
2866  ! groundwater flow equation
2867  do ib = 1, this%ninterbeds
2868  node = this%nodelist(ib)
2869  idelay = this%idelay(ib)
2870  idiag = this%dis%con%ia(node)
2871  area = this%dis%get_area(node)
2872  call this%csub_interbed_fc(ib, node, area, hnew(node), hold(node), &
2873  hcof, rhsterm)
2874  call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2875  rhs(node) = rhs(node) + rhsterm
2876  !
2877  ! -- calculate interbed water compressibility terms
2878  if (.not. is_close(this%brg, dzero) .and. idelay == 0) then
2879  call this%csub_nodelay_wcomp_fc(ib, node, tled, area, &
2880  hnew(node), hold(node), &
2881  hcof, rhsterm)
2882  !
2883  ! -- add water compression storage terms to amat and rhs for interbed
2884  call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2885  rhs(node) = rhs(node) + rhsterm
2886  end if
2887  end do
2888  end if
2889  end if
2890  !
2891  ! -- terminate if errors encountered when updating material properties
2892  if (count_errors() > 0) then
2893  call this%parser%StoreErrorUnit()
2894  end if
2895  !
2896  ! -- return
2897  return
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 2909 of file gwf-csub.f90.

2910  ! -- modules
2911  use tdismodule, only: delt
2912  ! -- dummy variables
2913  class(GwfCsubType) :: this
2914  integer(I4B), intent(in) :: kiter !< outer iteration number
2915  real(DP), intent(in), dimension(:) :: hold !< previous heads
2916  real(DP), intent(in), dimension(:) :: hnew !< current heads
2917  class(MatrixBaseType), pointer :: matrix_sln !< A matrix
2918  integer(I4B), intent(in), dimension(:) :: idxglo !< global index model to solution
2919  real(DP), intent(inout), dimension(:) :: rhs !< right-hand side
2920  ! -- local variables
2921  integer(I4B) :: idelay
2922  integer(I4B) :: node
2923  integer(I4B) :: idiag
2924  integer(I4B) :: ib
2925  real(DP) :: tled
2926  real(DP) :: area
2927  real(DP) :: hcof
2928  real(DP) :: rhsterm
2929  !
2930  ! -- formulate csub terms
2931  if (this%gwfiss == 0) then
2932  tled = done / delt
2933  !
2934  ! -- coarse-grained storage
2935  do node = 1, this%dis%nodes
2936  idiag = this%dis%con%ia(node)
2937  area = this%dis%get_area(node)
2938  !
2939  ! -- skip inactive cells
2940  if (this%ibound(node) < 1) cycle
2941  !
2942  ! -- calculate coarse-grained storage newton terms
2943  call this%csub_cg_fn(node, tled, area, &
2944  hnew(node), hcof, rhsterm)
2945  !
2946  ! -- add coarse-grained storage newton terms to amat and rhs for
2947  ! coarse-grained storage
2948  call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2949  rhs(node) = rhs(node) + rhsterm
2950  !
2951  ! -- calculate coarse-grained water compressibility storage
2952  ! newton terms
2953  if (this%brg /= dzero) then
2954  call this%csub_cg_wcomp_fn(node, tled, area, hnew(node), hold(node), &
2955  hcof, rhsterm)
2956  !
2957  ! -- add water compression storage newton terms to amat and rhs for
2958  ! coarse-grained storage
2959  call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2960  rhs(node) = rhs(node) + rhsterm
2961  end if
2962  end do
2963  !
2964  ! -- interbed storage
2965  if (this%ninterbeds /= 0) then
2966  !
2967  ! -- calculate the interbed newton terms for the
2968  ! groundwater flow equation
2969  do ib = 1, this%ninterbeds
2970  idelay = this%idelay(ib)
2971  node = this%nodelist(ib)
2972  !
2973  ! -- skip inactive cells
2974  if (this%ibound(node) < 1) cycle
2975  !
2976  ! -- calculate interbed newton terms
2977  idiag = this%dis%con%ia(node)
2978  area = this%dis%get_area(node)
2979  call this%csub_interbed_fn(ib, node, hnew(node), hold(node), &
2980  hcof, rhsterm)
2981  !
2982  ! -- add interbed newton terms to amat and rhs
2983  call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2984  rhs(node) = rhs(node) + rhsterm
2985  !
2986  ! -- calculate interbed water compressibility terms
2987  if (this%brg /= dzero .and. idelay == 0) then
2988  call this%csub_nodelay_wcomp_fn(ib, node, tled, area, &
2989  hnew(node), hold(node), &
2990  hcof, rhsterm)
2991  !
2992  ! -- add interbed water compression newton terms to amat and rhs
2993  call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2994  rhs(node) = rhs(node) + rhsterm
2995  end if
2996  end do
2997  end if
2998  end if
2999  !
3000  ! -- return
3001  return

◆ 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 1868 of file gwf-csub.f90.

1869  ! -- dummy variables
1870  class(GwfCsubType) :: this
1871  ! -- local variables
1872  character(len=LINELENGTH) :: title
1873  character(len=LINELENGTH) :: tag
1874  character(len=LINELENGTH) :: msg
1875  character(len=10) :: ctype
1876  character(len=20) :: cellid
1877  character(len=10) :: cflag
1878  integer(I4B) :: i
1879  integer(I4B) :: ib
1880  integer(I4B) :: i0
1881  integer(I4B) :: i1
1882  integer(I4B) :: node
1883  integer(I4B) :: nn
1884  integer(I4B) :: idelay
1885  integer(I4B) :: iexceed
1886  integer(I4B), parameter :: ncells = 20
1887  integer(I4B) :: nlen
1888  integer(I4B) :: ntabrows
1889  integer(I4B) :: ntabcols
1890  integer(I4B) :: ipos
1891  real(DP) :: b0
1892  real(DP) :: b1
1893  real(DP) :: strain
1894  real(DP) :: pctcomp
1895  integer(I4B), dimension(:), allocatable :: imap_sel
1896  integer(I4B), dimension(:), allocatable :: locs
1897  real(DP), dimension(:), allocatable :: pctcomp_arr
1898  !
1899  ! -- initialize locs
1900  allocate (locs(this%dis%ndim))
1901  !
1902  ! -- calculate and report strain for interbeds
1903  if (this%ninterbeds > 0) then
1904  nlen = min(ncells, this%ninterbeds)
1905  allocate (imap_sel(nlen))
1906  allocate (pctcomp_arr(this%ninterbeds))
1907  iexceed = 0
1908  do ib = 1, this%ninterbeds
1909  idelay = this%idelay(ib)
1910  b0 = this%thickini(ib)
1911  strain = this%tcomp(ib) / b0
1912  pctcomp = dhundred * strain
1913  pctcomp_arr(ib) = pctcomp
1914  if (pctcomp >= done) then
1915  iexceed = iexceed + 1
1916  end if
1917  end do
1918  call selectn(imap_sel, pctcomp_arr, reverse=.true.)
1919  !
1920  ! -- summary interbed strain table
1921  i0 = max(1, this%ninterbeds - ncells + 1)
1922  i1 = this%ninterbeds
1923  msg = ''
1924  if (iexceed /= 0) then
1925  write (msg, '(1x,a,1x,i0,1x,a,1x,i0,1x,a)') &
1926  'LARGEST', (i1 - i0 + 1), 'OF', this%ninterbeds, &
1927  'INTERBED STRAIN VALUES SHOWN'
1928  call write_message(msg, this%iout, skipbefore=1)
1929  !
1930  ! -- interbed strain data
1931  ! -- set title
1932  title = trim(adjustl(this%packName))//' PACKAGE INTERBED STRAIN SUMMARY'
1933  !
1934  ! -- determine the number of columns and rows
1935  ntabrows = nlen
1936  ntabcols = 9
1937  !
1938  ! -- setup table
1939  call table_cr(this%outputtab, this%packName, title)
1940  call this%outputtab%table_df(ntabrows, ntabcols, this%iout)
1941  !
1942  ! add columns
1943  tag = 'INTERBED NUMBER'
1944  call this%outputtab%initialize_column(tag, 10, alignment=tabcenter)
1945  tag = 'INTERBED TYPE'
1946  call this%outputtab%initialize_column(tag, 10, alignment=tabcenter)
1947  tag = 'CELLID'
1948  call this%outputtab%initialize_column(tag, 20, alignment=tableft)
1949  tag = 'INITIAL THICKNESS'
1950  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
1951  tag = 'FINAL THICKNESS'
1952  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
1953  tag = 'TOTAL COMPACTION'
1954  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
1955  tag = 'FINAL STRAIN'
1956  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
1957  tag = 'PERCENT COMPACTION'
1958  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
1959  tag = 'FLAG'
1960  call this%outputtab%initialize_column(tag, 10, alignment=tabcenter)
1961  !
1962  ! -- write data
1963  do i = 1, nlen
1964  ib = imap_sel(i)
1965  idelay = this%idelay(ib)
1966  b0 = this%thickini(ib)
1967  b1 = this%csub_calc_interbed_thickness(ib)
1968  if (idelay == 0) then
1969  ctype = 'no-delay'
1970  else
1971  ctype = 'delay'
1972  b0 = b0 * this%rnb(ib)
1973  end if
1974  strain = this%tcomp(ib) / b0
1975  pctcomp = dhundred * strain
1976  if (pctcomp >= 5.0_dp) then
1977  cflag = '**>=5%'
1978  else if (pctcomp >= done) then
1979  cflag = '*>=1%'
1980  else
1981  cflag = ''
1982  end if
1983  node = this%nodelist(ib)
1984  call this%dis%noder_to_string(node, cellid)
1985  !
1986  ! -- fill table line
1987  call this%outputtab%add_term(ib)
1988  call this%outputtab%add_term(ctype)
1989  call this%outputtab%add_term(cellid)
1990  call this%outputtab%add_term(b0)
1991  call this%outputtab%add_term(b1)
1992  call this%outputtab%add_term(this%tcomp(ib))
1993  call this%outputtab%add_term(strain)
1994  call this%outputtab%add_term(pctcomp)
1995  call this%outputtab%add_term(cflag)
1996  end do
1997  write (this%iout, '(/1X,A,1X,I0,1X,A,1X,I0,1X,A,/1X,A,/1X,A)') &
1998  'PERCENT COMPACTION IS GREATER THAN OR EQUAL TO 1 PERCENT IN', &
1999  iexceed, 'OF', this%ninterbeds, 'INTERBED(S).', &
2000  'USE THE STRAIN_CSV_INTERBED OPTION TO OUTPUT A CSV '// &
2001  'FILE WITH PERCENT COMPACTION ', 'VALUES FOR ALL INTERBEDS.'
2002  else
2003  msg = 'PERCENT COMPACTION WAS LESS THAN 1 PERCENT IN ALL INTERBEDS'
2004  write (this%iout, '(/1X,A)') trim(adjustl(msg))
2005  end if
2006  !
2007  ! -- write csv file
2008  if (this%istrainib /= 0) then
2009  !
2010  ! -- determine the number of columns and rows
2011  ntabrows = this%ninterbeds
2012  ntabcols = 7
2013  if (this%dis%ndim > 1) then
2014  ntabcols = ntabcols + 1
2015  end if
2016  ntabcols = ntabcols + this%dis%ndim
2017  !
2018  ! -- setup table
2019  call table_cr(this%outputtab, this%packName, '')
2020  call this%outputtab%table_df(ntabrows, ntabcols, this%istrainib, &
2021  lineseparator=.false., separator=',')
2022  !
2023  ! add columns
2024  tag = 'INTERBED_NUMBER'
2025  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
2026  tag = 'INTERBED_TYPE'
2027  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
2028  tag = 'NODE'
2029  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
2030  if (this%dis%ndim == 2) then
2031  tag = 'LAYER'
2032  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
2033  tag = 'ICELL2D'
2034  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
2035  else
2036  tag = 'LAYER'
2037  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
2038  tag = 'ROW'
2039  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
2040  tag = 'COLUMN'
2041  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
2042  end if
2043  tag = 'INITIAL_THICKNESS'
2044  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
2045  tag = 'FINAL_THICKNESS'
2046  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
2047  tag = 'TOTAL_COMPACTION'
2048  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
2049  tag = 'TOTAL_STRAIN'
2050  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
2051  tag = 'PERCENT_COMPACTION'
2052  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
2053  !
2054  ! -- write data
2055  do ib = 1, this%ninterbeds
2056  idelay = this%idelay(ib)
2057  b0 = this%thickini(ib)
2058  b1 = this%csub_calc_interbed_thickness(ib)
2059  if (idelay == 0) then
2060  ctype = 'no-delay'
2061  else
2062  ctype = 'delay'
2063  b0 = b0 * this%rnb(ib)
2064  end if
2065  strain = this%tcomp(ib) / b0
2066  pctcomp = dhundred * strain
2067  node = this%nodelist(ib)
2068  call this%dis%noder_to_array(node, locs)
2069  !
2070  ! -- fill table line
2071  call this%outputtab%add_term(ib)
2072  call this%outputtab%add_term(ctype)
2073  if (this%dis%ndim > 1) then
2074  call this%outputtab%add_term(this%dis%get_nodeuser(node))
2075  end if
2076  do ipos = 1, this%dis%ndim
2077  call this%outputtab%add_term(locs(ipos))
2078  end do
2079  call this%outputtab%add_term(b0)
2080  call this%outputtab%add_term(b1)
2081  call this%outputtab%add_term(this%tcomp(ib))
2082  call this%outputtab%add_term(strain)
2083  call this%outputtab%add_term(pctcomp)
2084  end do
2085  end if
2086  !
2087  ! -- deallocate temporary storage
2088  deallocate (imap_sel)
2089  deallocate (pctcomp_arr)
2090  end if
2091  !
2092  ! -- calculate and report strain for coarse-grained materials
2093  nlen = min(ncells, this%dis%nodes)
2094  allocate (imap_sel(nlen))
2095  allocate (pctcomp_arr(this%dis%nodes))
2096  iexceed = 0
2097  do node = 1, this%dis%nodes
2098  strain = dzero
2099  if (this%cg_thickini(node) > dzero) then
2100  strain = this%cg_tcomp(node) / this%cg_thickini(node)
2101  end if
2102  pctcomp = dhundred * strain
2103  pctcomp_arr(node) = pctcomp
2104  if (pctcomp >= done) then
2105  iexceed = iexceed + 1
2106  end if
2107  end do
2108  call selectn(imap_sel, pctcomp_arr, reverse=.true.)
2109  !
2110  ! -- summary coarse-grained strain table
2111  i0 = max(1, this%dis%nodes - ncells + 1)
2112  i1 = this%dis%nodes
2113  msg = ''
2114  if (iexceed /= 0) then
2115  write (msg, '(a,1x,i0,1x,a,1x,i0,1x,a)') &
2116  'LARGEST ', (i1 - i0 + 1), 'OF', this%dis%nodes, &
2117  'CELL COARSE-GRAINED VALUES SHOWN'
2118  call write_message(msg, this%iout, skipbefore=1)
2119  !
2120  ! -- set title
2121  title = trim(adjustl(this%packName))// &
2122  ' PACKAGE COARSE-GRAINED STRAIN SUMMARY'
2123  !
2124  ! -- determine the number of columns and rows
2125  ntabrows = nlen
2126  ntabcols = 7
2127  !
2128  ! -- setup table
2129  call table_cr(this%outputtab, this%packName, title)
2130  call this%outputtab%table_df(ntabrows, ntabcols, this%iout)
2131  !
2132  ! add columns
2133  tag = 'CELLID'
2134  call this%outputtab%initialize_column(tag, 20, alignment=tableft)
2135  tag = 'INITIAL THICKNESS'
2136  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
2137  tag = 'FINAL THICKNESS'
2138  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
2139  tag = 'TOTAL COMPACTION'
2140  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
2141  tag = 'FINAL STRAIN'
2142  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
2143  tag = 'PERCENT COMPACTION'
2144  call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
2145  tag = 'FLAG'
2146  call this%outputtab%initialize_column(tag, 10, alignment=tabcenter)
2147  ! -- write data
2148  do nn = 1, nlen
2149  node = imap_sel(nn)
2150  if (this%cg_thickini(node) > dzero) then
2151  strain = this%cg_tcomp(node) / this%cg_thickini(node)
2152  else
2153  strain = dzero
2154  end if
2155  pctcomp = dhundred * strain
2156  if (pctcomp >= 5.0_dp) then
2157  cflag = '**>=5%'
2158  else if (pctcomp >= done) then
2159  cflag = '*>=1%'
2160  else
2161  cflag = ''
2162  end if
2163  call this%dis%noder_to_string(node, cellid)
2164  !
2165  ! -- fill table line
2166  call this%outputtab%add_term(cellid)
2167  call this%outputtab%add_term(this%cg_thickini(node))
2168  call this%outputtab%add_term(this%cg_thick(node))
2169  call this%outputtab%add_term(this%cg_tcomp(node))
2170  call this%outputtab%add_term(strain)
2171  call this%outputtab%add_term(pctcomp)
2172  call this%outputtab%add_term(cflag)
2173  end do
2174  write (this%iout, '(/1X,A,1X,I0,1X,A,1X,I0,1X,A,/1X,A,/1X,A)') &
2175  'COARSE-GRAINED STORAGE PERCENT COMPACTION IS GREATER THAN OR '// &
2176  'EQUAL TO 1 PERCENT IN', iexceed, 'OF', this%dis%nodes, 'CELL(S).', &
2177  'USE THE STRAIN_CSV_COARSE OPTION TO OUTPUT A CSV '// &
2178  'FILE WITH PERCENT COMPACTION ', 'VALUES FOR ALL CELLS.'
2179  else
2180  msg = 'COARSE-GRAINED STORAGE PERCENT COMPACTION WAS LESS THAN '// &
2181  '1 PERCENT IN ALL CELLS '
2182  write (this%iout, '(/1X,A)') trim(adjustl(msg))
2183  end if
2184  !
2185  ! -- write csv file
2186  if (this%istrainsk /= 0) then
2187  !
2188  ! -- determine the number of columns and rows
2189  ntabrows = this%dis%nodes
2190  ntabcols = 5
2191  if (this%dis%ndim > 1) then
2192  ntabcols = ntabcols + 1
2193  end if
2194  ntabcols = ntabcols + this%dis%ndim
2195  !
2196  ! -- setup table
2197  call table_cr(this%outputtab, this%packName, '')
2198  call this%outputtab%table_df(ntabrows, ntabcols, this%istrainsk, &
2199  lineseparator=.false., separator=',')
2200  !
2201  ! add columns
2202  tag = 'NODE'
2203  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
2204  if (this%dis%ndim == 2) then
2205  tag = 'LAYER'
2206  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
2207  tag = 'ICELL2D'
2208  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
2209  else
2210  tag = 'LAYER'
2211  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
2212  tag = 'ROW'
2213  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
2214  tag = 'COLUMN'
2215  call this%outputtab%initialize_column(tag, 10, alignment=tabright)
2216  end if
2217  tag = 'INITIAL_THICKNESS'
2218  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
2219  tag = 'FINAL_THICKNESS'
2220  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
2221  tag = 'TOTAL_COMPACTION'
2222  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
2223  tag = 'TOTAL_STRAIN'
2224  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
2225  tag = 'PERCENT_COMPACTION'
2226  call this%outputtab%initialize_column(tag, 20, alignment=tabright)
2227  !
2228  ! -- write data
2229  do node = 1, this%dis%nodes
2230  if (this%cg_thickini(node) > dzero) then
2231  strain = this%cg_tcomp(node) / this%cg_thickini(node)
2232  else
2233  strain = dzero
2234  end if
2235  pctcomp = dhundred * strain
2236  call this%dis%noder_to_array(node, locs)
2237  !
2238  ! -- fill table line
2239  if (this%dis%ndim > 1) then
2240  call this%outputtab%add_term(this%dis%get_nodeuser(node))
2241  end if
2242  do ipos = 1, this%dis%ndim
2243  call this%outputtab%add_term(locs(ipos))
2244  end do
2245  call this%outputtab%add_term(this%cg_thickini(node))
2246  call this%outputtab%add_term(this%cg_thick(node))
2247  call this%outputtab%add_term(this%cg_tcomp(node))
2248  call this%outputtab%add_term(strain)
2249  call this%outputtab%add_term(pctcomp)
2250  end do
2251  end if
2252  !
2253  ! -- write a warning message for delay interbeds in non-convertible gwf
2254  ! cells that violate minimum head assumptions
2255  if (this%ndelaybeds > 0) then
2256  if (this%idb_nconv_count(2) > 0) then
2257  write (warnmsg, '(a,1x,a,1x,i0,1x,a,1x,a)') &
2258  'Delay interbed cell heads were less than the top of the interbed', &
2259  'cell in', this%idb_nconv_count(2), 'interbed cells in ', &
2260  'non-convertible GWF cells for at least one time step during '// &
2261  'the simulation.'
2262  call store_warning(warnmsg)
2263  end if
2264  end if
2265  !
2266  ! -- deallocate temporary storage
2267  deallocate (imap_sel)
2268  deallocate (locs)
2269  deallocate (pctcomp_arr)
2270  !
2271  ! -- return
2272  return
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 4889 of file gwf-csub.f90.

4890  ! -- dummy variables
4891  class(GwfCsubType) :: this
4892  integer(I4B), intent(in) :: ib !< interbed number
4893  integer(I4B), intent(in) :: node !< cell node number
4894  real(DP), intent(in) :: area !< horizontal cell area
4895  real(DP), intent(in) :: hcell !< current head in cell
4896  real(DP), intent(in) :: hcellold !< previous head in cell
4897  real(DP), intent(inout) :: hcof !< interbed A matrix entry
4898  real(DP), intent(inout) :: rhs !< interbed right-hand side
4899  ! -- local variables
4900  real(DP) :: snnew
4901  real(DP) :: snold
4902  real(DP) :: comp
4903  real(DP) :: compi
4904  real(DP) :: compe
4905  real(DP) :: rho1
4906  real(DP) :: rho2
4907  real(DP) :: f
4908  !
4909  ! -- initialize variables
4910  rhs = dzero
4911  hcof = dzero
4912  comp = dzero
4913  compi = dzero
4914  compe = dzero
4915  !
4916  ! -- skip inactive and constant head cells
4917  if (this%ibound(node) > 0) then
4918  if (this%idelay(ib) == 0) then
4919  !
4920  ! -- update material properties
4921  if (this%iupdatematprop /= 0) then
4922  if (this%ieslag == 0) then
4923  !
4924  ! -- calculate compaction
4925  call this%csub_nodelay_calc_comp(ib, hcell, hcellold, comp, &
4926  rho1, rho2)
4927  this%comp(ib) = comp
4928  !
4929  ! -- update thickness and void ratio
4930  call this%csub_nodelay_update(ib)
4931  end if
4932  end if
4933  !
4934  ! -- calculate no-delay interbed rho1 and rho2
4935  call this%csub_nodelay_fc(ib, hcell, hcellold, rho1, hcof, rhs)
4936  f = area
4937  else
4938  !
4939  ! -- calculate cell saturation
4940  call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4941  !
4942  ! -- update material properties
4943  if (this%iupdatematprop /= 0) then
4944  if (this%ieslag == 0) then
4945  !
4946  ! -- calculate compaction
4947  call this%csub_delay_calc_comp(ib, hcell, hcellold, &
4948  comp, compi, compe)
4949  this%comp(ib) = comp
4950  !
4951  ! -- update thickness and void ratio
4952  call this%csub_delay_update(ib)
4953  end if
4954  end if
4955  !
4956  ! -- calculate delay interbed hcof and rhs
4957  call this%csub_delay_sln(ib, hcell)
4958  call this%csub_delay_fc(ib, hcof, rhs)
4959  f = area * this%rnb(ib)
4960  end if
4961  rhs = rhs * f
4962  hcof = -hcof * f
4963  end if
4964  !
4965  ! -- return
4966  return

◆ 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 4978 of file gwf-csub.f90.

4979  ! -- modules
4980  use tdismodule, only: delt
4981  ! -- dummy variables
4982  class(GwfCsubType) :: this
4983  integer(I4B), intent(in) :: ib !< interbed number
4984  integer(I4B), intent(in) :: node !< cell node number
4985  real(DP), intent(in) :: hcell !< current head in a cell
4986  real(DP), intent(in) :: hcellold !< previous head in a cell
4987  real(DP), intent(inout) :: hcof !< interbed A matrix entry
4988  real(DP), intent(inout) :: rhs !< interbed right-hand side entry
4989  ! -- local variables
4990  integer(I4B) :: idelay
4991  real(DP) :: hcofn
4992  real(DP) :: rhsn
4993  real(DP) :: top
4994  real(DP) :: bot
4995  real(DP) :: tled
4996  real(DP) :: tthk
4997  real(DP) :: snnew
4998  real(DP) :: snold
4999  real(DP) :: f
5000  real(DP) :: satderv
5001  real(DP) :: hbar
5002  real(DP) :: hbarderv
5003  real(DP) :: rho1
5004  real(DP) :: rho2
5005  !
5006  ! -- initialize variables
5007  rhs = dzero
5008  hcof = dzero
5009  rhsn = dzero
5010  hcofn = dzero
5011  satderv = dzero
5012  idelay = this%idelay(ib)
5013  top = this%dis%top(node)
5014  bot = this%dis%bot(node)
5015  !
5016  ! -- skip inactive and constant head cells
5017  if (this%ibound(node) > 0) then
5018  tled = done / delt
5019  tthk = this%thickini(ib)
5020  !
5021  ! -- calculate cell saturation
5022  call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
5023  !
5024  ! -- no-delay interbeds
5025  if (idelay == 0) then
5026  !
5027  ! -- initialize factor
5028  f = done
5029  !
5030  ! -- calculate the saturation derivative
5031  satderv = this%csub_calc_sat_derivative(node, hcell)
5032  !
5033  ! -- calculate corrected head (hbar)
5034  hbar = squadratic0sp(hcell, bot, this%satomega)
5035  !
5036  ! -- calculate the derivative of the hbar functions
5037  hbarderv = squadratic0spderivative(hcell, bot, this%satomega)
5038  !
5039  ! -- calculate storage coefficient
5040  call this%csub_nodelay_fc(ib, hcell, hcellold, rho1, rho2, rhsn)
5041  !
5042  ! -- calculate hcofn term
5043  hcofn = rho2 * (done - hbarderv) * snnew + &
5044  rho2 * (this%cg_gs(node) - hbar + bot) * satderv
5045  if (this%ielastic(ib) == 0) then
5046  hcofn = hcofn - rho2 * this%pcs(ib) * satderv
5047  end if
5048  !
5049  ! -- Add additional term if using lagged effective stress
5050  if (this%ieslag /= 0) then
5051  if (this%ielastic(ib) /= 0) then
5052  hcofn = hcofn - rho1 * this%cg_es0(node) * satderv
5053  else
5054  hcofn = hcofn - rho1 * (this%pcs(ib) - this%cg_es0(node)) * satderv
5055  end if
5056  end if
5057  end if
5058  end if
5059  !
5060  ! -- return
5061  return
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 4308 of file gwf-csub.f90.

4309  ! -- dummy variables
4310  class(GwfCsubType) :: this
4311  integer(I4B), intent(in) :: ib !< interbed number
4312  real(DP), intent(in) :: hcell !< current head for the cell
4313  real(DP), intent(in) :: hcellold !< previous head for the cell
4314  real(DP), intent(inout) :: comp !< no-delay interbed compaction
4315  real(DP), intent(inout) :: rho1 !< current storage coefficient based on Sske
4316  real(DP), intent(inout) :: rho2 !< current storage coefficient based on Ssk
4317  ! -- local variables
4318  integer(I4B) :: node
4319  real(DP) :: es
4320  real(DP) :: es0
4321  real(DP) :: pcs
4322  real(DP) :: tled
4323  real(DP) :: rhs
4324  !
4325  ! -- initialize variables
4326  node = this%nodelist(ib)
4327  tled = done
4328  es = this%cg_es(node)
4329  es0 = this%cg_es0(node)
4330  pcs = this%pcs(ib)
4331  !
4332  ! -- calculate no-delay interbed rho1 and rho2
4333  call this%csub_nodelay_fc(ib, hcell, hcellold, rho1, rho2, rhs, argtled=tled)
4334  !
4335  ! -- calculate no-delay interbed compaction
4336  if (this%ielastic(ib) /= 0) then
4337  comp = rho2 * es - rho1 * es0
4338  else
4339  comp = -pcs * (rho2 - rho1) - (rho1 * es0) + (rho2 * es)
4340  end if
4341  !
4342  ! -- return
4343  return
4344 

◆ 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 4196 of file gwf-csub.f90.

4198  ! -- modules
4199  use tdismodule, only: delt
4200  ! -- dummy variables
4201  class(GwfCsubType) :: this
4202  integer(I4B), intent(in) :: ib !< interbed number
4203  real(DP), intent(in) :: hcell !< current head in the cell
4204  real(DP), intent(in) :: hcellold !< previous head in the cell
4205  real(DP), intent(inout) :: rho1 !< current storage coefficient value using Sske
4206  real(DP), intent(inout) :: rho2 !< current storage coefficient value based on Ssk
4207  real(DP), intent(inout) :: rhs !< no-delay interbed contribution to the right-hand side
4208  real(DP), intent(in), optional :: argtled !< optional reciprocal of the time step length
4209  ! -- local variables
4210  integer(I4B) :: node
4211  real(DP) :: tled
4212  real(DP) :: top
4213  real(DP) :: bot
4214  real(DP) :: thick
4215  real(DP) :: hbar
4216  real(DP) :: znode
4217  real(DP) :: snold
4218  real(DP) :: snnew
4219  real(DP) :: sto_fac
4220  real(DP) :: sto_fac0
4221  real(DP) :: area
4222  real(DP) :: theta
4223  real(DP) :: es
4224  real(DP) :: es0
4225  real(DP) :: f
4226  real(DP) :: f0
4227  real(DP) :: rcorr
4228  !
4229  ! -- process optional variables
4230  if (present(argtled)) then
4231  tled = argtled
4232  else
4233  tled = done / delt
4234  end if
4235  node = this%nodelist(ib)
4236  area = this%dis%get_area(node)
4237  bot = this%dis%bot(node)
4238  top = this%dis%top(node)
4239  thick = this%thickini(ib)
4240  !
4241  ! -- calculate corrected head (hbar)
4242  hbar = squadratic0sp(hcell, bot, this%satomega)
4243  !
4244  ! -- set iconvert
4245  this%iconvert(ib) = 0
4246  !
4247  ! -- aquifer saturation
4248  call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4249  if (this%lhead_based .EQV. .true.) then
4250  f = done
4251  f0 = done
4252  else
4253  znode = this%csub_calc_znode(top, bot, hbar)
4254  es = this%cg_es(node)
4255  es0 = this%cg_es0(node)
4256  theta = this%thetaini(ib)
4257  !
4258  ! -- calculate the compression index factors for the delay
4259  ! node relative to the center of the cell based on the
4260  ! current and previous head
4261  call this%csub_calc_sfacts(node, bot, znode, theta, es, es0, f)
4262  end if
4263  sto_fac = tled * snnew * thick * f
4264  sto_fac0 = tled * snold * thick * f
4265  !
4266  ! -- calculate rho1 and rho2
4267  rho1 = this%rci(ib) * sto_fac0
4268  rho2 = this%rci(ib) * sto_fac
4269  if (this%cg_es(node) > this%pcs(ib)) then
4270  this%iconvert(ib) = 1
4271  rho2 = this%ci(ib) * sto_fac
4272  end if
4273  !
4274  ! -- calculate correction term
4275  rcorr = rho2 * (hcell - hbar)
4276  !
4277  ! -- fill right-hand side
4278  if (this%ielastic(ib) /= 0) then
4279  rhs = rho1 * this%cg_es0(node) - &
4280  rho2 * (this%cg_gs(node) + bot) - &
4281  rcorr
4282  else
4283  rhs = -rho2 * (this%cg_gs(node) + bot) + &
4284  (this%pcs(ib) * (rho2 - rho1)) + &
4285  (rho1 * this%cg_es0(node)) - &
4286  rcorr
4287  end if
4288  !
4289  ! -- save ske and sk
4290  this%ske(ib) = rho1
4291  this%sk(ib) = rho2
4292  !
4293  ! -- return
4294  return
4295 
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 4149 of file gwf-csub.f90.

4150  ! -- dummy variables
4151  class(GwfCsubType), intent(inout) :: this
4152  integer(I4B), intent(in) :: i
4153  ! -- local variables
4154  real(DP) :: comp
4155  real(DP) :: thick
4156  real(DP) :: theta
4157  !
4158  ! -- update thickness and theta
4159  comp = this%tcomp(i) + this%comp(i)
4160  if (abs(comp) > dzero) then
4161  thick = this%thickini(i)
4162  theta = this%thetaini(i)
4163  call this%csub_adj_matprop(comp, thick, theta)
4164  if (thick <= dzero) then
4165  write (errmsg, '(a,1x,i0,1x,a,g0,a)') &
4166  'Adjusted thickness for no-delay interbed', i, &
4167  'is less than or equal to 0 (', thick, ').'
4168  call store_error(errmsg)
4169  end if
4170  if (theta <= dzero) then
4171  write (errmsg, '(a,1x,i0,1x,a,g0,a)') &
4172  'Adjusted theta for no-delay interbed', i, &
4173  'is less than or equal to 0 (', theta, ').'
4174  call store_error(errmsg)
4175  end if
4176  this%thick(i) = thick
4177  this%theta(i) = theta
4178  end if
4179  !
4180  ! -- return
4181  return
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 5332 of file gwf-csub.f90.

5334  ! -- dummy variables
5335  class(GwfCsubType), intent(inout) :: this
5336  integer(I4B), intent(in) :: ib !< interbed number
5337  integer(I4B), intent(in) :: node !< cell node number
5338  real(DP), intent(in) :: tled !< reciprocal of time step length
5339  real(DP), intent(in) :: area !< horizontal cell area
5340  real(DP), intent(in) :: hcell !< current head in cell
5341  real(DP), intent(in) :: hcellold !< previous head in cell
5342  real(DP), intent(inout) :: hcof !< no-delay A matrix entry
5343  real(DP), intent(inout) :: rhs !< no-delay right-hand side entry
5344  ! -- local variables
5345  real(DP) :: top
5346  real(DP) :: bot
5347  real(DP) :: snold
5348  real(DP) :: snnew
5349  real(DP) :: f
5350  real(DP) :: wc
5351  real(DP) :: wc0
5352  !
5353  ! -- initialize variables
5354  rhs = dzero
5355  hcof = dzero
5356  !
5357  ! -- aquifer elevations and thickness
5358  top = this%dis%top(node)
5359  bot = this%dis%bot(node)
5360  !
5361  ! -- calculate cell saturation
5362  call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
5363  !
5364  !
5365  f = this%brg * area * tled
5366  wc0 = f * this%theta0(ib) * this%thick0(ib)
5367  wc = f * this%theta(ib) * this%thick(ib)
5368  hcof = -wc * snnew
5369  rhs = -wc0 * snold * hcellold
5370  !
5371  ! -- return
5372  return

◆ 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 5385 of file gwf-csub.f90.

5387  ! -- dummy variables
5388  class(GwfCsubType), intent(inout) :: this
5389  integer(I4B), intent(in) :: ib !< interbed number
5390  integer(I4B), intent(in) :: node !< cell node number
5391  real(DP), intent(in) :: tled !< reciprocal of time step length
5392  real(DP), intent(in) :: area !< horizontal cell area
5393  real(DP), intent(in) :: hcell !< current head in cell
5394  real(DP), intent(in) :: hcellold !< previous head in cell
5395  real(DP), intent(inout) :: hcof !< no-delay A matrix entry
5396  real(DP), intent(inout) :: rhs !< no-delay right-hand side entry
5397  ! -- local variables
5398  real(DP) :: top
5399  real(DP) :: bot
5400  real(DP) :: f
5401  real(DP) :: wc
5402  real(DP) :: wc0
5403  real(DP) :: satderv
5404  !
5405  ! -- initialize variables
5406  rhs = dzero
5407  hcof = dzero
5408  !
5409  ! -- aquifer elevations and thickness
5410  top = this%dis%top(node)
5411  bot = this%dis%bot(node)
5412  !
5413  !
5414  f = this%brg * area * tled
5415  !
5416  ! -- calculate saturation derivative
5417  satderv = this%csub_calc_sat_derivative(node, hcell)
5418  !
5419  ! -- calculate the current water compressibility factor
5420  wc = f * this%theta(ib) * this%thick(ib)
5421  !
5422  ! -- calculate derivative term
5423  hcof = -wc * hcell * satderv
5424  !
5425  ! -- Add additional term if using lagged effective stress
5426  if (this%ieslag /= 0) then
5427  wc0 = f * this%theta0(ib) * this%thick0(ib)
5428  hcof = hcof + wc0 * hcellold * satderv
5429  end if
5430  !
5431  ! -- set rhs
5432  rhs = hcof * hcell
5433  !
5434  ! -- return
5435  return

◆ 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 6905 of file gwf-csub.f90.

6906  ! -- dummy variables
6907  class(GwfCsubType) :: this
6908  !
6909  ! -- initialize variables
6910  csub_obs_supported = .true.
6911  !
6912  ! -- return
6913  return

◆ 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 3679 of file gwf-csub.f90.

3680  ! -- dummy variables
3681  class(GwfCsubType) :: this
3682  integer(I4B), intent(in) :: idvfl !< flag to save dependent variable data
3683  integer(I4B), intent(in) :: idvprint !< flag to print dependent variable data
3684  ! -- local variables
3685  character(len=1) :: cdatafmp = ' '
3686  character(len=1) :: editdesc = ' '
3687  integer(I4B) :: ibinun
3688  integer(I4B) :: iprint
3689  integer(I4B) :: nvaluesp
3690  integer(I4B) :: nwidthp
3691  integer(I4B) :: ib
3692  integer(I4B) :: node
3693  integer(I4B) :: nodem
3694  integer(I4B) :: nodeu
3695  integer(I4B) :: i
3696  integer(I4B) :: ii
3697  integer(I4B) :: idx_conn
3698  integer(I4B) :: k
3699  integer(I4B) :: ncpl
3700  integer(I4B) :: nlay
3701  integer(I4B) :: ihc
3702  real(DP) :: dinact
3703  real(DP) :: va_scale
3704  ! -- formats
3705  character(len=*), parameter :: fmtnconv = &
3706  "(/4x, 'DELAY INTERBED CELL HEADS IN ', i0, ' INTERBEDS IN', &
3707  &' NON-CONVERTIBLE GWF CELLS WERE LESS THAN THE TOP OF THE INTERBED CELL')"
3708  !
3709  ! -- Save compaction results
3710  !
3711  ! -- Set unit number for binary compaction and z-displacement output
3712  if (this%ioutcomp /= 0 .or. this%ioutzdisp /= 0) then
3713  ibinun = 1
3714  else
3715  ibinun = 0
3716  end if
3717  if (idvfl == 0) ibinun = 0
3718  !
3719  ! -- save compaction results
3720  if (ibinun /= 0) then
3721  iprint = 0
3722  dinact = dhnoflo
3723  !
3724  ! -- fill buff with total compaction
3725  do node = 1, this%dis%nodes
3726  this%buff(node) = this%cg_tcomp(node)
3727  end do
3728  do ib = 1, this%ninterbeds
3729  node = this%nodelist(ib)
3730  this%buff(node) = this%buff(node) + this%tcomp(ib)
3731  end do
3732  !
3733  ! -- write compaction data to binary file
3734  if (this%ioutcomp /= 0) then
3735  ibinun = this%ioutcomp
3736  call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3737  comptxt(1), cdatafmp, nvaluesp, &
3738  nwidthp, editdesc, dinact)
3739  end if
3740  !
3741  ! -- calculate z-displacement (subsidence) and write data to binary file
3742  if (this%ioutzdisp /= 0) then
3743  ibinun = this%ioutzdisp
3744  !
3745  ! -- initialize buffusr
3746  do nodeu = 1, this%dis%nodesuser
3747  this%buffusr(nodeu) = dzero
3748  end do
3749  !
3750  ! -- fill buffusr with buff
3751  do node = 1, this%dis%nodes
3752  nodeu = this%dis%get_nodeuser(node)
3753  this%buffusr(nodeu) = this%buff(node)
3754  end do
3755  !
3756  ! -- calculate z-displacement
3757  ncpl = this%dis%get_ncpl()
3758  !
3759  ! -- disu
3760  if (this%dis%ndim == 1) then
3761  do node = this%dis%nodes, 1, -1
3762  do ii = this%dis%con%ia(node) + 1, this%dis%con%ia(node + 1) - 1
3763  !
3764  ! -- Set the m cell number
3765  nodem = this%dis%con%ja(ii)
3766  idx_conn = this%dis%con%jas(ii)
3767  !
3768  ! -- vertical connection
3769  ihc = this%dis%con%ihc(idx_conn)
3770  if (ihc == 0) then
3771  !
3772  ! -- node has an underlying cell
3773  if (node < nodem) then
3774  va_scale = this%dis%get_area_factor(node, idx_conn)
3775  this%buffusr(node) = this%buffusr(node) + &
3776  va_scale * this%buffusr(nodem)
3777  end if
3778  end if
3779  end do
3780  end do
3781  ! -- disv or dis
3782  else
3783  nlay = this%dis%nodesuser / ncpl
3784  do k = nlay - 1, 1, -1
3785  do i = 1, ncpl
3786  node = (k - 1) * ncpl + i
3787  nodem = k * ncpl + i
3788  this%buffusr(node) = this%buffusr(node) + this%buffusr(nodem)
3789  end do
3790  end do
3791  end if
3792  !
3793  ! -- fill buff with data from buffusr
3794  do nodeu = 1, this%dis%nodesuser
3795  node = this%dis%get_nodenumber_idx1(nodeu, 1)
3796  if (node /= 0) then
3797  this%buff(node) = this%buffusr(nodeu)
3798  end if
3799  end do
3800  !
3801  ! -- write z-displacement
3802  call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3803  comptxt(6), cdatafmp, nvaluesp, &
3804  nwidthp, editdesc, dinact)
3805 
3806  end if
3807  end if
3808  !
3809  ! -- Set unit number for binary inelastic interbed compaction
3810  if (this%ioutcompi /= 0) then
3811  ibinun = this%ioutcompi
3812  else
3813  ibinun = 0
3814  end if
3815  if (idvfl == 0) ibinun = 0
3816  !
3817  ! -- save inelastic interbed compaction results
3818  if (ibinun /= 0) then
3819  iprint = 0
3820  dinact = dhnoflo
3821  !
3822  ! -- fill buff with inelastic interbed compaction
3823  do node = 1, this%dis%nodes
3824  this%buff(node) = dzero
3825  end do
3826  do ib = 1, this%ninterbeds
3827  node = this%nodelist(ib)
3828  this%buff(node) = this%buff(node) + this%tcompi(ib)
3829  end do
3830  !
3831  ! -- write inelastic interbed compaction data to binary file
3832  call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3833  comptxt(2), cdatafmp, nvaluesp, &
3834  nwidthp, editdesc, dinact)
3835  end if
3836  !
3837  ! -- Set unit number for binary elastic interbed compaction
3838  if (this%ioutcompe /= 0) then
3839  ibinun = this%ioutcompe
3840  else
3841  ibinun = 0
3842  end if
3843  if (idvfl == 0) ibinun = 0
3844  !
3845  ! -- save elastic interbed compaction results
3846  if (ibinun /= 0) then
3847  iprint = 0
3848  dinact = dhnoflo
3849  !
3850  ! -- fill buff with elastic interbed compaction
3851  do node = 1, this%dis%nodes
3852  this%buff(node) = dzero
3853  end do
3854  do ib = 1, this%ninterbeds
3855  node = this%nodelist(ib)
3856  this%buff(node) = this%buff(node) + this%tcompe(ib)
3857  end do
3858  !
3859  ! -- write elastic interbed compaction data to binary file
3860  call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3861  comptxt(3), cdatafmp, nvaluesp, &
3862  nwidthp, editdesc, dinact)
3863  end if
3864  !
3865  ! -- Set unit number for binary interbed compaction
3866  if (this%ioutcompib /= 0) then
3867  ibinun = this%ioutcompib
3868  else
3869  ibinun = 0
3870  end if
3871  if (idvfl == 0) ibinun = 0
3872  !
3873  ! -- save interbed compaction results
3874  if (ibinun /= 0) then
3875  iprint = 0
3876  dinact = dhnoflo
3877  !
3878  ! -- fill buff with interbed compaction
3879  do node = 1, this%dis%nodes
3880  this%buff(node) = dzero
3881  end do
3882  do ib = 1, this%ninterbeds
3883  node = this%nodelist(ib)
3884  this%buff(node) = this%buff(node) + this%tcompe(ib) + this%tcompi(ib)
3885  end do
3886  !
3887  ! -- write interbed compaction data to binary file
3888  call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3889  comptxt(4), cdatafmp, nvaluesp, &
3890  nwidthp, editdesc, dinact)
3891  end if
3892  !
3893  ! -- Set unit number for binary coarse-grained compaction
3894  if (this%ioutcomps /= 0) then
3895  ibinun = this%ioutcomps
3896  else
3897  ibinun = 0
3898  end if
3899  if (idvfl == 0) ibinun = 0
3900  !
3901  ! -- save coarse-grained compaction results
3902  if (ibinun /= 0) then
3903  iprint = 0
3904  dinact = dhnoflo
3905  !
3906  ! -- fill buff with coarse-grained compaction
3907  do node = 1, this%dis%nodes
3908  this%buff(node) = this%cg_tcomp(node)
3909  end do
3910  !
3911  ! -- write coarse-grained compaction data to binary file
3912  call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3913  comptxt(5), cdatafmp, nvaluesp, &
3914  nwidthp, editdesc, dinact)
3915  end if
3916  !
3917  ! -- check that final effective stress values for the time step
3918  ! are greater than zero
3919  if (this%gwfiss == 0) then
3920  call this%csub_cg_chk_stress()
3921  end if
3922  !
3923  ! -- update maximum count of delay interbeds that violate
3924  ! basic head assumptions for delay beds and write a message
3925  ! for delay interbeds in non-convertible gwf cells that
3926  ! violate these head assumptions
3927  if (this%ndelaybeds > 0) then
3928  if (this%idb_nconv_count(1) > this%idb_nconv_count(2)) then
3929  this%idb_nconv_count(2) = this%idb_nconv_count(1)
3930  end if
3931  if (this%idb_nconv_count(1) > 0) then
3932  write (this%iout, fmtnconv) this%idb_nconv_count(1)
3933  end if
3934  end if
3935  !
3936  ! -- return
3937  return

◆ 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 7503 of file gwf-csub.f90.

7504  ! -- dummy variables
7505  type(ObserveType), intent(inout) :: obsrv !< observation type
7506  class(DisBaseType), intent(in) :: dis !< pointer to the model discretization
7507  integer(I4B), intent(in) :: inunitobs !< unit number of the observation file
7508  integer(I4B), intent(in) :: iout !< unit number to the model listing file
7509  ! -- local variables
7510  integer(I4B) :: nn1
7511  integer(I4B) :: nn2
7512  integer(I4B) :: icol, istart, istop
7513  character(len=LINELENGTH) :: string
7514  character(len=LENBOUNDNAME) :: bndname
7515  logical :: flag_string
7516  !
7517  ! -- initialize variables
7518  string = obsrv%IDstring
7519  !
7520  ! -- Extract reach number from string and store it.
7521  ! If 1st item is not an integer(I4B), it should be a
7522  ! boundary name--deal with it.
7523  icol = 1
7524  !
7525  ! -- get icsubno number or boundary name
7526  if (obsrv%ObsTypeId == 'CSUB' .or. &
7527  obsrv%ObsTypeId == 'INELASTIC-CSUB' .or. &
7528  obsrv%ObsTypeId == 'ELASTIC-CSUB' .or. &
7529  obsrv%ObsTypeId == 'SK' .or. &
7530  obsrv%ObsTypeId == 'SKE' .or. &
7531  obsrv%ObsTypeId == 'THETA' .or. &
7532  obsrv%ObsTypeId == 'THICKNESS' .or. &
7533  obsrv%ObsTypeId == 'INTERBED-COMPACTION' .or. &
7534  obsrv%ObsTypeId == 'INELASTIC-COMPACTION' .or. &
7535  obsrv%ObsTypeId == 'ELASTIC-COMPACTION' .or. &
7536  obsrv%ObsTypeId == 'DELAY-HEAD' .or. &
7537  obsrv%ObsTypeId == 'DELAY-GSTRESS' .or. &
7538  obsrv%ObsTypeId == 'DELAY-ESTRESS' .or. &
7539  obsrv%ObsTypeId == 'DELAY-PRECONSTRESS' .or. &
7540  obsrv%ObsTypeId == 'DELAY-COMPACTION' .or. &
7541  obsrv%ObsTypeId == 'DELAY-THICKNESS' .or. &
7542  obsrv%ObsTypeId == 'DELAY-THETA' .or. &
7543  obsrv%ObsTypeId == 'DELAY-FLOWTOP' .or. &
7544  obsrv%ObsTypeId == 'DELAY-FLOWBOT') then
7545  call extract_idnum_or_bndname(string, icol, istart, istop, nn1, bndname)
7546  else
7547  nn1 = dis%noder_from_string(icol, istart, istop, inunitobs, &
7548  iout, string, flag_string)
7549  end if
7550  if (nn1 == namedboundflag) then
7551  obsrv%FeatureName = bndname
7552  else
7553  if (obsrv%ObsTypeId == 'DELAY-HEAD' .or. &
7554  obsrv%ObsTypeId == 'DELAY-GSTRESS' .or. &
7555  obsrv%ObsTypeId == 'DELAY-ESTRESS' .or. &
7556  obsrv%ObsTypeId == 'DELAY-PRECONSTRESS' .or. &
7557  obsrv%ObsTypeId == 'DELAY-COMPACTION' .or. &
7558  obsrv%ObsTypeId == 'DELAY-THICKNESS' .or. &
7559  obsrv%ObsTypeId == 'DELAY-THETA') then
7560  call extract_idnum_or_bndname(string, icol, istart, istop, nn2, bndname)
7561  if (nn2 == namedboundflag) then
7562  obsrv%FeatureName = bndname
7563  ! -- reset nn1
7564  nn1 = nn2
7565  else
7566  obsrv%NodeNumber2 = nn2
7567  end if
7568  end if
7569  end if
7570  !
7571  ! -- store reach number (NodeNumber)
7572  obsrv%NodeNumber = nn1
7573  !
7574  ! -- return
7575  return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ csub_read_dimensions()

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

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

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

1043  ! -- modules
1045  use kindmodule, only: i4b
1046  ! -- dummy variables
1047  class(GwfCsubType), intent(inout) :: this
1048  ! -- local variables
1049  character(len=LENBOUNDNAME) :: keyword
1050  integer(I4B) :: ierr
1051  logical :: isfound, endOfBlock
1052  ! -- format
1053  !
1054  ! -- initialize dimensions to -1
1055  this%ninterbeds = -1
1056  !
1057  ! -- get dimensions block
1058  call this%parser%GetBlock('DIMENSIONS', isfound, ierr, &
1059  supportopenclose=.true.)
1060  !
1061  ! -- parse dimensions block if detected
1062  if (isfound) then
1063  write (this%iout, '(/1x,a)') 'PROCESSING '//trim(adjustl(this%packName))// &
1064  ' DIMENSIONS'
1065  do
1066  call this%parser%GetNextLine(endofblock)
1067  if (endofblock) exit
1068  call this%parser%GetStringCaps(keyword)
1069  select case (keyword)
1070  case ('NINTERBEDS')
1071  this%ninterbeds = this%parser%GetInteger()
1072  write (this%iout, '(4x,a,i0)') 'NINTERBEDS = ', this%ninterbeds
1073  case ('MAXSIG0')
1074  this%maxsig0 = this%parser%GetInteger()
1075  write (this%iout, '(4x,a,i0)') 'MAXSIG0 = ', this%maxsig0
1076  case default
1077  write (errmsg, '(a,3(1x,a),a)') &
1078  'Unknown', trim(this%packName), "dimension '", trim(keyword), "'."
1079  call store_error(errmsg)
1080  end select
1081  end do
1082  write (this%iout, '(1x,a)') &
1083  'END OF '//trim(adjustl(this%packName))//' DIMENSIONS'
1084  else
1085  call store_error('Required dimensions block not found.')
1086  end if
1087  !
1088  ! -- verify dimensions were set correctly
1089  if (this%ninterbeds < 0) then
1090  write (errmsg, '(a)') &
1091  'NINTERBEDS was not specified or was specified incorrectly.'
1092  call store_error(errmsg)
1093  end if
1094  !
1095  ! -- stop if errors were encountered in the DIMENSIONS block
1096  if (count_errors() > 0) then
1097  call this%parser%StoreErrorUnit()
1098  end if
1099 
1100  ! -- Call define_listlabel to construct the list label that is written
1101  ! when PRINT_INPUT option is used.
1102  call this%define_listlabel()
1103  !
1104  ! -- return
1105  return
Here is the call graph for this function:

◆ csub_read_packagedata()

subroutine gwfcsubmodule::csub_read_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 1410 of file gwf-csub.f90.

1411  ! -- modules
1412  use constantsmodule, only: linelength
1414  ! -- dummy variables
1415  class(GwfCsubType), intent(inout) :: this
1416  ! -- local variables
1417  character(len=LINELENGTH) :: cellid
1418  character(len=LINELENGTH) :: title
1419  character(len=LINELENGTH) :: tag
1420  character(len=20) :: scellid
1421  character(len=10) :: text
1422  character(len=LENBOUNDNAME) :: bndName
1423  character(len=7) :: cdelay
1424  logical :: isfound
1425  logical :: endOfBlock
1426  integer(I4B) :: ival
1427  integer(I4B) :: n
1428  integer(I4B) :: nn
1429  integer(I4B) :: ib
1430  integer(I4B) :: itmp
1431  integer(I4B) :: ierr
1432  integer(I4B) :: ndelaybeds
1433  integer(I4B) :: idelay
1434  integer(I4B) :: ntabrows
1435  integer(I4B) :: ntabcols
1436  real(DP) :: rval
1437  real(DP) :: top
1438  real(DP) :: bot
1439  real(DP) :: baq
1440  real(DP) :: q
1441  integer, allocatable, dimension(:) :: nboundchk
1442  !
1443  ! -- initialize temporary variables
1444  ndelaybeds = 0
1445  !
1446  ! -- allocate temporary arrays
1447  allocate (nboundchk(this%ninterbeds))
1448  do n = 1, this%ninterbeds
1449  nboundchk(n) = 0
1450  end do
1451  !
1452  call this%parser%GetBlock('PACKAGEDATA', isfound, ierr, &
1453  supportopenclose=.true.)
1454  !
1455  ! -- parse locations block if detected
1456  if (isfound) then
1457  write (this%iout, '(/1x,a)') 'PROCESSING '//trim(adjustl(this%packName))// &
1458  ' PACKAGEDATA'
1459  do
1460  call this%parser%GetNextLine(endofblock)
1461  if (endofblock) then
1462  exit
1463  end if
1464  !
1465  ! -- get interbed number
1466  itmp = this%parser%GetInteger()
1467  !
1468  ! -- check for error condition
1469  if (itmp < 1 .or. itmp > this%ninterbeds) then
1470  write (errmsg, '(a,1x,i0,2(1x,a),1x,i0,a)') &
1471  'Interbed number (', itmp, ') must be greater than 0 and ', &
1472  'less than or equal to', this%ninterbeds, '.'
1473  call store_error(errmsg)
1474  cycle
1475  end if
1476  !
1477  ! -- increment nboundchk
1478  nboundchk(itmp) = nboundchk(itmp) + 1
1479  !
1480  ! -- read cellid
1481  call this%parser%GetCellid(this%dis%ndim, cellid)
1482  nn = this%dis%noder_from_cellid(cellid, &
1483  this%parser%iuactive, this%iout)
1484  n = this%dis%nodeu_from_cellid(cellid, &
1485  this%parser%iuactive, this%iout)
1486  top = this%dis%top(nn)
1487  bot = this%dis%bot(nn)
1488  baq = top - bot
1489  !
1490  ! -- determine if a valid cell location was provided
1491  if (nn < 1) then
1492  write (errmsg, '(a,1x,i0,a)') &
1493  'Invalid cellid for packagedata entry', itmp, '.'
1494  call store_error(errmsg)
1495  end if
1496  !
1497  ! -- set nodelist and unodelist
1498  this%nodelist(itmp) = nn
1499  this%unodelist(itmp) = n
1500  !
1501  ! -- get cdelay
1502  call this%parser%GetStringCaps(cdelay)
1503  select case (cdelay)
1504  case ('NODELAY')
1505  ival = 0
1506  case ('DELAY')
1507  ndelaybeds = ndelaybeds + 1
1508  ival = ndelaybeds
1509  case default
1510  write (errmsg, '(a,1x,a,1x,i0,1x,a)') &
1511  'Invalid CDELAY ', trim(adjustl(cdelay)), &
1512  'for packagedata entry', itmp, '.'
1513  call store_error(errmsg)
1514  cycle
1515  end select
1516  idelay = ival
1517  this%idelay(itmp) = ival
1518  !
1519  ! -- get initial preconsolidation stress
1520  this%pcs(itmp) = this%parser%GetDouble()
1521  !
1522  ! -- get thickness or cell fraction
1523  rval = this%parser%GetDouble()
1524  if (this%icellf == 0) then
1525  if (rval < dzero .or. rval > baq) then
1526  write (errmsg, '(a,g0,2(a,1x),g0,1x,a,1x,i0,a)') &
1527  'THICK (', rval, ') MUST BE greater than or equal to 0 ', &
1528  'and less than or equal to than', baq, &
1529  'for packagedata entry', itmp, '.'
1530  call store_error(errmsg)
1531  end if
1532  else
1533  if (rval < dzero .or. rval > done) then
1534  write (errmsg, '(a,1x,a,1x,i0,a)') &
1535  'FRAC MUST BE greater than 0 and less than or equal to 1', &
1536  'for packagedata entry', itmp, '.'
1537  call store_error(errmsg)
1538  end if
1539  rval = rval * baq
1540  end if
1541  this%thickini(itmp) = rval
1542  if (this%iupdatematprop /= 0) then
1543  this%thick(itmp) = rval
1544  end if
1545  !
1546  ! -- get rnb
1547  rval = this%parser%GetDouble()
1548  if (idelay > 0) then
1549  if (rval < done) then
1550  write (errmsg, '(a,g0,a,1x,a,1x,i0,a)') &
1551  'RNB (', rval, ') must be greater than or equal to 1', &
1552  'for packagedata entry', itmp, '.'
1553  call store_error(errmsg)
1554  end if
1555  else
1556  rval = done
1557  end if
1558  this%rnb(itmp) = rval
1559  !
1560  ! -- get skv or ci
1561  rval = this%parser%GetDouble()
1562  if (rval < dzero) then
1563  write (errmsg, '(2(a,1x),i0,a)') &
1564  '(SKV,CI) must be greater than or equal to 0', &
1565  'for packagedata entry', itmp, '.'
1566  call store_error(errmsg)
1567  end if
1568  this%ci(itmp) = rval
1569  !
1570  ! -- get ske or rci
1571  rval = this%parser%GetDouble()
1572  if (rval < dzero) then
1573  write (errmsg, '(2(a,1x),i0,a)') &
1574  '(SKE,RCI) must be greater than or equal to 0', &
1575  'for packagedata entry', itmp, '.'
1576  call store_error(errmsg)
1577  end if
1578  this%rci(itmp) = rval
1579  !
1580  ! -- set ielastic
1581  if (this%ci(itmp) == this%rci(itmp)) then
1582  this%ielastic(itmp) = 1
1583  else
1584  this%ielastic(itmp) = 0
1585  end if
1586  !
1587  ! -- get porosity
1588  rval = this%parser%GetDouble()
1589  this%thetaini(itmp) = rval
1590  if (this%iupdatematprop /= 0) then
1591  this%theta(itmp) = rval
1592  end if
1593  if (rval <= dzero .or. rval > done) then
1594  write (errmsg, '(a,1x,a,1x,i0,a)') &
1595  'THETA must be greater than 0 and less than or equal to 1', &
1596  'for packagedata entry', itmp, '.'
1597  call store_error(errmsg)
1598  end if
1599  !
1600  ! -- get kv
1601  rval = this%parser%GetDouble()
1602  if (idelay > 0) then
1603  if (rval <= 0.0) then
1604  write (errmsg, '(a,1x,i0,a)') &
1605  'KV must be greater than 0 for packagedata entry', itmp, '.'
1606  call store_error(errmsg)
1607  end if
1608  end if
1609  this%kv(itmp) = rval
1610  !
1611  ! -- get h0
1612  rval = this%parser%GetDouble()
1613  this%h0(itmp) = rval
1614  !
1615  ! -- get bound names
1616  if (this%inamedbound /= 0) then
1617  call this%parser%GetStringCaps(bndname)
1618  if (len_trim(bndname) < 1) then
1619  write (errmsg, '(a,1x,i0,a)') &
1620  'BOUNDNAME must be specified for packagedata entry', itmp, '.'
1621  call store_error(errmsg)
1622  else
1623  this%boundname(itmp) = bndname
1624  end if
1625  end if
1626  end do
1627 
1628  write (this%iout, '(1x,a)') &
1629  'END OF '//trim(adjustl(this%packName))//' PACKAGEDATA'
1630  end if
1631  !
1632  ! -- write summary of interbed data
1633  if (this%iprpak == 1) then
1634  ! -- set title
1635  title = trim(adjustl(this%packName))//' PACKAGE INTERBED DATA'
1636  !
1637  ! -- determine the number of columns and rows
1638  ntabrows = this%ninterbeds
1639  ntabcols = 11
1640  if (this%inamedbound /= 0) then
1641  ntabcols = ntabcols + 1
1642  end if
1643  !
1644  ! -- setup table
1645  call table_cr(this%inputtab, this%packName, title)
1646  call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
1647  !
1648  ! add columns
1649  tag = 'INTERBED'
1650  call this%inputtab%initialize_column(tag, 10, alignment=tableft)
1651  tag = 'CELLID'
1652  call this%inputtab%initialize_column(tag, 20, alignment=tabcenter)
1653  tag = 'CDELAY'
1654  call this%inputtab%initialize_column(tag, 10, alignment=tabcenter)
1655  tag = 'PCS'
1656  call this%inputtab%initialize_column(tag, 10, alignment=tabcenter)
1657  tag = 'THICK'
1658  call this%inputtab%initialize_column(tag, 10, alignment=tabcenter)
1659  tag = 'RNB'
1660  call this%inputtab%initialize_column(tag, 10, alignment=tabcenter)
1661  tag = 'SSV_CC'
1662  call this%inputtab%initialize_column(tag, 10, alignment=tabcenter)
1663  tag = 'SSV_CR'
1664  call this%inputtab%initialize_column(tag, 10, alignment=tabcenter)
1665  tag = 'THETA'
1666  call this%inputtab%initialize_column(tag, 10, alignment=tabcenter)
1667  tag = 'KV'
1668  call this%inputtab%initialize_column(tag, 10, alignment=tabcenter)
1669  tag = 'H0'
1670  call this%inputtab%initialize_column(tag, 10, alignment=tabcenter)
1671  if (this%inamedbound /= 0) then
1672  tag = 'BOUNDNAME'
1673  call this%inputtab%initialize_column(tag, lenboundname, &
1674  alignment=tableft)
1675  end if
1676  !
1677  ! -- write the data
1678  do ib = 1, this%ninterbeds
1679  call this%dis%noder_to_string(this%nodelist(ib), scellid)
1680  if (this%idelay(ib) == 0) then
1681  text = 'NODELAY'
1682  else
1683  text = 'DELAY'
1684  end if
1685  call this%inputtab%add_term(ib)
1686  call this%inputtab%add_term(scellid)
1687  call this%inputtab%add_term(text)
1688  call this%inputtab%add_term(this%pcs(ib))
1689  call this%inputtab%add_term(this%thickini(ib))
1690  call this%inputtab%add_term(this%rnb(ib))
1691  call this%inputtab%add_term(this%ci(ib))
1692  call this%inputtab%add_term(this%rci(ib))
1693  call this%inputtab%add_term(this%thetaini(ib))
1694  if (this%idelay(ib) == 0) then
1695  call this%inputtab%add_term('-')
1696  call this%inputtab%add_term('-')
1697  else
1698  call this%inputtab%add_term(this%kv(ib))
1699  call this%inputtab%add_term(this%h0(ib))
1700  end if
1701  if (this%inamedbound /= 0) then
1702  call this%inputtab%add_term(this%boundname(ib))
1703  end if
1704  end do
1705  end if
1706  !
1707  ! -- Check to make sure that every interbed is specified and that no
1708  ! interbed is specified more than once.
1709  do ib = 1, this%ninterbeds
1710  if (nboundchk(ib) == 0) then
1711  write (errmsg, '(a,1x,i0,a)') &
1712  'Information for interbed', ib, 'not specified in packagedata block.'
1713  call store_error(errmsg)
1714  else if (nboundchk(ib) > 1) then
1715  write (errmsg, '(2(a,1x,i0),a)') &
1716  'Information specified', nboundchk(ib), 'times for interbed', ib, '.'
1717  call store_error(errmsg)
1718  end if
1719  end do
1720  deallocate (nboundchk)
1721  !
1722  ! -- set the number of delay interbeds
1723  this%ndelaybeds = ndelaybeds
1724  !
1725  ! -- process delay interbeds
1726  if (ndelaybeds > 0) then
1727  !
1728  ! -- reallocate and initialize delay interbed arrays
1729  if (ierr == 0) then
1730  call mem_allocate(this%idb_nconv_count, 2, &
1731  'IDB_NCONV_COUNT', trim(this%memoryPath))
1732  call mem_allocate(this%idbconvert, this%ndelaycells, ndelaybeds, &
1733  'IDBCONVERT', trim(this%memoryPath))
1734  call mem_allocate(this%dbdhmax, ndelaybeds, &
1735  'DBDHMAX', trim(this%memoryPath))
1736  call mem_allocate(this%dbz, this%ndelaycells, ndelaybeds, &
1737  'DBZ', trim(this%memoryPath))
1738  call mem_allocate(this%dbrelz, this%ndelaycells, ndelaybeds, &
1739  'DBRELZ', trim(this%memoryPath))
1740  call mem_allocate(this%dbh, this%ndelaycells, ndelaybeds, &
1741  'DBH', trim(this%memoryPath))
1742  call mem_allocate(this%dbh0, this%ndelaycells, ndelaybeds, &
1743  'DBH0', trim(this%memoryPath))
1744  call mem_allocate(this%dbgeo, this%ndelaycells, ndelaybeds, &
1745  'DBGEO', trim(this%memoryPath))
1746  call mem_allocate(this%dbes, this%ndelaycells, ndelaybeds, &
1747  'DBES', trim(this%memoryPath))
1748  call mem_allocate(this%dbes0, this%ndelaycells, ndelaybeds, &
1749  'DBES0', trim(this%memoryPath))
1750  call mem_allocate(this%dbpcs, this%ndelaycells, ndelaybeds, &
1751  'DBPCS', trim(this%memoryPath))
1752  call mem_allocate(this%dbflowtop, ndelaybeds, &
1753  'DBFLOWTOP', trim(this%memoryPath))
1754  call mem_allocate(this%dbflowbot, ndelaybeds, &
1755  'DBFLOWBOT', trim(this%memoryPath))
1756  call mem_allocate(this%dbdzini, this%ndelaycells, ndelaybeds, &
1757  'DBDZINI', trim(this%memoryPath))
1758  call mem_allocate(this%dbthetaini, this%ndelaycells, ndelaybeds, &
1759  'DBTHETAINI', trim(this%memoryPath))
1760  call mem_allocate(this%dbcomp, this%ndelaycells, ndelaybeds, &
1761  'DBCOMP', trim(this%memoryPath))
1762  call mem_allocate(this%dbtcomp, this%ndelaycells, ndelaybeds, &
1763  'DBTCOMP', trim(this%memoryPath))
1764  !
1765  ! -- allocate delay bed arrays
1766  if (this%iupdatematprop == 0) then
1767  call mem_setptr(this%dbdz, 'DBDZINI', trim(this%memoryPath))
1768  call mem_setptr(this%dbdz0, 'DBDZINI', trim(this%memoryPath))
1769  call mem_setptr(this%dbtheta, 'DBTHETAINI', trim(this%memoryPath))
1770  call mem_setptr(this%dbtheta0, 'DBTHETAINI', trim(this%memoryPath))
1771  else
1772  call mem_allocate(this%dbdz, this%ndelaycells, ndelaybeds, &
1773  'DBDZ', trim(this%memoryPath))
1774  call mem_allocate(this%dbdz0, this%ndelaycells, ndelaybeds, &
1775  'DBDZ0', trim(this%memoryPath))
1776  call mem_allocate(this%dbtheta, this%ndelaycells, ndelaybeds, &
1777  'DBTHETA', trim(this%memoryPath))
1778  call mem_allocate(this%dbtheta0, this%ndelaycells, ndelaybeds, &
1779  'DBTHETA0', trim(this%memoryPath))
1780  end if
1781  !
1782  ! -- allocate delay interbed solution arrays
1783  call mem_allocate(this%dbal, this%ndelaycells, &
1784  'DBAL', trim(this%memoryPath))
1785  call mem_allocate(this%dbad, this%ndelaycells, &
1786  'DBAD', trim(this%memoryPath))
1787  call mem_allocate(this%dbau, this%ndelaycells, &
1788  'DBAU', trim(this%memoryPath))
1789  call mem_allocate(this%dbrhs, this%ndelaycells, &
1790  'DBRHS', trim(this%memoryPath))
1791  call mem_allocate(this%dbdh, this%ndelaycells, &
1792  'DBDH', trim(this%memoryPath))
1793  call mem_allocate(this%dbaw, this%ndelaycells, &
1794  'DBAW', trim(this%memoryPath))
1795  !
1796  ! -- initialize delay bed counters
1797  do n = 1, 2
1798  this%idb_nconv_count(n) = 0
1799  end do
1800  !
1801  ! -- initialize delay bed storage
1802  do ib = 1, this%ninterbeds
1803  idelay = this%idelay(ib)
1804  if (idelay == 0) then
1805  cycle
1806  end if
1807  !
1808  ! -- initialize delay interbed variables
1809  do n = 1, this%ndelaycells
1810  rval = this%thickini(ib) / real(this%ndelaycells, dp)
1811  this%dbdzini(n, idelay) = rval
1812  this%dbh(n, idelay) = this%h0(ib)
1813  this%dbh0(n, idelay) = this%h0(ib)
1814  this%dbthetaini(n, idelay) = this%thetaini(ib)
1815  this%dbgeo(n, idelay) = dzero
1816  this%dbes(n, idelay) = dzero
1817  this%dbes0(n, idelay) = dzero
1818  this%dbpcs(n, idelay) = this%pcs(ib)
1819  this%dbcomp(n, idelay) = dzero
1820  this%dbtcomp(n, idelay) = dzero
1821  if (this%iupdatematprop /= 0) then
1822  this%dbdz(n, idelay) = this%dbdzini(n, idelay)
1823  this%dbdz0(n, idelay) = this%dbdzini(n, idelay)
1824  this%dbtheta(n, idelay) = this%theta(ib)
1825  this%dbtheta0(n, idelay) = this%theta(ib)
1826  end if
1827  end do
1828  !
1829  ! -- initialize elevation of delay bed cells
1830  call this%csub_delay_init_zcell(ib)
1831  end do
1832  !
1833  ! -- initialize delay bed solution arrays
1834  do n = 1, this%ndelaycells
1835  this%dbal(n) = dzero
1836  this%dbad(n) = dzero
1837  this%dbau(n) = dzero
1838  this%dbrhs(n) = dzero
1839  this%dbdh(n) = dzero
1840  this%dbaw(n) = dzero
1841  end do
1842  end if
1843  end if
1844  !
1845  ! -- check that ndelaycells is odd when using
1846  ! the effective stress formulation
1847  if (ndelaybeds > 0) then
1848  q = mod(real(this%ndelaycells, dp), dtwo)
1849  if (q == dzero) then
1850  write (errmsg, '(a,i0,a,1x,a)') &
1851  'NDELAYCELLS (', this%ndelaycells, ') must be an', &
1852  'odd number when using the effective stress formulation.'
1853  call store_error(errmsg)
1854  end if
1855  end if
1856  !
1857  ! -- return
1858  return
Here is the call 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 2505 of file gwf-csub.f90.

2506  ! -- modules
2507  use constantsmodule, only: linelength
2508  use tdismodule, only: kper, nper
2510  ! -- dummy variables
2511  class(GwfCsubType), intent(inout) :: this
2512  ! -- local variables
2513  character(len=LINELENGTH) :: line
2514  character(len=LINELENGTH) :: title
2515  character(len=LINELENGTH) :: text
2516  character(len=20) :: cellid
2517  logical :: isfound
2518  logical :: endOfBlock
2519  integer(I4B) :: jj
2520  integer(I4B) :: ierr
2521  integer(I4B) :: node
2522  integer(I4B) :: nlist
2523  real(DP), pointer :: bndElem => null()
2524  ! -- formats
2525  character(len=*), parameter :: fmtblkerr = &
2526  &"('Looking for BEGIN PERIOD iper. Found ',a,' instead.')"
2527  character(len=*), parameter :: fmtlsp = &
2528  &"(1X,/1X,'REUSING ',a,'S FROM LAST STRESS PERIOD')"
2529  !
2530  ! -- return if data is not read from file
2531  if (this%inunit == 0) return
2532  !
2533  ! -- get stress period data
2534  if (this%ionper < kper) then
2535  !
2536  ! -- get period block
2537  call this%parser%GetBlock('PERIOD', isfound, ierr, &
2538  supportopenclose=.true., &
2539  blockrequired=.false.)
2540  if (isfound) then
2541  !
2542  ! -- read ionper and check for increasing period numbers
2543  call this%read_check_ionper()
2544  else
2545  !
2546  ! -- PERIOD block not found
2547  if (ierr < 0) then
2548  ! -- End of file found; data applies for remainder of simulation.
2549  this%ionper = nper + 1
2550  else
2551  ! -- Found invalid block
2552  call this%parser%GetCurrentLine(line)
2553  write (errmsg, fmtblkerr) adjustl(trim(line))
2554  call store_error(errmsg)
2555  end if
2556  end if
2557  end if
2558  !
2559  ! -- read data if ionper == kper
2560  if (this%ionper == kper) then
2561  !
2562  ! -- setup table for period data
2563  if (this%iprpak /= 0) then
2564  !
2565  ! -- reset the input table object
2566  title = 'CSUB'//' PACKAGE ('// &
2567  trim(adjustl(this%packName))//') DATA FOR PERIOD'
2568  write (title, '(a,1x,i6)') trim(adjustl(title)), kper
2569  call table_cr(this%inputtab, this%packName, title)
2570  call this%inputtab%table_df(1, 2, this%iout, finalize=.false.)
2571  text = 'CELLID'
2572  call this%inputtab%initialize_column(text, 20)
2573  text = 'SIG0'
2574  call this%inputtab%initialize_column(text, 15, alignment=tableft)
2575  end if
2576  !
2577  ! -- initialize nlist
2578  nlist = 0
2579  !
2580  ! -- Remove all time-series links associated with this package.
2581  call this%TsManager%Reset(this%packName)
2582  !
2583  ! -- read data
2584  readdata: do
2585  call this%parser%GetNextLine(endofblock)
2586  !
2587  ! -- test for end of block
2588  if (endofblock) then
2589  exit readdata
2590  end if
2591  !
2592  ! -- increment counter
2593  nlist = nlist + 1
2594  !
2595  ! -- check for error condition with nlist
2596  if (nlist > this%maxsig0) then
2597  write (errmsg, '(a,i0,a,i0,a)') &
2598  'The number of stress period entries (', nlist, &
2599  ') exceeds the maximum number of stress period entries (', &
2600  this%maxsig0, ').'
2601  call store_error(errmsg)
2602  exit readdata
2603  end if
2604  !
2605  ! -- get cell i
2606  call this%parser%GetCellid(this%dis%ndim, cellid)
2607  node = this%dis%noder_from_cellid(cellid, &
2608  this%parser%iuactive, this%iout)
2609  !
2610  !
2611  if (node < 1) then
2612  write (errmsg, '(a,2(1x,a))') &
2613  'CELLID', cellid, 'is not in the active model domain.'
2614  call store_error(errmsg)
2615  cycle readdata
2616  end if
2617  this%nodelistsig0(nlist) = node
2618  !
2619  ! -- get sig0
2620  call this%parser%GetString(text)
2621  jj = 1 ! For 'SIG0'
2622  bndelem => this%sig0(nlist)
2623  call read_value_or_time_series_adv(text, nlist, jj, bndelem, &
2624  this%packName, 'BND', &
2625  this%tsManager, this%iprpak, &
2626  'SIG0')
2627  !
2628  ! -- write line to table
2629  if (this%iprpak /= 0) then
2630  call this%dis%noder_to_string(node, cellid)
2631  call this%inputtab%add_term(cellid)
2632  call this%inputtab%add_term(bndelem)
2633  end if
2634  end do readdata
2635  !
2636  ! -- set nbound
2637  this%nbound = nlist
2638  !
2639  ! -- finalize the table
2640  if (this%iprpak /= 0) then
2641  call this%inputtab%finalize_table()
2642  end if
2643  !
2644  ! -- reuse data from last stress period
2645  else
2646  write (this%iout, fmtlsp) trim(this%filtyp)
2647  end if
2648  !
2649  ! -- terminate if errors encountered in reach block
2650  if (count_errors() > 0) then
2651  call this%parser%StoreErrorUnit()
2652  end if
2653  !
2654  ! -- read observations
2655  call this%csub_rp_obs()
2656  !
2657  ! -- return
2658  return
subroutine, public read_value_or_time_series_adv(textInput, ii, jj, bndElem, pkgName, auxOrBnd, tsManager, iprpak, varName)
Call this subroutine from advanced packages to define timeseries link for a variable (varName).
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 7330 of file gwf-csub.f90.

7331  ! -- modules
7332  use tdismodule, only: kper
7333  ! -- dummy variables
7334  class(GwfCsubType), intent(inout) :: this
7335  ! -- local variables
7336  class(ObserveType), pointer :: obsrv => null()
7337  character(len=LENBOUNDNAME) :: bname
7338  integer(I4B) :: i
7339  integer(I4B) :: j
7340  integer(I4B) :: n
7341  integer(I4B) :: n2
7342  integer(I4B) :: idelay
7343  !
7344  ! -- return if observations are not supported
7345  if (.not. this%csub_obs_supported()) then
7346  return
7347  end if
7348  !
7349  ! -- process each package observation
7350  ! only done the first stress period since boundaries are fixed
7351  ! for the simulation
7352  if (kper == 1) then
7353  do i = 1, this%obs%npakobs
7354  obsrv => this%obs%pakobs(i)%obsrv
7355  !
7356  ! -- initialize BndFound to .false.
7357  obsrv%BndFound = .false.
7358  !
7359  bname = obsrv%FeatureName
7360  if (bname /= '') then
7361  !
7362  ! -- Observation location(s) is(are) based on a boundary name.
7363  ! Iterate through all boundaries to identify and store
7364  ! corresponding index(indices) in bound array.
7365  do j = 1, this%ninterbeds
7366  if (this%boundname(j) == bname) then
7367  obsrv%BndFound = .true.
7368  obsrv%CurrentTimeStepEndValue = dzero
7369  call obsrv%AddObsIndex(j)
7370  end if
7371  end do
7372  !
7373  ! -- one value per cell
7374  else if (obsrv%ObsTypeId == 'GSTRESS-CELL' .or. &
7375  obsrv%ObsTypeId == 'ESTRESS-CELL' .or. &
7376  obsrv%ObsTypeId == 'THICKNESS-CELL' .or. &
7377  obsrv%ObsTypeId == 'COARSE-CSUB' .or. &
7378  obsrv%ObsTypeId == 'WCOMP-CSUB-CELL' .or. &
7379  obsrv%ObsTypeId == 'COARSE-COMPACTION' .or. &
7380  obsrv%ObsTypeId == 'COARSE-THETA' .or. &
7381  obsrv%ObsTypeId == 'COARSE-THICKNESS') then
7382  obsrv%BndFound = .true.
7383  obsrv%CurrentTimeStepEndValue = dzero
7384  call obsrv%AddObsIndex(obsrv%NodeNumber)
7385  else if (obsrv%ObsTypeId == 'DELAY-PRECONSTRESS' .or. &
7386  obsrv%ObsTypeId == 'DELAY-HEAD' .or. &
7387  obsrv%ObsTypeId == 'DELAY-GSTRESS' .or. &
7388  obsrv%ObsTypeId == 'DELAY-ESTRESS' .or. &
7389  obsrv%ObsTypeId == 'DELAY-COMPACTION' .or. &
7390  obsrv%ObsTypeId == 'DELAY-THICKNESS' .or. &
7391  obsrv%ObsTypeId == 'DELAY-THETA') then
7392  if (this%ninterbeds > 0) then
7393  n = obsrv%NodeNumber
7394  idelay = this%idelay(n)
7395  if (idelay /= 0) then
7396  j = (idelay - 1) * this%ndelaycells + 1
7397  n2 = obsrv%NodeNumber2
7398  if (n2 < 1 .or. n2 > this%ndelaycells) then
7399  write (errmsg, '(a,2(1x,a),1x,i0,1x,a,i0,a)') &
7400  trim(adjustl(obsrv%ObsTypeId)), 'interbed cell must be ', &
7401  'greater than 0 and less than or equal to', this%ndelaycells, &
7402  '(specified value is ', n2, ').'
7403  call store_error(errmsg)
7404  else
7405  j = (idelay - 1) * this%ndelaycells + n2
7406  end if
7407  obsrv%BndFound = .true.
7408  call obsrv%AddObsIndex(j)
7409  end if
7410  end if
7411  !
7412  ! -- interbed value
7413  else if (obsrv%ObsTypeId == 'CSUB' .or. &
7414  obsrv%ObsTypeId == 'INELASTIC-CSUB' .or. &
7415  obsrv%ObsTypeId == 'ELASTIC-CSUB' .or. &
7416  obsrv%ObsTypeId == 'SK' .or. &
7417  obsrv%ObsTypeId == 'SKE' .or. &
7418  obsrv%ObsTypeId == 'THICKNESS' .or. &
7419  obsrv%ObsTypeId == 'THETA' .or. &
7420  obsrv%ObsTypeId == 'INTERBED-COMPACTION' .or. &
7421  obsrv%ObsTypeId == 'INELASTIC-COMPACTION' .or. &
7422  obsrv%ObsTypeId == 'ELASTIC-COMPACTION') then
7423  if (this%ninterbeds > 0) then
7424  j = obsrv%NodeNumber
7425  if (j < 1 .or. j > this%ninterbeds) then
7426  write (errmsg, '(a,2(1x,a),1x,i0,1x,a,i0,a)') &
7427  trim(adjustl(obsrv%ObsTypeId)), 'interbed cell must be greater', &
7428  'than 0 and less than or equal to', this%ninterbeds, &
7429  '(specified value is ', j, ').'
7430  call store_error(errmsg)
7431  else
7432  obsrv%BndFound = .true.
7433  obsrv%CurrentTimeStepEndValue = dzero
7434  call obsrv%AddObsIndex(j)
7435  end if
7436  end if
7437  else if (obsrv%ObsTypeId == 'DELAY-FLOWTOP' .or. &
7438  obsrv%ObsTypeId == 'DELAY-FLOWBOT') then
7439  if (this%ninterbeds > 0) then
7440  j = obsrv%NodeNumber
7441  if (j < 1 .or. j > this%ninterbeds) then
7442  write (errmsg, '(a,2(1x,a),1x,i0,1x,a,i0,a)') &
7443  trim(adjustl(obsrv%ObsTypeId)), &
7444  'interbed cell must be greater ', &
7445  'than 0 and less than or equal to', this%ninterbeds, &
7446  '(specified value is ', j, ').'
7447  call store_error(errmsg)
7448  end if
7449  idelay = this%idelay(j)
7450  if (idelay /= 0) then
7451  obsrv%BndFound = .true.
7452  obsrv%CurrentTimeStepEndValue = dzero
7453  call obsrv%AddObsIndex(j)
7454  end if
7455  end if
7456  else
7457  !
7458  ! -- Accumulate values in a single cell
7459  ! -- Observation location is a single node number
7460  ! -- save node number in first position
7461  if (obsrv%ObsTypeId == 'CSUB-CELL' .or. &
7462  obsrv%ObsTypeId == 'SKE-CELL' .or. &
7463  obsrv%ObsTypeId == 'SK-CELL' .or. &
7464  obsrv%ObsTypeId == 'THETA-CELL' .or. &
7465  obsrv%ObsTypeId == 'INELASTIC-COMPACTION-CELL' .or. &
7466  obsrv%ObsTypeId == 'ELASTIC-COMPACTION-CELL' .or. &
7467  obsrv%ObsTypeId == 'COMPACTION-CELL') then
7468  if (.NOT. obsrv%BndFound) then
7469  obsrv%BndFound = .true.
7470  obsrv%CurrentTimeStepEndValue = dzero
7471  call obsrv%AddObsIndex(obsrv%NodeNumber)
7472  end if
7473  end if
7474  jloop: do j = 1, this%ninterbeds
7475  if (this%nodelist(j) == obsrv%NodeNumber) then
7476  obsrv%BndFound = .true.
7477  obsrv%CurrentTimeStepEndValue = dzero
7478  call obsrv%AddObsIndex(j)
7479  end if
7480  end do jloop
7481  end if
7482  end do
7483  !
7484  ! -- evaluate if there are any observation errors
7485  if (count_errors() > 0) then
7486  call store_error_unit(this%inunit)
7487  end if
7488  end if
7489  !
7490  !
7491  return
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 3585 of file gwf-csub.f90.

3586  ! -- dummy variables
3587  class(GwfCsubType) :: this
3588  integer(I4B), intent(in) :: icbcfl !< flag to output budget data
3589  integer(I4B), intent(in) :: icbcun !< unit number for cell-by-cell file
3590  ! -- local variables
3591  character(len=1) :: cdatafmp = ' '
3592  character(len=1) :: editdesc = ' '
3593  integer(I4B) :: ibinun
3594  integer(I4B) :: iprint
3595  integer(I4B) :: nvaluesp
3596  integer(I4B) :: nwidthp
3597  integer(I4B) :: ib
3598  integer(I4B) :: node
3599  integer(I4B) :: naux
3600  real(DP) :: dinact
3601  real(DP) :: Q
3602  ! -- formats
3603  !
3604  ! -- Set unit number for binary output
3605  if (this%ipakcb < 0) then
3606  ibinun = icbcun
3607  elseif (this%ipakcb == 0) then
3608  ibinun = 0
3609  else
3610  ibinun = this%ipakcb
3611  end if
3612  if (icbcfl == 0) ibinun = 0
3613  !
3614  ! -- Record the storage rates if requested
3615  if (ibinun /= 0) then
3616  iprint = 0
3617  dinact = dzero
3618  !
3619  ! -- coarse-grained storage (sske)
3620  call this%dis%record_array(this%cg_stor, this%iout, iprint, -ibinun, &
3621  budtxt(1), cdatafmp, nvaluesp, &
3622  nwidthp, editdesc, dinact)
3623  if (this%ninterbeds > 0) then
3624  naux = 0
3625  !
3626  ! -- interbed elastic storage
3627  call this%dis%record_srcdst_list_header(budtxt(2), &
3628  this%name_model, &
3629  this%name_model, &
3630  this%name_model, &
3631  this%packName, &
3632  naux, &
3633  this%auxname, &
3634  ibinun, &
3635  this%ninterbeds, &
3636  this%iout)
3637  do ib = 1, this%ninterbeds
3638  q = this%storagee(ib)
3639  node = this%nodelist(ib)
3640  call this%dis%record_mf6_list_entry(ibinun, node, node, q, naux, &
3641  this%auxvar(:, ib))
3642  end do
3643  !
3644  ! -- interbed inelastic storage
3645  call this%dis%record_srcdst_list_header(budtxt(3), &
3646  this%name_model, &
3647  this%name_model, &
3648  this%name_model, &
3649  this%packName, &
3650  naux, &
3651  this%auxname, &
3652  ibinun, &
3653  this%ninterbeds, &
3654  this%iout)
3655  do ib = 1, this%ninterbeds
3656  q = this%storagei(ib)
3657  node = this%nodelist(ib)
3658  call this%dis%record_mf6_list_entry(ibinun, node, node, q, naux, &
3659  this%auxvar(:, ib))
3660  end do
3661  end if
3662  !
3663  ! -- water compressibility
3664  call this%dis%record_array(this%cell_wcstor, this%iout, iprint, -ibinun, &
3665  budtxt(4), cdatafmp, nvaluesp, &
3666  nwidthp, editdesc, dinact)
3667  end if
3668  !
3669  ! -- return
3670  return

◆ 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 4353 of file gwf-csub.f90.

4354  ! -- dummy variables
4355  class(GwfCsubType) :: this
4356  ! -- dummy variables
4357  integer(I4B), intent(in) :: nodes !< number of active model nodes
4358  real(DP), dimension(nodes), intent(in) :: hnew !< current heads
4359  ! -- local variables
4360  character(len=LINELENGTH) :: title
4361  character(len=LINELENGTH) :: tag
4362  character(len=20) :: cellid
4363  integer(I4B) :: ib
4364  integer(I4B) :: node
4365  integer(I4B) :: n
4366  integer(I4B) :: idelay
4367  integer(I4B) :: ntabrows
4368  integer(I4B) :: ntabcols
4369  real(DP) :: pcs0
4370  real(DP) :: pcs
4371  real(DP) :: fact
4372  real(DP) :: top
4373  real(DP) :: bot
4374  real(DP) :: void_ratio
4375  real(DP) :: es
4376  real(DP) :: znode
4377  real(DP) :: hcell
4378  real(DP) :: hbar
4379  real(DP) :: dzhalf
4380  real(DP) :: zbot
4381  real(DP) :: dbpcs
4382  !
4383  ! -- update geostatic load calculation
4384  call this%csub_cg_calc_stress(nodes, hnew)
4385  !
4386  ! -- initialize coarse-grained material effective stress
4387  ! for the previous time step and the previous iteration
4388  do node = 1, nodes
4389  this%cg_es0(node) = this%cg_es(node)
4390  end do
4391  !
4392  ! -- initialize interbed initial states
4393  do ib = 1, this%ninterbeds
4394  idelay = this%idelay(ib)
4395  node = this%nodelist(ib)
4396  top = this%dis%top(node)
4397  bot = this%dis%bot(node)
4398  hcell = hnew(node)
4399  pcs = this%pcs(ib)
4400  pcs0 = pcs
4401  if (this%ispecified_pcs == 0) then
4402  ! relative pcs...subtract head (u) from sigma'
4403  if (this%ipch /= 0) then
4404  pcs = this%cg_es(node) - pcs0
4405  else
4406  pcs = this%cg_es(node) + pcs0
4407  end if
4408  else
4409  ! specified pcs...subtract head (u) from sigma
4410  if (this%ipch /= 0) then
4411  pcs = this%cg_gs(node) - (pcs0 - bot)
4412  end if
4413  if (pcs < this%cg_es(node)) then
4414  pcs = this%cg_es(node)
4415  end if
4416  end if
4417  this%pcs(ib) = pcs
4418  !
4419  ! -- delay bed initial states
4420  if (idelay /= 0) then
4421  dzhalf = dhalf * this%dbdzini(1, idelay)
4422  !
4423  ! -- fill delay bed head with aquifer head or offset from aquifer head
4424  ! heads need to be filled first since used to calculate
4425  ! the effective stress for each delay bed
4426  do n = 1, this%ndelaycells
4427  if (this%ispecified_dbh == 0) then
4428  this%dbh(n, idelay) = hcell + this%dbh(n, idelay)
4429  else
4430  this%dbh(n, idelay) = hcell
4431  end if
4432  this%dbh0(n, idelay) = this%dbh(n, idelay)
4433  end do
4434  !
4435  ! -- fill delay bed effective stress
4436  call this%csub_delay_calc_stress(ib, hcell)
4437  !
4438  ! -- fill delay bed pcs
4439  pcs = this%pcs(ib)
4440  do n = 1, this%ndelaycells
4441  zbot = this%dbz(n, idelay) - dzhalf
4442  ! -- adjust pcs to bottom of each delay bed cell
4443  ! not using csub_calc_adjes() since smoothing not required
4444  dbpcs = pcs - (zbot - bot) * (this%sgs(node) - done)
4445  this%dbpcs(n, idelay) = dbpcs
4446  !
4447  ! -- initialize effective stress for previous time step
4448  this%dbes0(n, idelay) = this%dbes(n, idelay)
4449  end do
4450  end if
4451  end do
4452  !
4453  ! -- scale coarse-grained materials cr
4454  do node = 1, nodes
4455  top = this%dis%top(node)
4456  bot = this%dis%bot(node)
4457  !
4458  ! -- user-specified specific storage
4459  if (this%istoragec == 1) then
4460  !
4461  ! -- retain specific storage values since they are constant
4462  if (this%lhead_based .EQV. .true.) then
4463  fact = done
4464  !
4465  ! -- convert specific storage values since they are simulated to
4466  ! be a function of the average effective stress
4467  else
4468  void_ratio = this%csub_calc_void_ratio(this%cg_theta(node))
4469  es = this%cg_es(node)
4470  hcell = hnew(node)
4471  !
4472  ! -- calculate corrected head (hbar)
4473  hbar = squadratic0sp(hcell, bot, this%satomega)
4474  !
4475  ! -- calculate znode and factor
4476  znode = this%csub_calc_znode(top, bot, hbar)
4477  fact = this%csub_calc_adjes(node, es, bot, znode)
4478  fact = fact * (done + void_ratio)
4479  end if
4480  !
4481  ! -- user-specified compression indices - multiply by dlog10es
4482  else
4483  fact = dlog10es
4484  end if
4485  this%cg_ske_cr(node) = this%cg_ske_cr(node) * fact
4486  !
4487  ! -- write error message if negative compression indices
4488  if (fact <= dzero) then
4489  call this%dis%noder_to_string(node, cellid)
4490  write (errmsg, '(a,1x,a,a)') &
4491  'Negative recompression index calculated for cell', &
4492  trim(adjustl(cellid)), '.'
4493  call store_error(errmsg)
4494  end if
4495  end do
4496  !
4497  ! -- scale interbed cc and cr
4498  do ib = 1, this%ninterbeds
4499  idelay = this%idelay(ib)
4500  node = this%nodelist(ib)
4501  top = this%dis%top(node)
4502  bot = this%dis%bot(node)
4503  !
4504  ! -- user-specified specific storage
4505  if (this%istoragec == 1) then
4506  !
4507  ! -- retain specific storage values since they are constant
4508  if (this%lhead_based .EQV. .true.) then
4509  fact = done
4510  !
4511  ! -- convert specific storage values since they are simulated to
4512  ! be a function of the average effective stress
4513  else
4514  void_ratio = this%csub_calc_void_ratio(this%theta(ib))
4515  es = this%cg_es(node)
4516  hcell = hnew(node)
4517  !
4518  ! -- calculate corrected head (hbar)
4519  hbar = squadratic0sp(hcell, bot, this%satomega)
4520  !
4521  ! -- calculate zone and factor
4522  znode = this%csub_calc_znode(top, bot, hbar)
4523  fact = this%csub_calc_adjes(node, es, bot, znode)
4524  fact = fact * (done + void_ratio)
4525  end if
4526  !
4527  ! -- user-specified compression indices - multiply by dlog10es
4528  else
4529  fact = dlog10es
4530  end if
4531  this%ci(ib) = this%ci(ib) * fact
4532  this%rci(ib) = this%rci(ib) * fact
4533  !
4534  ! -- write error message if negative compression indices
4535  if (fact <= dzero) then
4536  call this%dis%noder_to_string(node, cellid)
4537  write (errmsg, '(a,1x,i0,2(1x,a),a)') &
4538  'Negative compression indices calculated for interbed', ib, &
4539  'in cell', trim(adjustl(cellid)), '.'
4540  call store_error(errmsg)
4541  end if
4542  end do
4543  !
4544  ! -- write current stress and initial preconsolidation stress
4545  if (this%iprpak == 1) then
4546  ! -- set title
4547  title = trim(adjustl(this%packName))// &
4548  ' PACKAGE CALCULATED INITIAL INTERBED STRESSES AT THE CELL BOTTOM'
4549  !
4550  ! -- determine the number of columns and rows
4551  ntabrows = this%ninterbeds
4552  ntabcols = 5
4553  if (this%inamedbound /= 0) then
4554  ntabcols = ntabcols + 1
4555  end if
4556  !
4557  ! -- setup table
4558  call table_cr(this%inputtab, this%packName, title)
4559  call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
4560  !
4561  ! add columns
4562  tag = 'INTERBED NUMBER'
4563  call this%inputtab%initialize_column(tag, 10, alignment=tableft)
4564  tag = 'CELLID'
4565  call this%inputtab%initialize_column(tag, 20)
4566  tag = 'GEOSTATIC STRESS'
4567  call this%inputtab%initialize_column(tag, 16)
4568  tag = 'EFFECTIVE STRESS'
4569  call this%inputtab%initialize_column(tag, 16)
4570  tag = 'PRECONSOLIDATION STRESS'
4571  call this%inputtab%initialize_column(tag, 16)
4572  if (this%inamedbound /= 0) then
4573  tag = 'BOUNDNAME'
4574  call this%inputtab%initialize_column(tag, lenboundname, &
4575  alignment=tableft)
4576  end if
4577  !
4578  ! -- write the data
4579  do ib = 1, this%ninterbeds
4580  node = this%nodelist(ib)
4581  call this%dis%noder_to_string(node, cellid)
4582  !
4583  ! -- write the columns
4584  call this%inputtab%add_term(ib)
4585  call this%inputtab%add_term(cellid)
4586  call this%inputtab%add_term(this%cg_gs(node))
4587  call this%inputtab%add_term(this%cg_es(node))
4588  call this%inputtab%add_term(this%pcs(ib))
4589  if (this%inamedbound /= 0) then
4590  call this%inputtab%add_term(this%boundname(ib))
4591  end if
4592  end do
4593  !
4594  ! -- write effective stress and preconsolidation stress
4595  ! for delay beds
4596  ! -- set title
4597  title = trim(adjustl(this%packName))// &
4598  ' PACKAGE CALCULATED INITIAL DELAY INTERBED STRESSES'
4599  !
4600  ! -- determine the number of columns and rows
4601  ntabrows = 0
4602  do ib = 1, this%ninterbeds
4603  idelay = this%idelay(ib)
4604  if (idelay /= 0) then
4605  ntabrows = ntabrows + this%ndelaycells
4606  end if
4607  end do
4608  ntabcols = 6
4609  if (this%inamedbound /= 0) then
4610  ntabcols = ntabcols + 1
4611  end if
4612  !
4613  ! -- setup table
4614  call table_cr(this%inputtab, this%packName, title)
4615  call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
4616  !
4617  ! add columns
4618  tag = 'INTERBED NUMBER'
4619  call this%inputtab%initialize_column(tag, 10, alignment=tableft)
4620  tag = 'CELLID'
4621  call this%inputtab%initialize_column(tag, 20)
4622  tag = 'DELAY CELL'
4623  call this%inputtab%initialize_column(tag, 10, alignment=tableft)
4624  tag = 'GEOSTATIC STRESS'
4625  call this%inputtab%initialize_column(tag, 16)
4626  tag = 'EFFECTIVE STRESS'
4627  call this%inputtab%initialize_column(tag, 16)
4628  tag = 'PRECONSOLIDATION STRESS'
4629  call this%inputtab%initialize_column(tag, 16)
4630  if (this%inamedbound /= 0) then
4631  tag = 'BOUNDNAME'
4632  call this%inputtab%initialize_column(tag, lenboundname, &
4633  alignment=tableft)
4634  end if
4635  !
4636  ! -- write the data
4637  do ib = 1, this%ninterbeds
4638  idelay = this%idelay(ib)
4639  if (idelay /= 0) then
4640  node = this%nodelist(ib)
4641  call this%dis%noder_to_string(node, cellid)
4642  !
4643  ! -- write the columns
4644  do n = 1, this%ndelaycells
4645  if (n == 1) then
4646  call this%inputtab%add_term(ib)
4647  call this%inputtab%add_term(cellid)
4648  else
4649  call this%inputtab%add_term(' ')
4650  call this%inputtab%add_term(' ')
4651  end if
4652  call this%inputtab%add_term(n)
4653  call this%inputtab%add_term(this%dbgeo(n, idelay))
4654  call this%inputtab%add_term(this%dbes(n, idelay))
4655  call this%inputtab%add_term(this%dbpcs(n, idelay))
4656  if (this%inamedbound /= 0) then
4657  if (n == 1) then
4658  call this%inputtab%add_term(this%boundname(ib))
4659  else
4660  call this%inputtab%add_term(' ')
4661  end if
4662  end if
4663  end do
4664  end if
4665  end do
4666  !
4667  ! -- write calculated compression indices
4668  if (this%istoragec == 1) then
4669  if (this%lhead_based .EQV. .false.) then
4670  ! -- set title
4671  title = trim(adjustl(this%packName))// &
4672  ' PACKAGE COMPRESSION INDICES'
4673  !
4674  ! -- determine the number of columns and rows
4675  ntabrows = this%ninterbeds
4676  ntabcols = 4
4677  if (this%inamedbound /= 0) then
4678  ntabcols = ntabcols + 1
4679  end if
4680  !
4681  ! -- setup table
4682  call table_cr(this%inputtab, this%packName, title)
4683  call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
4684  !
4685  ! add columns
4686  tag = 'INTERBED NUMBER'
4687  call this%inputtab%initialize_column(tag, 10, alignment=tableft)
4688  tag = 'CELLID'
4689  call this%inputtab%initialize_column(tag, 20)
4690  tag = 'CC'
4691  call this%inputtab%initialize_column(tag, 16)
4692  tag = 'CR'
4693  call this%inputtab%initialize_column(tag, 16)
4694  if (this%inamedbound /= 0) then
4695  tag = 'BOUNDNAME'
4696  call this%inputtab%initialize_column(tag, lenboundname, &
4697  alignment=tableft)
4698  end if
4699  !
4700  ! -- write the data
4701  do ib = 1, this%ninterbeds
4702  fact = done / dlog10es
4703  node = this%nodelist(ib)
4704  call this%dis%noder_to_string(node, cellid)
4705  !
4706  ! -- write the columns
4707  call this%inputtab%add_term(ib)
4708  call this%inputtab%add_term(cellid)
4709  call this%inputtab%add_term(this%ci(ib) * fact)
4710  call this%inputtab%add_term(this%rci(ib) * fact)
4711  if (this%inamedbound /= 0) then
4712  call this%inputtab%add_term(this%boundname(ib))
4713  end if
4714  end do
4715  end if
4716  end if
4717  end if
4718  !
4719  ! -- terminate if any initialization errors have been detected
4720  if (count_errors() > 0) then
4721  call this%parser%StoreErrorUnit()
4722  end if
4723  !
4724  ! -- set initialized
4725  this%initialized = 1
4726  !
4727  ! -- set flag to retain initial stresses for entire simulation
4728  if (this%lhead_based .EQV. .true.) then
4729  this%iupdatestress = 0
4730  end if
4731  !
4732  ! -- return
4733  return
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 7584 of file gwf-csub.f90.

7585  ! -- dummy variables
7586  class(GwfCsubType), intent(inout) :: this
7587  !
7588  ! -- create the header list label
7589  this%listlabel = trim(this%filtyp)//' NO.'
7590  if (this%dis%ndim == 3) then
7591  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'LAYER'
7592  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'ROW'
7593  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'COL'
7594  elseif (this%dis%ndim == 2) then
7595  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'LAYER'
7596  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'CELL2D'
7597  else
7598  write (this%listlabel, '(a, a7)') trim(this%listlabel), 'NODE'
7599  end if
7600  write (this%listlabel, '(a, a16)') trim(this%listlabel), 'SIG0'
7601  if (this%inamedbound == 1) then
7602  write (this%listlabel, '(a, a16)') trim(this%listlabel), 'BOUNDARY NAME'
7603  end if
7604  !
7605  ! -- return
7606  return

◆ read_options()

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

Read options block for CSUB package.

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

601  ! -- modules
604  use openspecmodule, only: access, form
606  ! -- dummy variables
607  class(GwfCsubType), intent(inout) :: this
608  ! -- local variables
609  character(len=LINELENGTH) :: keyword
610  character(len=:), allocatable :: line
611  character(len=MAXCHARLEN) :: fname
612  character(len=LENAUXNAME), dimension(:), allocatable :: caux
613  logical :: isfound
614  logical :: endOfBlock
615  integer(I4B) :: n
616  integer(I4B) :: lloc
617  integer(I4B) :: istart
618  integer(I4B) :: istop
619  integer(I4B) :: ierr
620  integer(I4B) :: inobs
621  integer(I4B) :: ibrg
622  integer(I4B) :: ieslag
623  integer(I4B) :: isetgamma
624  ! -- formats
625  character(len=*), parameter :: fmtts = &
626  &"(4x,'TIME-SERIES DATA WILL BE READ FROM FILE: ',a)"
627  character(len=*), parameter :: fmtflow = &
628  &"(4x,'FLOWS WILL BE SAVED TO FILE: ',a,/4x,'OPENED ON UNIT: ',I7)"
629  character(len=*), parameter :: fmtflow2 = &
630  &"(4x,'FLOWS WILL BE SAVED TO BUDGET FILE SPECIFIED IN OUTPUT CONTROL')"
631  character(len=*), parameter :: fmtssessv = &
632  &"(4x,'USING SSE AND SSV INSTEAD OF CR AND CC.')"
633  character(len=*), parameter :: fmtoffset = &
634  &"(4x,'INITIAL_STRESS TREATED AS AN OFFSET.')"
635  character(len=*), parameter :: fmtopt = &
636  &"(4x,A)"
637  character(len=*), parameter :: fmtopti = &
638  &"(4x,A,1X,I0)"
639  character(len=*), parameter :: fmtoptr = &
640  &"(4x,A,1X,G0)"
641  character(len=*), parameter :: fmtfileout = &
642  "(4x,'CSUB ',1x,a,1x,' WILL BE SAVED TO FILE: ',a,/4x,&
643  &'OPENED ON UNIT: ',I7)"
644  !
645  ! -- initialize variables
646  ibrg = 0
647  ieslag = 0
648  isetgamma = 0
649  !
650  ! -- get options block
651  call this%parser%GetBlock('OPTIONS', isfound, ierr, blockrequired=.false., &
652  supportopenclose=.true.)
653  !
654  ! -- parse options block if detected
655  if (isfound) then
656  write (this%iout, '(1x,a)') 'PROCESSING CSUB OPTIONS'
657  do
658  call this%parser%GetNextLine(endofblock)
659  if (endofblock) then
660  exit
661  end if
662  call this%parser%GetStringCaps(keyword)
663  select case (keyword)
664  case ('AUX', 'AUXILIARY')
665  call this%parser%GetRemainingLine(line)
666  lloc = 1
667  call urdaux(this%naux, this%parser%iuactive, this%iout, lloc, &
668  istart, istop, caux, line, this%packName)
669  call mem_reallocate(this%auxname, lenauxname, this%naux, &
670  'AUXNAME', this%memoryPath)
671  do n = 1, this%naux
672  this%auxname(n) = caux(n)
673  end do
674  deallocate (caux)
675  case ('SAVE_FLOWS')
676  this%ipakcb = -1
677  write (this%iout, fmtflow2)
678  case ('PRINT_INPUT')
679  this%iprpak = 1
680  write (this%iout, '(4x,a)') &
681  'LISTS OF '//trim(adjustl(this%packName))//' CELLS WILL BE PRINTED.'
682  case ('PRINT_FLOWS')
683  this%iprflow = 1
684  write (this%iout, '(4x,a)') trim(adjustl(this%packName))// &
685  ' FLOWS WILL BE PRINTED TO LISTING FILE.'
686  case ('BOUNDNAMES')
687  this%inamedbound = 1
688  write (this%iout, '(4x,a)') trim(adjustl(this%packName))// &
689  ' BOUNDARIES HAVE NAMES IN LAST COLUMN.' ! user specified boundnames
690  case ('TS6')
691  call this%parser%GetStringCaps(keyword)
692  if (trim(adjustl(keyword)) /= 'FILEIN') then
693  errmsg = 'TS6 keyword must be followed by "FILEIN" '// &
694  'then by filename.'
695  call store_error(errmsg)
696  call this%parser%StoreErrorUnit()
697  end if
698  call this%parser%GetString(fname)
699  write (this%iout, fmtts) trim(fname)
700  call this%TsManager%add_tsfile(fname, this%inunit)
701  case ('OBS6')
702  call this%parser%GetStringCaps(keyword)
703  if (trim(adjustl(keyword)) /= 'FILEIN') then
704  errmsg = 'OBS6 keyword must be followed by "FILEIN" '// &
705  'then by filename.'
706  call store_error(errmsg)
707  end if
708  if (this%obs%active) then
709  errmsg = 'Multiple OBS6 keywords detected in OPTIONS block. '// &
710  'Only one OBS6 entry allowed for a package.'
711  call store_error(errmsg)
712  end if
713  this%obs%active = .true.
714  call this%parser%GetString(this%obs%inputFilename)
715  inobs = getunit()
716  call openfile(inobs, this%iout, this%obs%inputFilename, 'OBS')
717  this%obs%inUnitObs = inobs
718  this%inobspkg = inobs
719 
720  call this%obs%obs_df(this%iout, this%packName, this%filtyp, this%dis)
721  call this%csub_df_obs()
722  !
723  ! -- CSUB specific options
724  case ('GAMMAW')
725  this%gammaw = this%parser%GetDouble()
726  ibrg = 1
727  case ('BETA')
728  this%beta = this%parser%GetDouble()
729  ibrg = 1
730  case ('HEAD_BASED')
731  this%ipch = 1
732  this%lhead_based = .true.
733  case ('INITIAL_PRECONSOLIDATION_HEAD')
734  this%ipch = 1
735  case ('NDELAYCELLS')
736  this%ndelaycells = this%parser%GetInteger()
737  !
738  ! -- compression indices (CR amd CC) will be specified instead of
739  ! storage coefficients (SSE and SSV)
740  case ('COMPRESSION_INDICES')
741  this%istoragec = 0
742  !
743  ! -- variable thickness and void ratio
744  case ('UPDATE_MATERIAL_PROPERTIES')
745  this%iupdatematprop = 1
746  !
747  ! -- cell fraction will be specified instead of interbed thickness
748  case ('CELL_FRACTION')
749  this%icellf = 1
750  !
751  ! -- specified initial pcs and delay bed heads
752  case ('SPECIFIED_INITIAL_INTERBED_STATE')
753  this%ispecified_pcs = 1
754  this%ispecified_dbh = 1
755  !
756  ! -- specified initial pcs
757  case ('SPECIFIED_INITIAL_PRECONSOLIDATION_STRESS')
758  this%ispecified_pcs = 1
759  !
760  ! -- specified initial delay bed heads
761  case ('SPECIFIED_INITIAL_DELAY_HEAD')
762  this%ispecified_dbh = 1
763  !
764  ! -- lag the effective stress used to calculate storage properties
765  case ('EFFECTIVE_STRESS_LAG')
766  ieslag = 1
767  !
768  ! -- strain table options
769  case ('STRAIN_CSV_INTERBED')
770  call this%parser%GetStringCaps(keyword)
771  if (keyword == 'FILEOUT') then
772  call this%parser%GetString(fname)
773  this%istrainib = getunit()
774  call openfile(this%istrainib, this%iout, fname, 'CSV_OUTPUT', &
775  filstat_opt='REPLACE', mode_opt=mnormal)
776  write (this%iout, fmtfileout) &
777  'INTERBED STRAIN CSV', fname, this%istrainib
778  else
779  errmsg = 'Optional STRAIN_CSV_INTERBED keyword must be '// &
780  'followed by FILEOUT.'
781  call store_error(errmsg)
782  end if
783  case ('STRAIN_CSV_COARSE')
784  call this%parser%GetStringCaps(keyword)
785  if (keyword == 'FILEOUT') then
786  call this%parser%GetString(fname)
787  this%istrainsk = getunit()
788  call openfile(this%istrainsk, this%iout, fname, 'CSV_OUTPUT', &
789  filstat_opt='REPLACE', mode_opt=mnormal)
790  write (this%iout, fmtfileout) &
791  'COARSE STRAIN CSV', fname, this%istrainsk
792  else
793  errmsg = 'Optional STRAIN_CSV_COARSE keyword must be '// &
794  'followed by fileout.'
795  call store_error(errmsg)
796  end if
797  !
798  ! -- compaction output
799  case ('COMPACTION')
800  call this%parser%GetStringCaps(keyword)
801  if (keyword == 'FILEOUT') then
802  call this%parser%GetString(fname)
803  this%ioutcomp = getunit()
804  call openfile(this%ioutcomp, this%iout, fname, 'DATA(BINARY)', &
805  form, access, 'REPLACE', mode_opt=mnormal)
806  write (this%iout, fmtfileout) &
807  'COMPACTION', fname, this%ioutcomp
808  else
809  errmsg = 'Optional COMPACTION keyword must be '// &
810  'followed by FILEOUT.'
811  call store_error(errmsg)
812  end if
813  case ('COMPACTION_INELASTIC')
814  call this%parser%GetStringCaps(keyword)
815  if (keyword == 'FILEOUT') then
816  call this%parser%GetString(fname)
817  this%ioutcompi = getunit()
818  call openfile(this%ioutcompi, this%iout, fname, &
819  'DATA(BINARY)', form, access, 'REPLACE', &
820  mode_opt=mnormal)
821  write (this%iout, fmtfileout) &
822  'COMPACTION_INELASTIC', fname, this%ioutcompi
823  else
824  errmsg = 'Optional COMPACTION_INELASTIC keyword must be '// &
825  'followed by fileout.'
826  call store_error(errmsg)
827  end if
828  case ('COMPACTION_ELASTIC')
829  call this%parser%GetStringCaps(keyword)
830  if (keyword == 'FILEOUT') then
831  call this%parser%GetString(fname)
832  this%ioutcompe = getunit()
833  call openfile(this%ioutcompe, this%iout, fname, &
834  'DATA(BINARY)', form, access, 'REPLACE', &
835  mode_opt=mnormal)
836  write (this%iout, fmtfileout) &
837  'COMPACTION_ELASTIC', fname, this%ioutcompe
838  else
839  errmsg = 'Optional COMPACTION_ELASTIC keyword must be '// &
840  'followed by FILEOUT.'
841  call store_error(errmsg)
842  end if
843  case ('COMPACTION_INTERBED')
844  call this%parser%GetStringCaps(keyword)
845  if (keyword == 'FILEOUT') then
846  call this%parser%GetString(fname)
847  this%ioutcompib = getunit()
848  call openfile(this%ioutcompib, this%iout, fname, &
849  'DATA(BINARY)', form, access, 'REPLACE', &
850  mode_opt=mnormal)
851  write (this%iout, fmtfileout) &
852  'COMPACTION_INTERBED', fname, this%ioutcompib
853  else
854  errmsg = 'Optional COMPACTION_INTERBED keyword must be '// &
855  'followed by FILEOUT.'
856  call store_error(errmsg)
857  end if
858  case ('COMPACTION_COARSE')
859  call this%parser%GetStringCaps(keyword)
860  if (keyword == 'FILEOUT') then
861  call this%parser%GetString(fname)
862  this%ioutcomps = getunit()
863  call openfile(this%ioutcomps, this%iout, fname, &
864  'DATA(BINARY)', form, access, 'REPLACE', &
865  mode_opt=mnormal)
866  write (this%iout, fmtfileout) &
867  'COMPACTION_COARSE', fname, this%ioutcomps
868  else
869  errmsg = 'Optional COMPACTION_COARSE keyword must be '// &
870  'followed by FILEOUT.'
871  call store_error(errmsg)
872  end if
873  !
874  ! -- zdisplacement output
875  case ('ZDISPLACEMENT')
876  call this%parser%GetStringCaps(keyword)
877  if (keyword == 'FILEOUT') then
878  call this%parser%GetString(fname)
879  this%ioutzdisp = getunit()
880  call openfile(this%ioutzdisp, this%iout, fname, &
881  'DATA(BINARY)', form, access, 'REPLACE', &
882  mode_opt=mnormal)
883  write (this%iout, fmtfileout) &
884  'ZDISPLACEMENT', fname, this%ioutzdisp
885  else
886  errmsg = 'Optional ZDISPLACEMENT keyword must be '// &
887  'followed by FILEOUT.'
888  call store_error(errmsg)
889  end if
890  ! -- package convergence
891  case ('PACKAGE_CONVERGENCE')
892  call this%parser%GetStringCaps(keyword)
893  if (keyword == 'FILEOUT') then
894  call this%parser%GetString(fname)
895  this%ipakcsv = getunit()
896  call openfile(this%ipakcsv, this%iout, fname, 'CSV', &
897  filstat_opt='REPLACE', mode_opt=mnormal)
898  write (this%iout, fmtfileout) &
899  'PACKAGE_CONVERGENCE', fname, this%ipakcsv
900  else
901  call store_error('Optional PACKAGE_CONVERGENCE keyword must be '// &
902  'followed by FILEOUT.')
903  end if
904  !
905  ! -- right now these are options that are only available in the
906  ! development version and are not included in the documentation.
907  ! These options are only available when IDEVELOPMODE in
908  ! constants module is set to 1
909  case ('DEV_NO_FINAL_CHECK')
910  call this%parser%DevOpt()
911  this%iconvchk = 0
912  write (this%iout, '(4x,a)') &
913  'A FINAL CONVERGENCE CHECK OF THE CHANGE IN DELAY INTERBED '// &
914  'HEADS AND FLOWS WILL NOT BE MADE'
915 
916  !
917  ! default case
918  case default
919  write (errmsg, '(a,3(1x,a),a)') &
920  'Unknown', trim(adjustl(this%packName)), "option '", &
921  trim(keyword), "'."
922  call store_error(errmsg)
923  end select
924  end do
925  write (this%iout, '(1x,a)') &
926  'END OF '//trim(adjustl(this%packName))//' OPTIONS'
927  end if
928  !
929  ! -- write messages for options
930  write (this%iout, '(//2(1X,A))') trim(adjustl(this%packName)), &
931  'PACKAGE SETTINGS'
932  write (this%iout, fmtopti) 'NUMBER OF DELAY CELLS =', &
933  this%ndelaycells
934  if (this%lhead_based .EQV. .true.) then
935  write (this%iout, '(4x,a)') &
936  'HEAD-BASED FORMULATION'
937  else
938  write (this%iout, '(4x,a)') &
939  'EFFECTIVE-STRESS FORMULATION'
940  end if
941  if (this%istoragec == 0) then
942  write (this%iout, '(4x,a,1(/,6x,a))') &
943  'COMPRESSION INDICES WILL BE SPECIFIED INSTEAD OF ELASTIC AND', &
944  'INELASTIC SPECIFIC STORAGE COEFFICIENTS'
945  else
946  write (this%iout, '(4x,a,1(/,6x,a))') &
947  'ELASTIC AND INELASTIC SPECIFIC STORAGE COEFFICIENTS WILL BE ', &
948  'SPECIFIED'
949  end if
950  if (this%iupdatematprop /= 1) then
951  write (this%iout, '(4x,a,1(/,6x,a))') &
952  'THICKNESS AND VOID RATIO WILL NOT BE ADJUSTED DURING THE', &
953  'SIMULATION'
954  else
955  write (this%iout, '(4x,a)') &
956  'THICKNESS AND VOID RATIO WILL BE ADJUSTED DURING THE SIMULATION'
957  end if
958  if (this%icellf /= 1) then
959  write (this%iout, '(4x,a)') &
960  'INTERBED THICKNESS WILL BE SPECIFIED AS A THICKNESS'
961  else
962  write (this%iout, '(4x,a,1(/,6x,a))') &
963  'INTERBED THICKNESS WILL BE SPECIFIED AS A AS A CELL FRACTION'
964  end if
965  if (this%ispecified_pcs /= 1) then
966  if (this%ipch /= 0) then
967  write (this%iout, '(4x,a,1(/,6x,a))') &
968  'PRECONSOLIDATION HEAD WILL BE SPECIFIED RELATIVE TO INITIAL', &
969  'STRESS CONDITIONS'
970  else
971  write (this%iout, '(4x,a,1(/,6x,a))') &
972  'PRECONSOLIDATION STRESS WILL BE SPECIFIED RELATIVE TO INITIAL', &
973  'STRESS CONDITIONS'
974  end if
975  else
976  if (this%ipch /= 0) then
977  write (this%iout, '(4x,a,1(/,6x,a))') &
978  'PRECONSOLIDATION HEAD WILL BE SPECIFIED AS ABSOLUTE VALUES', &
979  'INSTEAD OF RELATIVE TO INITIAL HEAD CONDITIONS'
980  else
981  write (this%iout, '(4x,a,1(/,6x,a))') &
982  'PRECONSOLIDATION STRESS WILL BE SPECIFIED AS ABSOLUTE VALUES', &
983  'INSTEAD OF RELATIVE TO INITIAL STRESS CONDITIONS'
984  end if
985  end if
986  if (this%ispecified_dbh /= 1) then
987  write (this%iout, '(4x,a,1(/,6x,a))') &
988  'DELAY INTERBED HEADS WILL BE SPECIFIED RELATIVE TO INITIAL ', &
989  'GWF HEADS'
990  else
991  write (this%iout, '(4x,a,1(/,6x,a))') &
992  'DELAY INTERBED HEADS WILL BE SPECIFIED AS ABSOLUTE VALUES INSTEAD', &
993  'OF RELATIVE TO INITIAL GWF HEADS'
994  end if
995  !
996  ! -- process effective_stress_lag, if effective stress formulation
997  if (this%lhead_based .EQV. .false.) then
998  if (ieslag /= 0) then
999  write (this%iout, '(4x,a,1(/,6x,a))') &
1000  'SPECIFIC STORAGE VALUES WILL BE CALCULATED USING THE EFFECTIVE', &
1001  'STRESS FROM THE PREVIOUS TIME STEP'
1002  else
1003  write (this%iout, '(4x,a,1(/,6x,a))') &
1004  'SPECIFIC STORAGE VALUES WILL BE CALCULATED USING THE CURRENT', &
1005  'EFFECTIVE STRESS'
1006  end if
1007  else
1008  if (ieslag /= 0) then
1009  ieslag = 0
1010  write (this%iout, '(4x,a,2(/,6x,a))') &
1011  'EFFECTIVE_STRESS_LAG HAS BEEN SPECIFIED BUT HAS NO EFFECT WHEN', &
1012  'USING THE HEAD-BASED FORMULATION (HEAD_BASED HAS BEEN SPECIFIED', &
1013  'IN THE OPTIONS BLOCK)'
1014  end if
1015  end if
1016  this%ieslag = ieslag
1017  !
1018  ! -- recalculate BRG if necessary and output
1019  ! water compressibility values
1020  if (ibrg /= 0) then
1021  this%brg = this%gammaw * this%beta
1022  end if
1023  write (this%iout, fmtoptr) 'GAMMAW =', this%gammaw
1024  write (this%iout, fmtoptr) 'BETA =', this%beta
1025  write (this%iout, fmtoptr) 'GAMMAW * BETA =', this%brg
1026  !
1027  ! -- terminate if errors encountered in reach block
1028  if (count_errors() > 0) then
1029  call this%parser%StoreErrorUnit()
1030  end if
1031  !
1032  ! -- return
1033  return
@ mnormal
normal output mode
Definition: Constants.f90:205
integer(i4b), parameter maxcharlen
maximum length of char string
Definition: Constants.f90:46
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
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 55 of file gwf-csub.f90.

55  character(len=LENBUDTXT), dimension(4) :: budtxt = & !< text labels for budget terms
56  [' CSUB-CGELASTIC', &
57  ' CSUB-ELASTIC', &
58  ' CSUB-INELASTIC', &
59  ' 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 60 of file gwf-csub.f90.

60  character(len=LENBUDTXT), dimension(6) :: comptxt = & !< text labels for compaction terms
61  ['CSUB-COMPACTION', &
62  ' CSUB-INELASTIC', &
63  ' CSUB-ELASTIC', &
64  ' CSUB-INTERBED', &
65  ' CSUB-COARSE', &
66  ' CSUB-ZDISPLACE']

◆ dlog10es

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

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

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