J65.5 Bringing WRF into MetPy (and the Rest of the Atmospheric Sciences Python Ecosystem)

Thursday, 16 January 2020: 11:30 AM
258C (Boston Convention and Exhibition Center)
Jonathan E. Thielen, Iowa State Univ., Ames, IA; and R. M. May

The longstanding Weather Research and Forecasting (WRF) Model, particularly in its Advanced Research version (WRF-ARW), remains widely used in the atmospheric sciences community. However, as increased numbers of researchers move away from legacy tools such as GEMPAK and NCL and instead utilize Python and packages in the scientific Python ecosystem, difficulties have arisen due to the idiosyncratic format of WRF-ARW’s netCDF raw output files. This has particularly been the case for MetPy, an open-source package maintained by Unidata for reading, writing, plotting, and performing calculations with meteorological data.

A first set of issues with raw WRF-ARW output is the lack of full diagnostic variables on regular grids and isobaric (or other analysis-friendly) vertical coordinates. These problems are common to any analysis of WRF-ARW output, and many utilities already exist to properly calculate diagnostic terms and interpolate and destagger variables (such as the NCEP Unified Post Processing System or NCAR’s wrf-python package). However, other issues remain for packages like MetPy that rely on the Climate and Forecast (CF) Metadata Conventions to provide straightforward APIs for users. These include non-CF-compliant map projection metadata, dimensions that lack corresponding geometric coordinates, units that are not UDUNITS-compatible, and missing standard_name or long_name attributes.

Taking WRF-ARW compatibility as motivation, several “dataset helpers” have been implemented in MetPy. These include constructors for Coordinate Reference System (CRS) objects in xarray Datasets, coordinate parsers that reconstruct dimension coordinates from latitude/longitude arrays or domain grid parameters, and metadata mapping utilities. When combined with wrf-python or a suitable post-processor, these allow streamlined analysis of WRF-ARW output using MetPy’s calculations and plotting tools, with easy integration into numerous other libraries for purposes such as regridding, visualization, and verification. Several examples of such analyses, including some that take advantage of MetPy’s simplified plotting interface and of dask to handle large datasets, will be shown.

- Indicates paper has been withdrawn from meeting
- Indicates an Award Winner