Subversion Repositories lagranto.ecmwf

Rev

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

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