Package {HeatStressR}


Type: Package
Title: Calculate Heat Stress Indices
Version: 3.1.1
Date: 2026-12-01
Description: Calculates heat-stress indices from meteorological observations using shared psychrometric calculations and consistent method-specific input handling. Methods include the physically based outdoor wet-bulb globe temperature model described by Liljegren et al. (2008) <doi:10.1080/15459620802310770>, wet-bulb temperature and heat-index calculations, and established closed-form heat-stress indices. Provides row-level diagnostics, configurable physical controls, vectorized batch processing, and optional parallel execution for the Liljegren method. It is an independently maintained fork of 'HeatStress'; its Liljegren implementation is not a bitwise-compatible port of the original program.
License: MIT + file LICENSE
URL: https://github.com/zyf0717/HeatStressR
BugReports: https://github.com/zyf0717/HeatStressR/issues
Depends: R (≥ 4.1.0)
Suggests: pkgload, testthat (≥ 3.2.0)
Config/testthat/edition: 3
Imports: stats, utils, parallel, heatindex (≥ 0.0.2)
Encoding: UTF-8
Config/roxygen2/version: 8.1.0
Config/roxygen2/markdown: true
Config/build/clean-inst-doc: false
NeedsCompilation: no
Packaged: 2026-12-01 08:44:40 UTC; yifei
Author: Yifei Zheng ORCID iD [aut, cre] (Creator and maintainer of this fork), Ana Casanueva [ctb] (Original HeatStress package author and R implementation)
Maintainer: Yifei Zheng <zyf0717@gmail.com>
Repository: CRAN
Date/Publication: 2026-12-01 09:20:02 UTC

Meteorological heat-stress metrics

Description

Canonical single-index functions, registry-driven multi-index calculations, aligned input validation and optional diagnostics. The package includes the vectorized R Liljegren WBGT model and delegates Romps thermodynamic wet bulb and the 2026 Lu Heat Index to the authors' heatindex package.

Details

Available methods:

wet_bulb_stull

Stull wet-bulb approximation; inputs: tas, hurs; units: degC.

wet_bulb_romps

Romps thermodynamic liquid-water wet bulb; inputs: tas, hurs, pressure; units: degC.

wbgt_simplified_abm

ABM simplified WBGT; inputs: tas, hurs; units: degC.

wbgt_simplified_indoor

Indoor simplified WBGT; inputs: tas, hurs; units: degC.

apparent_temperature

Apparent temperature; inputs: tas, hurs, wind_10m; units: degC.

effective_temperature

Effective temperature; inputs: tas, hurs, wind_10m; units: degC.

humidex

Humidex (Celsius-equivalent scale); inputs: tas, hurs; units: degC.

discomfort_index

Discomfort index; inputs: tas, hurs; units: degC.

heat_index_rothfusz

NWS Rothfusz Heat Index; inputs: tas, hurs; units: degC.

heat_index_lu

Lu et al. (2026) simplified Heat Index; inputs: tas, hurs; units: degC.

wbgt_bernard

Bernard indoor/shade WBGT; inputs: tas, dewp; units: degC.

wbgt_liljegren

Liljegren outdoor WBGT; inputs: tas, dewp, wind_2m, radiation, time, lon, lat, pressure; units: degC.

Temperatures use Celsius, pressure hPa, humidity percent, wind m/s, and radiation W/m2. Consult heat_methods() for phase conventions, wind measurement height, applicability and scientific references. Missing inputs propagate silently; invalid rows become NA with summarized warnings. Scalar observations expand to the common input length.

wbgt_liljegren() evaluates instantaneous states, using batch roots, scalar fallback and optional PSOCK workers. Its independently maintained R model is not a bitwise port of the original Liljegren program. Validated component temperatures are retained when another component fails.

HeatStressR is an MIT-licensed fork of HeatStress. Ana Casanueva authored the original package and R translation; Yifei Zheng maintains this fork. Historical contributions and attribution are retained. The fork is not affiliated with the original project or its authors. The MIT license follows the upstream license change.

