wiki:Documentation/UserGuide/flags

Version 3 (modified by mmcgrath, 6 years ago) (diff)

Some additional help with XIOS and memory bugs

Compilation flags

Compilation flags let users change compiler's behaviour. For example, they can give you more information about an exception or it can apply more or less optimizations to the code. Be aware that each compiler has its own flags.

Intel

Inside ../../util/AA_make.gdef you can modifify orchidee default flags. This lines belong to obelix HPC. Located at LSCE. They are ready for intel fortran compiler.

###-Q- lxiv8    F_O = -DCPP_PARA -O3 $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR) -fp-model precise
#-Q- lxiv8    F_O = -DCPP_PARA -p -g -traceback -fp-stack-check -ftrapuv -check bounds $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR)
  • First line is for production mode. In this case It is commented.
  • Second line belongs to debug mode.

In case you find non desired Nan in the code it is recommended to compile orchidee using the flag below. It triggers an exception instead of using Nan values.

  • -fpe0: floating point error related with divided by zero. More info
#-Q- lxiv8    F_O = -DCPP_PARA -p -g -fpe0 -traceback -fp-stack-check -ftrapuv -check bounds $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR)

Note: if you modify this file you have to apply ins_make again. This way it spreads the changes to all Orchidee's folders. Then recompile from zero.

Sometimes, when you get an error that you can't track down, I've found it helps to use the following flags (on obelix). It wasn't trivial to get XIOS, IOIPSL, and ORCHIDEE to all compile with the same flags, and perhaps this is not the best way to do it, but it works. I noticed this was necessary to catch a memory error one time: the error was in ORCHIDEE, but it was showing up as a crash in XIOS, until I compiled everything with full debug flags...then it pointed straight to the line number in ORCHIDEE that was writing out of bounds.

For XIOS,

cd ./modeles/XIOS
vi ./arch/arch-ifort_LSCE.fcm
%DEBUG_CFLAGS   -DBZ_DEBUG -g -fno-inline -ggdb --debug
%DEBUG_FFLAGS   -g -ggdb -debug all -traceback
  ./make_xios --arch ifort_LSCE --debug

For IOIPSL, the ins\_make -d command doesn't seem to have any effect. I have to comment out the debug line in util/AA\_make.gdef

  #-Q- lxiv8    F_O = -DCPP_PARA --i4 -r8 -fp-model precise -fpe0 -O0 -g -traceback -fp-stack-check
        -ftrapuv -check bounds -check all -check noarg_temp_created -I$(MODDIR) -module $(MODDIR)

and then redo ins\_make.

Can change l\_dbg = .TRUE. in errioipsl.f90 to get more information printed out about reading in .nc files.

Can also make the following changes to iodef.xml to get more information printed out from XIOS.

  <variable id="info_level"                type="int">100</variable>
  <variable id="print_file" type="bool">true</variable>

Make sure to do a full gmake clean, and recompile, checking to see that the flags flashing by on the screen are the same as the ones above.