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

Calls subroutines to perform surface water budget calculations. More...

Functions/Subroutines

subroutine waterbudgetdriver (THLIQ, THICE, TBAR, TCAN, RCAN, SNCAN, RUNOFF, TRUNOF, SNO, TSNOW, RHOSNO, ALBSNO, WSNOW, ZPOND, TPOND, GROWTH, TBASE, GFLUX, PCFC, PCLC, PCPN, PCPG, QFCF, QFCL, QFN, QFG, QFC, HMFC, HMFG, HMFN, HTCC, HTCS, HTC, ROFC, ROFN, ROVG, WTRS, WTRG, OVRFLW, SUBFLW, BASFLW, TOVRFL, TSUBFL, TBASFL, EVAP, QFLUX, RHOAIR, TBARC, TBARG, TBARCS, TBARGS, THLIQC, THLIQG, THICEC, THICEG, HCPC, HCPG, RPCP, TRPCP, SPCP, TSPCP, PCPR, TA, RHOSNI, GGEO, FC, FG, FCS, FGS, TPONDC, TPONDG, TPNDCS, TPNDGS, EVAPC, EVAPCG, EVAPG, EVAPCS, EVPCSG, EVAPGS, QFREZC, QFREZG, QMELTC, QMELTG, RAICAN, SNOCAN, RAICNS, SNOCNS, FSVF, FSVFS, CWLCAP, CWFCAP, CWLCPS, CWFCPS, TCANO, TCANS, CHCAP, CHCAPS, CMASSC, CMASCS, ZSNOW, GZEROC, GZEROG, GZROCS, GZROGS, G12C, G12G, G12CS, G12GS, G23C, G23G, G23CS, G23GS, TSNOCS, TSNOGS, WSNOCS, WSNOGS, RHOSCS, RHOSGS, ZPLIMC, ZPLIMG, ZPLMCS, ZPLMGS, TSFSAV, TCTOPC, TCBOTC, TCTOPG, TCBOTG, FROOT, FROOTS, THPOR, THLRET, THLMIN, BI, PSISAT, GRKSAT, THLRAT, THFC, XDRAIN, HCPS, DELZ, DELZW, ZBOTW, XSLOPE, GRKFAC, WFSURF, WFCINT, ISAND, IGDR, IWF, ILG, IL1, IL2, N, JL, IC, IG, IGP1, IGP2, NLANDCS, NLANDGS, NLANDC, NLANDG, NLANDI)
 

Detailed Description

Calls subroutines to perform surface water budget calculations.

Author
D. Verseghy, P. Bartlett, M. Lazare

Function/Subroutine Documentation

◆ waterbudgetdriver()