Deprecated 2.x adapters preserve signatures and return shapes while applying documented scientific corrections. Removal is planned no earlier than v4.0.0. See HeatStressR-deprecated and the installed migration guide. Package attachment performs no network access. Use citation("HeatStressR") for the package citation. Please also cite the original methodological reference for each heat-stress method used; see the corresponding function documentation.

See Also

heat_methods(), heat_indices(), wbgt_liljegren()


Deprecated HeatStressR 2.x endpoints

Description

Compatibility adapters preserve names, positional arguments and return shapes. Scientific corrections and invalid-row handling follow the canonical APIs. Each endpoint warns once per session and will be removed no earlier than v4.0.0. New code should use the replacements in heat_methods().

Usage

apparentTemp(tas, hurs, wind)

effectiveTemp(tas, hurs, wind)

discomInd(tas, hurs)

hi(tas, hurs)

swbgt(tas, hurs)

wbt.Stull(tas, hurs)

dewp2hurs(tas, dewp)

tashurs2vap.pres(tas, hurs)

wbgt.Bernard(tas, dewp, tolerance = 1e-04, noNAs = TRUE, swap = FALSE)

wbgt.Liljegren(
  tas,
  dewp,
  wind,
  radiation,
  dates,
  lon,
  lat,
  tolerance = 1e-04,
  noNAs = TRUE,
  swap = FALSE,
  hour = FALSE,
  engine = c("batch", "scalar"),
  diagnostics = FALSE,
  root_tolerance = NULL,
  residual_tolerance = NULL,
  dewpoint_tolerance = NULL,
  pressure = 1010,
  surface_albedo = 0.45,
  globe_diameter = 0.0508,
  min_wind_speed = 0.13,
  workers = 1L,
  solar_time = "timestamp",
  direct_fraction = 0.8
)

calZenith(dates, lon, lat, hour = FALSE, solar_time = "timestamp")

fTg(
  tas,
  relh,
  Pair,
  wind,
  min.speed,
  radiation,
  propDirect,
  zenith,
  SurfAlbedo = 0.45,
  tolerance = 1e-04,
  globe_diameter = 0.0508
)

fTnwb(
  tas,
  dewp,
  relh,
  Pair,
  wind,
  min.speed,
  radiation,
  propDirect,
  zenith,
  irad = 1,
  SurfAlbedo = 0.45,
  tolerance = 1e-04
)

indexShow()

Arguments

tas, dewp, hurs

Air/dew-point temperature in C and RH in percent.

wind

Wind in m/s: 10 m for apparent/effective temperature, 2 m for WBGT.

tolerance

Legacy tolerance mapped to numerical controls.

noNAs, swap

Legacy dew-point cap/reject/swap selection. Swapping is confined to these adapters. Small supersaturated differences are capped consistently rather than retained within a tolerance.

radiation

Solar shortwave radiation in W/m2.

dates

Legacy timestamps or date strings. Unzoned strings use UTC.

lon, lat

Coordinates in degrees east/north.

hour, solar_time

Legacy timestamp/date-noon selection.

engine

Legacy batch or scalar reference selection.

diagnostics

Return legacy solver diagnostics where supported.

root_tolerance, residual_tolerance

Independent numerical tolerances.

dewpoint_tolerance

Deprecated validation tolerance; accepted and validated, while canonical dew-point policy is applied exactly.

pressure

Atmospheric pressure in hPa.

surface_albedo, globe_diameter, min_wind_speed

Legacy physical controls.

workers

Number of PSOCK workers.

direct_fraction

Direct share of shortwave radiation.

relh

Relative humidity in percent for scalar component solvers.

Pair

Pressure in hPa for scalar component solvers.

min.speed

Minimum wind speed in m/s for scalar solvers.

propDirect

Direct shortwave fraction for scalar solvers.

zenith

Solar zenith in radians for scalar solvers.

SurfAlbedo

Surface albedo for scalar solvers.

irad

Include radiation (1) or omit it (0) in the scalar wet-bulb solver.

Details

swbgt maps to wbgt_simplified_indoor(), not the ABM formula. hi maps to corrected NWS Heat Index in Celsius. fTg/fTnwb remain scalar reference adapters; use the components from wbgt_liljegren() in new code.

Value

Simple indices and conversions return numeric vectors. Liljegren returns list(data, Tnwb, Tg), with diagnostics when requested. Bernard returns list(Tpwb, data). indexShow returns the legacy-shaped catalog.

