GEM 5.1.1
Compile one routine without optimization, '-O0'
- edit the file named CMakeLists.txt in the main directory where the subroutine is situated (for example, src/rpnphy/CMakeLists.txt if the subroutine is situated in the physics directory)
- copy the following example before the last line (add_library...) and modify it according to your needs:
set_source_files_properties(utils/sfclayer_mod.F90 PROPERTIES COMPILE_OPTIONS "-O0")
- make sure you use a recent version of cmake (at least 3.11) - on Narval we do
- you can verify the option was passed by looking at the file flags.make situated in the corresponding directory in the build directory, for example build/src/rpnphy/CMakeFiles/phy.dir/flags.make:
# Custom options: src/rpnphy/CMakeFiles/phy.dir/utils/sfclayer_mod.F90.o_OPTIONS = -O0
Then compile with the usual:
make maingemdm
or
make -j4 maingemdm
When compiling this routine now you should see something like the following:
Building Fortran object src/rpnphy/CMakeFiles/phy.dir/utils/sfclayer_mod.F90.o
... -O2 -g -O0 -c
... -O2 -g -O0 -c
The second '-O0' should overwrite the first '-O2'.