ArcticSnow / TopoPyScale

TopoPyScale: a Python library to perform simplistic climate downscaling at the hillslope scale
https://topopyscale.readthedocs.io
MIT License
40 stars 9 forks source link

Precipitation totals wrong at timesteps higher than 1h #41

Closed joelfiddes closed 9 months ago

joelfiddes commented 2 years ago

precip in era5 is still hourly sums (m) even at timesteps more than 1h - we are just simply missing precip budget. eg 6h data could be:

0, 0, 0.002, 0.002 (m)

this doesnt mean daily sum of 0.004m but more likely 0.004*4 = 0.016m

here is the bug in topo_scale.py:

down_pt['tp'] = surf_interp.tp 1 / tstep_dict.get(tstep) 10**3 # Convert to mm/hr

do not divide by timestep.

Furthermore, a rough way to get the budget right is to multiply by timestep.

Current code produces precip budgets around 9 times too low for a 3h timestep - twice an error of factor three.

ArcticSnow commented 2 years ago

This was hardcoded to run only at 1h in the current implementation. I had dropped support for 3 and 6H input data.

ArcticSnow commented 9 months ago

Let's open an issue about adding support for other timestep resolution

ArcticSnow commented 9 months ago

See issue #104