page header
 
Running WRFDA-3Dvar - real data case

The goal of this session is to generate a data-assimilated updated WRF analysis and boundary conditions.

Reference: Download the tutorial presentation

Source code

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

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

Choose your working directory

For this exercise you should create /data1/${USER}/DA/3dvar and use this as your working directory for this session. Alternatively, WRFDA/var/test/tutorial can be used as your working directory, but we do not recommend it for these practice cases.

mkdir /data1/${USER}/DA/3dvar
cd /data1/${USER}/DA/3dvar (or other your choice of working directory)

Input data

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

cp ${your_source_code_dir}/WRFDA/var/test/tutorial/namelist.input .

A LANDUSE.TBL file is needed as well

ln -fs ${your_source_code_dir}/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.

    ln -fs ${your_obsproc_working_dir}/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. (generating your own be.dat will be discussed in the day-2 class. For today's session, just use the pre-supplied be.dat)

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

  • fg is in netCDF format and can be either from WPS/real or from wrf forecast.

    cp -p /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.

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,
/
&physics
(make sure the physics options here are consistent with those in the first guess file, fg. Use ncdump -h fg to look for the options listed in the global attributes.)
......
mp_physics=3
sf_surface_physics=1
num_soil_layers=5
......
/

Run WRFDA-3DVAR (da_wrfvar.exe)

mpirun -np 4 -machinefile ~/mach ${your_source_code_dir}/WRFDA/var/build/da_wrfvar.exe_3dvar

Typically this executable will be named "da_wrfvar.exe", but for this pre-compiled tutorial we have named it da_wrfvar.exe_3dvar

Check output

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

Look for wrfvar_output in your working directory. That is the data-assimilated analysis output. It is in wrfinput format.

The analysis increments can be obtained by using NCO commands ncdiff (available as ~wrfhelp/ncdiff) or ncbo -y sbt. The fields can be quickly viewed using ncview, or other WRF NCL graphic tools, or WRFDA/var/graphics/ncl/WRF-Var_plot.ncl and WRFDA/var/graphics/ncl/WRF_contributed.ncl.test

cp ${your_source_code_dir}/WRFDA/var/graphics/ncl/WRF-Var_plot.ncl .
cp ${your_source_code_dir}/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.

......
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

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, qcstat_conv_01, and rej_obs_conv_01 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.

Take a look at namelist.output to see the full list of namelist options.

Update WRF lateral boundary conditions

After creating an analysis, we have changed the initial conditions for the model, the tendencies in the wrfbdy should be adjusted based on the updated initial conditions.

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 /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 ${your_source_code_dir}/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 = '/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

${your_source_code_dir}/WRFDA/var/build/da_update_bc.exe

Check output

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

${your_source_code_dir}/WRFV3/external/io_netcdf/diffwrf wrfbdy_d01 /wrfhelp/DATA/WRFDA/CONUS60/rc/2008020512/wrfbdy_d01

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 (/wrfhelp/DATA/WRFDA/CONUS60/ob/2008020512/gdas1.t12z.prepbufr.nr.linux) as the observation input.

    ln -fs /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 ${your_source_code_dir}/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