diff --git a/docs/configuration.rst b/docs/configuration.rst index 83192bb..ccd46b2 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -239,9 +239,9 @@ to the default after issuing a warning): - ``C`` (default) - ``K`` * vapor_pressure - - ``kPa`` (default) + - ``Pa`` (default) - ``hPa`` - - ``Pa`` + - ``KPa`` * air_pressure - ``kPa`` (default) - ``hPa`` diff --git a/docs/data.rst b/docs/data.rst index c8e7045..8563fa0 100644 --- a/docs/data.rst +++ b/docs/data.rst @@ -89,7 +89,7 @@ step: * ``t_min`` : Minimum temperature (also a required input value) (C) * ``t_max`` : Maximum temperature (also a required input value) (C) * ``prec`` : Precipitation (also a required input value) (mm/day) -* ``vapor_pressure`` : Vapor pressure (kPa) +* ``vapor_pressure`` : Vapor pressure (Pa) * ``shortwave`` : Shortwave radiation (W/m^2) * ``tskc`` : Cloud cover fraction * ``pet`` : Potential evapotranpiration (mm/day) @@ -125,7 +125,7 @@ The following variables (and name conventions) are allowed to be specified for s * ``temp`` : Temperature (C) * ``prec`` : Precipitation (mm/timestep) * ``shortwave`` : Shortwave radiation (W/m^2) -* ``vapor_pressure`` : Vapor pressure (kPa) +* ``vapor_pressure`` : Vapor pressure (Pa) * ``air_pressure`` : Air pressure (kPa) * ``rel_humid`` : Relative humidity * ``spec_humid`` : Specific humidity diff --git a/docs/whats-new.rst b/docs/whats-new.rst index b2f78c4..b21c720 100644 --- a/docs/whats-new.rst +++ b/docs/whats-new.rst @@ -5,6 +5,14 @@ What's New .. _whats-new.2.3.0: +v2.3.1 +------ + +Bug fixes +~~~~~~~~~ +- Fixed an error in unit conversions for vapor pressure +- Fixed documentation on vapor pressure units + v2.3.0 ------ Enchancements diff --git a/metsim/disaggregate.py b/metsim/disaggregate.py index 85bef72..e094a71 100644 --- a/metsim/disaggregate.py +++ b/metsim/disaggregate.py @@ -469,9 +469,9 @@ def specific_humidity(vapor_pressure: np.array, Parameters ---------- vapor_pressure: - A sub-daily timeseries of vapor pressure (kPa) + A sub-daily timeseries of vapor pressure (Pa) air_pressure: - A sub-daily timeseries of air pressure (kPa) + A sub-daily timeseries of air pressure (Pa) Returns ------- diff --git a/metsim/metsim.py b/metsim/metsim.py index e76518b..c8013aa 100644 --- a/metsim/metsim.py +++ b/metsim/metsim.py @@ -92,7 +92,7 @@ 'temp': {'units': 'C', 'long_name': 'air temperature', 'standard_name': 'air_temperature', 'missing_value': np.nan, 'fill_value': np.nan}, - 'vapor_pressure': {'units': 'kPa', 'long_name': 'vapor pressure', + 'vapor_pressure': {'units': 'Pa', 'long_name': 'vapor pressure', 'standard_name': 'vapor_pressure', 'missing_value': np.nan, 'fill_value': np.nan}, 'air_pressure': {'units': 'kPa', 'long_name': 'air pressure', diff --git a/metsim/units.py b/metsim/units.py index 8f985f9..d182ce9 100644 --- a/metsim/units.py +++ b/metsim/units.py @@ -30,9 +30,9 @@ 'K': lambda x, ts: x + 273.15, }, 'vapor_pressure': { - 'kPa': lambda x, ts: x, - 'hPa': lambda x, ts: x * 100., - 'Pa': lambda x, ts: x * 1000., + 'Pa': lambda x, ts: x, + 'hPa': lambda x, ts: x / 100., + 'kPa': lambda x, ts: x / 1000., }, 'air_pressure': { 'kPa': lambda x, ts: x,