3DVAR Tutorial
c. Setting up 3DVAR
(06/09/2003)
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 NCAR's ftp site. 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 123
drwxr-xr-x 2
dmbarker users 8192 May 28 12:57 CVS/
-rw-r--r-- 1
dmbarker users 2178 May 21 14:14 Makefile
-rw-r--r-- 1
dmbarker users
21823 Dec 2 14:21 README
drwxr-xr-x 3
dmbarker users 8192 May 28 12:56 Registry/
drwxr-xr-x 3
dmbarker users 8192 May 28 12:56 arch/
-rwxr-xr-x 1
dmbarker users 888 May 21 14:14 clean*
-rwxr-xr-x 1
dmbarker users 1201 Mar 11 12:00 compile*
-rwxr-xr-x 1
dmbarker users 6896 Jan 14 09:00 configure*
drwxr-xr-x 7
dmbarker users 8192 May 28 12:57 da_3dvar/
drwxr-xr-x 8
dmbarker users 8192 May 28 12:57 external/
drwxr-xr-x 3
dmbarker users 8192 May 28 12:57 frame/
drwxr-xr-x 3
dmbarker users 8192 May 28 12:57 inc/
-rw-r--r-- 1
dmbarker users 0 May 29
10:40 list
drwxr-xr-x 3
dmbarker users 8192 May 28 12:57 main/
drwxr-xr-x 3
dmbarker users 8192 May 28 12:57 run/
drwxr-xr-x 3
dmbarker users 8192 May 28 12:57 share/
drwxr-xr-x 3 dmbarker users 8192 May 28 12:57 tools/
2.
Compiling 3DVAR
To compile 3DVAR,
you first type
configure
You will then be
queried with something like the following:
service10:/mmmtmp/dmbarker/learn3dvar/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
dmbarker users
13924320 May 29 2003
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 WRF_DIR
(location of 3DVAR code).
You may also want
to set your own RUN_ID if you want to save output from different 3DVAR runs
(any previous experiment defined with the same RUN_ID is deleted by default
when you run the script).
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. Not all values are provided with
comments. This is deliberate – we only support changing the values with
comments! 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
(the previous serial version of 3DVAR would pick these dimensions up from
the input file and dynamically allocate memory).
For this
tutorial’s case study, we have created a file namelist.input.caa1 containing
the grid point dimensions for our standard case. The only values you need
concern yourself with are
e_we = 66 (Number of grid points in N-S direction)
e_ns = 80 (Number of grid points in E-W direction),
e_vert = 31 (Number of vertical levels)
You will need to
change these values for your own cases.
NOTE 1: The 3DVAR analysis is performed on the “cross” points
of the MM5 grid. The number of 3DVAR N-S and E-W points is one less than
the input MM5 first guess (e.g. 3DVAR dimension for the standard case is
60x80x31 whereas it is 61x81x31 for the MM5 first guess!
NOTE 2: So you think you spotted a mistake – shouldn’t e_ns
be the number of grid points in the N-S, not E-W direction? Full marks for
observation, but wrong! As this version of 3DVAR is on the MM5 grid (i=y), not
WRF (i=x), we fool the WRF framework into running on the 3DVAR grid with this
simple kludge.
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.