Skip to content

ground_surface: is the water branch meant to start from the RK2-updated Tg (Tg_stored alias)? #138

Description

@songololo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions