The Basics for Running WPS and WRF ================================== | The following shows the full model program flow for a real-data WRF model simualation. | .. image:: ../../images/basics_program_flow.png | | External Data Sources --------------------- * **Static Geographical Data** : Earth's geographical fields for topography, albedo, landuse, etc. These files are mandatory for running the WPS geogrid program. `Obtain these files from Geographic Static Data for the WPS`_. * **Gridded Meteorological Data** : Meteorological 3d and surface GRIB-formatted data to be used as input to WRF. This is necessary for the ungrib program. `See some options for obtaining input meteorological data`_. | | WPS --- The following three executables are used for WRF preprocessing. Details about each program are below. * **geogrid.exe** : program that defines the model domain and creates terrestrial data from static geographic data * **ungrib.exe** : program that unpacks GRIB-formatted meteorological data and packs it into the intermediate file format expected by the metgrid program * **metgrid.exe** : interpolates the meteorological data horizontally onto the model domain. Output from metgrid.exe is used as input to WRF (through the real.exe program) | .. note:: Within each section below are steps to follow when running each process. These are an abridged version for the purpose of explaining the process. **There is no need to follow the steps yet.** Full case study exercises are provided later. | | Geogrid +++++++ The purpose of the geogrid program is to define the simulation domain(s), and interpolate various terrestrial data sets to the model grids. Simulation domain(s) are defined using information specified by the user in the *&share* and *&geogrid* records in the WPS namelist (*namelist.wps* - available in the top-level WPS directory). In addition to computing latitude and longitude for every grid point, geogrid interpolates soil categories, land use category, terrain height, deep-soil temperature, vegetation fraction, albedo, snow albedo, slope category, and more to the model grids. | Basic Steps to Run Geogrid ************************** After step 1 below, move into the *WPS* directory for the remaining steps. #. `Download the geographic static fields`_ and place them in a unique location. #. Edit the *&share* and *&geogrid* namelist.wps records for the particular domain set-up. #. Run geogrid.exe Geogrid output files are in the format of *geo_em.dxx.nc*, where *xx* indicates the domain number. There will be one file available per domain. The file *geogrid.log* provides the logged information about the geogrid run. | .. tip:: Use the *plotgrids_new.ncl* script to ensure the domain is set up properly. This program requires an installation of NCL, as well as x-forwarding for a pop-up window on the screen. From the WPS/ directory, issue ``ncl util/plotgrids_new.ncl``. | | Ungrib ++++++ The purpose of the ungrib program is to unpack Grib-formatted (GRIB1 and GRIB2) meteorological data and convert it into an intermediate file format that is expected by the metgrid program. Unpacking the data is controlled via the *&share* and *&ungrib* namelist.wps records. The ungrib program * is not dependent on the model domain(s). * is not dependent on the geogrid program. * does not cut down the data according to model domain specifications - it simply unpacks the required fields and writes them out into a format that the metgrid program can read. * makes use of Vtables (see sample Vtables in the *WPS/ungrib/Variable_Tables/* directory) to specify which fields to unpack from the GRIB files. Vtables list the fields and their GRIB codes that must be unpacked from the GRIB files. | .. note:: If input data files are in a format other than GRIB, the data must be converted to the intermediate format and the ungrib program will not be used. `See Writing Meteorological Data to the Intermediate Format`_. Additionally, try searching scripting options available from previous posts to the `WRF & MPAS-A User Support Forum`_. After creating intermediate files manually, it is recommended to check the files with the *WPS/util/rd_intermediate.exe* utility. | Basic Steps to Run Ungrib ************************* After step 1 below, move into the *WPS* directory for the remaining steps. #. Download meteorological input data and place it in a unique directory (to keep organized). *Note that input files are needed for the entire planned simulation time*. #. Link the correct Vtable from the *ungrib/Variable_Tables* directory, to the *WPS* directory, with the generic name "Vtable," which is the file name expected by the ungrib program. For e.g., if using GFS data, use the following command: | .. code-block:: ln -sf ungrib/Variable_Tables/Vtable.GFS Vtable #. Use the *link_grib.csh* script (available in the top-level *WPS* directory) to link the Grib-formatted data to the *WPS* directory. | .. code-block:: ./link_grib.csh path-to-data-files/data-file-prefix *Note there is no need to provide a "." at the end of the command, as this is built into the script. Only a data file prefix is needed. Make sure to link the specific files in, and not just the directory that holds them.* #. Edit the *&share* and *&ungrib* namelist.wps records - specifically *start_date* and *end_date*, *interval_seconds*, and *prefix*. *Note that it is optional to modify the value of "FILE" for "prefix." It may help if wanting to prevent saved files from being overwritten.* #. Run ungrib.exe Ungrib output files are in the format of *FILE:YYYY-MM-DD_hh* - one for each time. | .. note:: Although Vtables are provided for many common data sets, it is not impossible for ungrib to anticipate every possible source of meteorological data in GRIB format. When a new source of data is to be processed by ungrib, the user may create a new Vtable, either from scratch, or by using an existing Vtable as a template. Basic knowledge of the meaning and use of the various fields in the Vtable will be helpful. Ensure the Vtable includes all `required input for running WRF`_ | | Metgrid +++++++ The purpose of metgrid is to horizontally interpolate the meteorological data onto the model domain. Output from metgrid.exe is used as input to WRF. The simulation domain(s) are defined using information specified by the user in the *&share* and *&metgrid* namelist records in namelist.wps. | Basic Steps to Run Metgrid ************************** Input to the metgrid program are both the *geo_em.dxx.nc*, and the *FILE:YYYY-MM-DD_hh* files from the geogrid and ungrib programs. Make sure to be in the *WPS* directory for the following steps. #. Edit the *&share* and *&metgrid* namelist.wps records. #. Run metgrid.exe Output files from the metgrid program are in the format *met_em.dxx.YYYY-MM-DD_hh:00:00.nc* - one file per time, per domain (*dxx* represents the domain number). | | .. seealso:: `See namelist.wps Best Practices`_ for details and recommendations for WPS namelist parameter settings. | | | WRF --- The following two executables are used in the WRF process. * **real.exe** : program that vertically interpolates the data onto the model coordinates * **wrf.exe** : program that generates the model forecast and output All user settings can be applied to *namelist.input* (available in the *WRF/test/em_real* directory). | | Real ++++ | Basic Steps to Run Real *********************** #. Move into the *WRF/test/em_real* directory. #. Link in the *met_em* files from WPS, as these are the input used for the real program. | .. code-block:: ln -sf path-to-wps-directory/met_em* . #. Edit *namelist.input* for the specific domain set-up, timing information, and additional options. `See namelist.input Best Practices`_ for details and recommendations for namelist parameter settings. #. Run real.exe. If this runs successfully, the output should be a *wrfinput_d0x* files - one for each domain, and a *wrfbdy_d01* file - only for domain 01. | | WRF +++ | Basic Steps to Run WRF ********************** #. Run wrf.exe. If this is succesful, the output files should be in the format *wrfout_d0x_YYYY-MM-DD_hh:mm:ss* for each time and each domain. | .. seealso:: Find detailed information on the above programs in the `WRF Users' Guide`_. | | .. rst-class:: horizbuttons-next-m :align: right * `Next: Tutorial Exercises -->`_ .. _`Obtain these files from Geographic Static Data for the WPS`: https://www2.mmm.ucar.edu/wrf/site/access_code/geog_data.html .. _`See some options for obtaining input meteorological data`: https://www2.mmm.ucar.edu/wrf/site/access_code/input_data.html .. _`WRF Users' Guide`: https://www2.mmm.ucar.edu/wrf/users/wrf_users_guide/index.html .. _`required input for running WRF`: https://www2.mmm.ucar.edu/wrf/users/wrf_users_guide/wps.html#required-input-for-running-wrf .. _`Download the geographic static fields`: https://www2.mmm.ucar.edu/wrf/site/access_code/geog_data.html .. _`See namelist.wps Best Practices`: ../../documentation/namelist.wps_best_practices.html .. _`See namelist.input Best Practices`: ../../documentation/namelist.input_best_practices.html .. _`See Writing Meteorological Data to the Intermediate Format`: https://www2.mmm.ucar.edu/wrf/users/wrf_users_guide/wps.html#writing-meteorological-data-to-the-intermediate-format .. _`WRF & MPAS-A User Support Forum`: https://forum.mmm.ucar.edu/ .. _`Next: Tutorial Exercises -->`: ./exercises.html