UFS Short-Range Weather (SRW) Practical Session Guide | Session 2 > 1. Changing the Predefined Grid

Changing the Predefined Grid

Starting with the configuration file from Session 1, we will now generate a new experiment that runs a forecast on a CONUS domain with 3km nominal resolution (as opposed to the 25km from Session 1).  Since this is only for demonstration purposes, we will also decrease the forecast time from 48 hours to 6 hours.  The steps are as follows:

1.  For convenience, in your bash shell set SR_WX_APP_TOP_DIR to the path in which you cloned the UFS-SRW App, e.g.

SR_WX_APP_TOP_DIR="/path/to/your/ufs-srweather-app"

     Then set the following variables:

HOMErrfs="${SR_WX_APP_TOP_DIR}/regional_workflow"
USHDIR="$HOMErrfs/ush"

2.  Change location to USHDIR and make a backup copy of your config.sh from the Session 1 experiment:

cd $USHDIR
cp config.sh config.sh.session_1

3.  Edit config.sh as follows:

    a.  Change the name of the experiment directory (which is also the name of the experiment) to something that properly represents the new settings:

EXPT_SUBDIR="test_CONUS_3km_GFSv15p2"

    b.  Change the name of the predefined grid to the CONUS grid with 3km resolution:

PREDEF_GRID_NAME="RRFS_CONUS_3km"

    c.  Change the forecast length to 6 hours:

FCST_LEN_HRS="6"

4.  [OPTIONAL] In order to have cron automatically relaunch the workflow without the user having to edit the cron table, add the following lines to the end of (or anywhere in) config.sh:

USE_CRON_TO_RELAUNCH="TRUE"
CRON_RELAUNCH_INTVL_MNTS=03

During the experiment generation step below, these settings will create an entry in the user’s cron table to resubmit the workflow every 3 minutes until either all workflow tasks complete successfully or there is a failure in one of the tasks. (Recall that creation of this cron job was done manually in Session 1.)

5.  Generate a new experiment using this configuration file:

    a.  Ensure that the proper workflow environment is loaded:

source ../../env/wflow_cheyenne.env

    b.  Generate the workflow:

cd $USHDIR
./generate_FV3LAM_wflow.sh

     After this completes, for convenience, in your shell define the variable EXPTDIR to the directory of the experiment created by this script:

EXPT_SUBDIR="test_CONUS_3km_GFSv15p2"
EXPTDIR=${SR_WX_APP_TOP_DIR}/../expt_dirs/${EXPT_SUBDIR}

6.  If you did not include the parameters USE_CRON_TO_RELAUNCH and CRON_RELAUNCH_INTVL_MNTS in your config.sh (the optional step above), create a cron job to automatically relaunch the workflow as follows:

    a.  Open your cron table for editing

crontab -e

     This will open the cron table for editing (in vi).

    b.  Insert the following line at the end of the file:

*/3 * * * * cd /glade/scratch/user_name/.../my_expt_name && ./launch_FV3LAM_wflow.sh

The path to my_expt_name must be edited manually to match the value in EXPTDIR.

7.  Monitor the status of the workflow:

cd $EXPTDIR
rocotostat -w FV3LAM_wflow.xml -d FV3LAM_wflow.db -v 10

      Continue to monitor until all workflow tasks complete successfully.  Note that the status of the workflow will change only after every 3 minutes because the cron job to relaunch the workflow is called at this frequency.

      If you don’t want to wait 3 minutes for the cron job (e.g. because your workflow tasks complete in a much shorter time, which is the case for this experiment), you can relaunch the workflow and update its status yourself at any time by calling the launch_FV3LAM_wflow.sh script from your experiment directory and then checking the log file it appends to.  This is done as follows:

cd $EXPTDIR
./launch_FV3LAM_wflow.sh
tail -n 40 log.launch_FV3LAM_wflow

The launch_FV3LAM_wflow.sh script does the following:

  1. Issues the rocotorun command to update and relaunch the workflow from its previous state.
  2. Issues the rocotostat command (same as above) to obtain the table containing the status of the various workflow tasks.
  3. Checks the output of the rocotostat command for the string “FAILURE” that indicates that at least one task has failed.
  4. Appends the output of the rocotorun and rocotostat commands to a log file in $EXPTDIR named log.launch_FV3LAM_wflow.
  5. Counts the number of cycles that have completed successfully.

8.  Once all workflow tasks have successfully completed, plot and display the output using a procedure analogous to the one in Session 1 but modified for the shorter forecast time. The steps are:

  1. Purge all modules and load the one needed for the plotting:
    module purge
    module load ncarenv
    ncar_pylib /glade/p/ral/jntp/UFS_SRW_app/ncar_pylib/python_graphics
  2. Change location to where the python plotting scripts are located:
    cd $USHDIR/Python
  3. Call the plotting script. Since this takes some time, here we will plot only the 0th and 6th hour forecasts as follows:
    Note:  The following is a one-line command.
    python plot_allvars.py 2019061500 0 6 6 $EXPTDIR /glade/p/ral/jntp/UFS_SRW_app/tools/NaturalEarth
  4. This takes about 6 minutes to complete.  The plots (in png format) will be placed in the directory $EXPTDIR/2019061500/postprd.  If you wish, you can generate plots for all forecast hours by changing the second "6" in the call above to a "1", i.e.

    Note:  The following is a one-line command.
    python plot_allvars.py 2019061500 0 6 1 $EXPTDIR /glade/p/ral/jntp/UFS_SRW_app/tools/NaturalEarth
    Note:  If you have gone back and forth between experiments in this session, before issuing the python plotting command above, make sure that you have (re)defined EXPTDIR in your shell to the one for the correct experiment.  You can check its value using
    echo $EXPTDIR
  5. As the plots appear in that directory, if you have an X-windows server running on your local machine, you can display them as follows:
    cd $EXPTDIR/2019061500/postprd
    display name_of_file.png &

    where name_of_file.png should be replaced by the name of the file you’d like to display.