Author(s)

Original package: Ana Casanueva, with contributions attributed in inherited source. Current fork: Yifei Zheng.


Convert degree angle to radians.

Description

Convert degree angle to radians.

Usage

degToRad(angleDeg)

Arguments

angleDeg

angle in degree.

Value

Angle in radians.

Author(s)

Ana Casanueva (10.01.2017).


Compute the diffusivity of water vapor in air.

Description

Compute the diffusivity of water vapor in air.

Usage

diffusivity(Tk, Pair)

Arguments

Tk

value of air temperature in Kelvin.

Pair

value of air pressure in hPa.

Details

Reference: BSL, page 505.

Value

Diffusivity of water vapor in air, m2/s.

Author(s)

Ana Casanueva (05.01.2017).


Calculate the atmospheric emissivity.

Description

Calculate the atmospheric emissivity.

Usage

emis_atm(Tk, RH)

Arguments

Tk

value of air temperature in Kelvin.

RH

value of relative humidity in fraction.

Details

Reference: Oke (2nd edition), page 373.

Value

atmospheric emissivity.

Author(s)

Ana Casanueva (05.01.2017).


Calculate the convective heat transfer coefficient for a long cylinder in cross flow.

Description

Calculate the convective heat transfer coefficient for a long cylinder in cross flow.

Usage

h_cylinder_in_air(Tk, Pair, speed, min.speed, diam.wick)

Arguments

Tk

value of air temperature in Kelvin.

Pair

value of air pressure in hPa.

speed

value of wind speed in m/s.

min.speed

value of minimum wind speed in m/s.

diam.wick

diameter of the cylinder in m.

Details

Reference: Bedingfield and Drew, eqn 32.

Value

Convective heat transfer coefficient for a long cylinder, W/(m2 K).

Author(s)

Ana Casanueva (05.01.2017).


Calculate the heat of evaporation, J/(kg K).

Description

Calculate the heat of evaporation, J/(kg K), for temperature in the range 283-313 K.

Usage

h_evap(Tk)

Arguments

Tk

value of air temperature in Kelvin.

Details

Reference: Van Wylen and Sonntag, Table A.1.1

Value

Heat of evaporation, J/(kg K).

Author(s)

Ana Casanueva (05.01.2017).


Calculate the convective heat transfer coefficient for flow around a sphere.

Description

Calculate the convective heat transfer coefficient for flow around a sphere.

Usage

h_sphere_in_air(Tk, Pair, speed, min.speed, diam.globe)

Arguments

Tk

value of air temperature in Kelvin.

Pair

value of air pressure in hPa.

speed

value of wind speed in m/s.

min.speed

value of minimum wind speed in m/s.

diam.globe

diameter of the sphere in m.

Details

Reference: Bird, Stewart, and Lightfoot (BSL), page 409.

Value

Convective heat transfer coefficient for flow around a sphere, W/(m2 K).

Author(s)

Ana Casanueva (05.01.2017).


Meteorological heat-stress indices

Description

Calculate one index from aligned observations. Numeric scalars expand to the common observation length; other unequal lengths and matrices are rejected. Missing inputs propagate silently. Invalid observations return NA with one summary warning. Outside documented applicability bounds, a formula is evaluated where possible and flagged with a warning. Unknown bounds do not establish validity.

Usage

wet_bulb_stull(tas, hurs, diagnostics = FALSE)

wet_bulb_romps(tas, hurs, pressure = 1010, diagnostics = FALSE)

heat_index_rothfusz(tas, hurs, diagnostics = FALSE)

heat_index_lu(tas, hurs, diagnostics = FALSE)

wbgt_simplified_abm(tas, hurs, diagnostics = FALSE)

wbgt_simplified_indoor(tas, hurs, diagnostics = FALSE)

apparent_temperature(tas, hurs, wind, diagnostics = FALSE)

effective_temperature(tas, hurs, wind, diagnostics = FALSE)

humidex(tas, hurs, diagnostics = FALSE)

discomfort_index(tas, hurs, diagnostics = FALSE)

Arguments

tas

Air temperature in degrees Celsius.