subroutine waterbudgetdriver ( real, dimension (ilg,ig), intent(inout)  THLIQ,
real, dimension (ilg,ig), intent(out)  THICE,
real, dimension (ilg,ig), intent(inout)  TBAR,
real, dimension (ilg), intent(inout)  TCAN,
real, dimension (ilg), intent(inout)  RCAN,
real, dimension (ilg), intent(inout)  SNCAN,
real, dimension(ilg), intent(inout)  RUNOFF,
real, dimension(ilg), intent(inout)  TRUNOF,
real, dimension (ilg), intent(inout)  SNO,
real, dimension (ilg), intent(inout)  TSNOW,
real, dimension(ilg), intent(inout)  RHOSNO,
real, dimension(ilg), intent(inout)  ALBSNO,
real, dimension (ilg), intent(inout)  WSNOW,
real, dimension (ilg), intent(inout)  ZPOND,
real, dimension (ilg), intent(inout)  TPOND,
real, dimension(ilg), intent(inout)  GROWTH,
real, dimension (ilg), intent(inout)  TBASE,
real, dimension (ilg,ig), intent(out)  GFLUX,
real, dimension (ilg), intent(in)  PCFC,
real, dimension (ilg), intent(in)  PCLC,
real, dimension (ilg), intent(in)  PCPN,
real, dimension (ilg), intent(inout)  PCPG,
real, dimension (ilg), intent(in)  QFCF,
real, dimension (ilg), intent(in)  QFCL,
real, dimension (ilg), intent(in)  QFN,
real, dimension (ilg), intent(in)  QFG,
real, dimension (ilg,ig), intent(in)  QFC,
real, dimension (ilg), intent(in)  HMFC,
real, dimension (ilg,ig), intent(in)  HMFG,
real, dimension (ilg), intent(in)  HMFN,
real, dimension (ilg), intent(inout)  HTCC,
real, dimension (ilg), intent(inout)  HTCS,
real, dimension (ilg,ig), intent(inout)  HTC,
real, dimension (ilg), intent(inout)  ROFC,
real, dimension (ilg), intent(inout)  ROFN,
real, dimension (ilg), intent(inout)  ROVG,
real, dimension (ilg), intent(in)  WTRS,
real, dimension (ilg), intent(in)  WTRG,
real, dimension(ilg), intent(inout)  OVRFLW,
real, dimension(ilg), intent(inout)  SUBFLW,
real, dimension(ilg), intent(inout)  BASFLW,
real, dimension(ilg), intent(inout)  TOVRFL,
real, dimension(ilg), intent(in)  TSUBFL,
real, dimension(ilg), intent(in)  TBASFL,
real, dimension (ilg), intent(inout)  EVAP,
real, dimension (ilg), intent(inout)  QFLUX,
real, dimension (ilg), intent(in)  RHOAIR,
real, dimension(ilg,ig), intent(in)  TBARC,
real, dimension(ilg,ig), intent(in)  TBARG,
real, dimension(ilg,ig), intent(in)  TBARCS,
real, dimension(ilg,ig), intent(in)  TBARGS,
real, dimension(ilg,ig), intent(in)  THLIQC,
real, dimension(ilg,ig), intent(in)  THLIQG,
real, dimension(ilg,ig), intent(in)  THICEC,
real, dimension(ilg,ig), intent(in)  THICEG,
real, dimension (ilg,ig), intent(in)  HCPC,
real, dimension (ilg,ig), intent(in)  HCPG,
real, dimension (ilg), intent(in)  RPCP,
real, dimension (ilg), intent(in)  TRPCP,
real, dimension (ilg), intent(in)  SPCP,
real, dimension (ilg), intent(in)  TSPCP,
real, dimension (ilg), intent(in)  PCPR,
real, dimension (ilg), intent(in)  TA,
real, dimension(ilg), intent(in)  RHOSNI,
real, dimension (ilg), intent(in)  GGEO,
real, dimension (ilg), intent(in)  FC,
real, dimension (ilg), intent(in)  FG,
real, dimension (ilg), intent(in)  FCS,
real, dimension (ilg), intent(in)  FGS,
real, dimension(ilg), intent(in)  TPONDC,
real, dimension(ilg), intent(in)  TPONDG,
real, dimension(ilg), intent(in)  TPNDCS,
real, dimension(ilg), intent(in)  TPNDGS,
real, dimension (ilg), intent(in)  EVAPC,
real, dimension(ilg), intent(in)  EVAPCG,
real, dimension (ilg), intent(in)  EVAPG,
real, dimension(ilg), intent(in)  EVAPCS,
real, dimension(ilg), intent(in)  EVPCSG,
real, dimension(ilg), intent(in)  EVAPGS,
real, dimension(ilg), intent(in)  QFREZC,
real, dimension(ilg), intent(in)  QFREZG,
real, dimension(ilg), intent(in)  QMELTC,
real, dimension(ilg), intent(in)  QMELTG,
real, dimension(ilg), intent(in)  RAICAN,
real, dimension(ilg), intent(in)  SNOCAN,
real, dimension(ilg), intent(in)  RAICNS,
real, dimension(ilg), intent(in)  SNOCNS,
real, dimension (ilg), intent(in)  FSVF,
real, dimension (ilg), intent(in)  FSVFS,
real, dimension(ilg), intent(in)  CWLCAP,
real, dimension(ilg), intent(in)  CWFCAP,
real, dimension(ilg), intent(in)  CWLCPS,
real, dimension(ilg), intent(in)  CWFCPS,
real, dimension (ilg), intent(in)  TCANO,
real, dimension (ilg), intent(in)  TCANS,
real, dimension (ilg), intent(in)  CHCAP,
real, dimension(ilg), intent(in)  CHCAPS,
real, dimension(ilg), intent(in)  CMASSC,
real, dimension(ilg), intent(in)  CMASCS,
real, dimension (ilg), intent(inout)  ZSNOW,
real, dimension(ilg), intent(in)  GZEROC,
real, dimension(ilg), intent(in)  GZEROG,
real, dimension(ilg), intent(in)  GZROCS,
real, dimension(ilg), intent(in)  GZROGS,
real, dimension (ilg), intent(in)  G12C,
real, dimension (ilg), intent(in)  G12G,
real, dimension (ilg), intent(in)  G12CS,
real, dimension (ilg), intent(in)  G12GS,
real, dimension (ilg), intent(in)  G23C,
real, dimension (ilg), intent(in)  G23G,
real, dimension (ilg), intent(in)  G23CS,
real, dimension (ilg), intent(in)  G23GS,
real, dimension(ilg), intent(in)  TSNOCS,
real, dimension(ilg), intent(in)  TSNOGS,
real, dimension(ilg), intent(in)  WSNOCS,
real, dimension(ilg), intent(in)  WSNOGS,
real, dimension(ilg), intent(in)  RHOSCS,
real, dimension(ilg), intent(in)  RHOSGS,
real, dimension(ilg), intent(in)  ZPLIMC,
real, dimension(ilg), intent(in)  ZPLIMG,
real, dimension(ilg), intent(in)  ZPLMCS,
real, dimension(ilg), intent(in)  ZPLMGS,
real, dimension(ilg,4), intent(in)  TSFSAV,
real, dimension(ilg,ig), intent(in)  TCTOPC,
real, dimension(ilg,ig), intent(in)  TCBOTC,
real, dimension(ilg,ig), intent(in)  TCTOPG,
real, dimension(ilg,ig), intent(in)  TCBOTG,
real, dimension (ilg,ig), intent(in)  FROOT,
real, dimension (ilg,ig), intent(in)  FROOTS,
real, dimension (ilg,ig), intent(in)  THPOR,
real, dimension(ilg,ig), intent(in)  THLRET,
real, dimension(ilg,ig), intent(in)  THLMIN,
real, dimension (ilg,ig), intent(in)  BI,
real, dimension(ilg,ig), intent(in)  PSISAT,
real, dimension(ilg,ig), intent(in)  GRKSAT,
real, dimension(ilg,ig), intent(in)  THLRAT,
real, dimension (ilg,ig), intent(in)  THFC,
real, dimension(ilg), intent(in)  XDRAIN,
real, dimension (ilg,ig), intent(in)  HCPS,
real, dimension (ig), intent(in)  DELZ,
real, dimension (ilg,ig), intent(in)  DELZW,
real, dimension (ilg,ig), intent(in)  ZBOTW,
real, dimension(ilg), intent(in)  XSLOPE,
real, dimension(ilg), intent(in)  GRKFAC,
real, dimension(ilg), intent(in)  WFSURF,
real, dimension(ilg), intent(in)  WFCINT,
integer, dimension(ilg,ig), intent(in)  ISAND,
integer, dimension (ilg), intent(in)  IGDR,
integer, intent(in)  IWF,
integer, intent(in)  ILG,
integer, intent(in)  IL1,
integer, intent(in)  IL2,
integer, intent(in)  N,
integer, intent(in)  JL,
integer, intent(in)  IC,
integer, intent(in)  IG,
integer, intent(in)  IGP1,
integer, intent(in)  IGP2,
integer, intent(in)  NLANDCS,
integer, intent(in)  NLANDGS,
integer, intent(in)  NLANDC,
integer, intent(in)  NLANDG,
integer, intent(in)  NLANDI 
)
Parameters
[in]iwfFlag governing lateral soil water flow calculations
[in]nlandcsNumber of modelled areas that contain subareas of canopy over snow
[in]nlandgsNumber of modelled areas that contain subareas of snow
[in]nlandcNumber of modelled areas that contain subareas of canopy over bare ground
[in]nlandgNumber of modelled areas that contain subareas of bare ground
[in]nlandiNumber of modelled areas that are ice sheets [ ]
[in,out]thliqVolumetric liquid water content of soil layers \([m^3 m^{-3}]\)
[out]thiceVolumetric frozen water content of soil layers \([m^3 m^{-3}]\)
[in,out]tbarTemperature of soil layers [K]
[out]gfluxHeat flux at interfaces between soil layers \([W m^{-2}]\)
[in,out]tcanVegetation canopy temperature [K]
[in,out]rcanIntercepted liquid water stored on canopy \([kg m^{-2}]\)
[in,out]sncanIntercepted frozen water stored on canopy \([kg m^{-2}]\)
[in,out]runoffTotal runoff from soil \([m or kg m^{-2} s^{-1}]\)
[in,out]snoMass of snow pack \([kg m^{-2}]\)
[in,out]tsnowSnowpack temperature [K]
[in,out]rhosnoDensity of snow \([kg m^{-3}]\)
[in,out]albsnoSnow albedo [ ]
[in,out]zpondDepth of ponded water on surface [m]
[in,out]tpondTemperature of ponded water [K]
[in,out]growthVegetation growth index [ ]
[in,out]tbaseTemperature of bedrock in third soil layer [K]
[in,out]trunofTemperature of total runoff [K]
[in,out]wsnowLiquid water content of snow pack \([kg m^{-2}]\)
[in]pcfcFrozen precipitation intercepted by vegetation \([kg m^{-2} s^{-1}]\)
[in]pclcLiquid precipitation intercepted by vegetation \([kg m^{-2} s^{-1}]\)
[in]pcpnPrecipitation incident on snow pack \([kg m^{-2} s^{-1}]\)
[in,out]pcpgPrecipitation incident on ground \([kg m^{-2} s^{-1}]\)
[in]qfcfSublimation from frozen water on vegetation \([kg m^{-2} s^{-1}]\)
[in]qfclEvaporation from liquid water on vegetation \([kg m^{-2} s^{-1}]\)
[in]qfnSublimation from snow pack \([kg m^{-2} s^{-1}]\)
[in]qfgEvaporation from ground \([kg m^{-2} s^{-1}]\)
[in]hmfcDiagnosed energy associated with phase change of water on vegetation \([W m^{-2}]\)
[in]hmfnDiagnosed energy associated with phase change of water in snow pack \([W m^{-2}]\)
[in,out]htccDiagnosed internal energy change of vegetation canopy due to conduction and/or change in mass \([W m^{-2}]\)
[in,out]htcsDiagnosed internal energy change of snow pack due to conduction and/or change in mass \([W m^{-2}]\)
[in,out]rofcLiquid/frozen water runoff from vegetation \([kg m^{-2} s^{-1}]\)
[in,out]rofnLiquid water runoff from snow pack \([kg m^{-2} s^{-1}]\)
[in,out]rovgLiquid/frozen water runoff from vegetation to ground surface \([kg m^{-2} s^{-1}]\)
[in]wtrsDiagnosed residual water transferred into or out of the snow pack \([kg m^{-2} s^{-1}]\)
[in]wtrgDiagnosed residual water transferred into or out of the soil \([kg m^{-2} s^{-1}]\)
[in,out]ovrflwOverland flow from top of soil column
[in,out]subflwInterflow from sides of soil column \([kg m^{-2} s^{-1}]\)
[in,out]basflwBase flow from bottom of soil column \([m or kg m^{-2} s^{-1}]\)
[in,out]tovrflTemperature of overland flow from top of soil column [K]
[in]tsubflTemperature of interflow from sides of soil column [K]
[in]tbasflTemperature of base flow from bottom of soil column [K]
[in,out]evapDiagnosed total surface water vapour flux over modelled area \([kg m^{-2} s^{-1}]\)
[in,out]qfluxProduct of surface drag coefficient, wind speed and surface-air specific humidity difference \([m s^{-1}]\)
[in]rhoairDensity of air \([kg m^{-3}]\)
[in]qfcWater removed from soil layers by transpiration \([kg m^{-2} s^{-1}]\)
[in]hmfgDiagnosed energy associated with phase change of water in soil layers \([W m^{-2}]\)
[in,out]htcDiagnosed internal energy change of soil layer due to conduction and/or change in mass \([W m^{-2}]\)
[in]rpcpRainfall rate over modelled area \([m s^{-1}]\)
[in]trpcpRainfall temperature over modelled area [C]
[in]spcpSnowfall rate over modelled area \([m s^{-1}]\)
[in]tspcpSnowfall temperature over modelled area [C]
[in]pcprSurface precipitation rate \([kg m^{-2} s^{-1}]\)
[in]taAir temperature at reference height [K]
[in]tbarcSubarea temperatures of soil layers [C]
[in]tbargSubarea temperatures of soil layers [C]
[in]tbarcsSubarea temperatures of soil layers [C]
[in]tbargsSubarea temperatures of soil layers [C]
[in]thliqcLiquid water content of soil layers under vegetation \([m^3 m^{-3}]\)
[in]thliqgLiquid water content of soil layers in bare areas \([m^3 m^{-3}]\)
[in]thicecFrozen water content of soil layers under vegetation \([m^3 m^{-3}]\)
[in]thicegFrozen water content of soil layers in bare areas \([m^3 m^{-3}]\)
[in]hcpcHeat capacity of soil layers under vegetation \([J m^{-3} K^{-1}]\)
[in]hcpgHeat capacity of soil layers in bare areas \([J m^{-3} K^{-1}]\)
[in]tctopcThermal conductivity of soil at top of layer (vegetation over ground) \([W m^{-1} K^{-1}]\)
[in]tcbotcThermal conductivity of soil at bottom of layer (vegetation over ground) \([W m^{-1} K^{-1}]\)
[in]tctopgThermal conductivity of soil at top of layer (bare ground) \([W m^{-1} K^{-1}]\)
[in]tcbotgThermal conductivity of soil at bottom of layer (bare ground) \([W m^{-1} K^{-1}]\)
[in]frootFraction of total transpiration contributed by soil layer over snow-free subarea [ ]
[in]frootsFraction of total transpiration contributed by soil layer over snow-covered subarea [ ]
[in]tsfsavGround surface temperature over subarea [K]
[in]fcSubarea fractional coverage of modelled area [ ]
[in]fgSubarea fractional coverage of modelled area [ ]
[in]fcsSubarea fractional coverage of modelled area [ ]
[in]fgsSubarea fractional coverage of modelled area [ ]
[in]tpondcSubarea temperature of surface ponded water [C]
[in]tpondgSubarea temperature of surface ponded water [C]
[in]tpndcsSubarea temperature of surface ponded water [C]
[in]tpndgsSubarea temperature of surface ponded water [C]
[in]evapcEvaporation from vegetation over ground \([m s^{-1}]\)
[in]evapcgEvaporation from ground under vegetation \([m s^{-1}]\)
[in]evapgEvaporation from bare ground \([m s^{-1}]\)
[in]evapcsEvaporation from vegetation over snow \([m s^{-1}]\)
[in]evpcsgEvaporation from snow under vegetation \([m s^{-1}]\)
[in]evapgsEvaporation from snow on bare ground \([m s^{-1}]\)
[in]qfrezcHeat sink to be used for freezing water on ground under canopy \([W m^{-2}]\)
[in]qfrezgHeat sink to be used for freezing water on bare ground \([W m^{-2}]\)
[in]qmeltcHeat to be used for melting snow under canopy \([W m^{-2}]\)
[in]qmeltgHeat to be used for melting snow on bare ground \([W m^{-2}]\)
[in]raicanIntercepted liquid water stored on canopy over ground \([kg m^{-2}]\)
[in]snocanIntercepted frozen water stored on canopy over ground \([kg m^{-2}]\)
[in]raicnsIntercepted liquid water stored on canopy over snow \([kg m^{-2}]\)
[in]snocnsIntercepted frozen water stored on canopy over snow \([kg m^{-2}]\)
[in]fsvfSky view factor of ground under vegetation canopy [ ]
[in]fsvfsSky view factor of snow under vegetation canopy [ ]
[in]cwlcapStorage capacity of canopy over bare ground for liquid water \([kg m^{-2}]\)
[in]cwfcapStorage capacity of canopy over bare ground for frozen water \([kg m^{-2}]\)
[in]cwlcpsStorage capacity of canopy over snow for liquid water \([kg m^{-2}]\)
[in]cwfcpsStorage capacity of canopy over snow for frozen water \([kg m^{-2}]\)
[in]tcanoTemperature of canopy over ground [K]
[in]tcansTemperature of canopy over snow [K]
[in]chcapHeat capacity of canopy over bare ground \([J m^{-2} K^{-1}] \)
[in]chcapsHeat capacity of canopy over snow \([J m^{-2} K^{-1}] \)
[in]cmasscMass of canopy over bare ground \([kg m^{-2}]\)
[in]cmascsMass of canopy over snow \([kg m^{-2}]\)
[in,out]zsnowDepth of snow pack [m]
[in]rhosniDensity of fresh snow \([kg m^{-3}]\)
[in]gzerocSubarea heat flux at soil surface \([W m^{-2}]\)
[in]gzerogSubarea heat flux at soil surface \([W m^{-2}]\)
[in]gzrocsSubarea heat flux at soil surface \([W m^{-2}]\)
[in]gzrogsSubarea heat flux at soil surface \([W m^{-2}]\)
[in]g12cSubarea heat flux between first and second soil layers \([W m^{-2}]\)
[in]g12gSubarea heat flux between first and second soil layers \([W m^{-2}]\)
[in]g12csSubarea heat flux between first and second soil layers \([W m^{-2}]\)
[in]g12gsSubarea heat flux between first and second soil layers \([W m^{-2}]\)
[in]g23cSubarea heat flux between second and third soil layers \([W m^{-2}]\)
[in]g23gSubarea heat flux between second and third soil layers \([W m^{-2}]\)
[in]g23csSubarea heat flux between second and third soil layers \([W m^{-2}]\)
[in]g23gsSubarea heat flux between second and third soil layers \([W m^{-2}]\)
[in]tsnocsTemperature of snow pack under vegetation [K]
[in]tsnogsTemperature of snow pack in bare areas [K]
[in]wsnocsLiquid water content of snow pack under vegetation \([kg m^{-2}]\)
[in]wsnogsLiquid water content of snow pack in bare areas \([kg m^{-2}]\)
[in]rhoscsDensity of snow under vegetation \([kg m^{-3}]\)
[in]rhosgsDensity of snow in bare areas \([kg m^{-3}]\)
[in]zplimcSubarea maximum ponding depth [m]
[in]zplimgSubarea maximum ponding depth [m]
[in]zplmcsSubarea maximum ponding depth [m]
[in]zplmgsSubarea maximum ponding depth [m]
[in]ggeoGeothermal heat flux at bottom of soil profile \([W m^{-2}]\)
[in]thporPore volume in soil layer \([m^3 m^{-3}]\)
[in]thlretLiquid water retention capacity for organic soil [m3 m-3 ]
[in]thlminResidual soil liquid water content remaining after freezing or evaporation \([m^3 m^{-3}]\)
[in]biClapp and Hornberger empirical "b" parameter [ ]
[in]grksatSaturated hydraulic conductivity of soil layer \([m s^{-1}]\)
[in]psisatSoil moisture suction at saturation [m]
[in]thlratFractional saturation of soil behind the wetting front [ ]
[in]thfcField capacity \([m^3 m^{-3}]\)
[in]hcpsHeat capacity of soil material \([J m^{-3} K^{-1}]\)
[in]delzwOverall thickness of soil layer [m]
[in]zbotwDepth to permeable bottom of soil layer [m]
[in]xdrainDrainage index at bottom of soil profile [ ]
[in]xslopeSurface slope (used when running MESH code) [degrees]
[in]grkfacWATROF parameter used when running MESH code [ ]
[in]wfsurfWATROF parameter used when running MESH code [ ]
[in]wfcintWATROF parameter used when running MESH code [ ]
[in]delzOverall thickness of soil layer [m]
[in]isandSand content flag
[in]igdrIndex of soil layer in which bedrock is encountered

