CLASSIC
Canadian Land Surface Scheme including Biogeochemical Cycles
energyWaterBalanceCheck.f90 File Reference

Checks for energy and water balance closure over modelled area. More...

Functions/Subroutines

subroutine energywaterbalancecheck (ISTEP, CTVSTP, CTSSTP, CT1STP, CT2STP, CT3STP, WTVSTP, WTSSTP, WTGSTP, FSGV, FLGV, HFSC, HEVC, HMFC, HTCC, FSGS, FLGS, HFSS, HEVS, HMFN, HTCS, FSGG, FLGG, HFSG, HEVG, HMFG, HTC, PCFC, PCLC, QFCF, QFCL, ROFC, WTRC, PCPN, QFN, ROFN, WTRS, PCPG, QFG, QFC, ROF, WTRG, CMAI, RCAN, SCAN, TCAN, SNO, WSNOW, TSNOW, THLIQ, THICE, HCPS, THPOR, DELZW, TBAR, ZPOND, TPOND, DELZ, FCS, FGS, FC, FG, IL1, IL2, ILG, IG, N)
 

Detailed Description

Checks for energy and water balance closure over modelled area.

Author
D. Verseghy

Function/Subroutine Documentation

◆ energywaterbalancecheck()

subroutine energywaterbalancecheck ( integer, intent(in)  ISTEP,
real, dimension(ilg), intent(inout)  CTVSTP,
real, dimension(ilg), intent(inout)  CTSSTP,
real, dimension(ilg), intent(inout)  CT1STP,
real, dimension(ilg), intent(inout)  CT2STP,
real, dimension(ilg), intent(inout)  CT3STP,
real, dimension(ilg), intent(inout)  WTVSTP,
real, dimension(ilg), intent(inout)  WTSSTP,
real, dimension(ilg), intent(inout)  WTGSTP,
real, dimension (ilg), intent(in)  FSGV,
real, dimension (ilg), intent(in)  FLGV,
real, dimension (ilg), intent(in)  HFSC,
real, dimension (ilg), intent(in)  HEVC,
real, dimension (ilg), intent(in)  HMFC,
real, dimension (ilg), intent(in)  HTCC,
real, dimension (ilg), intent(in)  FSGS,
real, dimension (ilg), intent(in)  FLGS,
real, dimension (ilg), intent(in)  HFSS,
real, dimension (ilg), intent(in)  HEVS,
real, dimension (ilg), intent(in)  HMFN,
real, dimension (ilg), intent(in)  HTCS,
real, dimension (ilg), intent(in)  FSGG,
real, dimension (ilg), intent(in)  FLGG,
real, dimension (ilg), intent(in)  HFSG,
real, dimension (ilg), intent(in)  HEVG,
real, dimension (ilg,ig), intent(in)  HMFG,
real, dimension (ilg,ig), intent(in)  HTC,
real, dimension (ilg), intent(in)  PCFC,
real, dimension (ilg), intent(in)  PCLC,
real, dimension (ilg), intent(in)  QFCF,
real, dimension (ilg), intent(in)  QFCL,
real, dimension (ilg), intent(in)  ROFC,
real, dimension (ilg), intent(in)  WTRC,
real, dimension (ilg), intent(in)  PCPN,
real, dimension (ilg), intent(in)  QFN,
real, dimension (ilg), intent(in)  ROFN,
real, dimension (ilg), intent(in)  WTRS,
real, dimension (ilg), intent(in)  PCPG,
real, dimension (ilg), intent(in)  QFG,
real, dimension (ilg,ig), intent(in)  QFC,
real, dimension (ilg), intent(in)  ROF,
real, dimension (ilg), intent(in)  WTRG,
real, dimension (ilg), intent(in)  CMAI,
real, dimension (ilg), intent(in)  RCAN,
real, dimension (ilg), intent(in)  SCAN,
real, dimension (ilg), intent(in)  TCAN,
real, dimension (ilg), intent(in)  SNO,
real, dimension (ilg), intent(in)  WSNOW,
real, dimension (ilg), intent(in)  TSNOW,
real, dimension (ilg,ig), intent(in)  THLIQ,
real, dimension (ilg,ig), intent(in)  THICE,
real, dimension (ilg,ig), intent(in)  HCPS,
real, dimension (ilg,ig), intent(in)  THPOR,
real, dimension (ilg,ig), intent(in)  DELZW,
real, dimension (ilg,ig), intent(in)  TBAR,
real, dimension (ilg), intent(in)  ZPOND,
real, dimension (ilg), intent(in)  TPOND,
real, dimension (ig), intent(in)  DELZ,
real, dimension (ilg), intent(in)  FCS,
real, dimension (ilg), intent(in)  FGS,
real, dimension (ilg), intent(in)  FC,
real, dimension (ilg), intent(in)  FG,
integer, intent(in)  IL1,
integer, intent(in)  IL2,
integer, intent(in)  ILG,
integer, intent(in)  IG,
integer, intent(in)  N 
)
Parameters
[in]istepFlag indicating position at beginning or end of time step
[in,out]ctvstpChange in internal energy of vegetation over current time step \([W m^{-2}] \)
[in,out]ctsstpChange in internal energy of snow pack over current time step \([W m^{-2}] \)
[in,out]ct1stpChange in internal energy of first soil layer over current time step \([W m^{-2}] \)
[in,out]ct2stpChange in internal energy of second soil layer over current time step \([W m^{-2}] \)
[in,out]ct3stpChange in internal energy of third soil layer over current time step \([W m^{-2}] \)
[in,out]wtvstpChange in vegetation mass over current time step \([kg m^{-2}]\)
[in,out]wtsstpChange in snow mass over current time step \([kg m^{-2}]\)
[in,out]wtgstpChange in soil water storage over current time step \([kg m^{-2}]\)
[in]fsgvDiagnosed net shortwave radiation on vegetation canopy \([W m^{-2}] (K_{*,c})\)
[in]flgvDiagnosed net longwave radiation on vegetation canopy \([W m^{-2}] (L_{*,c})\)
[in]hfscDiagnosed sensible heat flux on vegetation canopy \([W m^{-2}] (Q_{H,c})\)
[in]hevcDiagnosed latent heat flux on vegetation canopy \([W m^{-2}] (Q_{E,c})\)
[in]hmfcDiagnosed energy associated with phase change of water on vegetation \([W m^{-2}] (Q_{M,c})\)
[in]htccDiagnosed internal energy change of vegetation canopy due to conduction and/or change in mass \([W m^{-2}] (Q_{I,c})\)
[in]fsgsDiagnosed net shortwave radiation at snow surface \([W m^{-2}] (K_{*,s})\)
[in]flgsDiagnosed net longwave radiation at snow surface \([W m^{-2}] (L_{*,s})\)
[in]hfssDiagnosed sensible heat flux at snow surface \([W m^{-2}] (Q_{H,s})\)
[in]hevsDiagnosed latent heat flux at snow surface \([W m^{-2}] (Q_{E,s})\)
[in]hmfnDiagnosed energy associated with phase change of water in snow pack \([W m^{-2}] (Q_{M,s})\)
[in]htcsDiagnosed internal energy change of snow pack due to conduction and/or change in mass \([W m^{-2}] (Q_{I,s})\)
[in]fsggDiagnosed net shortwave radiation at soil surface \([W m^{-2}] (K_{*,g})\)
[in]flggDiagnosed net longwave radiation at soil surface \([W m^{-2}] (L_{*,g})\)
[in]hfsgDiagnosed sensible heat flux at soil surface \([W m^{-2}] (Q_{H,g})\)
[in]hevgDiagnosed latent heat flux at soil surface \([W m^{-2}] (Q_{E,g})\)
[in]hmfgDiagnosed energy associated with phase change of water in soil layers \([W m^{-2}] (Q_{M,g})\)
[in]htcDiagnosed internal energy change of soil layer due to conduction and/or change in mass \([W m^{-2}] (Q_{I,g})\)
[in]pcfcDiagnosed frozen precipitation intercepted by vegetation \([kg m^{-2} s^{-1}] (P_{f,c})\)
[in]pclcDiagnosed liquid precipitation intercepted by vegetation \([kg m^{-2} s^{-1}] (P_{l,c})\)
[in]qfcfDiagnosed vapour flux from frozen water on vegetation \([kg m^{-2} s^{-1}] (E_{f,c})\)
[in]qfclDiagnosed vapour flux from liquid water on vegetation \([kg m^{-2} s^{-1}] (E_{l,c})\)
[in]rofcLiquid/frozen water runoff from vegetation \([kg m^{-2} s^{-1}] (R_c)\)
[in]wtrcDiagnosed water transferred off the vegetation canopy \([kg m^{-2} s^{-1}] (A_c)\)
[in]pcpnDiagnosed precipitation incident on snow pack \([kg m^{-2} s^{-1}] (P_s)\)
[in]qfnDiagnosed water vapour flux from snow pack \([kg m^{-2} s^{-1}] (E_s)\)
[in]rofnLiquid water runoff from snow pack \([kg m^{-2} s^{-1}] (R_s)\)
[in]wtrsDiagnosed water transferred into or out of the snow pack \([kg m^{-2} s^{-1}] (A_s)\)
[in]pcpgDiagnosed precipitation incident on ground \([kg m^{-2} s^{-1}] (P_g)\)
[in]qfgDiagnosed water vapour flux from ground surface \([kg m^{-2} s^{-1}] (E_g)\)
[in]qfcDiagnosed vapour flux from transpiration over modelled area \([W m^{-2}] (E_c)\)
[in]rofTotal runoff from soil \([kg m^{-2} s^{-1}] (R_g)\)
[in]wtrgDiagnosed water transferred into or out of the soil \([kg m^{-2} s^{-1}] (A_g)\)
[in]cmaiCurrent mass of vegetation canopy \([kg m^{-2}] (W_c)\)
[in]rcanIntercepted liquid water stored on canopy \([kg m^{-2}] (W_{l,c})\)
[in]scanIntercepted frozen water stored on canopy \([kg m^{-2}] (W_{f,c})\)
[in]tcanVegetation canopy temperature \([K] (T_c)\)
[in]snoMass of snow pack \([kg m^{-2}] (W_s)\)
[in]wsnowLiquid water content of snow pack \([kg m^{-2}] (W_{l,s})\)
[in]tsnowSnowpack temperature \([K] (T_s)\)
[in]thliqVolumetric liquid water content of soil layers \([m^3 m^{-3}] (\theta_l)\)
[in]thiceVolumetric frozen water content of soil layers \([m^3 m^{-3}] (\theta_f)\)
[in]hcpsVolumetric heat capacity of soil particles \([J m^{-3}] (C_g)\)
[in]thporPore volume in soil layer \([m^3 m^{-3}]\)
[in]delzwPermeable thickness of soil layer \([m] (\Delta_zw)\)
[in]delzTotal thickness of soil layer \([m] (\Delta_z)\)
[in]tbarTemperature of soil layers \([K] (T_g)\)
[in]zpondDepth of ponded water on surface \([m] (z_p)\)
[in]tpondTotal thickness of soil layer \([m] (\Delta_z)\)
[in]fcsFractional coverage of vegetation over snow on modelled area [ ]
[in]fgsFractional coverage of snow over bare ground on modelled area [ ]
[in]fcFractional coverage of vegetation over bare ground on modelled area [ ]
[in]fgFractional coverage of bare ground on modelled area [ ]