hurs

Relative humidity in percent. The method catalog documents phase conventions. Methods using inherited Dosseger vapour pressure switch reference phase at 0 C; formulas using RH directly perform no conversion. Romps/Lu follow heatindex's water/ice convention at 273.16 K. Supply humidity on the chosen method's stated reference phase, especially below freezing.

diagnostics

Return values, component temperatures and diagnostics.

pressure

Atmospheric pressure in hPa, default 1010. This is an explicit near-sea-level assumption; use observed pressure at elevation.

wind

Wind speed in m/s measured at 10 m. Height adjustment is not performed for apparent or effective temperature.

Details

Romps calculates thermodynamic liquid-water wet bulb, not natural or aspirated wet bulb. Lu uses the simplified model published in 2026. Both call the external heatindex package; numerical reproducibility requires pinning its version. Stull assumes sea-level pressure and has a restricted domain. Cold observations within its rectangular bounds are marked unknown because its excluded cold/dry corner has no numeric boundary in the paper.

Simplified WBGT uses vapour pressure e in hPa from the shared Dosseger kernel. ABM: 0.567tas + 0.393e + 3.94; indoor: 0.567tas + 0.216e + 3.38. These empirical approximations do not calculate radiation or wind effects.

Value

By default, an aligned numeric vector on the Celsius scale. Humidex uses a Celsius-equivalent index scale. With diagnostics=TRUE, a list with values, components, and diagnostics. diagnostics contains a rows data frame (input_status, input_reason, domain_status, adjusted, converged, failure_reason), optional method-specific solver detail, and metadata.

References

See Also

heat_methods(), heat_indices(), wbgt_liljegren()

Examples

heat_index_rothfusz(c(25, 35), c(50, 10))
wet_bulb_romps(30, 70, pressure = 950)
wet_bulb_stull(c(30, 55), 50, diagnostics = TRUE)

Calculate all heat indices supported by supplied observations

Description

Uses the method registry to select and dispatch methods, including numerical Romps, Lu, Bernard and Liljegren calculations. Explicit indices are recommended for stable column sets and predictable workloads.

Usage

heat_indices(
  tas,
  hurs = NULL,
  wind = NULL,
  dewp = NULL,
  indices = NULL,
  wind_10m = NULL,
  wind_2m = NULL,
  pressure = 1010,
  radiation = NULL,
  time = NULL,
  lon = NULL,
  lat = NULL,
  diagnostics = FALSE,
  liljegren_options = list()
)

Arguments

tas

Air temperature in degrees Celsius.

hurs

Optional RH in percent; required by humidity-based methods.

wind

Deprecated alias for wind_10m.

dewp

Optional dew point in C for Bernard and Liljegren.

indices

Canonical method names or deprecated aliases. NULL selects all methods whose declared observation inputs were supplied, in registry order. Explicit selection retains requested order and column labels.

wind_10m, wind_2m

Wind in m/s at the indicated height. One is never substituted for the other.

pressure

Atmospheric pressure in hPa, default 1010. This is an explicit near-sea-level assumption; use observed pressure at elevation.

radiation, time, lon, lat

Optional Liljegren inputs; see wbgt_liljegren().

diagnostics

Return values, component temperatures and diagnostics.

liljegren_options

Named list containing direct_fraction, dewpoint_policy, workers, or control; see wbgt_liljegren().

Details

No absent meteorological inputs are inferred. pressure defaults to 1010 hPa, so Romps is selected when tas and hurs are supplied. An all-NA supplied input still satisfies availability, with NA rows in the result. All default column names are canonical. Humidity phase references differ between published methods below freezing; see heat_methods().

Available methods:

wet_bulb_stull

Stull wet-bulb approximation; inputs: tas, hurs; units: degC.

wet_bulb_romps

Romps thermodynamic liquid-water wet bulb; inputs: tas, hurs, pressure; units: degC.

wbgt_simplified_abm

ABM simplified WBGT; inputs: tas, hurs; units: degC.

wbgt_simplified_indoor

Indoor simplified WBGT; inputs: tas, hurs; units: degC.

apparent_temperature

Apparent temperature; inputs: tas, hurs, wind_10m; units: degC.

effective_temperature

