Changes between Version 4 and Version 5 of Documentation/UserGuide/NewFlag
- Timestamp:
- 2020-03-19T17:03:42+01:00 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Documentation/UserGuide/NewFlag
v4 v5 1 1 = How to add a new flag = 2 2 3 Author: D. Solyga [[BR]] 4 Last revision: B. Guenet (2020/03/19) 3 5 4 6 == Declare the new flag == … … 7 9 8 10 {{{ 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 12 15 }}} 13 16 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 20 Next, 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 15 21 16 22 {{{ 17 control%ok_NameOfNewFlag = control_in%ok_NameOfNewFlag 23 ok_NameOfNewFlag=.FALSE. 24 CALL getin_p('OK_NAMEOFNEWFLAG', ok_NameOfNewFlag) 18 25 }}} 19 26 20 27 [[BR]] 21 28 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_allocation25 26 {{{27 !Config Key = STOMATE_FUNCTIONAL_ALLOCATION28 !Config Desc = use Friedlingstein etal. 1999 or Zaehle et al 2010 for allocation29 !Config Def = n30 !Config Help = set to TRUE if functional allocation is to be activated31 !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_allocation35 }}}