1 |
1. Code retrieval
|
1 |
1. Code retrieval
|
2 |
------------------
|
2 |
------------------
|
3 |
|
3 |
|
4 |
Download the latest Lagranto version from SVN repository <https://svn.iac.ethz.ch/websvn/pub/wsvn/>.
|
4 |
Download the latest Lagranto version from SVN repository <https://svn.iac.ethz.ch/websvn/pub/wsvn/>.
|
5 |
|
5 |
|
6 |
Then create a directory where you want Lagranto to be installed; place the whole source code in this
|
6 |
Then create a directory where you want Lagranto to be installed; place the whole source code in this
|
7 |
directory and set an environment variable {LAGRANTO} pointing to this directory.
|
7 |
directory and set an environment variable {LAGRANTO} pointing to this directory.
|
8 |
|
8 |
|
9 |
> setenv LAGRANTO {PATH TO YOUR LAGRANTO INSTALLATION}
|
9 |
> setenv LAGRANTO {PATH TO YOUR LAGRANTO INSTALLATION}
|
10 |
|
10 |
|
11 |
|
- |
|
12 |
2. Compiling the Lagranto code
|
11 |
2. Compiling the Lagranto code
|
13 |
-------------------------------
|
12 |
-------------------------------
|
14 |
|
13 |
|
- |
|
14 |
First you will have to adapt some parameters in the installation script <install.csh>.
|
- |
|
15 |
|
- |
|
16 |
2.1 Set paths for development and for operational version of Lagranto (might be the same). For our system,
|
- |
|
17 |
we have a environment variable {DYN_TOOLS} (e.g., /usr/local/) that provides the paths to several tools.
|
- |
|
18 |
For your system, just provide the path to Lagranto (e.g., path_devel = /home/{user}/lagranto.ecmwf).
|
- |
|
19 |
set path_devel = "${DYN_TOOLS}//lagranto.ecmwf/"
|
- |
|
20 |
set path_sync = "${DYN_TOOLS}/lagranto/"
|
- |
|
21 |
|
15 |
Choose the correct Fortran compiler in <install.csh>. At the moment, PGI is set. I have sucessfully
|
22 |
2.2 Set the Fortran compiler to your version (e.g., gfortran, pgf90, ifort,...)
|
- |
|
23 |
setenv FORTRAN pgf90
|
- |
|
24 |
|
- |
|
25 |
2.3 Set netcdf format of the ECMWF files (typically cdo)
|
- |
|
26 |
set ncdf = cdo
|
- |
|
27 |
|
16 |
compiled the code with <ifort> and <gfortran>, so you might want to use one of these two compilers.
|
28 |
2.4 Set the paths to the netCDF library. At our system, this is done by means of modules, but certainly
|
17 |
You additonally have to set in <install.csh> the environment variable <NETCDF> which point to the
|
29 |
at your site you will have to change this. You system administrator will be able to help you with that!
|
- |
|
30 |
Just to give you an idea what <module load netcdf/4.3.2) does, here is the detailed list of commands
|
- |
|
31 |
run by the call:
|
- |
|
32 |
|
- |
|
33 |
module-whatis set environment for netcdf 4.3.2 and netcdf-fortran 4.2 compiled with gfortran and hdf5 1.8.13
|
- |
|
34 |
module load hdf5/1.8.13
|
- |
|
35 |
setenv NETCDF /usr/local/netcdf-4.3.2-4.2-gfortran
|
- |
|
36 |
prepend-path PATH /usr/local/netcdf-4.3.2-4.2-gfortran/bin
|
- |
|
37 |
prepend-path INCLUDE /usr/local/netcdf-4.3.2-4.2-gfortran/include
|
- |
|
38 |
prepend-path C_INCLUDE_PATH /usr/local/netcdf-4.3.2-4.2-gfortran/include
|
- |
|
39 |
prepend-path CPLUS_INCLUDE_PATH /usr/local/netcdf-4.3.2-4.2-gfortran/include
|
- |
|
40 |
prepend-path LIBRARY_PATH /usr/local/netcdf-4.3.2-4.2-gfortran/lib64
|
- |
|
41 |
prepend-path LD_LIBRARY_PATH /usr/local/netcdf-4.3.2-4.2-gfortran/lib64
|
- |
|
42 |
prepend-path MANPATH /usr/local/netcdf-4.3.2-4.2-gfortran/share/man
|
- |
|
43 |
|
- |
|
44 |
2.4 Possibly you will have to replace <nc-config> with <nf-config> in your setting. If the netCDF environment
|
- |
|
45 |
is correctly set up, entering either <nc-config> or <nf-config> in the command shell sould give some result:
|
- |
|
46 |
|
18 |
installstion of the netCDF libraries.
|
47 |
setenv NETCDF_LIB `nc-config --flibs`
|
- |
|
48 |
setenv NETCDF_INC `nc-config --fflags`
|
19 |
|
49 |
|
- |
|
50 |
2.5 If the previous steps have been done, you are ready to install Lagranto. I suggest to do it stepwise (as
|
20 |
> setenv NETCDF {PATH TO YOUR NETCDF LIBRARY}
|
51 |
listed below). If everything works fine, you can compile it in one single step by <install.csh all>.
|
21 |
|
52 |
|
22 |
> cd ${LAGRANTO}/
|
53 |
> cd ${LAGRANTO}/
|
23 |
> ./install.csh clean
|
54 |
> ./install.csh clean
|
24 |
> ./install.csh lib
|
55 |
> ./install.csh lib
|
25 |
> ./install.csh create_startf
|
56 |
> ./install.csh create_startf
|
26 |
> ./install.csh caltra
|
57 |
> ./install.csh caltra
|
27 |
> ./install.csh trace
|
58 |
> ./install.csh trace
|
28 |
> ./install.csh select
|
59 |
> ./install.csh select
|
29 |
> ./install.csh density
|
60 |
> ./install.csh density
|
30 |
> ./install.csh lidar
|
61 |
> ./install.csh lidar
|
31 |
> ./install.csh goodies
|
62 |
> ./install.csh goodies
|
32 |
> ./install.csh docu
|
63 |
> ./install.csh docu
|
33 |
> ./install.csh links
|
64 |
> ./install.csh links
|
34 |
|
65 |
|
35 |
Add the end of the installation, it's best to add the following directory to your PATH variable. In <bash>
|
66 |
Add the end of the installation, it's best to add the following directory to your PATH variable. In <bash>
|
36 |
this should look like
|
67 |
this should look like
|
37 |
|
68 |
|
38 |
> export PATH=${LAGRANTO}/bin/:$PATH
|
69 |
> export PATH=${LAGRANTO}/bin/:$PATH
|
39 |
|
70 |
|
40 |
If the <LAGRANTO/bin> directory is in your PATH, then you will be able to run Lagranto from any directory.
|
71 |
If the <LAGRANTO/bin> directory is in your PATH, then you will be able to run Lagranto from any directory.
|
41 |
Otherwise, you will always to give the full path to your Lagranto commands, e.g.
|
72 |
Otherwise, you will always to give the full path to your Lagranto commands, e.g.
|
42 |
|
73 |
|
43 |
> ${LAGRANTO}/bin/caltra
|
74 |
> ${LAGRANTO}/bin/caltra
|
44 |
|
75 |
|
45 |
|
- |
|
46 |
|
- |
|
47 |
3. Compiling the Grib-netCDF converter
|
- |
|
48 |
--------------------------------------
|
- |
|
49 |
|
- |
|
50 |
In the subdirectory <convert/fgrb2cdf> you find the program you find the Fortran program which we use to
|
- |
|
51 |
convert the Grib files from ECMWF into netCDF. Note that we use a somewhat 'strange' netCDF format; therefore
|
- |
|
52 |
you have to use this converter. In the near future, I will make available a conversion tool based on the CDO
|
- |
|
53 |
tools...
|
- |
|
54 |
|
- |
|
55 |
You will have to set some paths to compile the program; in particular, a reference must be made to the
|
- |
|
56 |
GRIB_API.
|
- |
|
57 |
|
- |
|
58 |
|
- |
|
59 |
4. Lagranto documentation
|
76 |
3. Lagranto documentation
|
60 |
-------------------------
|
77 |
-------------------------
|
61 |
|
78 |
|
62 |
Lagranto comes with a detailed documentation; you can start it with one of the following calls:
|
79 |
Lagranto comes with a detailed documentation; you can start it with one of the following calls:
|
63 |
|
80 |
|
64 |
> lagrantohelp
|
81 |
> lagrantohelp
|
65 |
> lagrantohelp tutorial
|
82 |
> lagrantohelp tutorial
|
66 |
> lagrantohelp reference
|
83 |
> lagrantohelp reference
|
67 |
|
84 |
|
68 |
The most important program for you will be <caltra> which calculates the trajectories...
|
85 |
The most important program for you will be <caltra> which calculates the trajectories...
|
69 |
|
86 |
|
70 |
> lagrantohelp caltra
|
87 |
> lagrantohelp caltra
|
71 |
|
88 |
|
72 |
|
- |
|
73 |
5. Test data set
|
89 |
4. Test data set
|
74 |
-----------------
|
90 |
-----------------
|
75 |
|
91 |
|
76 |
On our FTP server you find a sample data set which allows you to run Lagranto without bothering about the
|
92 |
On our FTP server you find a sample data set which allows you to run Lagranto without bothering about the
|
77 |
Grib-netCDF conversion.
|
93 |
Grib-netCDF conversion.
|
78 |
|
94 |
|
79 |
ftp://iacftp.ethz.ch/pub_read/sprenger/lagranto.ecmwf.test/
|
95 |
ftp://iacftp.ethz.ch/pub_read/sprenger/lagranto.ecmwf.test/
|
80 |
|
96 |
|
- |
|
97 |
There are two versions of test data available, depending on the netCDF version you would like to use.
|
- |
|
98 |
|
- |
|
99 |
- ive: the netCDF format used at ETH, converted with Fortran program <fgrb2cdf_api>
|
- |
|
100 |
- cdo: CF-conform netCDF format; the GRIB files and the conversion script are also included in the folder
|
- |
|
101 |
|
- |
|
102 |
If you don't know which version to use, I suggest to choose 'cdo' because here the conversion from GRIB to
|
- |
|
103 |
netCDF format can be done by means of the CDO tools (as done in <convert.sh>).
|
81 |
|
104 |
|
82 |
6. Minimal test run
|
105 |
5. Minimal test run
|
83 |
--------------------
|
106 |
--------------------
|
84 |
|
107 |
|
85 |
a) Define a starting position in a file <startf>; the format is <longitude latitude pressure>.
|
108 |
a) Define a starting position in a file <startf>; the format is <longitude latitude pressure>.
|
86 |
|
109 |
|
87 |
> more startf
|
110 |
> more startf
|
88 |
8.0 46.0 500.
|
111 |
8.0 46.0 500.
|
89 |
-10.0 30.0 850.
|
112 |
-10.0 30.0 850.
|
90 |
|
113 |
|
91 |
Each line corresponds to a single starting position. Note that longitudes must be within -180 ... +180 deg.
|
114 |
Each line corresponds to a single starting position. Note that longitudes must be within -180 ... +180 deg.
|
92 |
|
115 |
|
93 |
|
116 |
|
94 |
b) Start the trajectory
|
117 |
b) Start the trajectory
|
95 |
|
118 |
|
96 |
It is a forward trajectory starting at 00 UTC 1 Jan 2012. The time span is 18 UTC. Starting positions are
|
119 |
It is a forward trajectory starting at 00 UTC 1 Jan 2012. The time span is 18 UTC. Starting positions are
|
97 |
taken from <startf>, the output is written to <trajectory>. For details about the optional flag <-j> and
|
120 |
taken from <startf>, the output is written to <trajectory>. For details about the optional flag <-j> and
|
98 |
<-notimecheck>, please consult the Lagranto help <lagrantohelp caltra>.
|
121 |
<-notimecheck>, please consult the Lagranto help <lagrantohelp caltra>.
|
99 |
|
122 |
|
100 |
> caltra 20120101_00 20120101_18 startf trajectory -j
|
123 |
> caltra 20120101_00 20120101_18 startf trajectory -j
|
101 |
> more trajectory
|
124 |
> more trajectory
|
102 |
Reference date 20120101_0000 / Time range 1080 min
|
125 |
Reference date 20120101_0000 / Time range 1080 min
|
103 |
|
126 |
|
104 |
time lon lat p
|
127 |
time lon lat p
|
105 |
-----------------------------
|
128 |
-----------------------------
|
106 |
|
129 |
|
107 |
.00 8.00 46.00 500
|
130 |
.00 8.00 46.00 500
|
108 |
6.00 10.02 44.07 480
|
131 |
6.00 10.02 44.07 480
|
109 |
12.00 11.64 42.13 504
|
132 |
12.00 11.64 42.13 504
|
110 |
18.00 12.66 40.17 514
|
133 |
18.00 12.66 40.17 514
|
111 |
|
134 |
|
112 |
.00 -10.00 30.00 850
|
135 |
.00 -10.00 30.00 850
|
113 |
6.00 -10.42 30.14 866
|
136 |
6.00 -10.42 30.14 866
|
114 |
12.00 -10.40 30.25 885
|
137 |
12.00 -10.40 30.25 885
|
115 |
18.00 -10.46 29.93 906
|
138 |
18.00 -10.46 29.93 906
|
116 |
|
139 |
|
117 |
================================.
|
140 |
================================.
|