Subversion Repositories lagranto.um

Rev

Rev 15 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15 Rev 16
Line 4... Line 4...
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] "
9
  echo "install.sh [lib|core|goodies|links|all|docu|clean|convert] "
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
Line 19... Line 19...
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.um/"
20
set path_devel = "${DYN_TOOLS}/lagranto.um/"
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 gfortran 
25
 
-
 
26
# Init netCDF library depending on the Fortran compiler
-
 
27
if ( "${FORTRAN}" == "pgf90" ) then
-
 
28
  module load netcdf/4.2.1-pgf90
-
 
29
 
-
 
30
# Init Fortran compiler and set netCDF acccordingly
-
 
31
setenv FORTRAN pgf90
-
 
32
 
25
 
33
# Init netCDF library depending on the Fortran compiler
26
# Init netCDF library depending on the Fortran compiler
34
if ( "${FORTRAN}" == "pgf90" ) then
27
if ( "${FORTRAN}" == "pgf90" ) then
35
  module load netcdf/4.2.1-pgf90
28
  module load netcdf/4.2.1-pgf90
36
  module list
29
  module list
37
 
30
 
38
else if ( "${FORTRAN}" == "gfortran" ) then
31
else if ( "${FORTRAN}" == "gfortran" ) then
39
  module load gfortran
32
  module load gfortran
40
  module load netcdf/4.1.1
33
  module load netcdf/4.2.1
41
 
34
 
42
else if ( "${FORTRAN}" == "ifort" ) then
35
else if ( "${FORTRAN}" == "ifort" ) then
43
  module load ifort/10.1.017
36
  module load ifort/10.1.017
44
  module load netcdf/4.1.1-ifort
37
  module load netcdf/4.1.1-ifort
45
 
38
 
Line 120... Line 113...
120
if ( "${mode}" == "core"    ) goto modeok
113
if ( "${mode}" == "core"    ) goto modeok
121
if ( "${mode}" == "goodies" ) goto modeok
114
if ( "${mode}" == "goodies" ) goto modeok
122
if ( "${mode}" == "links"   ) goto modeok
115
if ( "${mode}" == "links"   ) goto modeok
123
if ( "${mode}" == "clean"   ) goto modeok
116
if ( "${mode}" == "clean"   ) goto modeok
124
if ( "${mode}" == "docu"    ) goto modeok
117
if ( "${mode}" == "docu"    ) goto modeok
-
 
118
if ( "${mode}" == "convert" ) goto modeok
125
echo "Unsupported mode ${mode} ... Stop"
119
echo "Unsupported mode ${mode} ... Stop"
126
exit 1
120
exit 1
127
 
121
 
128
modeok:
122
modeok:
129
 
123
 
Line 134... Line 128...
134
if ( "${mode}" == "clean" ) then
128
if ( "${mode}" == "clean" ) then
135
 
129
 
136
cd ${LAGRANTO}/
130
cd ${LAGRANTO}/
137
 
131
 
138
foreach prog ( $core )
132
foreach prog ( $core )
139
   \rm -f ${prog}/${prog} ${prog}/${prog}.o
133
  \rm -f ${prog}/${prog} ${prog}/${prog}.o
140
end
134
end
141
\rm -f trace/calvar.o select/special.o
135
\rm -f trace/calvar.o select/special.o
142
 
136
 
143
foreach tool ( $tools )
137
foreach tool ( $tools )
144
  \rm -f goodies/${tool} goodies/${tool}.o 
138
  \rm -f goodies/${tool} goodies/${tool}.o 
Line 156... Line 150...
156
end
150
end
157
\rm -f bin/lagrantohelp.sh bin/lagrantohelp.um
151
\rm -f bin/lagrantohelp.sh bin/lagrantohelp.um
158
\rm -f bin/startf bin/startf.sh bin/startf.um
152
\rm -f bin/startf bin/startf.sh bin/startf.um
159
\rm -f bin/lagranto.sh bin/lagranto.um
153
\rm -f bin/lagranto.sh bin/lagranto.um
160
 
154
 
161
\rm ${LAGRANTO}/startf
-
 
162
 
-
 
163
exit 0
155
exit 0
164
 
156
 
165
endif
157
endif
166
 
158
 
167
# -----------------------------------------------------------------------------
159
# -----------------------------------------------------------------------------
Line 377... Line 369...
377
 
369
 
378
# Exit if only goodies should be installed
370
# Exit if only goodies should be installed
379
if ( "${mode}" == "goodies" ) exit 0
371
if ( "${mode}" == "goodies" ) exit 0
380
 
372
 
381
# -----------------------------------------------------------------------------
373
# -----------------------------------------------------------------------------
-
 
374
# Compile conversion tool
-
 
375
# -----------------------------------------------------------------------------
-
 
376
 
-
 
377
if ( ("${mode}" == "all" ) | ("${mode}" == "convert" ) ) then
-
 
378
 
-
 
379
echo
-
 
380
echo "-----------------------------------------------------------------"
-
 
381
echo "Installing Lagranto conversion tool"
-
 
382
echo "-----------------------------------------------------------------"
-
 
383
 
-
 
384
cd ${LAGRANTO}/convert
-
 
385
 
-
 
386
foreach tool ( pp2cdf )
-
 
387
 
-
 
388
echo
-
 
389
echo "----- ${tool}"
-
 
390
echo
-
 
391
\rm -f ${tool}.o
-
 
392
\rm -f ${tool}
-
 
393
make -f ${tool}.make
-
 
394
if ( ! -f ${tool} ) then
-
 
395
  echo "Problem in compiling ${tool} ... Stop"
-
 
396
  exit 1
-
 
397
endif
-
 
398
 
-
 
399
end
-
 
400
 
-
 
401
endif
-
 
402
 
-
 
403
# Exit if only goodies should be installed
-
 
404
if ( "${mode}" == "convert" ) exit 0
-
 
405
 
-
 
406
# -----------------------------------------------------------------------------
-
 
407
# Check that all Lagranto conversion tool is available
-
 
408
# -----------------------------------------------------------------------------
-
 
409
 
-
 
410
echo
-
 
411
echo "-----------------------------------------------------------------"
-
 
412
echo "Check that all Lagranto conversion tool is available"
-
 
413
echo "-----------------------------------------------------------------"
-
 
414
echo
-
 
415
 
-
 
416
cd ${LAGRANTO}/convert
-
 
417
 
-
 
418
foreach tool ( pp2cdf  )
-
 
419
 
-
 
420
if ( ! -f ${tool} ) then
-
 
421
  echo "${tool} is missing... Stop"
-
 
422
  exit 1
-
 
423
else
-
 
424
  ls -l ${tool} 
-
 
425
endif
-
 
426
 
-
 
427
end
-
 
428
 
-
 
429
endif
-
 
430
 
-
 
431
# Exit if only conversion tool should be installed
-
 
432
if ( "${mode}" == "convert" ) exit 0
-
 
433
 
-
 
434
# -----------------------------------------------------------------------------
382
# Create links to programs
435
# Create links to programs
383
# -----------------------------------------------------------------------------
436
# -----------------------------------------------------------------------------
384
 
437
 
385
if ( ("${mode}" == "all" ) | ("${mode}" == "links" )  ) then
438
if ( ("${mode}" == "all" ) | ("${mode}" == "links" )  ) then
386
 
439