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:
<level>1. 2. 3. 4. 5.</level>
- 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)
- 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)
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:
This will create the new postxconfig-NT.txt text file necessary for outputting GRIB2 format, which will include all fields from the postcntrl.xml.