Changes between Version 9 and Version 10 of Documentation/UserGuide/flags


Ignore:
Timestamp:
2020-02-28T14:51:42+01:00 (4 years ago)
Author:
jgipsl
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/UserGuide/flags

    v9 v10  
    2222 
    2323 
    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  
    5724= Other useful tips for debugging = 
    5825 
    59 Can change l_dbg = .TRUE. in errioipsl.f90 to get more information printed out about reading in .nc files. 
     26* Can change l_dbg = .TRUE. in errioipsl.f90 to get more information printed out about reading in .nc files. 
    6027 
    61 Can also make the following changes to iodef.xml to get more information printed out from XIOS. 
     28* Can also make the following changes to iodef.xml to get more information printed out from XIOS. 
    6229 
    6330{{{ 
     
    6633}}} 
    6734 
    68 After running libIGCM/ins_job to submit a job with libIGCM, the Job_ file is created.  This file has a setting for Verbosity.  It's good to make sure that is as high as possible (3 is the maximum value, currently) if you are running into issues that seem to be related to libIGCM. 
    6935 
    70 The [https://forge.ipsl.jussieu.fr/orchidee/wiki/Documentation/UserGuide/Printlev printlev] flags can be very useful in finding out which routine the code is crashing in.  If you can't get a line number any other way, turn up the printlev as high as possible, check to see the last line printed out, and then check to see the next line which should be printed out.  The crash must be happening somewhere between those two lines.  
     36* The [https://forge.ipsl.jussieu.fr/orchidee/wiki/Documentation/UserGuide/Printlev printlev] flags can be very useful in finding out which routine the code is crashing in.  If you can't get a line number any other way, turn up the printlev as high as possible, check to see the last line printed out, and then check to see the next line which should be printed out.  The crash must be happening somewhere between those two lines.  
    7137 
    72 And if you are up against a bug that seems to change every single time you run the code, even with all the above flags on, you might want to check out [https://forge.ipsl.jussieu.fr/orchidee/wiki/Documentation/UserGuide/valgrind Valgrind]. 
     38* And if you are up against a bug that seems to change every single time you run the code, even with all the above flags on, you might want to check out [https://forge.ipsl.jussieu.fr/orchidee/wiki/Documentation/UserGuide/valgrind Valgrind].