CABLE-LSM / CABLE

Home to the CABLE land surface model and its documentation
https://cable.readthedocs.io/en/latest/
Other
12 stars 6 forks source link

bug in screen level temperature calculation #313

Closed har917 closed 3 months ago

har917 commented 5 months ago

Analyses of some offline-as-ACCESS runs as part of the development of ESM1.6 has highlighted a potential bug in the evaluation of the screen level temperature - under some circumstances the evaluation is hitting one of the imposed limits and 'always' reverts to the same value as the forcing air temperature.

A review of past work produces svn ticket 154 and the attached documentation - inspection of the two reveals that equation 2 in the note (which corresponds to lines 752-755 in define_canopy) has been coded incorrectly. Working variable r_sc becomes relatively large and line 788 then evaluates canopy%tscrn = ssnow%tss + (met%tk - ssnow%tss) * 1.0 - Ctfrz = met%tk - Ctfrz.

In effect line 754 should be

r_sc(j) = r_sc(j) + term5(j) * LOG(rough%disp(j)/zscl(j)) *  &
                  ( EXP(2*CCSW*canopy%rghlai(j)) - term1(j) ) / term3(j)

CABLE_screen_level_pt1.pdf - but note that the example code at the end includes the bug to be fixed

har917 commented 5 months ago

More generally - as part of the refaactoring of the CABLE code base #248 and #254 - we should work to consolidate these related bits of code into some kind of coherent whole.

har917 commented 5 months ago

Quick note: initial tests have highlighted an interesting quirk of the screen level calculations .... because the screen level temperature is evaluated at the end of define_canopy (but prior to call to soil_snow_main) the value obtained depends on the current meteorology, current leaf temperature, current air temperature but previous time step soil/snow temperature.

This is a bit odd!

To address this we would have to extract the calculations into a separate subroutine and call in the appropriate place - defer for now.

har917 commented 5 months ago

I haven't found a case that directly replicates the results in ESM - however we can test the new code by requiring that the updated screen temperature sits closer to the soil temperature than previously.

With the modification suggested - the revised code leads to a solution space where the screen level temperature is (on average) 29% of the way between the soil and reference air temperatures (previously this was 22%. Time series indicate no concerns around timing/dependence on meteorological conditions. Tumba_scn All other variables (except screen level humidity) are unaffected.