page header
 
Running WRFDA-3DVAR - real data case

The goal of this session is to generate an updated WRF analysis and boundary conditions using WRFDA 3DVAR data assimilation.

Reference: Download the tutorial presentation

Source code

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

WRFDA/var/build/da_wrfvar_3dvar.exe and WRFDA/var/build/da_update_bc.exe are the executables that will be used in this session.

Create your working directory

You should create /kumquat/users/${USER}/DA/3dvar and use this as your working directory for this lesson.

mkdir /kumquat/users/${USER}/DA/3dvar
cd /kumquat/users/${USER}/DA/3dvar

Input data

A very basic namelist file for running the tutorial case is available at WRFDA/var/test/tutorial/namelist.input

cp /kumquat/users/${USER}/DA/WRFDA/var/test/tutorial/namelist.input .

A land-use table is needed as well (provided in the WRFDA package)

ln -fs /kumquat/users/${USER}/DA/WRFDA/run/LANDUSE.TBL ./LANDUSE.TBL

Besides namelist.input and LANDUSE.TBL, the other three major input files to WRFDA-3DVAR are observations (ob.ascii), background error statistics (be.dat), and first guess (fg).

  • ob.ascii is in plain-text format and is the output from OBSPROC that you created in the previous lesson.

    ln -fs /kumquat/users/${USER}/DA/obsproc/obs_gts_2008-02-05_12:00:00.3DVAR ./ob.ascii

  • be.dat is in binary format and is the output from gen_be utility. For this lesson, just use the supplied pre-generated be.dat

    ln -fs /kumquat/wrfhelp/DATA/WRFDA/CONUS60/be/be.dat ./be.dat

  • fg is the first guess (background) in netCDF format and can be either a "wrfinput" file from WPS/real.exe or a "wrfout" file from a WRF forecast.

    cp -p /kumquat/wrfhelp/DATA/WRFDA/CONUS60/rc/2008020512/wrfinput_d01 ./fg

Edit namelist.input

You should edit namelist.input to ensure the following namelist variables are consistent with the time and domain of your analysis target. For the tutorial case, these values should be correct, but it is always good practice to make sure.

vi namelist.input

&wrfvar18
analysis_date="2008-02-05_12:00:00",
/
&wrfvar21
time_window_min="2008-02-05_11:00:00",
/
&wrfvar22

time_window_max="2008-02-05_13:00:00",
/
&domains
e_we=90,
e_sn=60,
e_vert=41,
dx=60000,
dy=60000,
/

Run WRFDA-3DVAR (da_wrfvar.exe)

For convenience, link the executable to your current working directory. Then run the executable

ln -sf /kumquat/users/${USER}/DA/WRFDA/var/build/da_wrfvar_3dvar.exe ./da_wrfvar.exe

mpirun -np 4 ./da_wrfvar.exe

Running this case should take less than a minute on the classroom computers.

Check output

Does your rsl.out.0000 (log file) end with *** WRF-Var completed successfully ***?

Look for the file wrfvar_output in your working directory. This is the analysis file generated by WRFDA. It is in WRF netCDF format.

rsl.out.0000 and statistics are the two most important diagnostic files that should be checked after each WRFDA run to make sure that the task was done correctly and successfully.

gts_omb_oma_01 (contains information about observations and innovation), qcstat_conv_01 (contains information about quality control), and rej_obs_conv_01 (lists all conventional observations that were rejected) are other useful diagnostic files.
WRFDA/var/graphics/ncl/plot_gts_omb_oma.ncl can be used to plot the contents of gts_omb_oma_01.

WRFDA/var/graphics/ncl/plot_cost_grad_fn.ncl can be used to plot cost function evolution.

There are several tools available for viewing the analysis increments. A netCDF file containing the analysis increment fields can be created with either ncdiff or ncbo.

ncdiff fg wrfvar_output increment.nc

  or

ncbo -y sbt fg wrfvar_output increment.nc

The resulting increment file can be quickly viewed using ncview:

ncview increment.nc

To create plots rather than a raw difference file, WRFDA/var/graphics/ncl/WRF-Var_plot.ncl and WRFDA/var/graphics/ncl/WRF_contributed.ncl.test can be used:

