# Presentation: 424089

## Robert Rozumalski 
National SOO Science and Training Resource CoordinatorNOAA/NWS/OCWWS/Training Division/FDTB

- National SOO Science and Training Resource CoordinatorNOAA/NWS/OCWWS/Training Division/FDTB

- Introduction to wrf_prep.pl

- SOO/STRC WRF Environmental Modeling System

## The WRF EMS Run-time Scripts

- The first of the three WRF EMS run-time scripts
- Handles the acquisition and processing of data sets for use as model initial and boundary conditions
- Supports multiple file formats including GRIB 1 and 2
- Supports the use of different data sets for initial and boundary conditions
- Allows for the inclusion of multiple static surface data sets, such as high resolution sea surface temperature (SST)

## The WRF EMS Run-time Scripts

- Supports the automated request and acquisition of GFS “personal tiles” from the STRC, NCEP and NCDC real-time data servers
- Supports data transfers via copy (NFS), FTP, and HTTP

- The wrf_prep.pl routine (cont’d)

## The WRF EMS Run-time Scripts

- Supports input files with up to 1-minute temporal frequency
- Determines which data sets from various model runs are available for ingestion at a given time
- Most of the default behavior is controlled by the “<dataset>_gribinfo.conf” files

- The wrf_prep.pl routine (cont’d)

## The WRF EMS Run-time Scripts

- Each file contains the default information on a specific data set used to initialize a model run
- Provides such information as:
- A general description of the data set
- The location of the initialization and method of acquisition (ftp, http, scp, cp)
- The file naming convention used on the remote and local servers
- The cycle and availability times for the data sets
- Default values for forecast length and boundary condition frequency
- Lots, lots more – Read the contents of a file for more information

- The <data set>_gribinfo.conf files

## The WRF EMS Run-time Scripts

- Use existing <data set>_gribinfo.conf file as a template
- Give it a unique name, E.g., quartogfs_gribinfo.conf
- Edit quartogfs_gribinfo.conf file to define the parameters for your new data set
- New server IDs must be defined in
- 		wrf/data/conf/config/wrf_prep/wrf_prep.conf

- Adding new initialization data sets

## The WRF EMS Run-time Scripts

- Determines the list of initialization and boundary condition files being requested by the user
- If not located in the local “grib” directory, it will attempt to acquire the requested data files from the specified source
- Unpacks the GRIB format initialization files
- Subsets the data into the user’s computational domain
- Horizontally interpolates the grids to the computational domain
- Vertically interpolates the grids to computational domain levels
- Outputs the files in netCDF format for use by the wrf_run.pl routine

## The WRF EMS Run-time Scripts

- % wrf_prep --help
- Displays the various command-line options and flags available
- % wrf_prep --guide <option>
- Displays much more detailed information of the user options

## The WRF EMS Run-time Scripts

- % wrf_prep --dslist
- Displays a summary of all the available initialization data sets
- % wrf_prep --query <data set>
- 	E.g.:
- 	% wrf_prep --query gfsgrb2
- Displays much more detailed information about a specific data set

## The WRF EMS Run-time Scripts

- % wrf_prep --dset gfs
- The --dset option is the only mandatory option
- All necessary information will be obtained from the gfs_gribinfo.conf file
- Defaults to current date and cycle of GFS data
- % wrf_prep --dset gfs --http
- Similar to (5) except use http to locate and download GFS files

- Usage:	% wrf_prep --dset <data set> [options ...]

**Notes:**
3. % wrf_prep –dset gfs

Following which wrf_prep will attempt to use the1.0 degree  GFS grid for model initialization and boundary conditions. In the absence of any other options, wrf_prep will default to the settings in the 
gfs_gribinfo.conf file.

The wrf_prep routine will use the default initial and final forecast hours (and thus the forecast length) and the boundary condition frequency defined in the gfs_gribinfo.conf file.

Because no method of acquisition is specified (nfs, ftp, or http), wrf_prep assumes that the initialization files already reside in the <domain>/grib directory and have the default naming convention specified 
by the LOCLFIL parameter.  

If you have placed your grib files in the <domain>/grib directory but wrf_prep fails to find them, the most likely problem is that you are not using the proper filenames. 
Look at the wrf_prep error messages for more information.

The wrf_prep routine will determine the most recent dataset available including the date (current) and cycle (00, 06, 12, or 18)

