Meteorology¶
Gridded meteorology (MetField) on the les_fvm analysis grid, the wrfout loader, and the adapter that feeds it to the Eulerian solver as wind. Tier 0.
met
¶
Meteorological forcing for the transport tiers (Tier 0 prerequisites).
The transport models are driven by an external meteorology; this package owns the container those models consume and the loaders that populate it from numerical-weather-prediction output.
- :class:
MetField— gridded wind, temperature, pressure and PBL height on ales_fvmanalysis grid, on theles_fvmC-grid stagger, with a time axis. - :func:
load_wrf— read awrfoutfile onto an analysis grid. - :func:
to_prescribed_wind— expose a :class:MetFieldas the :class:~plumax.les_fvm.wind.PrescribedWindFieldthe Eulerian solver takes, with piecewise-linear interpolation between met times.
MetField
¶
Bases: Module
Meteorological forcing on an analysis grid with a time axis.
Attributes:
| Name | Type | Description |
|---|---|---|
plume_grid |
PlumeGrid3D
|
Analysis grid every field lives on. |
times |
Float[Array, ' n_time']
|
Seconds since |
u |
Float[Array, 'n_time nz ny nx']
|
Eastward wind [m/s] at U-points (T-point |
v |
Float[Array, 'n_time nz ny nx']
|
Northward wind [m/s] at V-points (T-point |
w |
Float[Array, 'n_time nz ny nx']
|
Vertical wind [m/s] at T-points. |
temperature |
Float[Array, 'n_time nz ny nx']
|
Air temperature [K] at T-points. |
pressure |
Float[Array, 'n_time nz ny nx']
|
Air pressure [Pa] at T-points. |
pbl_height |
Float[Array, 'n_time ny nx']
|
Boundary-layer height above ground [m] at horizontal
T-points, shape |
t0 |
str
|
ISO-8601 timestamp that |
wind_at
¶
wind_at(t: Float[Array, '']) -> tuple[Float[Array, 'nz ny nx'], Float[Array, 'nz ny nx'], Float[Array, 'nz ny nx']]
Interior (u, v, w) at time t, piecewise-linear in time.
Met is typically hourly while the transport step is seconds, so the
wind is interpolated linearly between the two bracketing met times
(policy (b) of the Tier 0 design page). Outside [times[0],
times[-1]] the nearest end value is held constant.
Source code in src/plumax/met/field.py
to_prescribed_wind
¶
Expose a :class:MetField as the wind object the Eulerian solver takes.
The returned :class:~plumax.les_fvm.wind.PrescribedWindField samples
:meth:MetField.wind_at — so simulate_eulerian_dispersion(
wind_field=to_prescribed_wind(field), ...) runs the FV transport on
loaded meteorology with no other change. The caller's domain_*
triples must describe the same grid field.plume_grid was built on.
Source code in src/plumax/met/field.py
load_wrf
¶
load_wrf(path: str | Path, *, plume_grid: PlumeGrid3D, origin: tuple[float, float] = (0.0, 0.0), times: slice | None = None) -> MetField
Load a wrfout file onto an analysis grid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
NetCDF |
required |
plume_grid
|
PlumeGrid3D
|
Analysis grid (from :func: |
required |
origin
|
tuple[float, float]
|
WRF-frame metres of the analysis grid's |
(0.0, 0.0)
|
times
|
slice | None
|
Optional |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
MetField
|
class: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If any analysis T-, U- or V-point falls outside the
WRF mass-point domain (the loader never extrapolates
horizontally), or if |