Runtime bounds check in CABLE

We want to check if variables in CABLE are within a given range during runtime.
Some of this capability is already in place but there is nothing for a systematic check at every timestep.

@abhaasgoyal has started looking into this. The idea currently is to implement an option in the namelist to turn on these checks. The option would have 3 possible values:

  • off: no checks done. Useful for production runs
  • on-warn: checks are done and a warning is written to file if some variables are found that are outside their prescribed range.
  • on-fail: checks are done and the code exits with an error if any variable is found that is outside its prescribed range.

We could also add an option to specify how often we want to run the bounds check in the number of timesteps.

To put in place these sanity checks, we need to review the bounds that are already in CABLE. Below is a list of what is currently in CABLE (in offline/cable_checks.F90). I realise this list is using the CABLE’s variable names so it might be hard to know what all of these are. I will try and add more information in the coming days. If you have a question on the meaning of some specific variable names, please ask in a reply.

      nav_lon = (/-360.0,360.0/),         &
      nav_lat = (/-90.0,90.0/),           &
                            ! possible forcing variables for CABLE
      SWdown = (/0.0,1360.0/),            & ! W/m^2
      LWdown = (/0.0,950.0/),             & ! W/m^2
      Rainf = (/0.0,0.1/),               & ! mm/s
      Snowf = (/0.0,0.1/),             & ! mm/s
      PSurf = (/500.0,1100.0/),           & ! mbar/hPa
      Tair = (/200.0,333.0/),             & ! K
      Qair = (/0.0,0.1/),                & ! g/g
      Tscrn = (/-70.0,70.0/),             & ! oC - INH
      Qscrn = (/0.0,0.1/),                & ! kg/kg
      CO2air = (/160.0,2000.0/),          & ! ppmv
      Wind = (/0.0,75.0/),                & ! m/s
      Wind_N = (/-75.0,75.0/),            & ! m/s
      Wind_E = (/-75.0,75.0/),            & ! m/s
                            ! possible output variables
      Qmom = (/-10.0,8000.0/),            & ! kg/m/s2 - (INH generous range)
      Qh = (/-2000.0,2000.0/),            & ! W/m^2
      Qle = (/-2500.0,2500.0/),           & ! W/m^2
      Qg = (/-4000.0,4000.0/),            & ! W/m^2
      SWnet = (/0.0,1350.0/),             & ! W/m^2 (YP oct07)
                            ! SWnet = (/0.0,1250.0/),            & ! W/m^2
      LWnet = (/-500.0,510.0/),           & ! W/m^2
      Rnet = (/-500.0,1250.0/),           & ! W/m^2
      Evap = (/-0.0045,0.0045/),         &  ! note this is also used for snow melt !
      Ewater = (/-0.0005,0.0005/),        &
      ESoil = (/-0.0015,0.0015/),         &
      TVeg = (/-0.0003,0.0003/),          &
      ECanop = (/-0.0003,0.0003/),        &
      PotEvap = (/-0.0006,0.0006/),       &
      ACond = (/0.0,1.0/),                &
      SoilWet = (/-0.4,1.2/),             &
      Albedo = (/0.0,1.0/),               &
      visAlbedo = (/0.0,1.0/),            & ! vars intro for Ticket #27
      nirAlbedo = (/0.0,1.0/),            & ! vars intro for Ticket #27
      VegT = (/213.0,353.0/),             &
      SoilTemp = (/213.0,353.0/),         &
      SoilMoist = (/0.0,2000.0/),         &
      Qs = (/0.0,15.0/),                   &
      Qsb = (/0.0,15.0/),                  &
      DelSoilMoist  = (/-2000.0,2000.0/), &
      DelSWE  = (/-2000.0,2000.0/),       &
      DelIntercept = (/-100.0,100.0/),    &
      SnowT  = (/213.0,280.0/),           &
      BaresoilT = (/213.0,343.0/),        &
      AvgSurfT = (/213.0,333.0/),         &
      RadT = (/200.0,373.0/),             &
                            ! vh_js !
      SWE = (/0.0,4000.0/),               &
      RootMoist = (/0.0,2000.0/),         &
      CanopInt = (/0.0,100.0/),           &
      NEE = (/-70.0,50.0/),               & ! umol/m2/s
      NPP = (/-20.0,75.0/),               & ! umol/m2/s
      GPP = (/-20.0,100.0/),              & ! umol/m2/s
      PAR = (/-1000.0,5000.0/),              & ! umol/m2/s
      AutoResp = (/-50.0,20.0/),          & ! umol/m2/s
      LeafResp = (/-50.0,20.0/),          & ! umol/m2/s
      HeteroResp = (/-50.0,20.0/),        & ! umol/m2/s
      HSoil = (/-1000.0,1000.0/),         &
      HVeg = (/-1000.0,1000.0/),          &
      SnowDepth = (/0.0,50.0/),           & ! EK nov07
      Wbal = (/-999999.0,999999.0/),      &
      Ebal = (/-999999.0,999999.0/),      &
                            ! vh_js !
      CanT = (/213.0,333.0/),      &
      Fwsoil = (/0.0,1.0/),      &
                            ! parameters:
      albsoil = (/0.0,0.9/),              &
      isoil = (/1.0,30.0/),               &
      iveg = (/1.0,30.0/),                &
      bch = (/2.0,15.0/),                 &
      latitude = (/-90.0,90.0/),          &
      c3 = (/0.0,1.0/),                   & ! EK nov07
      clay = (/0.0,1.0/),                 &
      css = (/700.0,2200.0/),             &
      rhosoil = (/300.0,3000.0/),         &
      hyds = (/5.0E-7,8.5E-3/),           & ! vh_js ! sep14
      rs20 = (/0.0,10.0/),                &
      sand = (/0.0,1.0/),                 &
      sfc = (/0.1,0.5/),                  &
      silt = (/0.0,1.0/),                 &
      ssat = (/0.35,0.5/),                &
      sucs = (/-0.8,-0.03/),              &
      swilt = (/0.05,0.4/),               &
      froot = (/0.0,1.0/),                &
      zse = (/0.0,5.0/),                  &
      canst1 = (/0.05,0.15/),             &
      dleaf = (/0.005,0.4/),              &
      ejmax = (/1.0E-5,3.0E-4/),          &
      frac4 = (/0.0,1.0/),                &
      hc = (/0.0,100.0/),                 &
      lai = (/0.0,8.0/),                  &
      rp20 = (/0.0,10.0/),                &
      vbeta =(/-999999.0,999999.0/),      &
      g0 = (/-0.5,0.5/),                  & ! Ticket #56 (must find better range)
      g1 = (/0.0,20.0/),                  & ! Ticket #56 (must find better range)
      xalbnir = (/0.0,1.5/),              &
      meth = (/0.0,1.0/),                 &
      za =(/0.0,150.0/),                  &
      rpcoef = (/0.05,1.5/),              &
      shelrb = (/1.0,3.0/),               &
      vcmax = (/5.0E-6,1.5E-4/),          &
      xfang = (/-1.0,0.5/),               &
      ratecp = (/0.01,3.0/),              &
      ratecs = (/0.01,3.0/),              &
      refsbare = (/0.0,0.5/),             &
      taul = (/0.0,0.3/),                 &
      refl = (/0.0,0.5/),                 &
      tauw = (/0.0,0.1/),                 &
      refw = (/0.0,0.5/),                 &
      extkn = (/0.0,10.0/),               & ! YP oct07
      wai = (/0.0,5.0/),                  & ! YP oct07
      vegcf = (/0.0,100.0/),              & ! YP oct07
      tminvj = (/-20.0,15.0/),            &
      tmaxvj = (/-15.0,30.0/),            &
      rootbeta = (/0.7,1.0/),             & ! YP oct07
      veg_class = (/1.0,20.0/),           &
      soil_class = (/1.0,20.0/)  , &
      TotLivBiomass =  (/0.0, 1000./),      &
      TotSoilCarb =  (/0.0, 1000./),      &
      TotLittCarb =  (/0.0, 1000./), &
      Area = (/0.0, 5000./),&
                            !MD
      WatTable = (/0.0,1.0e10/),          &
      GWwb = (/0.0,1.0/),              &
      SatFrac = (/0.0,1.0/),              &
      Qrecharge = (/-9999.0,9999.0/)

Here are the questions we have:

Do we want to check all of these variables? Some of these are constant within a run and thus are cheap to check (done only once before the timestepping).
Are the given ranges correct and useful? Would you prefer a different range for some variables
Are there missing variables you would like to add? What range would you like to use for these variables?

Hi Claire,
When I originally wrote the driver and those variable bounds I had a namelist switch that meant ranges were checked at every time step, or at least each time output is written… I assume that’s been turned off or disappeared?
Gab

When looking at the code with Abhaas we couldn’t see any evidence this was still available at every timestep. I think there are still some checks happening at output time and on the met forcing, but I haven’t looked at the fine details there yet.

Actually, I think the namelist option is still in there. So we have a bit more digging around to see exactly what is still done.