In this subroutine, checks are carried out to ensure that the change in energy storage in each of the components of the modelled area (canopy, snow and soil) is equal to the sum of the energy fluxes into and out of them; and that the change in moisture storage in each of the components is equal to the sum of the water fluxes into and out of them. The subroutine is called twice, once at the beginning (ISTEP=0) and once at the end (ISTEP=1) of each time step. At the beginning, the instantaneous energy and moisture storage terms are evaluated, and at the end the differences over the time step are calculated:

Change in canopy energy storage = \(\Delta [(c_c W_c + c_w W_{l,c} + c_i W_{f,c} )T_c ] / \Delta t\)

Change in snow energy storage = \(\Delta [(C_i W_s /\rho_i + C_w W_{l,s} / \rho_w)T_s ]/ \Delta t \)

Change in soil layer energy storage = \(\Delta {[(C_w \theta_l + C_i \theta_f + C_g \theta_g) \Delta z_w + C_b (\Delta z – \Delta z_w)]T_j }/ \Delta t\) (For the first soil layer, the numerator contains the additional term \(C_w z_p T_p\).)

Change in canopy moisture storage = \(\Delta[W_{l,c} + W_{f,c}]\)

Change in snow moisture storage = \(\Delta[W_s + W_{l,s}]\)

Change in soil moisture storage = \(\Delta [(\theta_l \rho_w + \theta_f \rho_i) \Delta z_w + z_p \rho_w ]\)

