Control Files for GRIB2

Control Files for GRIB2 admin Fri, 03/01/2019 - 11:09

For outputting in GRIB2 format, a number of parameter files are utilized and can be found in the /UPPV4.1/parm/ directory:

  • post_avblflds.xml: parameter file listing all possible fields available for output in UPP
  • postcntrl.xml: sample configurable parameter file which declares which fields will be output from UPP
  • postxconfig-NT.txt: text file created from the postcntrl.xml that is read by unipost

For new users, the sample text file can be used to run UPP.

The following sections describe the configurable postcntrl.xml parameter file and the process for creating the postxconfig-NT.txt file required by unipost for outputting GRIB2 format.

Components of the post control xml

The header of the postcntrl.xml file contains a number of variables that specify the output file information, most of which will not need modification. The first variable is datset which defines the prefix used for the output file name (e.g. WRFPRS for WRF runs or GFSPRS for FV3 runs), and will be the only one described here.

The body of the postcntrl.xml file contains information for each variable similar to the following examples:

Example: 1

<param>
<shortname>PRES_ON_HYBRID_LVL</shortname>
<pname>PRES</pname>
<level>1. 2. 3. 4. 5.</level>
<scale>6.0</scale>
</param>

Where,

  • shortname declares the variable (e.g. PRES) and level type (e.g. ON_HYBRID_LVL)
  • pname is the standard GRIB2 abbreviation for that type of variable (e.g. PRES)
  • level lists the levels to output the variable on (e.g. hybrid levels 1. 2. 3. 4. 5.)
  • scale is the precision of the data written out to the GRIB2 file (e.g. a scale of 6)

Example 2:

<param>
<shortname>LFTX_ON_ISOBARIC_SFC_500-1000hpa</shortname>
<pname>LFTX</pname>
<table_info>NCEP</table_info>
<level>50000.</level>
<level2>100000.</level2>
<scale>3.0</scale>
</param>

Where,

  • shortname declares the variable (e.g. LFTX) and level type (e.g. ON_ISOBARIC_SFC_500-1000hpa)
  • pname is the standard GRIB2 abbreviation for that type of variable (e.g. LFTX)
  • table_info designates what table information to use if not standard (e.g. NCEP)
  • level lists the first level(s) of a layer, comma separated if outputting multiple layers (e.g. pressure level 50000. Pa)
  • level2 lists the second level(s) of a layer, comma separated if outputting multiple layers (e.g. pressure level 100000. Pa)
  • scale is the precision of the data written out to the GRIB2 file (e.g. a scale of 3)

arrow While the postcntrl.xml is not actually read directly by unipost, it is required for creating the postxconfig-NT.txt.

For those wishing to modify the postcntrl.xml file, please refer to How to control which GRIB2 variables and levels are output.

Creating the postxconfig text file

When outputting GRIB2 format, if any modifications have been made to the postcntrl.xml, a preprocessing step is required by the user to convert the postcntrl.xml to a flat text file postxconfig-NT.txt.

First, in order to ensure the xml files are error free, xml stylesheets are available to validate them and are located in the /UPPV4.1/parm/directory:

  • EMC_POST_CTRL_Schema.xsd: used to validate the postcntrl.xml
  • EMC_POST_Avblflds_Schema.xsd: used to validate the post_avblflds.xml

To run the validation, type:

     xmllint -noout --schema EMC_POST_CTRL_Schema.xsd postcntrl.xml
     xmllint -noout --schema EMC_POST_Avblflds_Schema.xsd post_avblflds.xml

Confirmation of validation will be given (e.g. postcntrl.xml validates) or will otherwise return errors.

Once the xmls are validated, the postxconfig-NT.txt file can be created. Edit the /UPPV4.1/parm/makefile so that it points to the correct directory locations. The makefile will call the perl program /UPPV4.1/parm/POSTXMLPreprocessor.pl to generate the new text file postxconfig-NT.txt.

To run the makefile, type:

     make

This will create the new postxconfig-NT.txt text file necessary for outputting GRIB2 format, which will include all fields from the postcntrl.xml.

GRIB2: Variable and level modifications

GRIB2: Variable and level modifications admin Wed, 03/06/2019 - 17:43

To output a field, the body of the postcntrl.xml file needs to contain an entry for the appropriate variable and include at least the shortname, pname, level, and scale, with additional tags as deemed necessary. If a field is not in your postcntrl.xml but it is available for output, you may simply copy that parameter from the post_avblflds.xml.

Controlling which levels unipost outputs

To modify which levels to output, the values in the level tag will need to be edited to reflect the desired output levels for that variable. If the variable is defined over a specific layer, then both the level (first level of the layer) and level2 (second level of the layer) tags will need to be edited.

The list below details which variables are available for output for a variety of fields.

  • For isobaric output, 47 levels are possible from 2 to 1000 hPa (2, 5, 7, 10, 20, 30, 50, 70 mb and then every 25 from 75 mb to 1000 mb). Modifications to which isobaric levels are possible can be made in /UPPV4.1/src/unipost/CTLBLK.f.
    • Modify the variable LSMDEF to change the number of pressure levels in your array (e.g. LSMDEF=47)
    • Modify the SPLDEF array to change the values of pressure levels, i.e. (/200.,500....97500.,100000./)
  • For model-level output, all model levels are possible, from the highest to lowest
  • For soil levels, layers or levels depend on your LSM:
    • Noah LSM soil layers are 0-10, 10-40, 40-100, and 100-200 cm.
    • RUC LSM soil levels are 0, 1, 4, 10, 30, 60, 100, 160, and 300 cm. For the RUC LSM, it is necessary to turn on 5 additional levels in the wrf_cntrl.parm to output 9 instead of 4. (For the old RUC LSM, there are only 6 layers, and if using this, you will need to change RUC LSM from 9 to 6 in the WRFPOST.f routine).
    • Pliem-Xiu LSM layers are 0-1 and 1-100 cm.
  • For low, mid, and high cloud layers, the layers are ≥642 hPa, ≥350 hPa, and <350 hPa, respectively.
  • For PBL layer averages, the levels correspond to 6 layers with a thickness of 30 hPa each.
  • For flight levels, the levels are 30, 50, 80, 100, 305, 457, 610, 914, 1524, 1829, 2134, 2743, 3658, 4572, 6000 and 7010 m.
  • For AGL radar reflectivity, the levels are 4000 and 1000 m.
  • For surface or shelter-level output, specify the surface level for the particular variable. 

For a list of available fields for GRIB2, see the GRIB2 Table