Subversion Repositories lagranto.ecmwf

Rev

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

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