Effective temperature; inputs: tas, hurs, wind_10m; units: degC.

humidex

Humidex (Celsius-equivalent scale); inputs: tas, hurs; units: degC.

discomfort_index

Discomfort index; inputs: tas, hurs; units: degC.

heat_index_rothfusz

NWS Rothfusz Heat Index; inputs: tas, hurs; units: degC.

heat_index_lu

Lu et al. (2026) simplified Heat Index; inputs: tas, hurs; units: degC.

wbgt_bernard

Bernard indoor/shade WBGT; inputs: tas, dewp; units: degC.

wbgt_liljegren

Liljegren outdoor WBGT; inputs: tas, dewp, wind_2m, radiation, time, lon, lat, pressure; units: degC.

Value

A data frame by default. With diagnostics, list(values, components, diagnostics), where components and diagnostics are named lists by requested index. Validation/forcing warnings are summarized once per call.

Examples

heat_indices(c(25, 30), c(60, 70), indices = c("humidex", "heat_index_lu"))
heat_indices(30, 70, wind_10m = 2)

Discover available heat-stress methods

Description

Discover available heat-stress methods

Usage

heat_methods()

Value

A data frame containing canonical method names, aliases, required inputs, units, applicability descriptions, humidity conventions, wind heights and scientific references. An unknown boundary does not establish validity. Humidex is reported on its Celsius-equivalent scale.

Examples

heat_methods()

Meteorological humidity conversions

Description

Meteorological humidity conversions

Usage

vapour_pressure(tas, hurs)

relative_humidity(tas, dewp, dewpoint_policy = c("cap", "na", "error"))

Arguments

tas

Air temperature in degrees Celsius.

hurs

Relative humidity in percent. The method catalog documents phase conventions. Methods using inherited Dosseger vapour pressure switch reference phase at 0 C; formulas using RH directly perform no conversion. Romps/Lu follow heatindex's water/ice convention at 273.16 K. Supply humidity on the chosen method's stated reference phase, especially below freezing.

dewp

Dew point in degrees Celsius.

dewpoint_policy

Handling of dew point above air temperature: cap, na, or error. Default cap.

Details

Uses the paired inherited Dosseger equations. Coefficients are selected by air temperature: water at or above 0 C, ice below 0 C. This preserves that convention when dew point and air temperature straddle 0 C.

Value

An aligned numeric vector: vapour pressure in hPa or RH in percent.

Examples

vapour_pressure(30, 70)
relative_humidity(30, 20)

Convert radian angle to degrees.

Description

Convert radian angle to degrees.

Usage

radToDeg(angleRad)

Arguments

angleRad

angle in radians.

Value

Angle in degrees.

Author(s)

Ana Casanueva (10.01.2017).


Solar zenith angle at supplied instants

Description

Solar zenith angle at supplied instants

Usage

solar_zenith(time, lon, lat)

Arguments

time

POSIXct/POSIXlt instants or offset-bearing ISO 8601 strings. Observations are instantaneous; align interval data externally. Strings without an offset and date-only values are not accepted as instants.

lon, lat

Longitude and latitude in degrees east and north.

Value

Numeric solar zenith angles in degrees, aligned with time.

Examples

solar_zenith("2024-06-01T12:00:00Z", 0, 15)

Calculate the thermal conductivity of air, W/(m K).

Description

Calculate the thermal conductivity of air, W/(m K).

Usage

thermal_cond(Tk)

Arguments

Tk

value of air temperature in Kelvin.

Details

Reference: BSL, page 257.

Value

Thermal conductivity of air, W/(m K).

Author(s)

Ana Casanueva (05.01.2017).


Compute the viscosity of air, kg/(m s).

Description

Compute the viscosity of air, kg/(m s) given temperature (K).

Usage

viscosity(Tk)

Arguments

Tk

value of air temperature in Kelvin.

Details

Reference: BSL, page 23.

Value

viscosity of air, kg/(m s).

Author(s)

Ana Casanueva (05.01.2017).


Bernard indoor or shade wet-bulb globe temperature

Description

Bernard indoor or shade wet-bulb globe temperature

Usage

wbgt_bernard(
  tas,
  dewp,
  dewpoint_policy = c("cap", "na", "error"),
  diagnostics = FALSE,
  tolerance = 1e-04
)

