Closed har917 closed 3 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.
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.
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. All other variables (except screen level humidity) are unaffected.
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 evaluatescanopy%tscrn = ssnow%tss + (met%tk - ssnow%tss) * 1.0 - Ctfrz = met%tk - Ctfrz
.In effect line 754 should be
CABLE_screen_level_pt1.pdf - but note that the example code at the end includes the bug to be fixed