page header
 
Hybrid data assimilation

Reference: Download the tutorial presentation

Source code

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

WRFDA/var/build/gen_be_ensmean.exe
WRFDA/var/build/gen_be_ep2.exe
WRFDA/var/build/da_wrfvar.exe
are the three executables that will be used in this session.

Choice of your working directory

We recommend running each session in a separate directory, so that it will be easier to check for the necessary input files and look for what output files are created after a successful run.

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

Input data

The hybrid case is different from other practice cases.

The procedure is the same as Running WRFDA-3DVAR except for some more input files and namelist.input settings.

In addition to the basic input files (LANDUSE.TBL, ob.ascii, be.dat) that you should have been familiar with by now, an ensemble mean (which will be the fg for the hybrid application) and ensemble perturbations are the extra required input files.

  • ensemble mean

    Usually, the first step of hybrid data assimilation is to prepare a set of ensembles.
    For this practice, a set of 10-member ensemble forecasts is provided under /kumquat/wrfhelp/DATA/WRFDA/Hybrid/fc directory.

    Hybrid/fc/2006102712/
    -rw-r--r-- 1 wrfhelp nobody 36059392 Aug 11 2015 wrfout_d01_2006-10-28_00:00:00.e001
    -rw-r--r-- 1 wrfhelp nobody 36059392 Aug 11 2015 wrfout_d01_2006-10-28_00:00:00.e002
    -rw-r--r-- 1 wrfhelp nobody 36059392 Aug 11 2015 wrfout_d01_2006-10-28_00:00:00.e003
    -rw-r--r-- 1 wrfhelp nobody 36059392 Aug 11 2015 wrfout_d01_2006-10-28_00:00:00.e004
    -rw-r--r-- 1 wrfhelp nobody 36059392 Aug 11 2015 wrfout_d01_2006-10-28_00:00:00.e005
    -rw-r--r-- 1 wrfhelp nobody 36059392 Aug 11 2015 wrfout_d01_2006-10-28_00:00:00.e006
    -rw-r--r-- 1 wrfhelp nobody 36059392 Aug 11 2015 wrfout_d01_2006-10-28_00:00:00.e007
    -rw-r--r-- 1 wrfhelp nobody 36059392 Aug 11 2015 wrfout_d01_2006-10-28_00:00:00.e008
    -rw-r--r-- 1 wrfhelp nobody 36059392 Aug 11 2015 wrfout_d01_2006-10-28_00:00:00.e009
    -rw-r--r-- 1 wrfhelp nobody 36059392 Aug 11 2015 wrfout_d01_2006-10-28_00:00:00.e010
    -rw-r--r-- 1 wrfhelp nobody 36059392 Aug 11 2015 wrfout_d01_2006-10-28_00:00:00.mean
    -rw-r--r-- 1 wrfhelp nobody 36059392 Aug 11 2015 wrfout_d01_2006-10-28_00:00:00.vari

    2006102712/wrfout_d01_2006-10-28_00:00:00.e* are ensemble forecasts valid at 2006102800 initialized at 2006102712.

    wrfout_d01_2006-10-28_00:00:00.mean and wrfout_d01_2006-10-28_00:00:00.vari are two template files that will be overwritten by a program that calculates ensemble mean from ensemble forecasts.

    • Copy ensemble forecasts and template files to your working directory.

    cp -r /kumquat/wrfhelp/DATA/WRFDA/Hybrid/fc/2006102712 .

    • Edit gen_be_ensmean_nl.nl (or copy it from /kumquat/wrfhelp/DATA/WRFDA/Hybrid/gen_be_ensmean_nl.nl)

    vi gen_be_ensmean_nl.nl

    &gen_be_ensmean_nl
    directory = './2006102712'
    filename = 'wrfout_d01_2006-10-28_00:00:00'
    num_members = 10
    nv = 7
    cv = 'U', 'V', 'W', 'PH', 'T', 'MU', 'QVAPOR'
    /

    • Run gen_be_ensmean.exe

    /kumquat/users/${USER}/DA/WRFDA/var/build/gen_be_ensmean.exe

    • Check output

    2006102712/wrfout_d01_2006-10-28_00:00:00.mean is the ensemble mean

2006102712/wrfout_d01_2006-10-28_00:00:00.vari is the ensemble variance

You may use the NCL script /kumquat/wrfhelp/DATA/WRFDA/Hybrid/ncl/ens_mean_std_dev.ncl to make some plots.

cp /kumquat/wrfhelp/DATA/WRFDA/Hybrid/ncl/ens_mean_std_dev.ncl .
cp /kumquat/wrfhelp/DATA/WRFDA/Hybrid/ncl/WRF_contributed.ncl.test .

Edit ens_mean_std_dev.ncl to set the proper date and path path

dir = "/kumquat/users/$USER/DA/hybrid/" + date + "/"

ncl ens_mean_std_dev.ncl
display mean_std_dev.pdf