cp /kumquat/users/${USER}/DA/WRFDA/var/graphics/ncl/WRF-Var_plot.ncl .
cp /kumquat/users/${USER}/DA/WRFDA/var/graphics/ncl/WRF_contributed.ncl.test .

Edit WRF-Var_plot.ncl to provide the filenames, level index, field name, and what plot_data to plot for your case.

vi WRF-Var_plot.ncl

......
first_guess = addfile("fg"+".nc", "r")
analysis = addfile("wrfvar_output"+".nc", "r")
......
kl = 18
var = "U"
fg = first_guess->U
an = analysis->U
plot_data = an - fg
; plot_data = an

Then run the ncl script

ncl WRF-Var_plot.ncl
display WRF-VAR_U_level_18.pdf

Other WRF graphic tools can be used as well.

The full list of namelist options, including those not specified by the user (and so were assigned default values), can be found in the namelist.output.da file.

Update WRF lateral boundary conditions

After creating an analysis, we have changed the initial conditions for the model. Therefore, the tendencies in the "wrfbdy" file should be adjusted based on these new initial conditions. This is done with da_update_bc.exe

Important: Make a copy of wrfbdy_d01 from this folder, do not simply link it. The wrf_bdy_file will be overwritten by da_update_bc.exe.

cp /kumquat/wrfhelp/DATA/WRFDA/CONUS60/rc/2008020512/wrfbdy_d01 ./wrfbdy_d01

Also, copy the sample da_update_bc namelist (parame.in) and make sure all the variables are set correctly for this experiment:

cp /kumquat/users/${USER}/DA/WRFDA/var/test/update_bc/parame.in .
vi parame.in

&control_param
da_file = './wrfvar_output'
da_file_02 = './ana02'
wrf_bdy_file = './wrfbdy_d01'
wrf_input = '/kumquat/wrfhelp/DATA/WRFDA/CONUS60/rc/2008020512/wrfinput_d01'
domain_id = 1
cycling = .false.
debug = .true.
low_bdy_only = .false.
update_lsm = .false.
var4d_lbc = .false.
/

Run da_update_bc.exe

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

Finally, check the output. Use diffwrf (available in compiled WRFV3 code at WRFV3/external/io_netcdf/diffwrf), ncdiff, ncview, or other WRF NCL graphic tools to check what fields have been updated.

The wrfvar_output and wrfbdy_d01 are the data-assimilated initial condition and tendency-updated boundary condition for your subsequent WRF model run.

If this was successful, you can continue to the next practice case.

Come back here later (or during Advanced Practice Session) for other advanced practices on running WRFDA-3DVAR with real data.

Advanced

  • Try modifying some of the namelist variables listed above (for example, setting a different analysis_date, setting a different e_we) and see what log messages you will get.

  • Try changing the time_window_min to be "2008-02-05_11:21:00" and compare the results with previous runs (Remember to check log and diagnostic files first).

  • Try running WRFDA using NCEP PREPBUFR data (/kumquat/wrfhelp/DATA/WRFDA/CONUS60/ob/2008020512/gdas1.t12z.prepbufr.nr.linux) as the observation input.

    ln -fs /kumquat/wrfhelp/DATA/WRFDA/CONUS60/ob/2008020512/gdas1.t12z.prepbufr.nr.linux ob.bufr

    vi namelist.input

    &wrfvar3
    ob_format=1
    /

  • Try running WRFDA with a different BE option (cv_options=3) using a pre-supplied be.dat available in the WRFDA package WRFDA/var/run/be.dat.cv3. Compare the results with previous cv_options=5 runs.

    ln -fs /kumquat/users/${USER}/DA/WRFDA/var/run/be.dat.cv3 ./be.dat

    vi namelist

    &wrfvar7
    cv_options = 3
    /

  • Try adding the following namelist settings and compare the results with previous runs (Remember to check log and diagnostic files first) .

    &wrfvar5
    max_error_t = 3.0
    max_error_uv = 3.0
    max_error_q = 3.0
    max_error_p = 3.0
    /


back to top
 
practical_page_header