/[lmdze]/trunk/ConfigureCompilerFlags.cmake
ViewVC logotype

Contents of /trunk/ConfigureCompilerFlags.cmake

Parent Directory Parent Directory | Revision Log Revision Log


Revision 335 - (show annotations)
Thu Sep 12 21:22:46 2019 UTC (4 years, 8 months ago) by guez
File size: 1660 byte(s)
Julian dates be in double precision

`ConfigureCompilerFlags.cmake` and `TAGS.cmake` are now copied into
LMDZE, to avoid dependency on the environment.

Julian dates must be in double precision, to get time step precision.

Add optional attribute to argument sec of procedure ju2ymds. We do
not need sec in procedure dynredem0.

In procedure ju2ymds, by construction, sec cannot be > `un_jour`.

Remove useless intermediary variables in procedure ymds2ju.

1 if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
2 # Fortran language options:
3 string(APPEND CMAKE_Fortran_FLAGS " -std=f2003")
4
5 # Error and warning options:
6 string(APPEND CMAKE_Fortran_FLAGS
7 " -fmax-errors=1 -pedantic -Wall -Wcharacter-truncation -Wunused-parameter -Wno-conversion -Wimplicit-interface -Wimplicit-procedure -Wno-integer-division")
8
9 # Debugging options:
10 set(CMAKE_Fortran_FLAGS_DEBUG
11 "-fbacktrace -g -ffpe-trap=invalid,zero,overflow")
12
13 # Code generation options:
14 string(APPEND CMAKE_Fortran_FLAGS_DEBUG
15 " -fcheck=bounds,do,mem,pointer,recursion -finit-real=nan -O0")
16
17 # Optimization options:
18 set(CMAKE_Fortran_FLAGS_RELEASE -O3)
19
20 # Hardware model options:
21 string(APPEND CMAKE_Fortran_FLAGS_RELEASE " -mcmodel=medium")
22 elseif(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
23 # Language:
24 string(APPEND CMAKE_Fortran_FLAGS
25 " -noaltparam -stand f03 -standard-semantics -assume nostd_mod_proc_name")
26 string(APPEND CMAKE_Fortran_FLAGS_DEBUG
27 " -check bounds,format,output_conversion,pointers,stack,uninit")
28
29 # Data:
30 string(APPEND CMAKE_Fortran_FLAGS " -auto -mcmodel=medium")
31 string(APPEND CMAKE_Fortran_FLAGS_DEBUG " -init=arrays,minus_huge,snan")
32
33 # Compiler diagnostics:
34 string(APPEND CMAKE_Fortran_FLAGS
35 " -warn declarations,general,stderrors,truncated_source,uncalled,unused,usage -traceback -diag-error-limit 1")
36
37 # Optimization:
38 string(APPEND CMAKE_Fortran_FLAGS_DEBUG " -O0")
39
40 # Floating point:
41 string(APPEND CMAKE_Fortran_FLAGS_DEBUG " -fp-stack-check -fpe-all=0")
42
43 # Debug:
44 string(APPEND CMAKE_Fortran_FLAGS_DEBUG
45 " -debug full -debug-parameters all -ftrapuv")
46 endif()

  ViewVC Help
Powered by ViewVC 1.1.21