Chapter 14: UTILITY PROGRAMS

 

 

14.1 Purpose

 

A number of utility programs are available to users. These programs are intended to assist users to work with MM5 input and output data. These programs and program tar files may be found from NCAR's anonymous ftp site: ftp://ftp.ucar.edu/mesouser/MM5V3/Util, and NCAR SCD disk: /fs/othrorgs/home0/mesouser/MM5V3/Util.

 

 

14.2 Utility Programs

 

14.2.1 readv3.f

 

Function -

 

This utility reads all V3 MM5 output files, print out the header, partial sub-header, and a value from all fields in the dataset.

 

This program can be used as an essential component to build user's utility program for data processing and analysis.

 

How to Run It -

 

This program is written in free-formatted FORTRAN. To compile it on a Compaq machine:

 

f90 -free -convert big_endian readv3.f

 

To compile on a Linux machine, type

 

pgf90 -Mfreeform -pc 32 -byteswapio readv3.f

 

 

 

To compile on a SGI, type

 

f90 -freeform readv3.f

 

To run it, type

 

a.out v3-filename

 

 

14.2.2 ieeev3.csh

 

Function -

 

This script converts MM5 modeling system output data from Cray binary to standard IEEE data. It only runs on Crays (since it needs to read Cray data).

 

How to Run It -

 

Obtain the script from ~mesouser/MM5V3/Util on NCAR's IBM, or ftp://ftp.ucar.edu/mesouser/MM5V3/Util directory. To run it, type

 

ieeev3.csh v3-filename-in-Cray-format

 

It creates an IEEE file with the name v3-filename-in-Cray-format.ieee.

 

 

14.2.3 V2-to-V3 Converter

 

Function -

 

This utility converts all V2 modeling system output to that of V3, including boundary condition file. It is intended for users who have data in V2 format and would like to use them in V3 system.

 

How to Run It -

 

This program is written in free-formatted FORTRAN 90. The program is built with a main program and a few modules. To compile it, simply type `make', and two executables will be built: v22v3.exe and readv3.exe. To run it, type

 

v22v3.exe v2-filename

 

The file name for the converted file is v2-filename.v3. To convert V2's boundary condition file, one must convert both the boundary file and the mminput file that corresponds to the boundary file together. For example,

 

v22v3.exe mminput_domain1 bdyout_domain1

 

It will create three files for V3 named mminput_domain1.v3, bdyout_domain1.v3 and lowbdy.v3 (which is a new file in V3 containing the lower boundary condition fields such as substrate temperature and SST).

 

 

14.2.4 V3-to-V2 converter

 

Function -

 

This utility converts ONLY V3 MM5 model output to that of V2. This is intended for users to make a smooth transition until all utility programs a user has developed are converted for V3.

 

How to Run It -

 

This program is written in free-formatted FORTRAN 90, and built similarly as the program v22v3. To compile it, simply type `make', and it will build two executables: v32v2.exe, and readv2.exe. To run it, type

 

v32v2.exe v3-mm5-filename

 

It will create an output file named v3-mm5-filename.v2

 

 

14.2.5 Get Scripts

 

Function -

 

These job scripts may be used to obtain analysis data for REGRID from NCAR's data archive. It can be run on NCAR's IBM either interactively or in batch mode. One should also be able to run it on other NCAR/SCD machines which have access to MSS.

 

The available scripts are:

 

get_on84

NCEP GDAS data in ON84 format

(dss.ucar.edu/datasets/ds082.0)

get_ncep

NCEP GDAS data in GRIB format

(dss.ucar.edu/datasets/ds083.0)

get_fnl

NCEP Final Analysis data in GRIB format

(dss.ucar.edu/datasets/ds083.2)

get_nnrp

NCEP Global Reanalysis data in GRIB format

(dss.ucar.edu/datasets/ds090.0)

get_awip

NCEP Eta model data (the AWIP data, GRID 212)

(dss.ucar.edu/datasets/ds609.2)

get_era

ECMWF Reanalysis data

(dss.ucar.edu/datasets/ds115)

get_toga

ECMWF Toga data

(dss.ucar.edu/datasets/ds111.2)

 

 

How to Run It -

 

Obtain the script for the data you wish to download from ~mesouser/MM5V3/Util, and edit the dates at the top of the script to specify the times you are interested in, and run the script:

 

startdate

Start date from which data will be extracted, format YYYY-MM-DD+HH

ndates

Number of time periods (eg, if data is available in 12 hour intervals, ndates=3, will give you 24 hours of data, but if the data is available every 6 hours, ndates=3 will only give you 12 hours of data)

itimint

Interval of available data (default is the available time)

 

Once completed the extracted data will be available in:

 

/ptmp/$USER/REGRID/pregrid/nnrp (for NNRP data);

/ptmp/$USER/REGRID/pregrid/era (for ERA data);

/ptmp/$USER/REGRID/pregrid/grib_misc (for AWIP data);

etc.

 

 

14.2.6 Fetch

 

Function -

 

This job script may be used to obtain data for LITTLE_R and RAWINS from NCAR's data archive. It can be run on NCAR's IBM either interactively or in batch mode. One should also be able to run it on other NCAR/SCD machines which have access to MSS.

 

How to Use It -

 

