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

Checks for closure of surface water budget, and for unphysical values of certain variables. More...

Functions/Subroutines

subroutine checkwaterbudget (ISFC, PCPR, EVAP, RUNOFF, WLOST, RAICAN, SNOCAN, RAICNI, SNOCNI, ZPOND, ZPONDI, THLIQ, THICE, THLIQI, THICEI, ZSNOW, RHOSNO, XSNOW, SNOWI, WSNOW, WSNOWI, FCS, FGS, FI, BAL, THPOR, THLMIN, DELZW, ISAND, IG, ILG, IL1, IL2, JL, N)
 

Detailed Description

Checks for closure of surface water budget, and for unphysical values of certain variables.

Author
D. Verseghy, M. Lazare, B. Dugas

Function/Subroutine Documentation

◆ checkwaterbudget()

subroutine checkwaterbudget ( integer, intent(in)  ISFC,
real, dimension (ilg), intent(in)  PCPR,
real, dimension (ilg), intent(in)  EVAP,
real, dimension(ilg), intent(in)  RUNOFF,
real, dimension (ilg), intent(in)  WLOST,
real, dimension(ilg), intent(in)  RAICAN,
real, dimension(ilg), intent(in)  SNOCAN,
real, dimension(ilg), intent(in)  RAICNI,
real, dimension(ilg), intent(in)  SNOCNI,
real, dimension (ilg), intent(in)  ZPOND,
real, dimension(ilg), intent(in)  ZPONDI,
real, dimension (ilg,ig), intent(in)  THLIQ,
real, dimension (ilg,ig), intent(in)  THICE,
real, dimension(ilg,ig), intent(in)  THLIQI,
real, dimension(ilg,ig), intent(in)  THICEI,
real, dimension (ilg), intent(in)  ZSNOW,
real, dimension(ilg), intent(in)  RHOSNO,
real, dimension (ilg), intent(inout)  XSNOW,
real, dimension (ilg), intent(in)  SNOWI,
real, dimension (ilg), intent(in)  WSNOW,
real, dimension(ilg), intent(in)  WSNOWI,
real, dimension (ilg), intent(in)  FCS,
real, dimension (ilg), intent(in)  FGS,
real, dimension (ilg), intent(in)  FI,
real, dimension(ilg), intent(inout)  BAL,
real, dimension (ilg,ig), intent(in)  THPOR,
real, dimension(ilg,ig), intent(in)  THLMIN,
real, dimension (ilg,ig), intent(in)  DELZW,
integer, dimension (ilg,ig), intent(in)  ISAND,
integer, intent(in)  IG,
integer, intent(in)  ILG,
integer, intent(in)  IL1,
integer, intent(in)  IL2,
integer, intent(in)  JL,
integer, intent(in)  N 
)
Parameters
[in]isfcType of surface (1 = canopy over snow, 2 = snow covered ground, 3 = canopy over bare ground, 4 = bare ground)
[in]pcprPrecipitation rate over modelled subarea \([kg m^{-2} s^{-1}]\)
[in]evapEvapotranspiration rate over modelled subarea \([kg m^{-2} s^{-1}]\)
[in]runoffTotal runoff over modelled subarea [m]
[in]wlostResidual amount of water that cannot be supplied by surface stores \([kg m^{-2}]\)
[in]raicanIntercepted liquid water on canopy at end of time step \([kg m^{-2}]\)
[in]snocanIntercepted frozen water on canopy at end of time step \([kg m^{-2}]\)
[in]raicniIntercepted liquid water on canopy at beginning of time step \([kg m^{-2}]\)
[in]snocniIntercepted frozen water on canopy at beginning of time step \([kg m^{-2}]\)
[in]zpondDepth of ponded water on ground at end of time step [m]
[in]zpondiDepth of ponded water on ground at beginning of time step [m]
[in]zsnowDepth of snow pack [m]
[in]rhosnoDensity of snow pack \([kg m^{-3}]\)
[in,out]xsnowSwitch to indicate presence of snow cover [ ]
[in]snowiSnow pack mass at beginning of time step \([kg m^{-2}]\)
[in]wsnowLiquid water content of snow pack at end of time step \([kg m^{-2}]\)
[in]wsnowiLiquid water content of snow pack at beginning of time step \([kg m^{-2}]\)
[in]fcsFractional coverage of canopy over snow on modelled area [ ]
[in]fgsFractional coverage of snow over bare ground on modelled area [ ]
[in]fiFractional coverage of subarea in question on modelled area [ ]
[in]thliqVolumetric liquid water content of soil layers at end of time step \([m^3 m^{-3}]\)
[in]thiceVolumetric frozen water content of soil layers at end of time step \([m^3 m^{-3}]\)
[in]thliqiVolumetric frozen water content of soil layers at beginning of time step \([m^3 m^{-3}]\)
[in]thiceiVolumetric frozen water content of soil layers at beginning of time step \([m^3 m^{-3}]\)
[in]thporPore volume in soil layer \([m^3 m^{-3}]\)
[in]thlminResidual soil liquid water content remaining after freezing or evaporation \([m^3 m^{-3}]\)
[in]delzwPermeable depth of soil layer [m]

This subroutine is called from waterBudgetDriver to perform water balance checks for each of the four subareas. The flag ISFC indicates which subarea is being addressed: ISFC=1 for vegetation over snow, ISFC=2 for snow over bare ground, ISFC=3 for vegetation over bare ground, and ISFC=4 for bare ground. If a problem is discovered, a flag is set to the index of the modelled area, and a call to errorHandler is performed with an error message. Checks for unphysical values of certain water balance variables are performed against an accuracy limit ACCLMT, currently set to \(1x10^{-3} kg m^{-2}\) or \(m^3 m^{-3}\). The overall water balance of the subarea is checked against an accuracy limit BALLMT, currently set to \(1x10^{-1} kg m^{-2}\). (These values reflect expected roundoff errors associated with 32-bit computation.)

In loop 100, for canopy-covered subareas, the intercepted rain RAICAN and snow SNOCAN are checked to ensure that if they are negative, they are vanishingly small. A similar check is done for the runoff.

In the 150 loop, for all areas that are not continental ice sheets (ISAND=-4), the liquid water content in each soil layer is checked to ensure that it is not larger than the pore volume and that it is not smaller than the minimum liquid water content (except for rock layers). The ice content is similarly checked to ensure that the sum of it, converted to an equivalent liquid water content, plus the minimum water content, is not greater than the pore volume (except for rock layers). It is also checked to ensure that if it is negative, it is vanishingly small.

Finally, in loop 300, the overall water balance BAL is calculated and compared to BALLMT. BAL is evaluated as the residual of the precipitation, the evaporation, the runoff, the water loss term WLOST, the change in canopy intercepted liquid and frozen water (for vegetation-covered areas), the change in surface ponded water, the change in snow pack and snow liquid water content (for snow-covered areas), and the changes in the soil layer liquid and frozen water contents. If the absolute value of BAL is greater than BALLMT, a flag is set, all of the terms entering BAL are printed out, and a call to errorHandler is performed.