wrfout_to_cf.ncl - Overview

An NCL based script to create new CF based NetCDF files from native wrfout NetCDF files.

News and Announcements - 17 August 2021:

NCL v6.6.0 and new bug fix (v2.0.3): In using NCL v6.6.2 (and likely v6.6.0 and later) a totype warning occurs whenever one of the outPressure variables is created. This warning appears to be related to a new function: wrf_user_interp_level which among other things replaces wrf_user_intrp3d. It appears that as a part of the deprecation of wrf_user_intrp3d the error/bug involving totype was introduced. Because of the dichotomy with wrf_user_intrp3d with the warning issue in v6.6.2 and wrf_user_interp_level only availabe v6.6.0 and later, the fix is a bit of a hack in that it needs to be applied only to v6.6.0 and later using the get_ncl_version function. The wrfout_to_cf release v2.0.3 addresses this bug fix.

End of Life: As is likely known by now, the development of NCL has stopped with the release of v6.6.2. The reason for this stop to NCL development is for the pivot at NCAR towards python. NCL 6.6.2 is still intended to be around for a long time, and this script/program will be as well. However, similar to NCL, v2.0.3 is anticipated to be the last version of wrfout_to_cf. The plans are to port wrfout_to_cf to python but it is unknown when such a transition will occur.

The problem:

The native WRFOUT files are not the easiest NetCDF files to use.
      • The variables are based on WRF development history and not necessarily community acceptance.
      • Several of the key variables (i.e. u and v wind) are on the staggered WRF horizontal grid.
      • The vertical levels are on the native eta vertical coordinate.
      • A large number of variables are included in the WRFOUT files related to the WRF simulation and not the applicable science.
      • The associated NetCDF attributes may not be helpful.
      • The WRFOUT files can often be considerably larger than required for a research project, especially when building an archive of simulations for a study.
Modifying the Registry can change the variables included in the WRFOUT files.
      • It can be a tedious and potentially messy process to make significant modifications to the Registry.
      • Some variables are included in WRFOUT for reasons the user may never know.  Removing the variables may create unintended consequences.
      • The variables are still on the staggered grid and on the model vertical levels.

What it is - one solution:

wrfout_to_cf is an NCL based script designed to create CF compliant NetCDF files with user selectable variables, time reference, vertical levels, and spatial and temporal subsetting.

There are a number of WRF post-processing utilities to create output files and/or graphics for scientific use (e.g. NCEP UPP, RIP4, ARWpost, VAPOR).  wrfout_to_cf is just one solution to create post-processed WRF output files that are more convenient to work with on a research project.

This is not the most computationally efficient post-processing utility. This utility does not fit all applications. It is designed to be a simple and user flexible post-processing utility.

CF compliant (http://cf-pcmdi.llnl.gov/):

Climate and Forecast (CF) is a metadata convention designed to promote the sharing and utilization of similar NetCDF data files.  CF conventions have been adopted by a number of research projects and groups as a primary standard.  Some graphics programs (e.g. IDV) can readily read CF compliant NetCDF files.

The CF convention does not standardize variable names.  The selected variable names for this post-processing script are partially based on WRF conventions, consistency amongst the variables, a self-describing simple approach, and standardized meteorological variables.
The data in CF files are described by specifying standard attributes for the variables.

The variables contain coordinate information accessed through the coordinate attribute.

The time in encoded with units specified by a specified "time_unit" since a given "reference_time.
TimeUnits = "hours since 2001-01-01 00:00:00"

NCL Based (http://www.ncl.ucar.edu/):

NCL is a free interpreted language designed for scientific data processing and visualization.  NCL Is available for a variety of operating systems including Linux, Mac OS X, and Cygwin/X running on Windows.

wrfout_to_cf heavily leverages the WRF-ARW NCL scripts and functions that are included in the NCL libraries.  These built-in NCL functions include diagnostics and tools for unstaggering the grids and interpolating to pressure levels.

Overview Usage Variables Add a Variable Release Notes TO DO Download