First, subroutine waterCalcPrep is called to initialize various arrays and produce parameters for the four subareas of canopy over snow (CS), snow on ground (GS), canopy over ground (C) and bare ground (G). Then, for each of the four subareas, if the number of modelled areas containing that subarea is greater than zero, a series of subroutines is called. The subroutines associated with each subarea are listed in the table below.

\[ \begin{array} { | l | l | c | } \hline \text{canopyWaterUpdate} & \text{Evaporation/sublimation of water from vegetation canopy} & \text{CS,C} \\ \hline \text{canopyInterception} & \text{Addition of rainfall/snowfall to canopy; throughfall and drip} & \text{CS,C} \\ \hline \text{canopyPhaseChange} & \text{Freezing/thawing of liquid/frozen water on canopy} & \text{CS,C} \\ \hline \text{waterUnderCanopy} & \text{Precipitaiton and condensation under canopy} & \text{CS,C} \\ \hline \text{soilWaterPhaseChg} & \text{Freezing/thawing of liquid/frozen water in soil} & \text{CS,GS,C,G} \\ \hline \text{snowSublimation} & \text{Sublimaiton from snow pack} & \text{CS,GS,C,G} \\ \hline \text{pondedWaterFreeze} & \text{Freezing of ponded water on soil} & \text{CS,GS,C,G} \\ \hline \text{snowMelt} & \text{Melting of snow pack} & \text{CS,GS} \\ \hline \text{snowAddNew} & \text{Accumulation of snow on ground} & \text{CS,GS,C,G} \\ \hline \text{snowInfiltrateRipen} & \text{Infiltration of rain into snow pack} & \text{CS,GS} \\ \hline \text{iceSheetBalance} & \text{Energy and water budget of ice sheets} & \text{GS,G} \\ \hline \text{waterFlowInfiltrate} & \text{Infiltraiton of water into soil} & \text{CS,GS,C,G} \\ \hline \text{waterFlowNonInfiltrate} & \text{Soil water movement in response to gravity and suction forces} & \text{CS,GS,C,G} \\ \hline \text{waterUpdates} & \text{Step ahead soil layer temperatures, check for freezing/thawing} & \text{CS,GS,C,G} \\ \hline \text{checkWaterBudget} & \text{Check subarea moisture balances for closure} & \text{CS,GS,C,G} \\ \hline \text{snowAging} & \text{Temporal variation of snow albedo and density} & \text{CS,GS} \\ \hline \end{array} \]

