Skip to content

Commit 26d76c1

Browse files
authored
Merge pull request #233 from arbennett/bugfix/vp_units
Bugfix/vp units
2 parents b9ed455 + 7148364 commit 26d76c1

File tree

6 files changed

+18
-10
lines changed

6 files changed

+18
-10
lines changed

docs/configuration.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@ to the default after issuing a warning):
239239
- ``C`` (default)
240240
- ``K``
241241
* vapor_pressure
242-
- ``kPa`` (default)
242+
- ``Pa`` (default)
243243
- ``hPa``
244-
- ``Pa``
244+
- ``KPa``
245245
* air_pressure
246246
- ``kPa`` (default)
247247
- ``hPa``

docs/data.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ step:
8989
* ``t_min`` : Minimum temperature (also a required input value) (C)
9090
* ``t_max`` : Maximum temperature (also a required input value) (C)
9191
* ``prec`` : Precipitation (also a required input value) (mm/day)
92-
* ``vapor_pressure`` : Vapor pressure (kPa)
92+
* ``vapor_pressure`` : Vapor pressure (Pa)
9393
* ``shortwave`` : Shortwave radiation (W/m^2)
9494
* ``tskc`` : Cloud cover fraction
9595
* ``pet`` : Potential evapotranpiration (mm/day)
@@ -125,7 +125,7 @@ The following variables (and name conventions) are allowed to be specified for s
125125
* ``temp`` : Temperature (C)
126126
* ``prec`` : Precipitation (mm/timestep)
127127
* ``shortwave`` : Shortwave radiation (W/m^2)
128-
* ``vapor_pressure`` : Vapor pressure (kPa)
128+
* ``vapor_pressure`` : Vapor pressure (Pa)
129129
* ``air_pressure`` : Air pressure (kPa)
130130
* ``rel_humid`` : Relative humidity
131131
* ``spec_humid`` : Specific humidity

docs/whats-new.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ What's New
55

66
.. _whats-new.2.3.0:
77

8+
v2.3.1
9+
------
10+
11+
Bug fixes
12+
~~~~~~~~~
13+
- Fixed an error in unit conversions for vapor pressure
14+
- Fixed documentation on vapor pressure units
15+
816
v2.3.0
917
------
1018
Enchancements

metsim/disaggregate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,9 @@ def specific_humidity(vapor_pressure: np.array,
469469
Parameters
470470
----------
471471
vapor_pressure:
472-
A sub-daily timeseries of vapor pressure (kPa)
472+
A sub-daily timeseries of vapor pressure (Pa)
473473
air_pressure:
474-
A sub-daily timeseries of air pressure (kPa)
474+
A sub-daily timeseries of air pressure (Pa)
475475
476476
Returns
477477
-------

metsim/metsim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
'temp': {'units': 'C', 'long_name': 'air temperature',
9393
'standard_name': 'air_temperature',
9494
'missing_value': np.nan, 'fill_value': np.nan},
95-
'vapor_pressure': {'units': 'kPa', 'long_name': 'vapor pressure',
95+
'vapor_pressure': {'units': 'Pa', 'long_name': 'vapor pressure',
9696
'standard_name': 'vapor_pressure',
9797
'missing_value': np.nan, 'fill_value': np.nan},
9898
'air_pressure': {'units': 'kPa', 'long_name': 'air pressure',

metsim/units.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
'K': lambda x, ts: x + 273.15,
3131
},
3232
'vapor_pressure': {
33-
'kPa': lambda x, ts: x,
34-
'hPa': lambda x, ts: x * 100.,
35-
'Pa': lambda x, ts: x * 1000.,
33+
'Pa': lambda x, ts: x,
34+
'hPa': lambda x, ts: x / 100.,
35+
'kPa': lambda x, ts: x / 1000.,
3636
},
3737
'air_pressure': {
3838
'kPa': lambda x, ts: x,

0 commit comments

Comments
 (0)