Arguments

tas

Air temperature in degrees Celsius.

dewp

Dew point in degrees Celsius, using the inherited Dosseger humidity conversion documented in heat_methods().

dewpoint_policy

Cap dew point at air temperature (default), return NA for supersaturated rows ("na"), or stop the call ("error").

diagnostics

Return values, component temperatures and diagnostics.

tolerance

Maximum final psychrometric root bracket width in C.

Value

Numeric WBGT in C, or the standardized diagnostic result with psychrometric wet-bulb component tpwb. Uses the inherited pressure assumption of 1010 hPa in Bernard's equation; it is not pressure configurable.

Author(s)

Original implementation: Ana Casanueva, P. Noti, J. Bhend.

References

Lemke and Kjellstrom (2012), doi:10.2486/indhealth.MS1352.

Examples

wbgt_bernard(30, 20, diagnostics = TRUE)

Liljegren outdoor wet-bulb globe temperature

Description

Liljegren outdoor wet-bulb globe temperature

Usage

wbgt_liljegren(
  tas,
  dewp,
  wind,
  radiation,
  time,
  lon,
  lat,
  pressure = 1010,
  direct_fraction = 0.8,
  dewpoint_policy = c("cap", "na", "error"),
  diagnostics = FALSE,
  workers = 1L,
  control = list()
)

Arguments

tas

Air temperature in degrees Celsius.

dewp

Dew point in degrees Celsius, using the inherited Dosseger humidity conversion documented in heat_methods().

wind

Wind speed in m/s at 2 m. Height adjustment is a caller responsibility.

radiation

Downwelling shortwave radiation in W/m2.

time

POSIXct/POSIXlt instants or offset-bearing ISO 8601 strings. Observations are instantaneous; align interval data externally. Strings without an offset and date-only values are not accepted as instants.

lon, lat

Longitude and latitude in degrees east and north.

pressure

Atmospheric pressure in hPa, default 1010. This is an explicit near-sea-level assumption; use observed pressure at elevation.

direct_fraction

Direct / (direct + diffuse) shortwave fraction, from zero through one. Default 0.8; scalar or row-aligned.

dewpoint_policy

Cap dew point at air temperature (default), return NA for supersaturated rows ("na"), or stop the call ("error").

diagnostics

Return values, component temperatures and diagnostics.

workers

Number of temporary PSOCK processes; default 1. Respect the detected CPU count and R check core limits. Avoid nested worker pools.

control

Named list of advanced controls: root_tolerance (1e-6 K), residual_tolerance (1e-4 K, at most 0.01), surface_albedo (0.45), globe_diameter (0.0508 m), and min_wind_speed (0.13 m/s).

Details

Uses the existing vectorized R heat-balance model with scalar fallback. A validated component is retained if its partner fails. Radiation is zeroed below the solar horizon and this adjustment is recorded in solver diagnostics. This independently maintained R model is not a bitwise port of the original Liljegren C program. Match physical assumptions before comparing implementations.

Value

An aligned numeric WBGT vector in degrees Celsius. With diagnostics, a list of values, components (tnwb and tg in C), and diagnostics. Detailed solver records retain initial/final brackets, residuals and fallback reasons. Bracket temperatures are Kelvin; candidate roots are Celsius. Final residuals and root/residual tolerances are Kelvin. Globe endpoint residuals use the energy equation (K to the fourth power); wet-bulb endpoints use K.

Author(s)

Original R translation: Ana Casanueva. Fork: Yifei Zheng.

References

Liljegren et al. (2008), doi:10.1080/15459620802310770.

Examples

wbgt_liljegren(30, 22, 1.5, 700,
  as.POSIXct("2024-06-01 12:00:00", tz = "UTC"), 0, 15)

Estimate 2 m wind with the Liljegren SRDT stability-class method

Description

Compatibility estimator reproducing the original Liljegren v1.1 SRDT (Solar Radiation/Delta Temperature) stability-class lookup and 2 m power-law estimate from the retained C implementation (EPA-454/R-99-005, 2000, section 6.2.5). Use it when a reanalysis or tower wind must be reduced to the 2 m height wbgt_liljegren() expects using exactly the original stability logic. For any other height conversion, including 2 m targets under neutral assumptions, use wind_at_height() instead; this function is the only place the SRDT tables and the 0.13 m/s estimated-speed floor apply.

