Subversion Repositories lagranto.ecmwf

Rev

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

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