3DVAR Tutorial

c. Setting up 3DVAR

(05/19/2004)

In this part of the 3DVAR tutorial you will download and compile 3DVAR. A description of the script that controls the running of 3DVAR and an overview of the namelist that it creates will also be given.

1. Accessing 3DVAR code

First, go to your working directory (defined by $DAT_DIR) and download the 3dvar program tar file from 3DVAR_code_data by clickinf "MM5 3DVAR Source Code". Once you have it on your machine, type the following to unzip and untar it:

gunzip 3dvar.tar.gz

tar -xvf 3dvar.tar

After this, you should see a program directory 3dvar/ created in your working directory. If so, tidy up with the command

rm 3dvar.tar

cd to th3 3dvar directory:

cd 3dvar

and you should see something like the following files and subdirectories listed:

ls –l

total 47

-rw-r--r--   1 guo users       264 Jul 9 2003 CHANGES

drwxr-xr-x   2 guo users       512 Mar 29 2004 CVS/

-rw-r--r--   1 guo users       2184 Jan 27 10:39 Makefile

-rw-r--r--   1 guo users      21823 Jul 9 2003 README

drwxr-xr-x   3 guo users       512 Mar 29 2004 Registry/

drwxr-xr-x   3 guo users       512 Mar 29 2004 arch/

-rwxr-xr-x   1 guo users        888 Jul 9 2003 clean*

-rwxr-xr-x   1 guo users       1201 Jul 9 2003 compile*

-rwxr-xr-x   1 guo users       6896 Jul 9 2003 configure*

drwxr-xr-x   7 guo users       512 Mar 29 2004 da_3dvar/

drwxr-xr-x   8 guo users       512 Mar 29 2004 external/

drwxr-xr-x   3 guo users       1024 Mar 29 2004 frame/

drwxr-xr-x   3 guo users       512 Mar 29 2004 inc/

drwxr-xr-x   3 guo users       512 Mar 29 2004 main/

drwxr-xr-x   3 guo users       512 Mar 29 2004 run/

drwxr-xr-x   3 guo users       512 Mar 29 2004 share/

drwxr-xr-x   3 guo users       1024 Mar 29 2004 tools/

2. Compiling 3DVAR

To compile 3DVAR, you first type

configure

You will then be queried with something like the following:

service10:/mmmtmp/guo/3dvar>configure

checking for perl5... no

checking for perl... found /usr/bin/perl (perl)

Will use NETCDF in dir: /usr/local/netcdf

------------------------------------------------------------------------

Please select from among the following supported platforms.

 

   1.  Compaq OSF1 alpha          (single-threaded)

   2.  Compaq OSF1 alpha DM       (RSL, MPICH, RSL IO)

   3.  Compaq OSF1 alpha    (single-threaded, no NetCDF)

   4.  Compaq OSF1 alpha DM  (RSL, MPICH, RSL IO, no NetCDF)

   5.  Compaq OSF1 alpha DM       (RSL, DECMPI, RSL IO)

 

Enter selection [1-5] :

In this tutorial, you will be running 3DVAR in single processor mode. Therefore enter “1” (single-threaded) at the prompt. This will automatically create a file “configure.3dvar” in your 3dvar directory which sets up compile options etc ready for compilation. We recommend you run 3DVAR in single processor mode first, but you later want to run 3DVAR on distributed memory machines to really speed things up.

Check the configure.3dvar file has been produced by typing

ls –l configure.3dvar

Browse the file if interested, then to compile 3DVAR type

compile 3dvar

Once this is complete, you can check for the presence of the 3dvar executable by issuing the command (from the 3dvar directory)

ls –l main/da_3dvar.exe

-rwxr-xr-x   1 guo users    16039760 Mar 29  2004 main/da_3dvar.exe*

While you’re waiting for compilation to finish, we suggest you read the following sections to acquaint yourself with how you’re going to run 3DVAR.

3. The DA_Run_3DVAR.csh script.

The 3DVAR system is run (don’t do this yet!) from the DA_Run_3DVAR.csh script, found in the 3dvar/run directory. The script performs a number of tasks, as follows:

a) Specify job details: At minimum, you need to define the directories DAT_DIR (where input data is stored), RUN_DIR (where you will run and output data) and SRC_DIR (location of 3DVAR code).

b) Set up files/directories and perform checks on the 3DVAR set up.

c) Set default 3DVAR namelist options. In the DA_Run_3DVAR.csh script this is done via environment variables. Values may be overwritten by i) predefining the environment variables on the command line, ii) within the script or iii) in future via a GHUI.

d) Create 3DVAR namelist file namelist.3dvar.

e) Run 3DVAR – the exact method will depend on your machine. A few examples are included. Uncomment the command appropriate for your machine.

A brief description of 3DVAR’s namelist options is now given.

4. The  3DVAR namelist “namelist.3dvar”

There are many options you can change in a data assimilation system:  withholding particular observations, empirically retuning background errors, changing the minimization convergence criteria, etc, etc. To see the current full list of namelist options, check out the section of DA_Run_3DVAR.csh script that sets the default values. Feel free to experiment with the others only if you can support yourself by checking the code to see what these other options do!

5. The  WRF namelist “namelist.input”

Since 3DVAR is now a core for the WRF model, it uses the WRF framework to define and perform parallel, I/O functions. This is fairly transparent in the 3DVAR code. However, one disadvantage is that 3DVAR now requires one to specify the grid dimensions at run-time via a file namelist.input. Now the size of the domain can be set in DA_Run_3DVAR.csh script

Note: The dimensions in horizontal must be set the dot-points values: WEST_EAST_GRID_NUMB = JMX, and SOUTH_NORTH_GRID_NUMB = IMX. The vertical dimension: VERTICAL_GRID_NUMB equals the number of FULL sigma levels (KMX+1).

5. What next?

Having compiled 3DVAR and familiarized yourself with the script and namelist files, it’s time to run 3DVAR!

d) 3DVAR – Run Pseudo Single Observation Test (PSOT)


Trouble Shooting:

1. If you have questions, ask mesouser.


 

Return to 3DVAR Tutorial Page