page header
 
Running gen_be utility

The goal of this session is to generate the background error statistics file (i.e. the B0 shown in the WRFDA flowchart) for running WRFDA.

Reference: Download the tutorial presentation

Source code

Get the pre-compiled code, if you have not done so.

WRFDA/var/scripts/gen_be/gen_be_wrapper.ksh is the main script that will be used in this practice.

GEN_BE consists of several stages. Quite a few executables and scripts are used for the process. They are listed below for reference. These executables and scripts will be called subsequently by gen_be_wrapper.ksh:

WRFDA/var/scripts/gen_be/gen_be.ksh
WRFDA/var/scripts/gen_be/gen_be_stage0_wrf.ksh
WRFDA/var/scripts/gen_be/gen_be_stage4_regional.ksh
WRFDA/var/scripts/gen_be/gen_be_cov2d.ksh
WRFDA/var/scripts/gen_be/gen_be_cov3d.ksh
WRFDA/var/build/gen_be_stage0_wrf.exe
WRFDA/var/build/gen_be_stage1.exe
WRFDA/var/build/gen_be_stage2.exe
WRFDA/var/build/gen_be_stage2a.exe
WRFDA/var/build/gen_be_stage3.exe
WRFDA/var/build/gen_be_stage4_regional.exe
WRFDA/var/build/gen_be_diags_read.exe
WRFDA/var/build/gen_be_diags.exe
WRFDA/var/build/gen_be_cov2d.exe
WRFDA/var/build/gen_be_cov3d.exe

Choice of your working directory

For this exercise you should create /kumquat/users/${USER}/DA/gen_be and use this as your working directory for this session.

mkdir /kumquat/users/${USER}/DA/gen_be
cd /kumquat/users/${USER}/DA/gen_be

Edit gen_be_wrapper.ksh

Copy gen_be_wrapper.ksh to your working directory

cp /kumquat/users/${USER}/DA/WRFDA/var/scripts/gen_be/gen_be_wrapper.ksh .

Pay special attention to the following settings and make necessary modifications for your case and directories:

vi gen_be_wrapper.ksh

......
export WRFVAR_DIR=/kumquat/users/${USER}/DA/WRFDA
......
export START_DATE = 2008020612   # the first perturbation valid date
export END_DATE = 2008020700 # the last perturbation valid date
export NUM_LEVELS = 40 # e_vert -1
export BIN_TYPE = 5
export FC_DIR = /kumquat/wrfhelp/DATA/WRFDA/CONUS60/fc
export RUN_DIR =/kumquat/users/${USER}/DA/gen_be
export DOMAIN = 01
export FCST_RANGE = 24
export FCST_RANGE = 12
export INTERVAL = 12
export STRIDE = 1

FC_DIR specifies the directory where the WRF forecast files (wrfout*) reside. Observe the directory structure and how the wrfout files are stored. To generate your own BE file for your own case and domain in the future, you will need to prepare and arrange your wrfout files in the same way (for example, 2008020512/wrfout_d01_2008-02-06_12:00:00; 2008020512 is the initial time, wrfout_d01_2008-02-06_12:00:00 is the 24-hour forecast valid at 2008020612).

Run gen_be_wrapper.ksh

./gen_be_wrapper.ksh >& gen_be.log

Check output

View the log file (gen_be.log) to ensure that all stages (stage0_wrf, stage1, stage2, stage2a, stage3, stage4, gen_be_cov2d) have been run successfully.

