Warning, /tools/build_options/linux_amd64_ifort_beagle is written in an unsupported language. File is not indexed.
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
2eab4961da Oliv*0001 #!/bin/bash
0002 #
0003 #
0004 # These are the build options used with the Intel 10.x compiler for
11cca6c7e1 Jean*0005 # testing on Beagle (with and without MPI).
2eab4961da Oliv*0006 #
0007 # Use after
0008 #
0009 # module add mitgcm
0010 #
0011 # (tested with darwin/20090605 mitgcm/20090605, i.e.,
0012 # intel/10.0.025 mx/1.0 netcdf/3.6.2/intel-10.0.025 mpich-mx/1.2.7..7/intel-10.0.025)
0013 #
0014 # These modules set FFLAGS, CFLAGS and CPPFLAGS for mpich and netcdf.
0015 #
0016 # The SGE -V option for exporting environment variables may also be
0017 # helpful if you encounter missing-library problems. Or,
0018 # alternatively, one may choose to link with one of the intel
0019 # "-static" or "-i-static" flags.
0020
11cca6c7e1 Jean*0021 if test "x$MPI" = xtrue ; then
0022 CC='mpicc'
0023 FC='mpif77'
0024 F90C='mpif90'
0025 LINK='mpif77'
0026 for path in $(echo "$CPATH" | sed 's/:/ /g'); do
0027 CPPFLAGS="$CPPFLAGS -I$path"
0028 done
0029 else
0030 CC='icc'
0031 FC='ifort'
0032 F90C=$FC
0033 LINK=$FC
0034 fi
0035
2eab4961da Oliv*0036 # the netcdf module sets CPPFLAGS, LDFLAGS and FFLAGS
0037 INCLUDES="$CPPFLAGS"
11cca6c7e1 Jean*0038 # for static linkage:
0039 #LIBS="$LDFLAGS -static"
0040 # for dynamic linkage (note: needed with netcdf <- namespace conflict???)
2eab4961da Oliv*0041 LIBS="$LDFLAGS -shared-intel"
0042
0043 # -DIFORT turns on ifort-specific declarations in darwin (RAND is not an intrinsic)
0044 DEFINES='-DWORDLENGTH=4 -DIFORT'
0045 CPP='cpp -traditional -P'
11cca6c7e1 Jean*0046 F90FIXEDFORMAT='-fixed -Tf'
08bdbd4b74 Jean*0047 EXTENDED_SRC_FLAG='-132'
a5566b88fb Jean*0048 GET_FC_VERSION="--version"
11cca6c7e1 Jean*0049 OMPFLAG='-openmp'
2eab4961da Oliv*0050
11cca6c7e1 Jean*0051 NOOPTFILES='mds_byteswapr8.F mds_byteswapr4.F mds_byteswapi4.F mds_byteswap.F'
0052 NOOPTFILES=$NOOPTFILES' mom_calc_ke.F mon_ke.F'
2eab4961da Oliv*0053
11cca6c7e1 Jean*0054 # ifort options:
0055 # -132 fixed-form line length is 132 characters
0056 # -r8 REAL is REAL*8
0057 # -i4 INTEGER is INTEGER*4
0058 # -w95 don't warn about use of Fortran 95 extensions
0059 # -W0 disable all warning messages
0060 # -WB turns a compile-time bounds check error into a warning
0061 # -xT optimize for Intel Core2 and Xeon 51xx
0062 # -fno-alias don't assume aliasing (assume that different variables
0063 # DON'T refer to the same memory location)
0064 # -assume byterecl record length in OPEN statements is in bytes
0065 # -convert big_endian binary files contain big-endian data
0066 # -CB check bounds
0067 # -pc64 round floating point values to 64 bits
0068 # one could also try
0069 # -mp maintain precision
0070
0071 FFLAGS="$FFLAGS -w95 -W0 -WB -xT -fno-alias -assume byterecl -convert big_endian"
0072 #- might want to use '-r8' for fizhi pkg:
0073 #FFLAGS="$FFLAGS -r8"
0074
0075 if test "x$IEEE" = x ; then #- with optimisation:
2eab4961da Oliv*0076 NOOPTFLAGS='-O2'
11cca6c7e1 Jean*0077 # use this for exact restart (slightly slower):
0078 FOPTIM='-O2 -pc64 -mieee-fp -align'
0079 # use this for flighty faster execution but with roundoff errors in restart:
0080 # FOPTIM='-O2 -align'
0081 else #- no optimisation + IEEE :
2eab4961da Oliv*0082 NOOPTFLAGS='-O0'
0083 # FOPTIM='-O0 -noalign -CA -CB -CU -CV -CS'
0084 FOPTIM='-O0 -noalign'
11cca6c7e1 Jean*0085 FFLAGS="$FFLAGS -pc64"
2eab4961da Oliv*0086 fi
0087
11cca6c7e1 Jean*0088 F90FLAGS=$FFLAGS
0089 F90OPTIM=$FOPTIM
2eab4961da Oliv*0090