After these calls have been done, average values of the main prognostic variables over the modelled area are determined by performing weighted averages over the four subareas, and checks are carried out to identify and remove vanishingly small values. First the bedrock temperature in the third soil layer, the total runoff and the runoff temperature are calculated. Then the total runoff and the overland flow, interflow and baseflow are converted from units of m to \(kg m^{-2} s^{-1}\). The total surface water vapour flux over the modelled area is updated to account for the residual amounts of evaporative demand over the four subareas that could not be supplied by surface stores (WLSTCS, WLSTGS, WLOSTC and WLOSTG, variables that are defined internally in this subroutine), and the diagnostic variable QFLUX is evaluated.

The temperature of the vegetation canopy TCAN and the amount of intercepted liquid water RCAN are calculated as weighted averages over the two canopy subareas. A flag is set to trigger a call to abort if TCAN is less than -100 C or greater than 100 C. If RCAN is vanishingly small, it is added to the overland flow and to the total runoff, and their respective temperatures are recalculated. The diagnostic arrays ROFC, ROVG, PCPG and HTCC are updated, and RCAN is set to zero. The amount of intercepted snow SNCAN is likewise calculated as a weighted average over the two canopy subareas. If SNCAN is vanishingly small, it is added to the overland flow and to the total runoff, and their respective temperatures are recalculated. The diagnostic arrays ROFC, ROVG, PCPG and HTCC are updated, and SNCAN is set to zero. If there is no canopy present, TCAN is set to zero.

