Subversion Repositories lagranto.ecmwf

Rev

Rev 44 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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