The net energy and moisture fluxes are also evaluated at the end of the time step:

Net energy flux for canopy = \(K_{*,c} + L_{*,c} – Q_{H,c} – Q_{E,c} – Q_{M,c} + Q_{I,c}\)

Net energy flux for snow = \(K_{*,s} + L_{*,s} – Q_{H,s} – Q_{E,s} – Q_{M,s} + Q_{I,s}\)

Net energy flux for first soil layer = \(K_{*,g} + L_{*,g} – Q_{H,g} – Q_{E,g} – Q_{M,1} + Q_{I,1}\)

Net energy flux for other soil layers = \(- Q_{M,j} + Q_{I,j}\)

Net moisture flux for canopy = \(P_{l,c} + P_{f,c} – E_{l,c} – E_{f,c} – R_c + A_c\)

Net moisture flux for snow = \(P_s – E_s – R_s + A_s\)

Net moisture flux for soil = \(P_g – E_g – R_g + A_g - E_c\)

In these equations the \(K_*\) terms refer to net shortwave radiation, the \(L_*\) terms to net longwave radiation, the \(Q_H\) terms to sensible heat flux, the \(Q_E\) terms to latent heat flux, the \(Q_M\) terms to heat associated with melting or freezing of water, and the \(Q_I\) terms to changes in heat storage caused by conduction or redistribution of water. The P terms refer to precipitation, the E terms to evaporation, the R terms to runoff and the A terms to water transferred between different components of the landscape. The subscript 1 refers to the first soil layer, and j to a generalized other layer.

Finally, each change in energy or moisture storage is compared in turn with the corresponding net flux of energy or moisture, and if the difference is greater than a selected threshold value, an error message is printed out and the run is stopped.