-
Notifications
You must be signed in to change notification settings - Fork 7
/
compile_ALL.sh
executable file
·52 lines (40 loc) · 1.43 KB
/
compile_ALL.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
##==============================================================================
## N. Jourdain, IGE-CNRS, Feb. 2017
##
## purpose : used to compile all fortran routines
##
##==============================================================================
##==============================================================================
## User's setting :
#module list
#module unload netcdf
#module load netcdf/4.1.1-intel
# Fortran compiler :
FC='ifort'
# Netcdf libraries :
## ada :
## export NC_INC=" " ## empty on adapp with modules 1) hdf5/seq/1.8.9(default); 2) netcdf/seq/4.1.3(default); 3) intel/2013.1
## export NC_LIB=" " ## empty on adapp with modules 1) hdf5/seq/1.8.9(default); 2) netcdf/seq/4.1.3(default); 3) intel/2013.1
# other machines :
export NC_INC="-I`nc-config --includedir` `nc-config --fflags`"
export NC_LIB="`nc-config --flibs`"
export GSW_DIR="./GSW-Fortran"
##==============================================================================
echo "NC_INC=${NC_INC}"
echo "NC_LIB=${NC_LIB}"
for file in src/*f90
do
filobj=`basename $file | sed -e "s/\.f90/\.o/g"`
namexe=`basename $file | sed -e "s/\.f90//g"`
rm -f $namexe $filobj
$FC -c $NC_INC -I${GSW_DIR}/modules $file
$FC -o $namexe ${GSW_DIR}/modules/*.o ${GSW_DIR}/toolbox/*.o $filobj $NC_LIB
if [ -f $namexe ]; then
rm -f $filobj
echo "$namexe [oK]"
else
echo "~!@#%^&* ERROR : $namexe HAS NOT BEEN CREATED >>>>>>>> stop !!"
exit
fi
done