The stability class is computed from the wind speed at its ORIGINAL measurement height, before conversion, exactly as the C program does. Daytime classes use the wind thresholds 2/3/5/6 m/s and radiation classes at 175/675/925 W/m2; nighttime classes use wind thresholds 2/2.5 m/s and the sign of delta_t_10m_2m_c. Separate rural and urban power-law exponent tables are applied, selected by the explicit urban flag. The estimated speed is wind * (2 / from_height_m)^exponent, floored at 0.13 m/s (the original MIN_SPEED); this floor applies only inside this estimator. Inside the WBGT kernel the existing wbgt_liljegren()⁠$min_wind_speed⁠ control remains in force; do not apply both clamps expecting a single raw wind to pass through them twice.

Usage

wind_2m_liljegren(
  wind,
  from_height_m,
  solar_w_m2 = NA_real_,
  daytime = NA,
  delta_t_10m_2m_c = NA_real_,
  urban = NA,
  diagnostics = FALSE
)

Arguments

wind

Wind speed in m/s at from_height_m. Zero is valid; negative values are invalid. The stability class uses this original-height value.

from_height_m

Measurement height of wind in metres. Must be positive. Rows already at 2 m pass through unchanged with all stability inputs optional.

solar_w_m2

Solar irradiance in W/m2, used only for daytime rows to select the radiation class (>= 925, >= 675, >= 175, < 175). Daytime estimates require finite, non-negative irradiance.

daytime

Logical (or 0/1 numeric) flag determined from solar geometry. Required on every estimated row.

delta_t_10m_2m_c

Vertical temperature difference (10 m minus 2 m) in degrees C, used only for nighttime rows with wind below 2.5 m/s, where its sign selects the inversion class.

urban

Logical (or 0/1 numeric) land-use flag selecting the urban versus rural exponent table. Required on every estimated row.

diagnostics

Single logical. If TRUE, return row-aligned metadata instead of a bare vector.

Details

Assumptions inherited from the original method: the SRDT class is a coarse surface-layer stability surrogate driven by wind, solar geometry and irradiance; solar_w_m2 should be the same forcing passed to the WBGT kernel. The original C evaluates the radiation class on its internally normalized solar value; when comparing against a full C pipeline, use forcing where that normalization is the identity (see the reference tests). Results are computed in double precision while the original uses float, so agreement is to floating-point tolerance, not bitwise. Conversion does not resolve exposure representativeness, terrain or building effects, or time-averaging mismatches.

Value

Numeric wind speed in m/s at 2 m. Scalars expand and equal-length vectors are processed row-wise; numeric(0) is preserved; NA inputs propagate silently. Omitted stability inputs default to NA. Estimates with missing required inputs return NA without warning. Physically invalid rows (negative wind, non-positive or non-finite height, negative or non-finite required radiation, non-finite required temperature difference) become NA with a summary warning. With diagnostics = TRUE, a data frame with wind_2m plus row-aligned stability_class (1..6, NA for pass-through rows), exponent, adjustment (the applied (2 / from_height_m)^exponent factor; 1 for pass-through rows), floored (whether the 0.13 m/s floor was applied), and status/reason row records.

Attribution

This product includes software produced by UChicago Argonne, LLC under Contract No. DE-AC02-06CH11357 with the Department of Energy. See the installed ‘COPYRIGHTS’ file for the original license.

References

Liljegren, J. C., Carhart, R. A., Lawday, P., Tschopp, S. and Sharp, R. (2008). "Modeling the Wet Bulb Globe Temperature Using Standard Meteorological Measurements." Journal of Occupational and Environmental Hygiene, 5(10), 645-655. doi:10.1080/15459620802310770.

U.S. EPA (2000). "Meteorological Monitoring Guidance for Regulatory Modeling Applications." EPA-454/R-99-005, section 6.2.5.

See Also

wind_at_height() for explicit general height conversion

Examples

