Subversion Repositories lagranto.ecmwf

Rev

Rev 5 | Rev 11 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5 Rev 9
1
#!/bin/csh
1
#!/bin/csh
2
 
2
 
3
# -----------------------------------------------------------------------------
3
# -----------------------------------------------------------------------------
4
# Set some general parameters
4
# Set some general parameters
5
# -----------------------------------------------------------------------------
5
# -----------------------------------------------------------------------------
6
 
6
 
7
# Usage
7
# Usage
8
if ( $#argv == 0 ) then
8
if ( $#argv == 0 ) then
9
  echo "install.sh [lib|core|goodies|links|all|docu|clean] "
9
  echo "install.sh [lib|core|goodies|links|all|docu|clean|tag] "
10
  exit 0
10
  exit 0
11
endif
11
endif
12
 
12
 
13
# Set the mode
13
# Set the mode
14
set mode = $1
14
set mode = $1
15
 
15
 
-
 
16
# Set path to SVN repository
-
 
17
set svnpath=https://svn.iac.ethz.ch/pub/lagranto.ecmwf/
-
 
18
 
16
# Set paths for development and for synchronisation (operational)
19
# Set paths for development and for synchronisation (operational)
17
set path_devel = "${DYN_TOOLS}//lagranto.ecmwf/"
20
set path_devel = "${DYN_TOOLS}//lagranto.ecmwf/"
18
set path_sync  = "${DYN_TOOLS}/lagranto.ecmwf/"
21
set path_sync  = "${DYN_TOOLS}/lagranto/"
19
 
22
 
20
# Init Fortran compiler and set netCDF acccordingly
23
# Init Fortran compiler and set netCDF acccordingly
21
setenv FORTRAN pgf90 
24
setenv FORTRAN pgf90 
22
 
25
 
23
# Init netCDF library depending on the Fortran compiler
26
# Init netCDF library depending on the Fortran compiler
24
if ( "${FORTRAN}" == "pgf90" ) then
27
if ( "${FORTRAN}" == "pgf90" ) then
25
  module load netcdf/4.2.1-pgf90
28
  module load netcdf/4.2.1-pgf90
26
  module list
29
  module list
27
 
30
 
28
else if ( "${FORTRAN}" == "gfortran" ) then
31
else if ( "${FORTRAN}" == "gfortran" ) then
29
  module load gfortran
32
  module load gfortran
30
  module load netcdf/4.1.1
33
  module load netcdf/4.1.1
31
 
34
 
32
else if ( "${FORTRAN}" == "ifort" ) then
35
else if ( "${FORTRAN}" == "ifort" ) then
33
  module load ifort/10.1.017
36
  module load ifort/10.1.017
34
  module load netcdf/4.1.1-ifort
37
  module load netcdf/4.1.1-ifort
35
 
38
 
36
else
39
else
37
  echo "Fortran Compiler ${FORTRAN} not supported... Exit"
40
  echo "Fortran Compiler ${FORTRAN} not supported... Exit"
38
  exit 1
41
  exit 1
39
 
42
 
40
endif
43
endif
41
 
44
 
42
# -----------------------------------------------------------------------------
45
# -----------------------------------------------------------------------------
-
 
46
# Create a new tag in SVN repository
-
 
47
# -----------------------------------------------------------------------------
-
 
48
 
-
 
49
if ( "${mode}" == "tag" ) then
-
 
50
   svn info
-
 
51
   if ( "${#argv}" != 2 ) then
-
 
52
     echo "Usage: install.csh tag id <id=tag number>"
-
 
53
   else
-
 
54
     set tagnr = $2
-
 
55
   endif
-
 
56
   svn copy ${svnpath}/trunk ${svnpath}/tags/${tagnr} -m "Release ${tagnr}"
-
 
57
   exit 0
-
 
58
endif
-
 
59
 
-
 
60
# -----------------------------------------------------------------------------
43
# Set internal parameters and detailed installation mode
61
# Set internal parameters and detailed installation mode
44
# -----------------------------------------------------------------------------
62
# -----------------------------------------------------------------------------
45
 
63
 
46
# Set LAGRANTO environment variable
64
# Set LAGRANTO environment variable
47
setenv LAGRANTO ${path_devel}
65
setenv LAGRANTO ${path_devel}
48
 
66
 
49
# Set netCDF paths
67
# Set netCDF paths
50
setenv NETCDF_LIB `nc-config --flibs`
68
setenv NETCDF_LIB `nc-config --flibs`
51
setenv NETCDF_INC `nc-config --fflags`
69
setenv NETCDF_INC `nc-config --fflags`
52
 
70
 
53
# Set list of core programs
71
# Set list of core programs
54
set core  = "create_startf caltra trace select density lidar"
72
set core  = "create_startf caltra trace select density lidar"
55
 
73
 
56
# Set list of goodies
74
# Set list of goodies
57
set tools = "changecst changet extract getmima gettidiff getvars list2lsl lsl2list mergetra newtime reformat timeres trainfo difference datelist tracal" 
75
set tools = "changecst changet extract getmima gettidiff getvars list2lsl lsl2list mergetra newtime reformat timeres trainfo difference datelist tracal" 
58
 
76
 
59
# Set list of libraries
77
# Set list of libraries
60
set libs  = "iotra ioinp inter times libcdfio libcdfplus"
78
set libs  = "iotra ioinp inter times libcdfio libcdfplus"
61
 
79
 
62
# Core programs
80
# Core programs
63
foreach prog ( $core )
81
foreach prog ( $core )
64
   if ( "${prog}" == "${mode}" ) then
82
   if ( "${prog}" == "${mode}" ) then
65
      set core  = ${prog}
83
      set core  = ${prog}
66
      set mode  = "core"
84
      set mode  = "core"
67
   endif
85
   endif
68
end
86
end
69
 
87
 
70
# Goodies
88
# Goodies
71
foreach tool ( $tools )
89
foreach tool ( $tools )
72
   if ( "${tool}" == "${mode}" ) then
90
   if ( "${tool}" == "${mode}" ) then
73
      set tools = ${tool}
91
      set tools = ${tool}
74
      set mode  = "goodies"
92
      set mode  = "goodies"
75
   endif
93
   endif
76
end
94
end
77
 
95
 
78
# Libraries
96
# Libraries
79
foreach lib ( $libs )
97
foreach lib ( $libs )
80
   if ( "${lib}" == "${mode}" ) then
98
   if ( "${lib}" == "${mode}" ) then
81
      set libs  = ${lib}
99
      set libs  = ${lib}
82
      set mode  = "lib"
100
      set mode  = "lib"
83
   endif
101
   endif
84
end
102
end
85
 
103
 
86
# Check that the mode is ok 
104
# Check that the mode is ok 
87
if ( "${mode}" == "all"     ) goto modeok
105
if ( "${mode}" == "all"     ) goto modeok
88
if ( "${mode}" == "lib"     ) goto modeok
106
if ( "${mode}" == "lib"     ) goto modeok
89
if ( "${mode}" == "core"    ) goto modeok
107
if ( "${mode}" == "core"    ) goto modeok
90
if ( "${mode}" == "goodies" ) goto modeok
108
if ( "${mode}" == "goodies" ) goto modeok
91
if ( "${mode}" == "links"   ) goto modeok
109
if ( "${mode}" == "links"   ) goto modeok
92
if ( "${mode}" == "clean"   ) goto modeok
110
if ( "${mode}" == "clean"   ) goto modeok
93
if ( "${mode}" == "docu"    ) goto modeok
111
if ( "${mode}" == "docu"    ) goto modeok
-
 
112
if ( "${mode}" == "sync"    ) goto modeok
94
echo "Unsupported mode ${mode} ... Stop"
113
echo "Unsupported mode ${mode} ... Stop"
95
exit 1
114
exit 1
96
 
115
 
97
modeok:
116
modeok:
98
 
117
 
99
# -----------------------------------------------------------------------------
118
# -----------------------------------------------------------------------------
100
# Make clean 
119
# Make clean 
101
# -----------------------------------------------------------------------------
120
# -----------------------------------------------------------------------------
102
 
121
 
103
if ( "${mode}" == "clean" ) then
122
if ( "${mode}" == "clean" ) then
104
 
123
 
105
cd ${LAGRANTO}/
124
cd ${LAGRANTO}/
106
 
125
 
107
foreach prog ( $core )
126
foreach prog ( $core )
108
   \rm -f ${prog}/${prog} ${prog}/${prog}.o
127
   \rm -f ${prog}/${prog} ${prog}/${prog}.o
109
end
128
end
110
\rm -f trace/calvar.o select/special.o
129
\rm -f trace/calvar.o select/special.o
111
 
130
 
112
foreach tool ( $tools )
131
foreach tool ( $tools )
113
  \rm -f goodies/${tool} goodies/${tool}.o 
132
  \rm -f goodies/${tool} goodies/${tool}.o 
114
end
133
end
115
\rm -f goodies/*.mod goodies/*.o
134
\rm -f goodies/*.mod goodies/*.o
116
 
135
 
117
\rm lib/*.a lib/*.o
136
\rm lib/*.a lib/*.o
118
 
137
 
119
foreach prog ( $core )
138
foreach prog ( $core )
120
   \rm -f bin/${prog} bin/${prog}.sh  bin/${prog}.ecmwf
139
   \rm -f bin/${prog} bin/${prog}.sh  bin/${prog}.ecmwf
121
end
140
end
122
\rm -f bin/seltra bin/seltra.sh bin/seltra.ecmwf
141
\rm -f bin/seltra bin/seltra.sh bin/seltra.ecmwf
123
foreach tool ( $tools )
142
foreach tool ( $tools )
124
  \rm -f bin/${tool} bin/${tool}.sh bin/${tool}.ecmwf
143
  \rm -f bin/${tool} bin/${tool}.sh bin/${tool}.ecmwf
125
end
144
end
126
\rm -f bin/lagrantohelp.sh bin/lagrantohelp.ecmwf
145
\rm -f bin/lagrantohelp.sh bin/lagrantohelp.ecmwf
127
\rm -f bin/startf bin/startf.sh bin/startf.ecmwf
146
\rm -f bin/startf bin/startf.sh bin/startf.ecmwf
128
\rm -f bin/lagranto.sh bin/lagranto.ecmwf
147
\rm -f bin/lagranto.sh bin/lagranto.ecmwf
129
 
148
 
130
\rm ${LAGRANTO}/startf
149
\rm ${LAGRANTO}/startf
131
 
150
 
132
exit 0
151
exit 0
133
 
152
 
134
endif
153
endif
135
 
154
 
136
# -----------------------------------------------------------------------------
155
# -----------------------------------------------------------------------------
137
# Install reference 
156
# Install reference 
138
# -----------------------------------------------------------------------------
157
# -----------------------------------------------------------------------------
139
 
158
 
140
if ( ("${mode}" == "docu") | ("${mode}" == "all" ) ) then
159
if ( ("${mode}" == "docu") | ("${mode}" == "all" ) ) then
141
    
160
    
142
echo "-----------------------------------------------------------------"
161
echo "-----------------------------------------------------------------"
143
echo "Installing documentation"
162
echo "Installing documentation"
144
echo "-----------------------------------------------------------------"
163
echo "-----------------------------------------------------------------"
145
echo
164
echo
146
 
165
 
147
cd ${LAGRANTO}/docu/reference/
166
cd ${LAGRANTO}/docu/reference/
148
 
167
 
149
\rm -f reference.ps
168
\rm -f reference.ps
150
\rm -f reference2.ps
169
\rm -f reference2.ps
151
groff -man ../man/*.0 > reference2.ps
170
groff -man ../man/*.0 > reference2.ps
152
ps2pdf reference2.ps
171
ps2pdf reference2.ps
153
 
172
 
154
latex title
173
latex title
155
dvips title
174
dvips title
156
ps2pdf title.ps
175
ps2pdf title.ps
157
 
176
 
158
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=reference.pdf title.pdf reference2.pdf
177
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=reference.pdf title.pdf reference2.pdf
159
 
178
 
160
\rm -f *.aux *.log *.dvi
179
\rm -f *.aux *.log *.dvi
161
\rm -f title.ps  reference2.ps
180
\rm -f title.ps  reference2.ps
162
\rm -f title.pdf reference2.pdf
181
\rm -f title.pdf reference2.pdf
163
 
182
 
164
endif
183
endif
165
 
184
 
166
if ( "${mode}" == "docu" ) exit 0
185
if ( "${mode}" == "docu" ) exit 0
167
 
186
 
168
 
187
 
169
 
188
 
170
# -----------------------------------------------------------------------------
189
# -----------------------------------------------------------------------------
171
# Install libraries 
190
# Install libraries 
172
# -----------------------------------------------------------------------------
191
# -----------------------------------------------------------------------------
173
 
192
 
174
if ( ("${mode}" == "lib") | ("${mode}" == "all" ) ) then
193
if ( ("${mode}" == "lib") | ("${mode}" == "all" ) ) then
175
 
194
 
176
echo "-----------------------------------------------------------------"
195
echo "-----------------------------------------------------------------"
177
echo "Installing libraries"
196
echo "Installing libraries"
178
echo "-----------------------------------------------------------------"
197
echo "-----------------------------------------------------------------"
179
echo
198
echo
180
 
199
 
181
# Change to library directory
200
# Change to library directory
182
cd ${LAGRANTO}/lib
201
cd ${LAGRANTO}/lib
183
 
202
 
184
# Loop over all libraries - compile and make library
203
# Loop over all libraries - compile and make library
185
foreach lib ( $libs )
204
foreach lib ( $libs )
186
 
205
 
187
\rm -f ${lib}.a
206
\rm -f ${lib}.a
188
\rm -f ${lib}.o
207
\rm -f ${lib}.o
189
echo ${FORTRAN} -c -O ${lib}.f
208
echo ${FORTRAN} -c -O ${lib}.f
190
${FORTRAN} -c -O ${NETCDF_INC} ${lib}.f
209
${FORTRAN} -c -O ${NETCDF_INC} ${lib}.f
191
ar r ${lib}.a ${lib}.o
210
ar r ${lib}.a ${lib}.o
192
\rm -f ${lib}.l ${lib}.o
211
\rm -f ${lib}.l ${lib}.o
193
ranlib ${lib}.a
212
ranlib ${lib}.a
194
if ( ! -f ${lib}.a ) then
213
if ( ! -f ${lib}.a ) then
195
  echo "Problem in compiling ${lib} ... Stop"
214
  echo "Problem in compiling ${lib} ... Stop"
196
  exit 1
215
  exit 1
197
endif
216
endif
198
 
217
 
199
end
218
end
200
 
219
 
201
endif
220
endif
202
 
221
 
203
if ( "${mode}" == "lib" ) exit 0
222
if ( "${mode}" == "lib" ) exit 0
204
 
223
 
205
# -----------------------------------------------------------------------------
224
# -----------------------------------------------------------------------------
206
# Check that libraries are ok
225
# Check that libraries are ok
207
# -----------------------------------------------------------------------------
226
# -----------------------------------------------------------------------------
208
 
227
 
209
echo
228
echo
210
echo "-----------------------------------------------------------------"
229
echo "-----------------------------------------------------------------"
211
echo "Check that all libraries are available"
230
echo "Check that all libraries are available"
212
echo "-----------------------------------------------------------------"
231
echo "-----------------------------------------------------------------"
213
echo
232
echo
214
 
233
 
215
# Change to library directory
234
# Change to library directory
216
cd ${LAGRANTO}/lib
235
cd ${LAGRANTO}/lib
217
 
236
 
218
# Check whether all libraries are available
237
# Check whether all libraries are available
219
foreach lib ( $libs )
238
foreach lib ( $libs )
220
 
239
 
221
if ( ! -f ${lib}.a ) then
240
if ( ! -f ${lib}.a ) then
222
  echo "Library ${lib} missing... Stop"
241
  echo "Library ${lib} missing... Stop"
223
  exit 1
242
  exit 1
224
else
243
else
225
  ls -l ${lib}.a    
244
  ls -l ${lib}.a    
226
endif
245
endif
227
 
246
 
228
end
247
end
229
 
248
 
230
# Exit if only libraries shoudl be installed
249
# Exit if only libraries shoudl be installed
231
if ( "${mode}" == "lib" ) exit 0
250
if ( "${mode}" == "lib" ) exit 0
232
 
251
 
233
# -----------------------------------------------------------------------------
252
# -----------------------------------------------------------------------------
234
# Compile Lagrango core programs
253
# Compile Lagrango core programs
235
# -----------------------------------------------------------------------------
254
# -----------------------------------------------------------------------------
236
 
255
 
237
if ( ("${mode}" == "all" ) | ("${mode}" == "core" ) ) then
256
if ( ("${mode}" == "all" ) | ("${mode}" == "core" ) ) then
238
 
257
 
239
echo
258
echo
240
echo "-----------------------------------------------------------------"
259
echo "-----------------------------------------------------------------"
241
echo "Installing Lagranto core programs"
260
echo "Installing Lagranto core programs"
242
echo "-----------------------------------------------------------------"
261
echo "-----------------------------------------------------------------"
243
 
262
 
244
foreach prog ( $core )
263
foreach prog ( $core )
245
 
264
 
246
echo
265
echo
247
echo "----- $prog"
266
echo "----- $prog"
248
echo
267
echo
249
cd ${LAGRANTO}/${prog}
268
cd ${LAGRANTO}/${prog}
250
\rm -f ${prog}.o 
269
\rm -f ${prog}.o 
251
\rm -f ${prog}
270
\rm -f ${prog}
252
if ( "${prog}" == "trace"  ) \rm calvar.o
271
if ( "${prog}" == "trace"  ) \rm calvar.o
253
if ( "${prog}" == "select" ) \rm special.o
272
if ( "${prog}" == "select" ) \rm special.o
254
\rm -f ${prog}
273
\rm -f ${prog}
255
make -f ${prog}.make
274
make -f ${prog}.make
256
if ( ! -f ${prog} ) then
275
if ( ! -f ${prog} ) then
257
  echo "Problem in compiling ${prog} ... Stop"
276
  echo "Problem in compiling ${prog} ... Stop"
258
  exit 1
277
  exit 1
259
endif
278
endif
260
 
279
 
261
end
280
end
262
 
281
 
263
endif
282
endif
264
 
283
 
265
if ( "${mode}" == "core" ) exit 0
284
if ( "${mode}" == "core" ) exit 0
266
 
285
 
267
# -----------------------------------------------------------------------------
286
# -----------------------------------------------------------------------------
268
# Check that all Lagranto core programs are available
287
# Check that all Lagranto core programs are available
269
# -----------------------------------------------------------------------------
288
# -----------------------------------------------------------------------------
270
 
289
 
271
echo
290
echo
272
echo "-----------------------------------------------------------------"
291
echo "-----------------------------------------------------------------"
273
echo "Check that all Lagranto core programs are available"
292
echo "Check that all Lagranto core programs are available"
274
echo "-----------------------------------------------------------------"
293
echo "-----------------------------------------------------------------"
275
echo
294
echo
276
 
295
 
277
foreach prog ( $core )
296
foreach prog ( $core )
278
 
297
 
279
  cd ${LAGRANTO}/${prog}
298
  cd ${LAGRANTO}/${prog}
280
  if ( ! -f ${prog} ) then
299
  if ( ! -f ${prog} ) then
281
    echo "${prog} is missing... Stop"
300
    echo "${prog} is missing... Stop"
282
    exit 1
301
    exit 1
283
  else
302
  else
284
    ls -l ${prog}    
303
    ls -l ${prog}    
285
  endif
304
  endif
286
 
305
 
287
end
306
end
288
 
307
 
289
# Exit if only core programs shoudl be installed
308
# Exit if only core programs shoudl be installed
290
if ( "${mode}" == "core" ) exit 0
309
if ( "${mode}" == "core" ) exit 0
291
 
310
 
292
# -----------------------------------------------------------------------------
311
# -----------------------------------------------------------------------------
293
# Compile Lagrango goodies
312
# Compile Lagrango goodies
294
# -----------------------------------------------------------------------------
313
# -----------------------------------------------------------------------------
295
 
314
 
296
if ( ("${mode}" == "all" ) | ("${mode}" == "goodies" ) ) then
315
if ( ("${mode}" == "all" ) | ("${mode}" == "goodies" ) ) then
297
 
316
 
298
echo
317
echo
299
echo "-----------------------------------------------------------------"
318
echo "-----------------------------------------------------------------"
300
echo "Installing Lagranto goodies"
319
echo "Installing Lagranto goodies"
301
echo "-----------------------------------------------------------------"
320
echo "-----------------------------------------------------------------"
302
 
321
 
303
cd ${LAGRANTO}/goodies
322
cd ${LAGRANTO}/goodies
304
 
323
 
305
foreach tool ( $tools )
324
foreach tool ( $tools )
306
 
325
 
307
echo
326
echo
308
echo "----- ${tool}"
327
echo "----- ${tool}"
309
echo
328
echo
310
\rm -f ${tool}.o
329
\rm -f ${tool}.o
311
\rm -f ${tool}
330
\rm -f ${tool}
312
if ( -f ${tool}.make ) then
331
if ( -f ${tool}.make ) then
313
   make -f ${tool}.make
332
   make -f ${tool}.make
314
else if ( -f ${tool}.install ) then
333
else if ( -f ${tool}.install ) then
315
   ./${tool}.install
334
   ./${tool}.install
316
endif
335
endif
317
 
336
 
318
if ( ! -f ${tool} ) then
337
if ( ! -f ${tool} ) then
319
  echo "Problem in compiling ${tool} ... Stop"
338
  echo "Problem in compiling ${tool} ... Stop"
320
  exit 1
339
  exit 1
321
endif
340
endif
322
 
341
 
323
end
342
end
324
 
343
 
325
endif
344
endif
326
 
345
 
327
if ( "${mode}" == "goodies" ) exit 0
346
if ( "${mode}" == "goodies" ) exit 0
328
 
347
 
329
# -----------------------------------------------------------------------------
348
# -----------------------------------------------------------------------------
330
# Check that all Lagranto goodies are available
349
# Check that all Lagranto goodies are available
331
# -----------------------------------------------------------------------------
350
# -----------------------------------------------------------------------------
332
 
351
 
333
echo
352
echo
334
echo "-----------------------------------------------------------------"
353
echo "-----------------------------------------------------------------"
335
echo "Check that all Lagranto goodies are available"
354
echo "Check that all Lagranto goodies are available"
336
echo "-----------------------------------------------------------------"
355
echo "-----------------------------------------------------------------"
337
echo
356
echo
338
 
357
 
339
cd ${LAGRANTO}/goodies
358
cd ${LAGRANTO}/goodies
340
 
359
 
341
foreach tool ( $tools )
360
foreach tool ( $tools )
342
 
361
 
343
if ( ! -f ${tool} ) then
362
if ( ! -f ${tool} ) then
344
  echo "${tool} is missing... Stop"
363
  echo "${tool} is missing... Stop"
345
  exit 1
364
  exit 1
346
else
365
else
347
  ls -l ${tool} 
366
  ls -l ${tool} 
348
endif
367
endif
349
 
368
 
350
end
369
end
351
 
370
 
352
endif
371
endif
353
 
372
 
354
# Exit if only goodies should be installed
373
# Exit if only goodies should be installed
355
if ( "${mode}" == "goodies" ) exit 0
374
if ( "${mode}" == "goodies" ) exit 0
356
 
375
 
357
# -----------------------------------------------------------------------------
376
# -----------------------------------------------------------------------------
358
# Create links to programs
377
# Create links to programs
359
# -----------------------------------------------------------------------------
378
# -----------------------------------------------------------------------------
360
 
379
 
361
if ( ("${mode}" == "all" ) | ("${mode}" == "links" )  ) then
380
if ( ("${mode}" == "all" ) | ("${mode}" == "links" )  ) then
362
 
381
 
363
echo
382
echo
364
echo "-----------------------------------------------------------------"
383
echo "-----------------------------------------------------------------"
365
echo "Create links in ${LAGRANTO}/bin/"
384
echo "Create links in ${LAGRANTO}/bin/"
366
echo "-----------------------------------------------------------------"
385
echo "-----------------------------------------------------------------"
367
echo
386
echo
368
 
387
 
369
if ( ! -d ${LAGRANTO}/bin ) mkdir ${LAGRANTO}/bin
388
if ( ! -d ${LAGRANTO}/bin ) mkdir ${LAGRANTO}/bin
370
cd ${LAGRANTO}/bin
389
cd ${LAGRANTO}/bin
371
 
390
 
372
ln -svf ${LAGRANTO}/bin/lagranto            lagranto.sh
391
ln -svf ${LAGRANTO}/bin/lagranto            lagranto.sh
373
ln -svf ${LAGRANTO}/bin/lagranto            lagranto.ecmwf  
392
ln -svf ${LAGRANTO}/bin/lagranto            lagranto.ecmwf  
374
ln -svf ${LAGRANTO}/bin/lagrantohelp        lagrantohelp.sh
393
ln -svf ${LAGRANTO}/bin/lagrantohelp        lagrantohelp.sh
375
ln -svf ${LAGRANTO}/bin/lagrantohelp        lagrantohelp.ecmwf
394
ln -svf ${LAGRANTO}/bin/lagrantohelp        lagrantohelp.ecmwf
376
 
395
 
377
ln -svf ${LAGRANTO}/caltra/caltra.sh        caltra.sh
396
ln -svf ${LAGRANTO}/caltra/caltra.sh        caltra.sh
378
ln -svf ${LAGRANTO}/startf/create_startf.sh create_startf.sh
397
ln -svf ${LAGRANTO}/startf/create_startf.sh create_startf.sh
379
ln -svf ${LAGRANTO}/select/select.sh        select.sh
398
ln -svf ${LAGRANTO}/select/select.sh        select.sh
380
ln -svf ${LAGRANTO}/select/select.sh        seltra.sh
399
ln -svf ${LAGRANTO}/select/select.sh        seltra.sh
381
ln -svf ${LAGRANTO}/trace/trace.sh          trace.sh
400
ln -svf ${LAGRANTO}/trace/trace.sh          trace.sh
382
ln -svf ${LAGRANTO}/density/density.sh      density.sh
401
ln -svf ${LAGRANTO}/density/density.sh      density.sh
383
ln -svf ${LAGRANTO}/startf/create_startf.sh startf.sh
402
ln -svf ${LAGRANTO}/startf/create_startf.sh startf.sh
384
ln -svf ${LAGRANTO}/lidar/lidar.sh          lidar.sh
403
ln -svf ${LAGRANTO}/lidar/lidar.sh          lidar.sh
385
 
404
 
386
ln -svf ${LAGRANTO}/caltra/caltra.sh        caltra.ecmwf
405
ln -svf ${LAGRANTO}/caltra/caltra.sh        caltra.ecmwf
387
ln -svf ${LAGRANTO}/startf/create_startf.sh create_startf.ecmwf
406
ln -svf ${LAGRANTO}/startf/create_startf.sh create_startf.ecmwf
388
ln -svf ${LAGRANTO}/select/select.sh        select.ecmwf
407
ln -svf ${LAGRANTO}/select/select.sh        select.ecmwf
389
ln -svf ${LAGRANTO}/select/select.sh        seltra.ecmwf
408
ln -svf ${LAGRANTO}/select/select.sh        seltra.ecmwf
390
ln -svf ${LAGRANTO}/trace/trace.sh          trace.ecmwf
409
ln -svf ${LAGRANTO}/trace/trace.sh          trace.ecmwf
391
ln -svf ${LAGRANTO}/density/density.sh      density.ecmwf
410
ln -svf ${LAGRANTO}/density/density.sh      density.ecmwf
392
ln -svf ${LAGRANTO}/startf/create_startf.sh startf.ecmwf
411
ln -svf ${LAGRANTO}/startf/create_startf.sh startf.ecmwf
393
ln -svf ${LAGRANTO}/lidar/lidar.sh          lidar.ecmwf
412
ln -svf ${LAGRANTO}/lidar/lidar.sh          lidar.ecmwf
394
 
413
 
395
ln -svf ${LAGRANTO}/caltra/caltra.sh        caltra
414
ln -svf ${LAGRANTO}/caltra/caltra.sh        caltra
396
ln -svf ${LAGRANTO}/startf/create_startf.sh create_startf
415
ln -svf ${LAGRANTO}/startf/create_startf.sh create_startf
397
ln -svf ${LAGRANTO}/select/select.sh        select
416
ln -svf ${LAGRANTO}/select/select.sh        select
398
ln -svf ${LAGRANTO}/select/select.sh        seltra
417
ln -svf ${LAGRANTO}/select/select.sh        seltra
399
ln -svf ${LAGRANTO}/trace/trace.sh          trace
418
ln -svf ${LAGRANTO}/trace/trace.sh          trace
400
ln -svf ${LAGRANTO}/density/density.sh      density
419
ln -svf ${LAGRANTO}/density/density.sh      density
401
ln -svf ${LAGRANTO}/startf/create_startf.sh startf
420
ln -svf ${LAGRANTO}/startf/create_startf.sh startf
402
ln -svf ${LAGRANTO}/lidar/lidar.sh          lidar
421
ln -svf ${LAGRANTO}/lidar/lidar.sh          lidar
403
 
422
 
404
foreach tool ( $tools )
423
foreach tool ( $tools )
405
 
424
 
406
ln -svf ${LAGRANTO}/goodies/${tool}.sh     ${tool}.sh 
425
ln -svf ${LAGRANTO}/goodies/${tool}.sh     ${tool}.sh 
407
ln -svf ${LAGRANTO}/goodies/${tool}.sh     ${tool}.ecmwf
426
ln -svf ${LAGRANTO}/goodies/${tool}.sh     ${tool}.ecmwf
408
ln -svf ${LAGRANTO}/goodies/${tool}.sh     ${tool} 
427
ln -svf ${LAGRANTO}/goodies/${tool}.sh     ${tool} 
409
 
428
 
410
end
429
end
411
 
430
 
412
# Set link for create_startf / startf
431
# Set link for create_startf / startf
413
\rm -f ${LAGRANTO}/startf
432
\rm -f ${LAGRANTO}/startf
414
ln -svf ${LAGRANTO}/create_startf ${LAGRANTO}/startf
433
ln -svf ${LAGRANTO}/create_startf ${LAGRANTO}/startf
415
 
434
 
416
# Set extra name for <select> to avoid conflict in BASH
435
# Set extra name for <select> to avoid conflict in BASH
417
ln -svf ${LAGRANTO}/select/select.sh        seltra
436
ln -svf ${LAGRANTO}/select/select.sh        seltra
418
ln -svf ${LAGRANTO}/select/select.sh        seltra.sh
437
ln -svf ${LAGRANTO}/select/select.sh        seltra.sh
419
ln -svf ${LAGRANTO}/select/select.sh        seltra.ecmwf
438
ln -svf ${LAGRANTO}/select/select.sh        seltra.ecmwf
420
 
439
 
421
endif
440
endif
422
 
441
 
423
 
442
 
424
# -----------------------------------------------------------------------------
443
# -----------------------------------------------------------------------------
425
# Synchronise ( development -> operational ) 
444
# Synchronise ( development -> operational ) 
426
# -----------------------------------------------------------------------------
445
# -----------------------------------------------------------------------------
427
 
446
 
428
if ( "${mode}" == "sync"  ) then
447
if ( ("${mode}" == "all" ) | ("${mode}" == "sync" )  ) then
429
 
448
 
430
echo
449
echo
431
echo "-----------------------------------------------------------------"
450
echo "-----------------------------------------------------------------"
432
echo "Sync ( development -> operational )"
451
echo "Sync ( lagranto.ecmwf -> lagranto )"
433
echo "-----------------------------------------------------------------"
452
echo "-----------------------------------------------------------------"
434
echo
453
echo
435
 
454
 
436
# Synchronize directories
-
 
437
rsync --delete -avz ${path_devel} ${path_sync}
-
 
438
 
-
 
439
# Set the correct path 
-
 
440
setenv LAGRANTO ${path_sync}
-
 
441
 
-
 
442
# Set the correct links
-
 
443
if ( ! -d ${LAGRANTO}/bin ) mkdir ${LAGRANTO}/bin
-
 
444
cd ${LAGRANTO}/bin
455
cd ${path_sync}/bin/
445
 
-
 
446
ln -svf ${LAGRANTO}/bin/lagranto            lagranto.sh
-
 
447
ln -svf ${LAGRANTO}/bin/lagranto            lagranto.ecmwf
-
 
448
ln -svf ${LAGRANTO}/bin/lagrantohelp        lagrantohelp.sh
-
 
449
ln -svf ${LAGRANTO}/bin/lagrantohelp        lagrantohelp.ecmwf
-
 
450
 
-
 
451
ln -svf ${LAGRANTO}/caltra/caltra.sh        caltra.sh
-
 
452
ln -svf ${LAGRANTO}/startf/create_startf.sh create_startf.sh
-
 
453
ln -svf ${LAGRANTO}/select/select.sh        select.sh
-
 
454
ln -svf ${LAGRANTO}/trace/trace.sh          trace.sh
-
 
455
ln -svf ${LAGRANTO}/density/density.sh      density.sh
-
 
456
ln -svf ${LAGRANTO}/startf/create_startf.sh startf.sh
-
 
457
ln -svf ${LAGRANTO}/lidar/lidar.sh          lidar.sh
-
 
458
 
456
 
459
ln -svf ${LAGRANTO}/caltra/caltra.sh        caltra.ecmwf
457
ln -svf ${path_devel}/bin/lagranto.sh            lagranto.ecmwf
460
ln -svf ${LAGRANTO}/startf/create_startf.sh create_startf.ecmwf
-
 
461
ln -svf ${LAGRANTO}/select/select.sh        select.ecmwf
-
 
462
ln -svf ${LAGRANTO}/trace/trace.sh          trace.ecmwf
458
ln -svf ${path_devel}/bin/lagrantohelp.sh        lagrantohelp.ecmwf
463
ln -svf ${LAGRANTO}/density/density.sh      density.ecmwf
-
 
464
ln -svf ${LAGRANTO}/startf/create_startf.sh startf.ecmwf
-
 
465
ln -svf ${LAGRANTO}/lidar/lidar.sh          lidar.ecmwf
-
 
466
 
459
 
467
ln -svf ${LAGRANTO}/caltra/caltra.sh        caltra
460
ln -svf ${path_devel}/caltra/caltra.sh           caltra.ecmwf
468
ln -svf ${LAGRANTO}/startf/create_startf.sh create_startf
461
ln -svf ${path_devel}/startf/create_startf.sh    create_startf.ecmwf
469
ln -svf ${LAGRANTO}/select/select.sh        select
462
ln -svf ${path_devel}/select/select.sh           select.ecmwf
470
ln -svf ${LAGRANTO}/trace/trace.sh          trace
463
ln -svf ${path_devel}/trace/trace.sh             trace.ecmwf
471
ln -svf ${LAGRANTO}/density/density.sh      density
464
ln -svf ${path_devel}/density/density.sh         density.ecmwf
472
ln -svf ${LAGRANTO}/startf/create_startf.sh startf
465
ln -svf ${path_devel}/startf/create_startf.sh    startf.ecmwf
473
ln -svf ${LAGRANTO}/lidar/lidar.sh          lidar
466
ln -svf ${path_devel}/lidar/lidar.sh             lidar.ecmwf
-
 
467
ln -svf ${path_devel}/lidar/seltra.sh            seltra.ecmwf
474
 
468
 
475
foreach tool ( $tools )
469
foreach tool ( $tools )
476
 
470
 
477
ln -svf ${LAGRANTO}/goodies/${tool}.sh     ${tool}.sh 
-
 
478
ln -svf ${LAGRANTO}/goodies/${tool}.sh     ${tool}.ecmwf
471
ln -svf ${path_devel}/goodies/${tool}.sh         ${tool}.ecmwf
479
ln -svf ${LAGRANTO}/goodies/${tool}.sh     ${tool} 
-
 
480
 
472
 
481
end
473
end
482
 
474
 
483
# Set all permissions
475
# Set all permissions
484
chmod -R og+rx ${path_sync}
476
chmod -R og+rx ${path_sync}/bin/
485
 
-
 
486
# Set link for create_startf / startf
-
 
487
ln -s ${LAGRANTO}/create_startf ${LAGRANTO}/startf
-
 
488
 
477
 
489
endif
478
endif
490
 
479
 
491
# -----------------------------------------------------------------------------
480
# -----------------------------------------------------------------------------
492
# Final tasks
481
# Final tasks
493
# -----------------------------------------------------------------------------
482
# -----------------------------------------------------------------------------
494
 
483
 
495
echo
484
echo
496
echo "-----------------------------------------------------------------"
485
echo "-----------------------------------------------------------------"
497
echo "Installation complete"
486
echo "Installation complete"
498
echo "-----------------------------------------------------------------"
487
echo "-----------------------------------------------------------------"
499
echo
488
echo
500
echo "Please set the environmental variable LAGRANTO"
489
echo "Please set the environmental variable LAGRANTO"
501
echo
490
echo
502
echo "    setenv LAGRANTO ${LAGRANTO}"
491
echo "    setenv LAGRANTO ${LAGRANTO}"
503
echo
492
echo
504
 
493
 
505
 
494
 
506
 
495
 
507
 
496
 
508
 
497