DassHydro / smash

An open source, Python library interfacing the Fortran Spatially distributed Modelling and ASsimilation for Hydrology platform.
https://smash.recover.inrae.fr/
GNU General Public License v3.0
12 stars 6 forks source link

Handle no data value when computing GR interception reservoir capacity #163

Closed inoelloc closed 5 months ago

inoelloc commented 5 months ago

Currently, when precipitation and potential evapotranspiration are aggregated to a daily time step, missing data (i.e. -99 in Fortran) are not taken into account and are used in the aggregation. Therefore, we need to aggregate only the available prcp and pet and assuming zero for the no data.

Previous code:

daily_prcp(:, :, ind) = daily_prcp(:, :, ind) + mat_prcp
daily_pet(:, :, ind) = daily_pet(:, :, ind) + mat_pet

Updated code:

where (mat_prcp .ge. 0._sp) daily_prcp(:, :, ind) = daily_prcp(:, :, ind) + mat_prcp
where (mat_pet .ge. 0._sp) daily_pet(:, :, ind) = daily_pet(:, :, ind) + mat_pet