Changes between Initial Version and Version 1 of Documentation/UserGuide/Printlev


Ignore:
Timestamp:
2015-07-10T12:18:05+02:00 (9 years ago)
Author:
jgipsl
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/UserGuide/Printlev

    v1 v1  
     1= Control text output = 
     2The control of text output in ORCHIDEE trunk has been homogenized. The externalized parameter PRINTLEV is replacing BAVARD, LONGPRINT and local hard coded debug variables. This is available in ORCHIDEE trunk since revision 2348. 
     3 
     4=== PRINTLEV : global parameter === 
     5 
     6PRINTLEV is an externalised parameter used to define a global level of output text information. Default value is 1. 
     7 
     8PRINTLEV definition: 
     9* 0 no output. 
     10* 1 minimum writing for long simulations only at initialization and finalization phase (default) 
     11* 2 more basic information for long simulations, some daily information can be written, nothing must be written at each time step. 
     12* 3 first debug level: entering and leaving important subroutines can be reported. 
     13* 4 higher debug level: input parameters to major subroutines can be reported, other debug information. 
     14 
     15 
     16In the code, use the following syntax: 
     17{{{ 
     18IF (printlev>=1) WRITE(numout,*) 'This is a very important write statement...' 
     19IF (printlev>=3) WRITE(numout,*) 'This is a debug print...' 
     20}}} 
     21 
     22=== PRINTLEV_''modulename'' : local parameter to one module === 
     23The function get_ printlev('modulename') makes it possible to have a local write level in a module. Setting PRINTLEV_modulename in run.def changes then the write level in that module. The default value is the global PRINTLEV value. This functionality is available only in modules where the function get_printlev() is called. get_printlev should be called once in the initialization part for the module to define a new local saved variable. This new variable should be used in the whole module for all write statements instead of printlev. For example: 
     24 
     25In module sechiba: 
     26 
     27{{{ 
     28! Module declared variable 
     29INTEGER, SAVE :: printlev_loc 
     30 
     31! In subroutine sechiba_init: 
     32printlev_loc=get_printlev('sechiba')  
     33}}} 
     34In the example the function printlev_loc will read the variable PRINTLEV _sechiba from run.def. The default value is the same as the global printlev variable.[[BR]] 
     35 
     36In the rest of the module, all write statements should be done as follows: 
     37{{{ 
     38IF (printlev_loc>=1) WRITE(numout,*) 'This is a low level print' 
     39IF (printlev_loc>=3) WRITE(numout,*) 'This is a debug print' 
     40}}}