Subversion Repositories lagranto.ecmwf

Rev

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

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