1 |
#!/bin/bash |
#!/bin/bash |
2 |
|
# |
3 |
|
# $Header$ |
4 |
|
# $Name$ |
5 |
|
|
6 |
# Adapted from linux_amd64_ifort_generic_mpi |
# Adapted from linux_amd64_ifort_generic_mpi |
7 |
# with specific local path (=MPI_INC_DIR & NETCDF_ROOT ) for MPI & NetCDF |
# with specific local path (=MPI_INC_DIR & NETCDF_ROOT ) for MPI & NetCDF |
8 |
# Tested on jmc's laptop (FC.8), with MPI & Multi-Threaded (OpenMP) |
# Tested on jmc's laptop with MPI & Multi-Threaded |
9 |
# using ifort v.10.1.012 & mpich-1.2.7 (installed in /opt/intel/) |
# using intel compiler v.10.1.012 & mpich-1.2.7 (FC.8) |
10 |
|
# v.11.1.046 & mpich-1.2.7 (FC.11) |
11 |
|
# (intel compiler, mpich & netcdf installed in /opt/intel/ ) |
12 |
|
|
13 |
#------- |
#------- |
14 |
# run with OpenMP: needs to set environment var. OMP_NUM_THREADS |
# run with OpenMP: needs to set environment var. OMP_NUM_THREADS |
19 |
# - csh,tcsh: |
# - csh,tcsh: |
20 |
# > setenv OMP_NUM_THREADS 2 |
# > setenv OMP_NUM_THREADS 2 |
21 |
# > setenv KMP_STACKSIZE 400m |
# > setenv KMP_STACKSIZE 400m |
22 |
|
# NOTE: need to set KMP_STACKSIZE in ~/.tcshrc (but curiously, works |
23 |
|
# without OMP_NUM_THREADS in ~/.tcshrc). |
24 |
#------- |
#------- |
25 |
|
|
26 |
# Composed and tested by ce107 on ross/weddell (Opteron system) |
# Composed and tested by ce107 on ross/weddell (Opteron system) |
41 |
# DON'T FORGET to set environment variable MPI_INC_DIR to the include |
# DON'T FORGET to set environment variable MPI_INC_DIR to the include |
42 |
# directory of your MPI implementation |
# directory of your MPI implementation |
43 |
|
|
44 |
NETCDF_ROOT='/opt/intel/netcdf-3.6.2' |
NETCDF_ROOT='/opt/intel/netcdf-4.0.1/11.1' |
45 |
MPI_INC_DIR='/opt/intel/mpich-1.2.7p1_ic-10.1.012/include' |
MPI_INC_DIR='/opt/intel/mpich-1.2.7p1_ic-11.1.046/include' |
46 |
|
|
47 |
FC=mpif77 |
FC=mpif77 |
48 |
F90C='mpif90 -fixed' |
F90C='mpif90 -fixed' |
56 |
EXTENDED_SRC_FLAG='-132' |
EXTENDED_SRC_FLAG='-132' |
57 |
OMPFLAG='-openmp' |
OMPFLAG='-openmp' |
58 |
|
|
59 |
NOOPTFLAGS='-O0 -g -m64 -fPIC' |
NOOPTFLAGS='-O0 -g' |
60 |
NOOPTFILES='' |
NOOPTFILES='' |
61 |
|
|
62 |
INCLUDEDIRS='' |
INCLUDEDIRS='' |
64 |
LIBS='' |
LIBS='' |
65 |
|
|
66 |
if test "x$DEVEL" != x ; then |
if test "x$DEVEL" != x ; then |
67 |
FFLAGS='-r8 -i4 -w95 -W0 -WB -convert big_endian -assume byterecl -fPIC -O0 -g -noalign -fp-stack-check -check all -fpe0 -traceback -ftrapuv -fp-model except -warn all' |
FFLAGS="$FFLAGS -w95 -W0 -WB -convert big_endian -assume byterecl -fPIC -O0 -g -noalign -fp-stack-check -check all -fpe0 -traceback -ftrapuv -fp-model except -warn all" |
68 |
else |
else |
69 |
FFLAGS='-r8 -i4 -w95 -W0 -WB -convert big_endian -assume byterecl -fPIC' |
FFLAGS="$FFLAGS -w95 -W0 -WB -convert big_endian -assume byterecl -fPIC" |
70 |
fi |
fi |
71 |
|
#- might want to use '-r8' for fizhi pkg: |
72 |
|
#FFLAGS="$FFLAGS -r8" |
73 |
|
|
74 |
if test "x$IEEE" = x ; then |
if test "x$IEEE" = x ; then |
75 |
# No need for IEEE-754 |
# No need for IEEE-754 |
76 |
FOPTIM='-O2 -align -xW -ip' |
FOPTIM='-O2 -align -xW -ip' |
77 |
else |
else |
78 |
# Try to follow IEEE-754 |
# Try to follow IEEE-754 |
79 |
FOPTIM='-O0 -align -xW -ip -fp-model strict' |
FOPTIM='-O0 -xW -ip -fp-model strict' |
80 |
# for automatic testing with testreport (but no relation with IEEE arithmetic): |
# for automatic testing with testreport (but no relation with IEEE arithmetic): |
81 |
FOPTIM="$FOPTIM -g -noalign -fp-stack-check -check all -fpe0 -traceback -ftrapuv" |
FOPTIM="$FOPTIM -fpe0 -ftz -fp-stack-check -check all -ftrapuv" |
82 |
|
FOPTIM="$FOPTIM -noalign -g -traceback" |
83 |
|
NOOPTFILES='ad_taf_output.f' |
84 |
fi |
fi |
85 |
F90FLAGS=$FFLAGS |
F90FLAGS=$FFLAGS |
86 |
F90OPTIM=$FOPTIM |
F90OPTIM=$FOPTIM |
121 |
LIBS='-L/usr/local/lib64' |
LIBS='-L/usr/local/lib64' |
122 |
fi |
fi |
123 |
|
|
|
|
|
124 |
INCLUDES="$INCLUDES -I$MPI_INC_DIR" |
INCLUDES="$INCLUDES -I$MPI_INC_DIR" |
125 |
INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR" |
INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR" |
126 |
MPIINCLUDEDIR="$MPI_INC_DIR" |
MPIINCLUDEDIR="$MPI_INC_DIR" |