page header
 

Running 4D-VAR

Reference: Download the tutorial presentation

source code

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

WRFDA/var/build/da_wrfvar.exe_4dvar (this is renamed from da_wrfvar.exe)
is the executable that will be used in the 4D-VAR 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.

We recommend you create /data1/${USER}/DA/4dvar and cd there to be your working directory for this session.

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

Input data

For running 3D-VAR, the 3 major input files are observations (ob.ascii), background error statistics (be.dat) and first guess (fg). For 4D-VAR, the similar concept holds except that now the observations need to be processed into multiple time-slot files.

Test data for this 4D-VAR tutorial case are in /wrfhelp/DATA/WRFDA/4dvar.

  • Observations

    /wrfhelp/DATA/WRFDA/4dvar/ob/2005071600/ob.ascii+
    /wrfhelp/DATA/WRFDA/4dvar/ob/2005071601/ob.ascii
    /wrfhelp/DATA/WRFDA/4dvar/ob/2005071602/ob.ascii
    /wrfhelp/DATA/WRFDA/4dvar/ob/2005071603/ob.ascii
    /wrfhelp/DATA/WRFDA/4dvar/ob/2005071604/ob.ascii
    /wrfhelp/DATA/WRFDA/4dvar/ob/2005071605/ob.ascii
    /wrfhelp/DATA/WRFDA/4dvar/ob/2005071606/ob.ascii-

  • First guess

    /wrfhelp/DATA/WRFDA/4dvar/rc/2005071600/wrfinput_d01
    /wrfhelp/DATA/WRFDA/4dvar/rc/2005071600/wrfbdy_d01

  • Background error statistics

    /wrfhelp/DATA/WRFDA/4dvar/be/be.dat

Linking files

cd /data1/${USER}/DA/4dvar

A few additional contant files are needed for 4D-VAR runs.

ln -fs ${your_source_code_dir}/WRFDA/run/RRTM_DATA_DBL ./RRTM_DATA # be sure to link the double-precision one for 4dvar runs and rename it

ln -fs ${your_source_code_dir}/WRFDA/run/*.TBL .

link first guess and boundary files.

ln -fs /wrfhelp/DATA/WRFDA/4dvar/rc/2005071600/wrfinput_d01 ./fg

ln -fs /wrfhelp/DATA/WRFDA/4dvar/rc/2005071600/wrfavn_d01 ./fg02

ln -fs /wrfhelp/DATA/WRFDA/4dvar/rc/2005071600/wrfinput_d01 .

ln -fs /wrfhelp/DATA/WRFDA/4dvar/rc/2005071600/wrfbdy_d01 .

link observation files

ln -fs /wrfhelp/DATA/WRFDA/4dvar/ob/2005071600/ob.ascii+ ./ob01.ascii

ln -fs /wrfhelp/DATA/WRFDA/4dvar/ob/2005071601/ob.ascii ./ob02.ascii

ln -fs /wrfhelp/DATA/WRFDA/4dvar/ob/2005071602/ob.ascii ./ob03.ascii

ln -fs /wrfhelp/DATA/WRFDA/4dvar/ob/2005071603/ob.ascii ./ob04.ascii

ln -fs /wrfhelp/DATA/WRFDA/4dvar/ob/2005071604/ob.ascii ./ob05.ascii

ln -fs /wrfhelp/DATA/WRFDA/4dvar/ob/2005071605/ob.ascii ./ob06.ascii

ln -fs /wrfhelp/DATA/WRFDA/4dvar/ob/2005071606/ob.ascii ./ob07.ascii

link background error file

ln -fs /wrfhelp/DATA/WRFDA/4dvar/be/be.dat .

Edit namelists

A very basic namelist.input for running the 4D-VAR tutorial case is available at /wrfhelp/DATA/WRFDA/4dvar/namelist.input

cp /wrfhelp/DATA/WRFDA/4dvar/namelist.input .

vi namelist.input

Pay special attention to the following namelist variables.

&wrfvar1
var4d=true,
var4d_lbc=true,
var4d_bin=3600,
/
&wrfvar6
ntmax=5 # for testing purpose only, reduce the maximum iteration number for quick test, as for each iteration, 4D-VAR takes a lot longer to run than 3D-VAR
/
&wrfvar18
analysis_date='2005-07-16_00:00:00",
/
&wrfvar21
time_window_min="2005-07-16_00:00:00",
/
&wrfvar22
time_window_max="2005-07-16_06:00:00",
/
&time_control
run_hours=6,
start_year=2005,
start_month=07,
start_day=16,
start_hour=00,
end_year=2005,
end_month=07,
end_day=16,
end_hour=06,
interval_seconds=21600,
debug_level=-300,
/
&domains
time_step=600,
e_we=31,
e_sn=25,
e_vert=17,
dx=135000,
dy=135000,
smooth_option=0,
nproc_x=0,
/
&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=2
num_soil_layers=4
......
/
&perturbation
trajectory_io=true,
enable_identity=false,
jcdfi_use=true,
jcdfi_diag=1,
jcdfi_penalty=1000.0,
/

Running 4D-VAR

mpirun -np 1 ${your_source_code_dir}/WRFDA/var/build/da_wrfvar.exe_4dvar >&! var4d.log

 

Advanced

Try setting up a different 4D-VAR run using CONUS60 case (/wrfhelp/DATA/WRFDA/CONUS60) and compare the results with the 3D-VAR run. A sample namelist.input is provided in the WRFDA source tar file as WRFDA/var/test/4dvar/namelist.input for the CONUS60 case.

The CONUS60 case is not used as the default 4D-VAR practical case because of its relatively large domain dimensions for 4D-VAR tutorial purpose.

 


back to top
 
practical_page_header