This script displays the mean and standard deviation for the ensemble at a single level for a single variable. You can change the level and variable by changing these lines a bit further down in the script:

var = "U"
kl = 24

V, W, T, P, and QVAPOR are some other interesting fields to look at.

  • ensemble perturbations
    • This step will extract the ensemble perturbations from the existing ensemble wrfout files provided for you. Create another sub-directory where you will be working for this step.

    cd /kumquat/users/${USER}/DA/hybrid

    mkdir -p 2006102800/ep

    cd 2006102800/ep

  • Run gen_be_ep2.exe

gen_be_ep2.exe requires 4 command arguments (DATE, NUM_MEMBER, DIRECTORY, FILENAME) as defined below:

/kumquat/users/${USER}/DA/WRFDA/var/build/gen_be_ep2.exe 2006102800 10 ../../2006102712 wrfout_d01_2006-10-28_00:00:00

  • Check the output files generated by gen_be_ep2.exe

A list of binary files will be created under 2006102800/ep directory. Among them, tmp.e* are temporary scratch files that can be removed.

You may use the NCL script /kumquat/wrfhelp/DATA/WRFDA/Hybrid/ncl/ens_perturbations.ncl to make some plots.

cp /kumquat/wrfhelp/DATA/WRFDA/Hybrid/ncl/ens_perturbations.ncl .
cp /kumquat/wrfhelp/DATA/WRFDA/Hybrid/ncl/WRF_contributed.ncl.test .

Edit ens_perturbations.ncl to set the proper date and path.

directory = "/kumquat/users/$USER/DA/hybrid/" + date

ncl ens_perturbations.ncl
display ens_perturbations.pdf

Again, you can modify the script to look at different vertical levels and variables by changing these settings:

var = "U"
kl = 32

Depending on what variable you display, you may have to change the color contour settings "cont_min", "cont_max", and "cont_spacing" as well to get a nice-looking plot.

Run WRFDA in hybrid mode

cd /kumquat/users/${USER}/DA/hybrid

ln -fs 2006102800/ep ./ep # ensemble perturbation files should be under the ep subdirectory

ln -fs 2006102712/wrfout_d01_2006-10-28_00:00:00.mean ./fg # first guess is an ensemble forecast mean

ln -fs /kumquat/users/${USER}/DA/WRFDA/run/LANDUSE.TBL .
ln -fs /kumquat/wrfhelp/DATA/WRFDA/Hybrid/ob/2006102800/ob.ascii ./ob.ascii
ln -fs /kumquat/wrfhelp/DATA/WRFDA/Hybrid/be/be.dat ./be.dat

Edit namelist.input (a sample file is provided as /kumquat/wrfhelp/DATA/WRFDA/Hybrid/namelist.input)

cp /kumquat/wrfhelp/DATA/WRFDA/Hybrid/namelist.input .

vi namelist.input

Pay special attention to the following hybrid-related settings:

&wrfvar7
je_factor = 2.0
/
&wrfvar16
ensdim_alpha = 10
# hybrid mode is activated when ensdim_alpha is larger than zero.
alphacv_method = 2
alpha_corr_scale = 500.0
/

mpirun -np 6 /kumquat/users/${USER}/DA/WRFDA/var/build/da_wrfvar.exe

View the different output files to see how they differ from a 3DVAR assimilation run. For example, in cost_fn and grad_fn, you will see the ensemble terms of the cost function and gradient, respectively.

Other practice

Do a pseudo-single obs test (PSOT) like we learned in a previous exercise. Edit the following namelist options to run the test:

&wrfvar15
num_pseudo = 1,
pseudo_x = 50.0,
pseudo_y = 50.0,
pseudo_z = 10.0,
pseudo_err = 1.0,
pseudo_val = 1.0,
/
. . .
&wrfvar19
pseudo_var = 'u'
/

mpirun -np 1 /kumquat/users/${USER}/DA/WRFDA/var/build/da_wrfvar.exe

ncdiff -v U,V,T,QVAPOR,MU,P,PSFC wrfvar_output fg increment.nc
ncview increment.nc

To the right you can see what the lowest level pressure perturbation should look like. Notice the differences from the basic 3dvar case due to the BE contribution from the ensemble.

Pressure perturbation from PSOT with the above settings.

 

Try different settings like the ones below, then run a PSOT to see how they influence the background error statistics.

Ensemble covariance weighting factor (je): try
je_factor = 10.0 (jb = je_factor/(je_factor - 1), so jb = 1.11 in this example)
je_factor = 1.25 (jb = 5)
je_factor = 1.1 (jb = 11)

Hybrid covariance localization scale (alpha_corr_scale): try
alpha_corr_scale = 200.0
alpha_corr_scale = 1500.0

Try setting ensdim_alpha = 0, and compare the results.

You have now completed the WRFDA hybrid assimilation tutorial. You can now move on to the next exercise.

 


back to top
 
practice_page_header