4. % wrf_prep –dset gfs --http

Wrf_prep will search for the data set on the available HTTP servers listed in the gfs_gribinfo.conf configuration file. The script will check each HTTP server listed (if more than one) 
for the requested files until all files have been downloaded to the local machine and renamed using the file naming convention defined in gfs_gribinfo.conf. All files are placed in 
the <domain>/grib directory.

## The WRF EMS Run-time Scripts

- Similar to (6) except obtain files from the most recent 12 UTC cycle of the operational GFS run
- All necessary information will be obtained from the gfs_gribinfo.conf file
- % wrf_prep --dset gfs --http --cycle 12 --date 20070231
- 	Similar to (7) except download data for 31 February 2007 rather than the current date

- Some more wrf_prep examples:

**Notes:**
3. % wrf_prep –dset gfs

Following which wrf_prep will attempt to use the1.0 degree  GFS grid for model initialization and boundary conditions. In the absence of any other options, wrf_prep will default to the settings in the 
gfs_gribinfo.conf file.

The wrf_prep routine will use the default initial and final forecast hours (and thus the forecast length) and the boundary condition frequency defined in the gfs_gribinfo.conf file.

Because no method of acquisition is specified (nfs, ftp, or http), wrf_prep assumes that the initialization files already reside in the <domain>/grib directory and have the default naming convention specified 
by the LOCLFIL parameter.  

If you have placed your grib files in the <domain>/grib directory but wrf_prep fails to find them, the most likely problem is that you are not using the proper filenames. 
Look at the wrf_prep error messages for more information.

4. % wrf_prep –dset gfs --http

Wrf_prep will search for the data set on the available HTTP servers listed in the gfs_gribinfo.conf configuration file. The script will check each HTTP server listed (if more than one) 
for the requested files until all files have been downloaded to the local machine and renamed using the file naming convention defined in gfs_gribinfo.conf. All files are placed in 
the <domain>/grib directory.

## The WRF EMS Run-time Scripts

- Similar to (7) except override the default settings and initialize the model for a 12 hour forecast
- % wrf_prep --dset gfs --http --cycle 12:00:12
- Just like (9) – Note the use of the --cycle arguments

- Some more wrf_prep examples:

**Notes:**
3. % wrf_prep –dset gfs

Following which wrf_prep will attempt to use the1.0 degree  GFS grid for model initialization and boundary conditions. In the absence of any other options, wrf_prep will default to the settings in the 
gfs_gribinfo.conf file.

The wrf_prep routine will use the default initial and final forecast hours (and thus the forecast length) and the boundary condition frequency defined in the gfs_gribinfo.conf file.

Because no method of acquisition is specified (nfs, ftp, or http), wrf_prep assumes that the initialization files already reside in the <domain>/grib directory and have the default naming convention specified 
by the LOCLFIL parameter.  

If you have placed your grib files in the <domain>/grib directory but wrf_prep fails to find them, the most likely problem is that you are not using the proper filenames. 
Look at the wrf_prep error messages for more information.

4. % wrf_prep –dset gfs --http

Wrf_prep will search for the data set on the available HTTP servers listed in the gfs_gribinfo.conf configuration file. The script will check each HTTP server listed (if more than one) 
for the requested files until all files have been downloaded to the local machine and renamed using the file naming convention defined in gfs_gribinfo.conf. All files are placed in 
the <domain>/grib directory.

## The WRF EMS Run-time Scripts

- Similar to (9) except initialize your run with the **06** hour forecast from the **12** UTC run of the GFS
- The final file used for initialization will be the **18** hour forecast, and thus the forecast length will be 12 hours (18 – **06**)
- The boundary condition update frequency will be every **06** hours
- % wrf_prep --dset gfs --http --cycle 12:06:18:**06** --length 24
- Just like (11) except that --length 24 overrides ALL other settings
- The forecast length will be 24 hours
- The boundary condition frequency will still be every **06** hours

- Some more wrf_prep examples:

**Notes:**
3. % wrf_prep –dset gfs

Following which wrf_prep will attempt to use the1.0 degree  GFS grid for model initialization and boundary conditions. In the absence of any other options, wrf_prep will default to the settings in the 
gfs_gribinfo.conf file.

The wrf_prep routine will use the default initial and final forecast hours (and thus the forecast length) and the boundary condition frequency defined in the gfs_gribinfo.conf file.

