Changes between Version 1 and Version 2 of Documentation/UserGuide/Printlev
- Timestamp:
- 2019-01-23T10:26:31+01:00 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Documentation/UserGuide/Printlev
v1 v2 21 21 22 22 === PRINTLEV_''modulename'' : local parameter to one module === 23 The 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:23 The 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. 24 24 25 In module sechiba: 25 For example in module condveg: 26 In the beginning, declare a private module variable, before CONTAINS: (note that the keyword PRIVATE should only be set once) 27 {{{ 28 PRIVATE 29 INTEGER, SAVE :: printlev_loc !! Local printlev for this module 30 }}} 26 31 32 In subroutine condveg_initialize: 27 33 {{{ 28 ! Module declared variable 29 INTEGER, SAVE :: printlev_loc 30 31 ! In subroutine sechiba_init: 32 printlev_loc=get_printlev('sechiba') 34 !! Initialize local printlev 35 printlev_loc=get_printlev('condveg') 33 36 }}} 34 In the example the function printlev_loc will read the variable PRINTLEV _sechibafrom run.def. The default value is the same as the global printlev variable.[[BR]]37 In the example the function printlev_loc will read the variable PRINTLEV_condveg from run.def. The default value is the same as the global printlev variable.[[BR]] 35 38 36 39 In the rest of the module, all write statements should be done as follows: