Hello, a question about the water branch of surfaceTemperature_calc in ground_surface.py. The scheme itself is a welcome addition, the water slab model in particular.
The function begins with:
# Store the past ground surface temperature
Tg_stored = Tg
This is an alias rather than a copy, and Tg is updated in place further down (Tg += (k1 + k2) / 2 * timestep), so by the time the water branch runs:
Tg[lc_grid == 7] = Tg_stored[lc_grid == 7] + deltaTg[lc_grid == 7]
Tg_stored already holds the RK2-updated temperature. The comment suggests the intent was to base the water update on the previous timestep's temperature. As written, water pixels receive the full force-restore/OHM step plus the slab increment, and the increment itself (Rn_water, the evaporation term, and the relaxation toward Tm) is evaluated at the updated temperature rather than the stored one. If unintended, Tg_stored = Tg.copy() restores the commented behaviour.
Two smaller observations in the same file, mentioned here to keep the noise down:
- The docstring describes
timestep as being in minutes, but the force-restore constant (2π/86400 s⁻¹) and the caller both use seconds. Probably just a docstring fix.
initiate_groundScheme leaves the water deep temperature at the land-cover code itself (Tm[lc == 7] = 7.0), so water relaxes toward 7 °C regardless of season or latitude, while the other classes get seasonal sinusoids. If that is a deliberate cold-bath approximation a comment would help; if not, it may be an unfinished branch.
Are these behaviours intended? Happy to submit PRs if useful.
Hello, a question about the water branch of
surfaceTemperature_calcinground_surface.py. The scheme itself is a welcome addition, the water slab model in particular.The function begins with:
This is an alias rather than a copy, and
Tgis updated in place further down (Tg += (k1 + k2) / 2 * timestep), so by the time the water branch runs:Tg_storedalready holds the RK2-updated temperature. The comment suggests the intent was to base the water update on the previous timestep's temperature. As written, water pixels receive the full force-restore/OHM step plus the slab increment, and the increment itself (Rn_water, the evaporation term, and the relaxation towardTm) is evaluated at the updated temperature rather than the stored one. If unintended,Tg_stored = Tg.copy()restores the commented behaviour.Two smaller observations in the same file, mentioned here to keep the noise down:
timestepas being in minutes, but the force-restore constant (2π/86400 s⁻¹) and the caller both use seconds. Probably just a docstring fix.initiate_groundSchemeleaves the water deep temperature at the land-cover code itself (Tm[lc == 7] = 7.0), so water relaxes toward 7 °C regardless of season or latitude, while the other classes get seasonal sinusoids. If that is a deliberate cold-bath approximation a comment would help; if not, it may be an unfinished branch.Are these behaviours intended? Happy to submit PRs if useful.