Converting Other Models’ Output#
HYSPLIT reads only ARL files, and NOAA publishes them for a few products (HRRR,
NAM, GDAS, GFS, …; see Downloading Archived Meteorology). For any other model, HYSPLIT ships
one Fortran data2arl program per product. arlmet.converters holds
Python versions of them, and converters for products HYSPLIT has none for. Each takes the product’s own output, opened with
xarray, and returns a Dataset in the layout arlmet.write_dataset() writes:
ARL’s four-character names, the units HYSPLIT reads, rows from south to north,
and the vertical axis HYSPLIT expects for the product. You can look at it, plot
it and change it before anything is written.
The converters so far:
arlmet.converters.from_era5(): ECMWF’s ERA5 reanalysis on pressure levels, as HYSPLIT’sera52arlconverts it, and on its model levels, as HYSPLIT’sapi2arlconverts ECMWF’s hybrid levels.arlmet.converters.from_flex_extract(): ERA5 as flex_extract writes it for FLEXPART, on model levels, which HYSPLIT has no converter for.arlmet.converters.from_gfs(): NCEP’s GFS forecasts and GDAS analyses on pressure levels (pgrb2files), as HYSPLIT’sapi2arlconverts them.arlmet.converters.from_icon(): DWD’s ICON-EU and ICON-D2 forecasts on their regular lat/lon grids and pressure levels, which HYSPLIT has no converter for.arlmet.converters.from_wrf(): WRF-ARW output (wrfoutfiles) on its own grid and model levels, as HYSPLIT’sarw2arlconverts it.
ERA5#
Download the pressure-level and single-level fields from the Copernicus Climate
Data Store, for example with its cdsapi client (an account and API key are
needed). Ask for the same hours and area in both:
import cdsapi
client = cdsapi.Client()
when = {
"product_type": ["reanalysis"],
"year": ["2024"],
"month": ["07"],
"day": ["18"],
"time": [f"{hour:02d}:00" for hour in range(24)],
"area": [44, -116, 38, -110], # north, west, south, east
"data_format": "netcdf",
}
client.retrieve(
"reanalysis-era5-pressure-levels",
{
**when,
"variable": [
"geopotential", "temperature", "u_component_of_wind",
"v_component_of_wind", "vertical_velocity", "relative_humidity",
],
"pressure_level": ["1000", "975", "950", "925", "900", "850", "800",
"700", "600", "500", "400", "300", "250", "200"],
},
"era5_pressure_levels.nc",
)
client.retrieve(
"reanalysis-era5-single-levels",
{
**when,
"variable": [
"surface_pressure", "geopotential", "2m_temperature",
"2m_dewpoint_temperature", "10m_u_component_of_wind",
"10m_v_component_of_wind", "boundary_layer_height",
"total_precipitation", "surface_sensible_heat_flux",
"surface_latent_heat_flux", "surface_solar_radiation_downwards",
],
},
"era5_single_levels.zip",
)
Open both with xarray. A single-level netCDF request that mixes instantaneous
fields with accumulated ones (precipitation, the fluxes) comes as a zip of two
files; open each and merge them. chunks={} keeps the values on disk until
they are written, one time step at a time:
import xarray as xr
pressure_levels = xr.open_dataset("era5_pressure_levels.nc", chunks={})
single_levels = xr.merge(
[
xr.open_dataset("data_stream-oper_stepType-instant.nc", chunks={}),
xr.open_dataset("data_stream-oper_stepType-accum.nc", chunks={}),
],
compat="override",
)
GRIB files work the same way, opened with engine="cfgrib" (which needs the
cfgrib package). Here two small made-up Datasets laid out as the netCDF
files are stand in for the download:
In [1]: import arlmet
In [2]: pressure_levels, single_levels = docs_examples.era5_sample()
In [3]: pressure_levels
Out[3]:
<xarray.Dataset> Size: 180kB
Dimensions: (valid_time: 3, pressure_level: 4, latitude: 25,
longitude: 25)
Coordinates:
* valid_time (valid_time) datetime64[us] 24B 2024-07-18T15:00:00 ... 2...
* pressure_level (pressure_level) float64 32B 1e+03 850.0 700.0 500.0
* latitude (latitude) float64 200B 44.0 43.75 43.5 ... 38.5 38.25 38.0
* longitude (longitude) float64 200B -116.0 -115.8 ... -110.2 -110.0
Data variables:
z (valid_time, pressure_level, latitude, longitude) float32 30kB ...
t (valid_time, pressure_level, latitude, longitude) float32 30kB ...
u (valid_time, pressure_level, latitude, longitude) float32 30kB ...
v (valid_time, pressure_level, latitude, longitude) float32 30kB ...
w (valid_time, pressure_level, latitude, longitude) float32 30kB ...
r (valid_time, pressure_level, latitude, longitude) float32 30kB ...
Convert them, look at the result, and write it:
In [4]: ds = arlmet.converters.from_era5(pressure_levels, single_levels)
In [5]: ds
Out[5]:
<xarray.Dataset> Size: 241kB
Dimensions: (lon: 25, lat: 25, time: 3, level: 4)
Coordinates:
* lon (lon) float64 200B -116.0 -115.8 -115.5 ... -110.2 -110.0
* lat (lat) float64 200B 38.0 38.25 38.5 38.75 ... 43.5 43.75 44.0
* time (time) datetime64[us] 24B 2024-07-18T15:00:00 ... 2024-07-...
forecast_hour (time) int64 24B 0 0 0
* level (level) int64 32B 1 2 3 4
pressure (level) float64 32B 1e+03 850.0 700.0 500.0
arl_grid int64 8B 0
Data variables: (12/14)
HGTS (time, level, lat, lon) float32 30kB 110.9 ... 5.574e+03
TEMP (time, level, lat, lon) float32 30kB 296.3 296.3 ... 257.8
UWND (time, level, lat, lon) float32 30kB 4.487 4.457 ... 11.79
VWND (time, level, lat, lon) float32 30kB -3.97 -3.97 ... -3.532
WWND (time, level, lat, lon) float32 30kB 0.00829 ... -0.0006976
RELH (time, level, lat, lon) float32 30kB 56.58 56.38 ... 38.6
... ...
T02M (time, lat, lon) float32 8kB 289.5 289.5 ... 293.5 293.5
U10M (time, lat, lon) float32 8kB 2.829 2.819 2.809 ... 1.948 1.93
V10M (time, lat, lon) float32 8kB -1.0 -1.0 -1.0 ... -1.0 -1.0
TPP1 (time, lat, lon) float32 8kB 0.0001658 0.0001638 ... 0.0 0.0
SHTF (time, lat, lon) float32 8kB 194.9 194.7 ... 238.7 238.3
DSWF (time, lat, lon) float32 8kB 600.0 600.0 ... 800.0 800.0
Attributes:
source: ERA5
vertical_flag: 2
arlmet_version: 0.1.0b13
In [6]: ds["pressure"].values # level 1 is the highest pressure
Out[6]: array([1000., 850., 700., 500.])
In [7]: ds["SHTF"].attrs # W m-2, positive upward
Out[7]: {'units': 'W m-2'}
In [8]: arlmet.write_dataset(ds, "era5.arl")
In [9]: with arlmet.File("era5.arl") as met:
...: print(met.grid, met.vertical_axis.levels)
...:
Grid(latlon, 25×25) [ 0. 1000. 850. 700. 500.]
The API page of from_era5() lists every ERA5 variable
it converts and how. Variables it does not know are left out, so ask the Data
Store only for those you need.
How it differs from era52arl#
The values are what HYSPLIT reads, which is not always what era52arl
writes:
geopotential becomes height through ECMWF’s gravity, 9.80665 m s-2 (
era52arlmultiplies by 0.102);the hourly totals of the heat fluxes and the downward solar radiation become W m-2 by dividing by 3600 s (
era52arlmultiplies by 0.00028, so itsDSWFis 0.8 % high);total cloud cover
TCLDis in percent, as HYSPLIT reads it (era52arlwrites the 0 to 1 fraction);the heat fluxes
SHTFandLHTFare positive upward, as HYSPLIT takes them: its stability routine (stbanl.f) reads a positiveSHTFas the ground heating the air, and HYSPLIT changes the sign only for NAM’sETAfiles (prfcom.f). ERA5’s fluxes, andera52arl’s, are positive downward, so HYSPLIT reads a sunny afternoon in anera52arlfile as a stable surface layer;the latent heat flux is named
LHTF, which HYSPLIT reads (era52arlnames itLTHF).
As era52arl does, it writes a DIFW record after each WWND and a
DIFR record after TPP1, which keep what 8-bit packing leaves out.
What it does not do#
The ensemble (a
numberdimension) and forecast-step layouts (astepdimension): each raisesValueError. Select one ensemble member, or the valid times, first.Regridding: the converter writes the grid the input is on, which must be a regular latitude/longitude grid.
ERA5 on model levels#
ERA5’s own vertical grid is 137 hybrid sigma-pressure levels, which follow the
terrain near the ground: model level 137 is about 10 m above it. HYSPLIT reads
them as its hybrid levels (vertical flag 4), which is what
from_era5() writes when the first Dataset is on model
levels. The Climate Data Store serves them from ECMWF’s archive as
reanalysis-era5-complete, in GRIB, with a request in MARS’s keywords:
client.retrieve(
"reanalysis-era5-complete",
{
"class": "ea", "expver": "1", "stream": "oper", "type": "an",
"date": "2024-07-18", "time": "00:00:00/to/23:00:00",
"levtype": "ml", "levelist": "80/to/137",
"param": "130/131/132/133/135", # t, u, v, q, w
"grid": "0.25/0.25", "area": "44/-116/38/-110",
},
"era5_model_levels.grib",
)
Open it with cfgrib, which names the level dimension hybrid, and pass the
single-level fields of the same hours, which must include the surface pressure
sp: HYSPLIT finds each level’s pressure from it.
model_levels = xr.open_dataset(
"era5_model_levels.grib",
engine="cfgrib",
backend_kwargs={"filter_by_keys": {"typeOfLevel": "hybrid"}},
)
ds = arlmet.converters.from_era5(model_levels, single_levels)
A made-up Dataset on five model levels stands in for the download here:
In [10]: model_levels = docs_examples.era5_model_level_sample()
In [11]: ds = arlmet.converters.from_era5(model_levels, single_levels)
In [12]: ds.attrs["vertical_flag"]
Out[12]: 4
In [13]: arlmet.write_dataset(ds, "era5_ml.arl")
In [14]: with arlmet.File("era5_ml.arl") as met:
....: print(met.vertical_axis.levels) # the ground as 1, then levels 137 to 100
....:
[ 1. 0.99882 4.9723 29.881 85.693 159.42 ]
Each ARL hybrid level is one number, as HYSPLIT’s api2arl writes it: a
pressure offset in whole hPa plus a sigma, so that the level’s pressure is
offset + sigma * surface pressure (model level 120 is 29.881). Three
limits of that format decide which levels can be written:
The offsets of the levels above about model level 24 (near 5 hPa) round to the same whole hPa, so
from_era5refuses them and names the first.A record’s header numbers its level in two characters, so an ARL file holds at most 99 levels above the ground: keep model levels 39 to 137 (up to about 25 hPa), or fewer.
The index record at the start of each time step lists every level’s variables and must fit in one record of
nx * nybytes, so a small crop holds fewer levels: a 61 x 61 cell grid holds about 60 levels of five variables.arlmet.write_dataset()says when it does not fit.
The level is written in six characters, so where its offset is 100 hPa or
more its sigma keeps two decimals, and HYSPLIT reads some mid-troposphere
levels up to about 5 hPa from ERA5’s pressure. api2arl’s files are rounded
the same way.
ERA5 from flex_extract#
FLEXPART reads ERA5 from the files
flex_extract writes, one GRIB file
per hour (EAyymmddhh) holding the 137 model levels, the surface fields and
the precipitation. from_flex_extract() turns them into
the same ARL hybrid Dataset as from_era5() writes for
ERA5 on model levels, so HYSPLIT, or arlmet.sample_points(), can read the
met a FLEXPART run used. Open each file with cfgrib.open_datasets(), which
splits it into five Datasets, and pass them all:
import cfgrib
files = ["EA23053118", "EA23053119", "EA23053120"]
datasets = [ds for f in files for ds in cfgrib.open_datasets(f)]
ds = arlmet.converters.from_flex_extract(datasets)
arlmet.write_dataset(ds, "era5.arl")
The files are not ERA5 as the Climate Data Store serves it, which is why this is its own converter:
flex_extract has turned ERA5’s hourly totals (the sensible heat flux, the net solar radiation, the surface stress, the precipitation) into rates at the valid time, but keeps their GRIB names and
accumlabels. They are read as the rates they are.Some fields are on longitudes from 0 to 360 and others from -180 to 180, on the same grid. All are put on the model levels’ longitudes.
The friction velocity
USTRis made from the surface stress, as FLEXPART makes it, and the precipitationTPP1from the large-scale and convective rates.The solar radiation is net (
ssr), not downward asfrom_era5’sDSWF.Only the lowest 99 model levels are kept (137 to 39, up to about 25 hPa): an ARL record’s header numbers its level in two characters.
The files hold no boundary layer height, latent heat flux or pressure vertical
velocity (flex_extract’s etadot is the rate of change of the hybrid
coordinate), so no PBLH, LHTF or WWND is written: HYSPLIT finds
the mixed layer from the temperature profile and the vertical velocity from
the divergence of the wind.
GFS and GDAS#
NOAA publishes GFS and GDAS as ARL files (Downloading Archived Meteorology), but only some
of them: the 0.25 degree GFS on its own hybrid levels, the 1 degree GDAS on
pressure levels. from_gfs() converts NCEP’s GRIB2
pgrb2 files themselves, so any cycle, forecast hour or resolution (0.25,
0.5 or 1 degree) can be written on pressure levels. NOAA keeps them in a public
bucket, https://noaa-gfs-bdp-pds.s3.amazonaws.com, one file per cycle and
forecast hour:
gfs.20250901/00/atmos/gfs.t00z.pgrb2.0p25.f003 GFS, 0.25 degree, 3-hour forecast
gdas.20250901/00/atmos/gdas.t00z.pgrb2.1p00.f000 GDAS, 1 degree, analysis
Open each file with cfgrib (pip install cfgrib eccodes), which splits a
GRIB2 file into one Dataset per kind of level, and pass all the Datasets of all
the files together. The boundary layer height needs a second open of each
file (below):
import cfgrib
import xarray as xr
files = ["gdas.t18z.pgrb2.1p00.f006", "gdas.t00z.pgrb2.1p00.f000"]
datasets = [ds for f in files for ds in cfgrib.open_datasets(f)]
hpbl = {
"filter_by_keys": arlmet.converters.GFS_HPBL,
"read_keys": list(arlmet.converters.GFS_HPBL),
}
datasets += [xr.open_dataset(f, engine="cfgrib", backend_kwargs=hpbl) for f in files]
Keep cfgrib’s index files (its default, indexpath unset): without them it
reads the whole file again for every Dataset, and opening ten 0.25 degree
files can read hundreds of gigabytes. To convert a region, pass
bbox=(west, south, east, north): each field is cropped before it is read
into memory.
Each valid time becomes one time step. An analysis has no precipitation or
fluxes, which a forecast accumulates or averages over its hours, so where two
files hold a field at the same valid time the shorter forecast is used: above,
the 00 UTC analysis gives the instantaneous fields and the 18 UTC cycle’s
6-hour forecast the precipitation and fluxes, as NOAA’s GDAS ARL files are
made. GFS empties its precipitation bucket every 6 hours (a 3-hour forecast
holds hours 0 to 3, a 6-hour forecast 0 to 6), which is what HYSPLIT reads in
TPP6. Here made-up Datasets laid out as cfgrib returns them stand in for
those two files:
In [15]: datasets = docs_examples.gfs_sample()
In [16]: [list(d.data_vars) for d in datasets]
Out[16]:
[['gh', 't', 'u', 'v', 'w', 'r'],
['sp', 'orog'],
['t2m'],
['tp'],
['avg_ishf'],
['gh', 't', 'u', 'v', 'w', 'r'],
['sp', 'orog'],
['t2m']]
In [17]: ds = arlmet.converters.from_gfs(datasets)
In [18]: ds
Out[18]:
<xarray.Dataset> Size: 61kB
Dimensions: (lon: 25, lat: 21, time: 1, level: 4)
Coordinates:
* lon (lon) float64 200B -125.0 -124.0 -123.0 ... -102.0 -101.0
* lat (lat) float64 168B 30.0 31.0 32.0 33.0 ... 48.0 49.0 50.0
* time (time) datetime64[us] 8B 2025-09-01
forecast_hour (time) int64 8B 0
* level (level) int64 32B 1 2 3 4
pressure (level) float64 32B 1e+03 850.0 700.0 500.0
arl_grid int64 8B 0
Data variables:
HGTS (time, level, lat, lon) float32 8kB 110.9 110.9 ... 5.574e+03
TEMP (time, level, lat, lon) float32 8kB 300.3 300.3 ... 254.8
UWND (time, level, lat, lon) float32 8kB 3.026 3.408 ... 14.36
VWND (time, level, lat, lon) float32 8kB -3.732 -3.732 ... -2.684
WWND (time, level, lat, lon) float32 8kB 0.00171 ... 0.00394
RELH (time, level, lat, lon) float32 8kB 46.84 49.39 ... 55.76
PRSS (time, lat, lon) float32 2kB 866.5 866.5 ... 866.5 866.5
SHGT (time, lat, lon) float32 2kB 1.3e+03 1.3e+03 ... 1.3e+03
T02M (time, lat, lon) float32 2kB 289.5 289.5 ... 289.5 289.5
TPP6 (time, lat, lon) float32 2kB 0.000684 0.0009389 ... 0.001576
SHTF (time, lat, lon) float32 2kB 46.84 49.39 ... 53.89 55.76
Attributes:
source: GFS
vertical_flag: 2
arlmet_version: 0.1.0b13
In [19]: ds["forecast_hour"].values # the analysis's
Out[19]: array([0])
In [20]: arlmet.write_dataset(ds, "gdas.arl")
The API page of from_gfs() lists the GRIB2 variables
it converts. All the pressure levels of a file are written; to write fewer,
select them first, in the Dataset that holds gh
(d.sel(isobaricInhPa=[1000, 925, 850, 700, 500, 300, 200])). NCEP’s
planetary boundary layer height, HPBL, is a local GRIB2 parameter that
ecCodes has no name for: cfgrib calls it unknown, and
cfgrib.open_datasets() drops it from a forecast file, where a second
unnamed field shares its level. The second open above finds it by its
numbers (GFS_HPBL), and it is written as
PBLH; without it, no PBLH. The GDAS files’ instantaneous total cloud cover is
missing at every point, so they give no TCLD. Like
api2arl, it writes no DIF* records.
ICON#
DWD’s ICON-EU (Europe, about 6.5 km) and ICON-D2 (Germany, about 2.2 km) are
published free at https://opendata.dwd.de/weather/nwp/, each forecast on
its own grid and on a regular lat/lon grid; from_icon()
converts the lat/lon files on pressure levels. DWD keeps a forecast for about
a day. Each file holds one variable at one level and one forecast step,
compressed with bzip2:
icon-eu/grib/00/t/icon-eu_europe_regular-lat-lon_pressure-level_2026110600_003_850_T.grib2.bz2
icon-eu/grib/00/tot_prec/icon-eu_europe_regular-lat-lon_single-level_2026110600_003_TOT_PREC.grib2.bz2
icon-eu/grib/00/hsurf/icon-eu_europe_regular-lat-lon_time-invariant_2026110600_HSURF.grib2.bz2
The pressure-level variables are fi, t, u, v, omega and
relhum; the API page of from_icon() lists the
single-level ones it reads. Download those you need for every step, unpack
them (bunzip2) and open each with cfgrib, passing all the Datasets
together:
import glob
import cfgrib
files = sorted(glob.glob("icon-eu_europe_regular-lat-lon_*.grib2"))
datasets = [ds for f in files for ds in cfgrib.open_datasets(f)]
The levels of each variable are stacked, and each valid time becomes one time
step. ICON’s precipitation and surface fluxes are totals and means from the
start of the forecast (a 3-hour file holds hours 0 to 3); each is written as
the total or mean since the step before. TPP1 is that precipitation per
hour, so 3-hourly steps (ICON-EU’s after 78 hours) give the hourly mean of
each 3 hours. A forecast’s step 0 has no such interval, so its precipitation
and fluxes are missing records; as in from_gfs(),
where two forecasts hold a field at the same valid time the shorter step is
used, so the first 6 hours of each run joined together give every time step
its fields. ICON’s fluxes are positive downward; SHTF and LHTF are
written positive upward, as HYSPLIT takes them. Here made-up Datasets laid out
as cfgrib returns DWD’s files stand in for one forecast’s steps 0 to 3:
In [21]: datasets = docs_examples.icon_sample()
In [22]: len(datasets), list(datasets[-1].data_vars)
Out[22]: (113, ['avg_slhtf'])
In [23]: ds = arlmet.converters.from_icon(datasets)
In [24]: ds
Out[24]:
<xarray.Dataset> Size: 509kB
Dimensions: (lon: 41, lat: 25, time: 4, level: 4)
Coordinates:
* lon (lon) float64 328B 0.0 0.5 1.0 1.5 ... 18.5 19.0 19.5 20.0
* lat (lat) float64 200B 44.0 44.5 45.0 45.5 ... 55.0 55.5 56.0
* time (time) datetime64[us] 32B 2026-11-06 ... 2026-11-06T03:00:00
forecast_hour (time) int64 32B 0 1 2 3
* level (level) int64 32B 1 2 3 4
pressure (level) float64 32B 1e+03 850.0 700.0 500.0
arl_grid int64 8B 0
Data variables:
HGTS (time, level, lat, lon) float32 66kB 93.56 94.7 ... 5.574e+03
TEMP (time, level, lat, lon) float32 66kB 285.2 285.2 ... 246.0
UWND (time, level, lat, lon) float32 66kB 0.7859 1.014 ... 16.75
VWND (time, level, lat, lon) float32 66kB 2.0 1.996 ... -2.5
WWND (time, level, lat, lon) float32 66kB -0.002598 ... -2.204e-18
RELH (time, level, lat, lon) float32 66kB 38.35 39.77 ... 60.0
PRSS (time, lat, lon) float32 16kB 989.5 989.5 ... 989.5 989.5
SHGT (time, lat, lon) float32 16kB 200.0 200.0 ... 200.0 200.0
T02M (time, lat, lon) float32 16kB 281.7 281.7 ... 281.7 281.7
TPP1 (time, lat, lon) float64 33kB nan nan nan nan ... 0.0 0.0 0.0
LHTF (time, lat, lon) float64 33kB nan nan nan ... 37.91 40.0
Attributes:
source: ICON
vertical_flag: 2
arlmet_version: 0.1.0b13
In [25]: ds["TPP1"].mean(["lat", "lon"]).values # m per hour; none at step 0
Out[25]: array([ nan, 0.00037703, 0.00037703, 0.00037703])
In [26]: arlmet.write_dataset(ds, "icon-eu.arl")
ICON’s own grid (icosahedral, the only one DWD publishes for global ICON) and
its model levels (heights that follow the terrain, which no ARL vertical
coordinate describes) are not converted: remap the output to a lat/lon grid
and pressure levels first (for example with CDO) and write it as GRIB2 with
DWD’s variable names. HYSPLIT has no ICON converter to compare with; the
files written are read by HYSPLIT’s hycs_std.
WRF#
from_wrf() converts WRF-ARW’s wrfout netCDF files
on the model’s own grid (Lambert conformal, polar stereographic or Mercator)
and levels, as arw2arl does with its default variables. Open the files of
one run together, joined along Time, so that each hour’s precipitation can
be taken from the run’s accumulated totals:
import xarray as xr
wrf = xr.open_mfdataset(
"wrfout_d01_2013-06-30_*", combine="nested", concat_dim="Time"
)
Here a small made-up run, laid out as xarray opens wrfout files, stands in
for them:
In [27]: wrf = docs_examples.wrf_sample()
In [28]: ds = arlmet.converters.from_wrf(wrf)
In [29]: ds
Out[29]:
<xarray.Dataset> Size: 274kB
Dimensions: (y: 25, x: 30, time: 3, level: 4)
Coordinates:
* y (y) float64 200B 0.0 1.2e+04 2.4e+04 ... 2.76e+05 2.88e+05
* x (x) float64 240B 0.0 1.2e+04 2.4e+04 ... 3.36e+05 3.48e+05
lon (y, x) float64 6kB -113.6 -113.4 -113.3 ... -109.5 -109.3
lat (y, x) float64 6kB 38.65 38.65 38.65 ... 41.32 41.32 41.31
* time (time) datetime64[us] 24B 2013-06-30 ... 2013-06-30T02:00:00
forecast_hour (time) int64 24B 6 7 8
* level (level) int64 32B 1 2 3 4
sigma (level) float64 32B 0.99 0.95 0.85 0.7
arl_grid int64 8B 0
Data variables:
SHGT (time, y, x) float32 9kB 1.3e+03 1.341e+03 ... 1.497e+03
PRSS (time, y, x) float32 9kB 870.0 865.9 861.8 ... 853.6 850.3
TPP1 (time, y, x) float64 18kB 0.0 0.0 0.0 ... 0.0005471 0.000657
T02M (time, y, x) float32 9kB 295.0 294.7 294.5 ... 295.9 295.7
PRES (time, level, y, x) float32 36kB 1.003e+03 ... 709.6
TEMP (time, level, y, x) float32 36kB 300.4 300.5 ... 275.2 275.3
UWND (time, level, y, x) float32 36kB 5.0 5.412 ... 10.64 10.97
VWND (time, level, y, x) float32 36kB -2.5 -2.706 ... -5.485
WWND (time, level, y, x) float32 36kB -0.0 -0.001564 ... -0.005775
SPHU (time, level, y, x) float32 36kB 0.00495 0.00495 ... 0.0035
Attributes:
source: AWRF
vertical_flag: 1
arlmet_version: 0.1.0b13
In [30]: ds.arl.grid
Out[30]: Grid(lcc 12km, 30×25)
In [31]: ds.arl.vertical_axis # sigma levels, with the model top as offset
Out[31]: SigmaAxis(n=5)
In [32]: arlmet.write_dataset(ds, "wrf.arl")
The file has source AWRF, which HYSPLIT reads as WRF. It keeps WRF’s
staggered winds where WRF puts them, UWND on the west and VWND on the
south face of each cell, and HYSPLIT (and arlmet.sample_points()) read
them there. WWND is WRF’s vertical velocity as a pressure tendency
(hPa s-1), and TPP1 the precipitation since the time step before, per
hour, each with a DIF* record. The first time step has no precipitation,
as arw2arl writes it when it has no earlier file.
Converted alongside arw2arl from the same four hours of a 12 km WRF run,
every field matched its file but the two it computes, TEMP and WWND,
which differ in the last bits of single precision, as Fortran’s and NumPy’s
arithmetic do: TEMP mostly by 1e-4 K, and by one packing step (0.125 K)
at 0.006 % of its values; WWND by at most 6e-5 hPa s-1. arw2arl keeps the
lowest 50 levels unless told otherwise; all are kept here, and
ds.isel(level=slice(0, 50)) keeps fewer.
A run made with do_avgflx_em = 1 also writes winds averaged over each
output interval and coupled to the column mass (AVGFLX_RUM, …), which
arw2arl -c2 converts (NOAA’s notes on its own WRF ARL files say HYSPLIT
did slightly better with them in limited testing). winds="averaged"
writes those instead, as stored, with the fields HYSPLIT decouples them with
(MUU0, MUV0, MSFT, MSFU, MSFV); arlmet.sample_points()
decouples them too, while arlmet.open_dataset() returns the stored
values:
In [33]: averaged = arlmet.converters.from_wrf(wrf, winds="averaged")
In [34]: averaged["UWND"].attrs # mass-coupled, as stored
Out[34]: {'units': 'Pa m s-1'}
In [35]: sorted(set(averaged.data_vars) - set(ds.data_vars))
Out[35]: ['MSFT', 'MSFU', 'MSFV', 'MUU0', 'MUV0']
arw2arl’s TKE list is not converted.