7 |
# first version tested on Fedore Core 4 x86-64 Opteron (Linux batsi) |
# first version tested on Fedore Core 4 x86-64 Opteron (Linux batsi) |
8 |
# updated and tested on acesgrid (Fedora Core 15), using: |
# updated and tested on acesgrid (Fedora Core 15), using: |
9 |
# module load open64 (Version 4.2.4) |
# module load open64 (Version 4.2.4) |
10 |
|
# Also tested with MPI on acesgrid, using: |
11 |
|
# module load open64 (Version 4.2.4) |
12 |
|
# and with mpich1: |
13 |
|
# module load mvapich |
14 |
|
# or with mpich2: |
15 |
|
# module load mvapich2 |
16 |
|
# or with openmpi: <== not yet tested |
17 |
|
# module load openmpi |
18 |
|
|
19 |
#------- |
#------- |
20 |
# run with OpenMP: needs to set environment var. OMP_NUM_THREADS |
# run with OpenMP: needs to set environment var. OMP_NUM_THREADS |
27 |
# > setenv OMP_SLAVE_STACK_SIZE 400m |
# > setenv OMP_SLAVE_STACK_SIZE 400m |
28 |
#------- |
#------- |
29 |
|
|
30 |
CC=opencc |
if test "x$MPI" = xtrue ; then |
31 |
FC=openf90 |
CC=mpicc |
32 |
LINK=openf90 |
FC=mpif90 |
33 |
|
F90C=mpif90 |
34 |
|
LINK=mpif90 |
35 |
|
else |
36 |
|
CC=opencc |
37 |
|
FC=openf90 |
38 |
|
F90C=openf90 |
39 |
|
LINK=openf90 |
40 |
|
fi |
41 |
|
|
42 |
DEFINES='-DWORDLENGTH=4' |
DEFINES='-DWORDLENGTH=4' |
43 |
CPP='cpp -traditional -P' |
CPP='cpp -traditional -P' |
44 |
EXTENDED_SRC_FLAG='-extend-source' |
EXTENDED_SRC_FLAG='-extend-source' |
45 |
|
F90FIXEDFORMAT='-fixedform -x f95' |
46 |
GET_FC_VERSION="--version" |
GET_FC_VERSION="--version" |
47 |
OMPFLAG='-openmp' |
OMPFLAG='-openmp' |
48 |
#OMPFLAG='-openmp -OPT:early_mp=ON' |
#OMPFLAG='-openmp -OPT:early_mp=ON' |
55 |
#FFLAGS="$FFLAGS -r8" |
#FFLAGS="$FFLAGS -r8" |
56 |
|
|
57 |
if test "x$IEEE" = x ; then #- with optimisation: |
if test "x$IEEE" = x ; then #- with optimisation: |
58 |
FOPTIM='-O3 -LNO:fusion=2 -OPT:roundoff=1:IEEE_arithmetic=3' # -funsafe-math-optimizations' |
#- full optimisation |
59 |
|
# ("-Ofast" eqv "-O3 -ipa -OPT:Ofast -fno-math-errno -ffast-math" and "-OPT:Ofast" |
60 |
|
# eqv to "-OPT:roundoff=2 -OPT:Olimit=0 -OPT:div_split=ON -OPT:alias=typed") |
61 |
|
#FOPTIM='-Ofast -OPT:roundoff=1:IEEE_arithmetic=3 -LNO:fusion=2' |
62 |
|
FOPTIM='-O3 -OPT:Ofast:roundoff=1:IEEE_arithmetic=3 -ffast-math -LNO:fusion=2' |
63 |
|
#- high optimisation (-O3), might find Pb with few S/R; fully safe: switch to -O2: |
64 |
|
#FOPTIM='-O3 -OPT:roundoff=1:IEEE_arithmetic=3 -LNO:fusion=2' |
65 |
|
NOOPTFLAGS='-O3 -OPT:roundoff=1:IEEE_arithmetic=2 -LNO:fusion=2' |
66 |
|
NOOPTFILES='seaice_evp.F' |
67 |
else |
else |
68 |
if test "x$DEVEL" = x ; then #- no optimisation + IEEE : |
if test "x$DEVEL" = x ; then #- no optimisation + IEEE : |
69 |
FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math' |
FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math' |
78 |
CFLAGS='-O0 -m64 -fPIC' |
CFLAGS='-O0 -m64 -fPIC' |
79 |
GSLLIB='-lgsl -lgslcblas' |
GSLLIB='-lgsl -lgslcblas' |
80 |
|
|
81 |
|
INCLUDEDIRS='' |
82 |
|
INCLUDES='' |
83 |
|
LIBS='' |
84 |
|
|
85 |
if [ "x$NETCDF_ROOT" != x ] ; then |
if [ "x$NETCDF_ROOT" != x ] ; then |
86 |
INCLUDEDIR="${NETCDF_ROOT}/include" |
INCLUDEDIR="${NETCDF_ROOT}/include" |
87 |
INCLUDES="-I${NETCDF_ROOT}/include" |
INCLUDES="-I${NETCDF_ROOT}/include" |
117 |
LIBS='-L/usr/local/lib64' |
LIBS='-L/usr/local/lib64' |
118 |
fi |
fi |
119 |
|
|
120 |
|
if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then |
121 |
|
INCLUDES="$INCLUDES -I$MPI_INC_DIR" |
122 |
|
INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR" |
123 |
|
MPIINCLUDEDIR="$MPI_INC_DIR" |
124 |
|
MPI_HEADER_FILES='mpif.h mpiof.h' |
125 |
|
MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h' |
126 |
|
fi |
127 |
|
|