Skip to content

Commit

Permalink
'tas' is in kelvin for lumped makking forcing, convert to deg c
Browse files Browse the repository at this point in the history
  • Loading branch information
Daafip committed Apr 8, 2024
1 parent c36ba60 commit 9af5cfc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ewatercycle_HBV/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ def _make_cfg_file(self, **kwargs) -> Path:
ds = xr.open_dataset(self.forcing.directory / self.forcing.filenames['tas'])
attributes = ds['tas'].attrs
ds['tasmean'] = ds['tas']
if ds['tasmean'].mean().values > 200: # adjust for kelvin units
ds['tasmean'] -= 273.15
ds['tasmean'].attrs = attributes
ds.to_netcdf(temporary_tasmean_file)
ds.close()
Expand Down

0 comments on commit 9af5cfc

Please sign in to comment.