At the end of the 600 loop, the depth of ponded water ZPOND and its temperature TPOND over the modelled area are calculated as weighted averages over the four subareas. If ZPOND is vanishingly small, then as in the case of intercepted water, it is added to the overland flow and to the total runoff, and their respective temperatures are recalculated. The diagnostic array HTC is updated, ZPOND is set to zero and TPOND is set to 0 \(^o\)C.

In the 650 loop, values of the snow prognostic variables are calculated as weighted averages over the four subareas. The weightings for the subareas include the four internally-defined waterBudgetDriver variables XSNOCS, XSNOGS, XSNOWC and XSNOWG, which are set in subroutine checkWaterBudget to 1 if the subarea snow depth is greater than zero, and to zero otherwise. If the snow depth over the CS and GS subareas is greater than zero (meaning that there was a pre-existing snow cover at the beginning of the time step), the average snow albedo ALBSNO is preferentially set to the average over these two subareas. Otherwise ALBSNO is set to the average over the C and G subareas (where snow has just been added in the current time step). The snow temperature TSNOW and density RHOSNO are set to weighted averages over the four subareas, using the internally-defined subarea volumetric heat capacities HCPSCS/GS/C/G and RHOSCS/GS/C/G. Finally the snow depth ZSNOW is calculated from the subarea depths; the liquid water content of the snow pack WSNOW is obtained as a weighted average over the CS and GS subareas (assuming that freshly fallen snow does not yet contain liquid water); and the snow mass is determined from ZSNOW and RHOSNO. Upper and lower limits apply to the snow pack. If the snow depth exceeds 10 m, the excess snow and its associated liquid water content are added to the overland flow and the total runoff, the respective temperatures of the latter are recalculated and the diagnostic arrays ROFN, PCPG and HTCS are updated. As in the case of intercepted and ponded water, if the snow mass is vanishingly small it and its liquid water content are added to the overland flow and to the total runoff, and their respective temperatures are recalculated, the diagnostic arrays ROFN, PCPG and HTCS are updated, and TSNOW, RHOSNO, SNO and WSNOW are set to zero. Flags are set to trigger calls to abort if TSNOW is less than 0 K or greater than 0.001 C. Finally, the three abort flags set thus far are checked, and calls to abort are performed if they are greater than zero.

In the 700 loop, the temperature of each soil layer is calculated as a weighted average over the four subareas. In the case of the third soil layer., if the standard three-layer configuration is being modelled (with a very thick third soil layer of 3.75 m), the subarea layer temperatures TBARCS/GS/C/G and the layer heat capacities HCPCS/GS/C/G apply to the permeable depth DELZW of the layer, and the bedrock temperature TBASE and the rock heat capacity HCPSND to the remainder, DELZ-DELZW. The averaging is carried out accordingly. In all other soil layers, the layer temperature applies to the whole thickness, whose heat capacity is a weighted average of HCPCS/GS/C/G over DELZW and HCPSND over DELZ-DELZW. The volumetric liquid water content THLIQ, the volumetric frozen water content THICE, and the heat flux at the soil layer interfaces GFLUX are calculated as simple weighted averages over the subareas. A flag is set to trigger a call to abort if the soil layer temperature is less than -100 C or greater than 100 C, and after the end of the loop, a call to abort is performed if the flag is greater than zero.

Finally, subroutine classGrowthIndex is called to update the vegetation growth index.