# 10 m rural daytime wind, mid-range radiation.
wind_2m_liljegren(4, from_height_m = 10, solar_w_m2 = 500,
  daytime = TRUE, urban = FALSE)

# Nighttime with a surface inversion (delta_t > 0 means stable).
wind_2m_liljegren(1.5, from_height_m = 10,
  daytime = FALSE, delta_t_10m_2m_c = 2, urban = FALSE)

# Wind already at 2 m passes through without stability inputs.
wind_2m_liljegren(3.5, from_height_m = 2)

# Row-aligned metadata.
wind_2m_liljegren(c(4, 0.05), from_height_m = 10, solar_w_m2 = 500,
  daytime = TRUE, urban = FALSE, diagnostics = TRUE)

Convert wind speed between measurement heights

Description

Converts wind speed from one measurement height to another using an explicit, caller-selected profile method. This is a preprocessing step: convert observations to the height a heat-stress method requires (for example 2 m for wbgt_liljegren() or 10 m for indices documented at 10 m), then pass the converted value as that method's wind input.

Two methods are provided:

method = "power"

Power-law profile, u_to = u_from * (to_height_m / from_height_m)^exponent. The exponent must be supplied explicitly; no default such as the 1/7-power rule is assumed, because the appropriate exponent depends on surface roughness and stability.

method = "neutral_log"

Neutral logarithmic profile, u_to = u_from * log((to_height_m - d) / z0) / log((from_height_m - d) / z0) with surface roughness length z0 = roughness_length_m and zero-plane displacement height d = displacement_height_m. Requires from_height_m > d + z0 and to_height_m > d + z0.

Usage

wind_at_height(
  wind,
  from_height_m,
  to_height_m = 2,
  method,
  exponent = NULL,
  roughness_length_m = NULL,
  displacement_height_m = 0
)

Arguments

wind

Wind speed in m/s at from_height_m. Zero is valid; negative values are invalid.

from_height_m

Measurement height of wind in metres above the surface. Must be positive.

to_height_m

Target height in metres above the surface. Must be positive. Default 2.

method

Either "power" or "neutral_log". No default; the conversion method is always an explicit analysis choice.

exponent

Power-law exponent (dimensionless). Required, finite and non-NA for method = "power"; ignored otherwise.

roughness_length_m

Surface roughness length z0 in metres. Required and strictly positive for method = "neutral_log"; ignored otherwise.

displacement_height_m

Zero-plane displacement height d in metres. Default 0 (open terrain). Must be non-negative; negative values have no physical meaning for a zero-plane displacement and mark the row invalid. Used only by method = "neutral_log".

Details

Both profiles describe a horizontally homogeneous surface layer under near-neutral stability. The power law is an empirical fit whose exponent varies with terrain and stability; the log law assumes a neutral surface layer and can fail outright inside and above urban canopies, where extrapolating below d + z0 is undefined. Conversion between heights does not resolve exposure representativeness, terrain or building effects, or time-averaging mismatches between source and target series.

When from_height_m equals to_height_m the wind is returned unchanged, subject to ordinary wind and height validation.

Record the source height, method and parameters alongside converted results for reproducibility.

Value

Numeric wind speed in m/s at to_height_m. Scalars expand and equal-length vectors are processed row-wise; numeric(0) is preserved. NA inputs propagate. Rows that are physically invalid (negative wind, non-positive heights, non-finite exponent, non-positive roughness, negative displacement height, or a height at or below d + z0) become NA with a summary warning. No minimum-wind clamp is applied; use method-specific controls such as wbgt_liljegren()⁠$min_wind_speed⁠ for that, and do not apply both.

References

U.S. EPA (2000). "Meteorological Monitoring Guidance for Regulatory Modeling Applications." EPA-454/R-99-005, section 6.2.5 (stability-class wind-profile adjustment).

Examples

# 10 m reanalysis wind to the 2 m height wbgt_liljegren() expects,
# using an explicit neutral log-law with open-terrain roughness.
wind_at_height(4, from_height_m = 10, method = "neutral_log",
               roughness_length_m = 0.1)

# Power law with an explicit exponent, row-wise.
wind_at_height(c(3, 6), from_height_m = c(10, 10), to_height_m = 2,
               method = "power", exponent = 0.143)