Skip to content

get_recharge: support model time axes extending past the last KNMI observation (forecast fill) #580

Description

@bdestombe

This is an open-ended feature request from my side. I thought it would be useful to think of how to project future-climate and future-weather scenarios on a groundwater model. The text below is auto-generated, but the request seems reasonable.


nlmod.read.knmi.get_recharge derives its download window from the model time axis and fails on stress periods beyond the last KNMI observation (read/knmi.py:448-449); injecting a hindcast-only oc_knmi also fails, because trailing NaNs from the forecast periods survive the bfill in _resample_df_to_model_time and hit the raise at read/knmi.py:318-319. So any model whose time axis extends past "now" — scenario runs to 2030/2100 are routine in NHFLO (09pwnmodel2, 10vlotter, 16dwat) — cannot use KNMI recharge at all, even for its hindcast portion.

Proposal: an explicit forecast-fill option so the observation layer stays the single mechanism, e.g.

nlmod.read.knmi.get_recharge(ds, forecast_fill="doy_climatology")   # or a float, or "tile"

— download through the last available observation, extend the series over the forecast horizon by day-of-year climatology (or a constant), then let discretize_knmi own model-time assembly as today. Alternatively (smaller): make discretize_knmi accept a series that ends before the model end instead of unconditionally raising, so callers can pad the oc_knmi they inject.

Context: NHFLO/models#113, where this is currently worked around script-side; none of the existing recharge issues cover the forecast horizon. Happy to contribute the PR if a direction is agreed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions