Log In | Users | Register
COSMO Web

Fortran compilers used for RCM activities

Some information about Fortran compilers can be found in http://www.fortran-2000.com/ArnaudRecipes/CompilerTricks.html.

Dictionary (options equivalence among compilers)

Effect PGI GNU Cray Intel IBM XL
Show compilation information (invocations of compiler, assembler, linker) -v -v -v -v -v
Ensure compliance with IEEE floating point arithmetics rules -Kieee -fno-fast-math -Ofp0 -mieee-fp -qstrict=ieeefp
Assume free form syntax -Mfree -ffree-form -ffree -free -qfree
Assume fixed form syntax -Mfixed -ffixed-form ? ? ?
Check that all variables are declared (implicit none) -Mdclchk -fimplicit-none -eI -implicitnone -u
Turn-on preprocessing of all files (CPP keys) -Mpreprocess -cpp -eZ -cpp (or -fpp) -tF or -WF or -qsuffix=cpp=f90
Array bounds checking -C (or -Mbounds) -fbounds-check -Rb -CB (or -check bounds) -qcheck (or -C)
Floating point exceptions -Ktrap=fp -ffpe-trap=invalid,zero,overflow -K trap=fp (?) -fpe0 -qflttrap
Check null pointers reference -Mchkptr ? -Rp -check pointers (?) -qinit (?)
Allow 132-column source lines -Mextend -ffree-line-length-132 (free form), -ffixed-line-length-132 (fixed form) ? ? ?
Swap byte-order for unformatted i/o (big/little-endian) -byteswapio ? ? ? ?
Disables automatic vector pipelining -Mnovect ? ? ? ?

A similar dictionary for (partly) other compilers can be found under: http://www.fortran-2000.com/ArnaudRecipes/CompilerTricks.html#CompTable_fortran

PGI compiler

Official documentation on the PGI compiler can be found here.

The PGI compiler is available at CSCS in the module PrgEnv-pgi (CSCS documentation).

Options used for compiling COSMO, Int2lm and Extpar at CSCS

General flags

Option Effect
-Kieee Use IEEE division, optionally enable traps
-Mfree Assume free-format source
-Mdclchk Check that all variables are declared
-v Displays invocations of compiler, assembler and linker
-Minform=inform Display all error messages (inform, warn, severe and fatal)
-Minfo=all Display all information (accel,inline,ipa,loop,lre,mp,opt,par,vect)
-Mneginfo=all Display all negative information
-Mpreprocess Perform preprocessing for all source files

Debug mode

Option Effect
-O0 Inhibit any optimizations
-C Array bounds checking (== -Mbounds)
-g Generate information for debugger (disable optimizations)
-Mchkfpstk Check consistency of floating point stack at subprogram calls
-Mchkptr Check of NULL pointer references
-Ktrap=fp Enable floating point exceptions (inv,divz,ovf)
-traceback Add debug information for runtime traceback
-Mdepchk Check dependence relations for vector or parallel code
-Mstandard Check standard conformance
-Mchkstk Check for sufficient stack space upon subprogram entry
-Meh_frame Preserve exception-handling frame information (export PGI_TERM=trace)

Optimized mode

Option Effect
-O3 Aggressive global optimization
-fast Common optimizations (includes -O2 -Mvect=sse -Mlre -Mautoinline)
-Mvect=noassoc Dissallow associative transformations (OBSOLETE?)
-Mipa=fast,inline Interprocedural analysis (automatically inline)
-Mnofma Prevent fused multiply-add optimization (this prevents issues with restarts

GNU compiler

Official documentation on the GNU compiler can be found here.

The GNU compiler is available at CSCS in the module PrgEnv-gnu (CSCS documentation).

Options used for compiling COSMO and Fieldextra at CSCS

General flags

Option Effect
-fno-fast-math Enforce IEEE behaviour
-ffree-form Specify free-format source
-ffree-line-length-none Specify infinitely long lines
-fno-backslash Treat backslash as normal character
-fimplicit-none No implicit typing is allowed
-frange-check Range checking of constants at compile time
-pedantic Warn about extensions to Fortran 95 standard
-v Displays invocations of compiler, assembler and linker
-Wconversion Warn about implicit conversion of types
-cpp Perform preprocessing for all source files

Linking flags

Option Effect
-fconvert=big-endian Convert unformatted I/O byte order to big-endian
-frecord-marker=4 Length of record marker in bytes (for unformatted I/O)

Debug mode

Option Effect
-O0 Inhibit any optimizations
-g Generate information for debugger (disable optimizations)
-fbacktrace Provide backtrace of error upon crash
-fdump-core Dump core file on crash
-ffpe-trap=invalid,zero,overflow Floating point exceptions (invalid,zero,underflow)
-fbounds-check Check array bounds
-fcheck-array-temporaries Warn about array temporaries (at runtime)
-finit-real=nan Initialize all reals with NaN?
-finit-integer=999999 Initialize ints with a rediculous value
-finit-logical=true Un-intuitive logical initialization
-finit-character=35 Un-intuitive character initialization
-Wall Enable commonly used warning options
Remark: For Fieldextra, a value of -999999 is used for -finit-integer and false is used for -finit-logical.

Optimized mode

OptionSorted ascending Effect
-ftree-vectorize Enable vectorization
-funroll-loops Unroll loops whose number of iterations can be determined at compile time or upon entry to the loop
-O3 Aggressive global optimization

Cray compiler

Official documentation on the Cray compiler can be found here.

The Cray compiler is available at CSCS in the module PrgEnv-cray (CSCS documentation).

Options used for compiling COSMO at CSCS

General flags

Option Effect
-ffree Free-form source format
-N255 Line width (max number of columns) for fixed- (poss. val. are 132 or 255) and free-format (poss. val. are 72, 80, 132, 255) source lines
-ec Interface checking
-eC Standard call site checking
-eI Treat all variables as if an implicit none is there
-hnosecond_underscore Symbol names only have one underscore
-Ofp0 Require strong IEEE standard conformance
-v Show compilation information
-en Generate message for all nonstandard Fortran usage
-eo Display all optimization options used
-hmsgs Display optimization messages
-hnegmsgs Display negative optimization messages
-m1 High message level (error, warning, caution and note)
-T Display all options currently in effect
-eZ Perform preprocessing for all source files

Linking flags

Option Effect
-fconvert=big-endian Convert unformatted I/O byte order to big-endian
-frecord-marker=4 Length of record marker in bytes (for unformatted I/O)

Debug mode

Option Effect
-O0 No optimization
-g Debugging support (== -G0)
-eD Turn on all debugging information (-O0 -g -m2 -R bcdspi -rl)
-Rb Array bound checking
-Rc Check conformance of array operands
-Rd Directives checking
-Rp Check NULL pointer references
-Rs Check string bounds

Optimized mode

No option is used at the moment since the Cray compiler is a highly optimized compiler. Thus the default optimization level corresponds to -O3 (or -fast) and inlining is performed by default.

Intel compiler

Official documentation on the Intel compiler can be found here.

The Intel compiler is available at CSCS in the module PrgEnv-intel (CSCS documentation).

Options used for compiling COSMO and Int2lm on Ipazia

  • Code (version): COSMO and Int2lm
  • Machine: Ipazia
  • Compiler version: 10.0.026 (?)
  • Group/People: EMPA

General flags

Option Effect
-fpp Run the Fortran preprocessor on source files before compilation

Linking flags

No linking flag is used.

Debug mode

Option Effect
-O0 Inhibit any optimizations
-CA ???
-CB Check array bounds (same as the -check bounds option)
-CU Check uninitialized variables
-ftrapuv Initialize variables to an unusual value (error detection)
-debug all Generate complete debugging information
-stand Cause the compiler to issue compile-time messages for nonstandard language elements
-check bounds Check array bounds (same as the -CB)
-check format Check that the data type of an item being formatted for output matches the format descriptor being used
-check output_conversion Check (warning) that a data item is not too large to fit in a designated format descriptor field (otherwise field filled with asterisks)
-implicitnone Set the default type of a variable to undefined (same as -u)
-g Symbolic debug information in the object file

Optimized mode

Option Effect
-O1 Enable optimizations for speed

Options used for compiling COSMO on Tempest

  • Code (version): COSMO (and Int2lm)
  • Machine: Tempest (cluster located at ETH)
  • Compiler version: 11.1
  • Group/People: IAC (Heini Wernli's group)

General flags

Option Effect
-fpp Turn on pre-processing
-prec-div Improve precision of floating-point divides (IEEE rules compliance)
-heap-arrays Use the heap instead of the stack for automatic arrays and tmp arrays
-override-limits Override any internal limit on memory usage

Linking flags

No linking flag is used.

Debug mode

No debug flag used.

Optimized mode

Option Effect
-O3 Set optimization level
-ip Interprocedural optimizations for single-file (in-lining of procedures located in the current file)
-ipo Interprocedural optimization across files (in-lining of procedures located in other files)
-scalar-rep Enable scalar replacement performed during loop transformation (need -O3)

Options used for compiling COSMO by ARPA Emiglia-Romagnia

  • Code (version): COSMO
  • Machine: ?
  • Compiler version: ?
  • Group/People: ARPA Emiglia-Romagnia (Davide Cesari)

General flags

Option Effect
-cpp Turn on pre-processing
-prec-div Improve precision of floating-point divides (IEEE rules compliance)
-xW Generate code for Intel Pentium 4 processors and compatible Intel processors

Linking flags

No linking flag is used.

Debug mode

No information.

Optimized mode

Option Effect
-O3 Set optimization level
-ip Interprocedural optimizations for single-file (in-lining of procedures located in the current file)
-ipo Interprocedural optimization across files (in-lining of procedures located in other files)
-scalar-rep Enable scalar replacement performed during loop transformation (need -O3)
-unroll16 Unroll loops having up to 16 iterations
Remark: use -O2 on src_turbdiff.f90 due to known bugs in stab_funct.

Options used for compiling COSMO by Roshydromet

  • Code (version): COSMO
  • Machine: ?
  • Compiler version: ?
  • Group/People: Roshydromet (Gdaly Rivin)

General flags

Option Effect
-fpp Turn on pre-processing
-c Prevents linking
IPF-fp-relaxed Faster but slightly less accurate math functions (!!! not IEEE compliant !!!)
-fno-alias No pointer aliasing

Linking flags

No linking flag is used.

Debug mode

No information.

Optimized mode

Option Effect
-O2 Set optimization level
-unroll10 Unroll loops having up to 10 iterations
Remark: does not work with v10.1.018 but works fine with v11.1.075

IBM compiler

Official documentation on the IBM compiler can be found here or there.

Options used for compiling COSMO-CLM on Mistral

General flags

Option Effect
-c Prevent the completed object from being sent to the linker (output is .o)
-q64 64-bit compilation bit mode
-qsuffix=cpp=f90 Precompilation of all .f90 files
-qarch=pwr6 Specify the hardware as being a POWER6 platform
-qextname Add an underscore to the names of all global entities (avoid name confusion)
-WF Pass the listed options to the C precompiler
-D__AIX ? (Treat fixed source form lines with a D in column 1 as code to compile)
-D_AIX ? (Treat fixed source form lines with a D in column 1 as code to compile)
-DIBM ? (Treat fixed source form lines with a D in column 1 as code to compile)
-D__ibm__ ? (Treat fixed source form lines with a D in column 1 as code to compile)
-Dextname ? (Treat fixed source form lines with a D in column 1 as code to compile)
-D_EXTNAME ? (Treat fixed source form lines with a D in column 1 as code to compile)
-DNETCDF ? (Treat fixed source form lines with a D in column 1 as code to compile)
-DCLM ? (Treat fixed source form lines with a D in column 1 as code to compile)

Linking flags

Option Effect
-q64 64-bit compilation bit mode
-qextname Add an underscore to the names of all global entities (avoid name confusion)

Debug mode

No information.

Optimized mode

Option Effect
-O2 Set optimization level
-qmaxmem=-1 No memory limitations for optimizations
-qstrict Ensure IEEE floating point compliance even for aggressive optimizations
-qtune=pwr6 Code tuning for POWER6 platform
Remark: use only -O1 for src_setup_vartab.f90 spacer
This site is managed by the Center for Climate Systems Modeling (C2SM).
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems? Send feedback!