24 | | If you compile at obelix, earlier versions of XIOS/trunk than revision 1659 do not compile in mode debug due to an error in arch-ifort_LSCE.fcm. Change following: |
25 | | {{{ |
26 | | cd ../modeles/XIOS |
27 | | vi arch/arch-ifort_LSCE.fcm |
28 | | %DEBUG_CFLAGS -DBZ_DEBUG -g -fno-inline -ggdb --debug |
29 | | %DEBUG_FFLAGS -g -ggdb -debug all -traceback |
30 | | ./make_xios --arch ifort_LSCE --debug |
31 | | }}} |
32 | | |
33 | | == Compile IOIPSL with debug options == |
34 | | Note that above changes will not compile IOIPSL in debug mode. Sometimes it is useful to have IOIPSL in debug mode as well. This can be done by modifying lines in modipsl/util/AA_make.gdef. |
35 | | |
36 | | For example, the following lines are for the obelix machine at LSCE, using the Intel fortran compiler. The first line (with a single #) is the one used, while the second line (with multiple #s) is ignored. |
37 | | |
38 | | {{{ |
39 | | #-Q- lxiv8 F_O = -DCPP_PARA -O3 $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR) -fp-model precise |
40 | | #####-Q- lxiv8 F_O = -DCPP_PARA -p -g -traceback -fp-stack-check -ftrapuv -check bounds $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR) |
41 | | }}} |
42 | | |
43 | | The debug flags are in the second line. In order to use debug flags with IOIPSL on obelix, the first line should be commented out (by adding ####) and the second should be uncommented (by removing # until there is only one at the beginning of the line), i.e. |
44 | | {{{ |
45 | | #####-Q- lxiv8 F_O = -DCPP_PARA -O3 $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR) -fp-model precise |
46 | | #-Q- lxiv8 F_O = -DCPP_PARA -p -g -traceback -fp-stack-check -ftrapuv -check bounds $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR) |
47 | | }}} |
48 | | |
49 | | In case you find non-desired NaN values in the code, it is recommended to compile orchidee using the flag below. It triggers an exception and stops execution instead of trying to use NaN values. NaN means "Not a Number", and happens when you try to divide by zero (or take the square root of a negative number). |
50 | | |
51 | | * -fpe0: [http://fulla.fnal.gov/intel/compiler_f/main_for/fpops/fortran/fpops_fpew_f.htm More info] |
52 | | |
53 | | 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 you must recompile from zero (using the "gmake clean && gmake" above). |
54 | | |
55 | | With the above, you should be able to get XIOS, IOIPSL, and ORCHIDEE to all compile with the same flags. 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. |
56 | | |