Because no method of acquisition is specified (nfs, ftp, or http), wrf_prep assumes that the initialization files already reside in the <domain>/grib directory and have the default naming convention specified 
by the LOCLFIL parameter.  

If you have placed your grib files in the <domain>/grib directory but wrf_prep fails to find them, the most likely problem is that you are not using the proper filenames. 
Look at the wrf_prep error messages for more information.

4. % wrf_prep –dset gfs --http

Wrf_prep will search for the data set on the available HTTP servers listed in the gfs_gribinfo.conf configuration file. The script will check each HTTP server listed (if more than one) 
for the requested files until all files have been downloaded to the local machine and renamed using the file naming convention defined in gfs_gribinfo.conf. All files are placed in 
the <domain>/grib directory.

## The WRF EMS Run-time Scripts

- Similar to (5) except initialize your run using the 0.5 degree GFS for the initial conditions and the 1.0 degree GFS for the boundary conditions
- % wrf_prep --dset gfsgrb2%gfs --sfcdset ssthr --sftp
- Just like (13) except also use the 1/12 degree high resolution SST dataset for model initialization
- Obtain the SST files via ftp (--sftp)

- Some more wrf_prep examples:

**Notes:**
3. % wrf_prep –dset gfs

Following which wrf_prep will attempt to use the1.0 degree  GFS grid for model initialization and boundary conditions. In the absence of any other options, wrf_prep will default to the settings in the 
gfs_gribinfo.conf file.

The wrf_prep routine will use the default initial and final forecast hours (and thus the forecast length) and the boundary condition frequency defined in the gfs_gribinfo.conf file.

Because no method of acquisition is specified (nfs, ftp, or http), wrf_prep assumes that the initialization files already reside in the <domain>/grib directory and have the default naming convention specified 
by the LOCLFIL parameter.  

If you have placed your grib files in the <domain>/grib directory but wrf_prep fails to find them, the most likely problem is that you are not using the proper filenames. 
Look at the wrf_prep error messages for more information.

4. % wrf_prep –dset gfs --http

Wrf_prep will search for the data set on the available HTTP servers listed in the gfs_gribinfo.conf configuration file. The script will check each HTTP server listed (if more than one) 
for the requested files until all files have been downloaded to the local machine and renamed using the file naming convention defined in gfs_gribinfo.conf. All files are placed in 
the <domain>/grib directory.

## The WRF EMS Run-time Scripts

- Similar to nothing
- Initialize your run using the 0.5 degree GFS for the initial conditions and the 1.0 degree GFS for the boundary conditions
- Use the current cycle **–cycle ****CYCLE****:****06****:****36**
- Initialize the model with the **06 hour forecast** from the current cycle
- Use the **36 hour forecast** as the last initialization hour, thus a 30 hour forecast
- locate the 0.5 degree GFS via http in the **/data/gfs/gfs.tCCz.pgrbfFF** directory on the **STRC** data server. The file naming convention is **gfs.tCCz.pgrbfFF**
- Obtain the **1.0 degree GFS via ftp** from the **NCEP** server

- One last Example:

**Notes:**
3. % wrf_prep –dset gfs

Following which wrf_prep will attempt to use the1.0 degree  GFS grid for model initialization and boundary conditions. In the absence of any other options, wrf_prep will default to the settings in the 
gfs_gribinfo.conf file.

The wrf_prep routine will use the default initial and final forecast hours (and thus the forecast length) and the boundary condition frequency defined in the gfs_gribinfo.conf file.

Because no method of acquisition is specified (nfs, ftp, or http), wrf_prep assumes that the initialization files already reside in the <domain>/grib directory and have the default naming convention specified 
by the LOCLFIL parameter.  

If you have placed your grib files in the <domain>/grib directory but wrf_prep fails to find them, the most likely problem is that you are not using the proper filenames. 
Look at the wrf_prep error messages for more information.

4. % wrf_prep –dset gfs --http

Wrf_prep will search for the data set on the available HTTP servers listed in the gfs_gribinfo.conf configuration file. The script will check each HTTP server listed (if more than one) 
for the requested files until all files have been downloaded to the local machine and renamed using the file naming convention defined in gfs_gribinfo.conf. All files are placed in 
the <domain>/grib directory.

## The End

- Introduction to wrf_prep.pl

- SOO/STRC WRF Environmental Modeling System