Changes between Version 4 and Version 5 of Documentation/UserGuide/NewFlag


Ignore:
Timestamp:
2020-03-19T17:03:42+01:00 (4 years ago)
Author:
bguenet
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/UserGuide/NewFlag

    v4 v5  
    11= How to add a new flag = 
    22 
     3Author: D. Solyga [[BR]] 
     4Last revision: B. Guenet (2020/03/19) 
    35 
    46== Declare the new flag == 
     
    79 
    810{{{ 
    9 TYPE control_type 
    10    LOGICAL :: ok_NameOfNewFlag      !! Explanation of new flag 
    11 END TYPE control_type 
     11 
     12   LOGICAL, SAVE :: ok_NameOfNewFlag      !! Explanation of new flag 
     13!$OMP THREADPRIVATE(ok_NameOfNewFlag) 
     14 
    1215}}} 
    1316 
    14 Next, you store the flags in a common variable named 'control'. This is done in ../modeles/ORCHIDEE/src_sechiba/sechiba.f90 in the subroutine sechiba_init 
     17 
     18== Read the flag from the parameter file == 
     19 
     20Next, you need to read the flag value. Don't forget to wrote a default value. This is done in ../modeles/ORCHIDEE/src_sechiba/sechiba.f90 in the subroutine sechiba_init 
    1521 
    1622{{{ 
    17 control%ok_NameOfNewFlag = control_in%ok_NameOfNewFlag 
     23    ok_NameOfNewFlag=.FALSE. 
     24    CALL getin_p('OK_NAMEOFNEWFLAG', ok_NameOfNewFlag) 
    1825}}} 
    1926 
    2027[[BR]] 
    2128 
    22 == Read the flag from the parameter file == 
    23  
    24 The flag can be read in the routine where you need it, if the flag is shared among routines you can read it in the first common routine. Quite a few flags that control the flow of th emodel are read in intersurf.f90 in the subroutine intsurf_config. Document the flag using the default keywords (see below). An example is shown for the flag called control%ok_functional_allocation  
    25  
    26 {{{ 
    27 !Config Key  = STOMATE_FUNCTIONAL_ALLOCATION 
    28 !Config Desc = use Friedlingstein etal. 1999 or Zaehle et al 2010 for allocation 
    29 !Config Def  = n 
    30 !Config Help = set to TRUE if functional allocation is to be activated 
    31 ! 
    32 control%ok_functional_allocation = .FALSE. 
    33 CALL getin_p('STOMATE_FUNCTIONAL_ALLOCATION',control%ok_functional_allocation) 
    34 WRITE(*,*) 'Allocation is based on plant structure: ',control%ok_functional_allocation 
    35 }}}