Sun Jul 27 20:49:50 MDT 2014 Start
WRFVAR_DIR is /kumquat/users/class01/DA/WRFDA exported
RUN_DIR is /kumquat/users/class01/DA/gen_be
---------------------------------------------------------------
Run Stage 0: Calculate ensemble perturbations from model forecasts.
---------------------------------------------------------------
Beginning CPU time: Sun Jul 27 20:49:50 MDT 2014
gen_be_stage0_wrf: Calculating standard perturbation fields valid at time 2008020612
2008020512 /kumquat/wrfhelp/DATA/WRFDA/CONUS60/fc/2008020512/wrfout_d01_2008-02-06_12:00:00 /kumquat/wrfhelp/DATA/WRFDA/CONUS60/fc/2008020600/wrfout_d01_2008-02-06_12:00:00
gen_be_stage0_wrf: Calculating standard perturbation fields valid at time 2008020700
2008020600 /kumquat/wrfhelp/DATA/WRFDA/CONUS60/fc/2008020600/wrfout_d01_2008-02-07_00:00:00 /kumquat/wrfhelp/DATA/WRFDA/CONUS60/fc/2008020612/wrfout_d01_2008-02-07_00:00:00
Ending CPU time: Sun Jul 27 20:49:53 MDT 2014
---------------------------------------------------------------
Run Stage 1: Read standard fields, and remove time/ensemble/area mean.
---------------------------------------------------------------
Beginning CPU time: Sun Jul 27 20:49:53 MDT 2014
Ending CPU time: Sun Jul 27 20:49:54 MDT 2014
---------------------------------------------------------------
Run Stage 2: Calculate regression coefficients.
---------------------------------------------------------------
Beginning CPU time: Sun Jul 27 20:49:54 MDT 2014
Ending CPU time: Sun Jul 27 20:49:54 MDT 2014
---------------------------------------------------------------
Run Stage 2a: Calculate control variable fields.
---------------------------------------------------------------
Beginning CPU time: Sun Jul 27 20:49:54 MDT 2014
Ending CPU time: Sun Jul 27 20:49:54 MDT 2014
---------------------------------------------------------------
Run Stage 3: Read 3D control variable fields, and calculate vertical covariances.
---------------------------------------------------------------
Beginning CPU time: Sun Jul 27 20:49:54 MDT 2014
Ending CPU time: Sun Jul 27 20:49:57 MDT 2014
---------------------------------------------------------------
Run Stage 4: Calculate horizontal covariances (regional lengthscales).
---------------------------------------------------------------
Beginning CPU time: Sun Jul 27 20:49:57 MDT 2014
Ending CPU time: Sun Jul 27 20:50:11 MDT 2014
Ending CPU time: Sun Jul 27 20:50:11 MDT 2014
---------------------------------------------------------------
Run gen_be_cov2d.
---------------------------------------------------------------

Sun Jul 27 20:50:12 MDT 2014 Finished

 

Look for be.dat in the ${RUN_DIR} you specified in your gen_be_wrapper.ksh. be.dat is the background error file which can now be used to run WRFDA.

If be.dat has not been created, check the log files for each gen_be stage (found in ${RUN_DIR}) to find the error.

The fort.* files under the directory $RUN_DIR/working are the files to be read by the graphics tools mentioned below.

Graphics

WRFDA/var/scripts/gen_be/gen_be_plot_wrapper.ksh is the main plotting script which calls other NCL scripts located in WRFDA/var/graphics/ncl/gen_be.

cp /kumquat/users/${USER}/DA/WRFDA/var/scripts/gen_be/gen_be_plot_wrapper.ksh .

Edit gen_be_plot_wrapper.ksh to provide proper settings.

vi gen_be_plot_wrapper.ksh

......
export WRFVAR_DIR=/kumquat/wrfhelp/SOURCE_CODE/WRFDA/WRFDA
export GEN_BE_PLOT=${WRFVAR_DIR}/var/graphics/ncl/gen_be
export GRAPHIC_WORKS=pdf

export NUM_WE=89 # 1 point less than stagger points 90
export NUM_SN=59 # 1 point less than stagger points 60
export NUM_LEVELS=40 # 1 point less than stagger points 41
export RESOLUTION=60.0 # km
export REGION=tutorial # only for naming output purpose
export BE_DIR=/kumquat/users/${USER}/DA/gen_be/working
export BE_NROW=$NUM_LEVELS

./gen_be_plot_wrapper.ksh

Look for gen_be_*.pdf and display each of them.

Other practice

If this was successful, continue to try more single ob tests using the be.dat you have created.

 


back to top
 
practical_page_header