This program is written in free-formatted FORTRAN 90, and built in a program tar file. To use it, get fetch-little_r-data.deck.ibm from ~mesouser/MM5V3/Util directory if a user wants to obtain data for LITTLE_R (fetch.deck is also in LITTLE_R/util directory in the program tar file), or get fetch-rawins-data.deck.ibm from the same directory if obtaining data for Rawins. Edit the deck to define starting and ending dates (starting_date and ending_date in the deck). Either type

 

fetch-little_r-data.deck.ibm

 

to run it interactively (in /ptmp/$USER), or type

 

llsubmit fetch-little_r-data.deck.ibm

 

to submit the deck to IBM as a batch job.

 

 

14.2.7 Cray-to-IBM Converters

 

Function -

 

There are 2 programs that will convert Cray bindary data to IEEE formatted data.

These programs must run on NCAR's IBM, since they require a special library.

 

cray2ibm.f

covert MM5 V3 output from Cray binary to IEEE formatted data

cray2ibm-intermediate.f

convert intermediate files (as produced by pregrid) from Cray binary to IEEE formatted data

 

How to Use It -

 

The programs can be obtained from NCAR's computer under the ~mesouser/MM5V3/Util directory. To compile on IBM, type

 

xlf90 -O -o cray2ibm.exe cray2ibm.f -L/usr/local/lib32/r8i4 -lncaru

 

OR

 

xlf90 -O -o cray2ibm.exe cray2ibm-intermediate.f -L/usr/local/lib32/r8i4 -lncaru

 

To run it, type

 

cray2ibm.exe filename

 

 

14.2.8 tovis5d

 

Function -

 

This utility converts MM5 V3 (and MM5 V2) σ-level data (MMINPUT_DOMAINx and MMOUT_DOMAINx) to the form Vis5D can accept. This program can also calculate some diagnostic fields selected by user with namelist option.

 

How to Run It -

 

The new version of tovis5d program is written in FORTRAN 90. The program tar file can be downloaded from ftp://ftp.ucar.edu/mesouser/MM5V3/Util/tovis5d.tar.gz. When it is uncompressed and untared, a directory TOVIS5D/ should be built. To compile the program, cd to TOVIS5D, type `make', which will return a list of make commands one can use. To compile on a Compaq Alpha machine, type `make dec'. If `make' is successful, the executable named tovis5d will be built and linked to the top directory. To select namelist options, edit tovis5d.csh. To run it, type

 

tovis5d.csh mm5-filename

 

It creates a file for Vis5D named vis5d.file. It will also create a log file named tovis5d.log. For detailed instructions, please read the README file inside the tar file.

 

 

 

14.2.9 MM5toGrADS

 

Function -

 

MM5toGrADS is a utility program for the MM5 modeling system that convert MM5 output to data that can be displayed with the GrADS software (which can be freely downloaded from http://grads.iges.org/grads). The advantage of this software is that it does not need any special libraries to run, and the user can create plots interactively. To be able to display the data, GrADS must be loaded on your system, and a user must have at least a basic understanding of the GrADS software.

 

Development of this software has primarily been done by George H Bryan from Pennsylvania State University. This software are been supported by mesouser since the beginning of 2002.

MM5toGrADS can plot output from most of the MM5 programs; TERRAIN_DOMAINx, REGRID_DOMAINx, LITTLE_R_DOMAINx, RAWINS_DOMAINx, MMINPUT_DOMAINx, LOWBDY_DOMAINx, and MMOUT_DOMAINx.

 

Namelist -

 

Table 14-1: MM5toGrADS namelist RECORD1

Namelist Variable

Description

TIMIN

First model output time that must be processed.

TIMAX

Last model output time to process.

Set this to -99 to get all times from TIMIN to the last time available in the input file.

NSKIP

Skip increment.

IFLINUX

If you need to byteswap data on your machine, set to 1.

IFMAP

Interpolate the map background

IFSFC

Set to 1 if only processing the surface data.

IFSKEW

Set to 0 if 3D fields are generated,

or to 1 if data from a single point is required.

ISKW

JSKW

The i and j point location if generating data for a single point only (case where IFSKEW=1)

ZTYPE

=1, data will be displayed on the native vertical coordinate of the dataset

=2, data will be interpolated to pressure levels (must also set plev)

plev

pressure levels to interpolate to (for ZTYPE=2)

 

RECORD10,11,12,13 are lists of switches to either plot ("1") or skip ("0") a specific variable.

 

How to Run It -

 

1) Obtain the source code tar file from one of the following places:

 

     Anonymous ftp:

     ftp://ftp.ucar.edu/mesouser/MM5V3/MM5toGrADS.TAR.gz

 

     On NCAR MSS:

     /MESOUSER/MM5V3/MM5toGrADS.TAR.gz

 

2) gunzip the file, untar it. A directory MM5toGrADS will be created. cd to MM5toGrADS.

 

3) Type `make' to create an executable for your platform.

 

4) Edit the namelist to set up the plotting parameters, and choose which fields must be processed.

 

5) Edit the mm5_to_grads.csh script to indicate input and output file names.

 

6) Create the graphics output by running the mm5_to_grads.csh script

     This will generate the grads .dat and .ctl files

 

7) View the output by invoking the GrADS software:

     Example: grads -l -c "open grads_output"

     (where grads_output, is the .ctl file created in step 6)