source: tags/ORCHIDEE_2_0/ORCHIDEE/src_parameters/constantes.f90 @ 5110

Last change on this file since 5110 was 4962, checked in by josefine.ghattas, 6 years ago

Updated default values as have been decided for version ORCHIDEE 2.0 and to be used for CMIP6. See ticket #414

  • Property svn:keywords set to Date Revision
File size: 73.2 KB
Line 
1! =================================================================================================================================
2! MODULE       : constantes
3!
4! CONTACT      : orchidee-help _at_ listes.ipsl.fr
5!
6! LICENCE      : IPSL (2006)
7! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC
8!
9!>\BRIEF        "constantes" module contains subroutines to initialize most of the exernalized parameters. This module
10!!              also make a use to the module constantes_var where the parameters are declared.
11!!
12!!\n DESCRIPTION: This module contains subroutines to initialize most of the exernalized parameters. This module
13!!                also make a use to the module constantes_var where the parameters are declared.\n
14!!                This module can be used to acces the subroutines and the constantes. The constantes declarations
15!!                can also be used seperatly with "USE constantes_var".
16!!
17!! RECENT CHANGE(S): Didier Solyga : This module contains now all the externalized parameters of ORCHIDEE
18!!                   listed by modules which are not pft-dependent 
19!!                   Josefine Ghattas 2013 : The declaration part has been extracted and moved to module constates_var
20!!
21!! REFERENCE(S) :
22!! - Louis, Jean-Francois (1979), A parametric model of vertical eddy fluxes in the atmosphere.
23!! Boundary Layer Meteorology, 187-202.
24!!
25!! SVN          :
26!! $HeadURL: $
27!! $Date$
28!! $Revision$
29!! \n
30!_ ================================================================================================================================
31
32MODULE constantes
33
34  USE constantes_var
35  USE defprec
36  USE ioipsl_para, ONLY : getin_p, ipslerr_p
37  USE mod_orchidee_para_var, ONLY : numout
38  USE time, ONLY : one_day, dt_sechiba
39
40  IMPLICIT NONE
41 
42CONTAINS
43
44
45!! ================================================================================================================================
46!! SUBROUTINE   : activate_sub_models
47!!
48!>\BRIEF         This subroutine reads the flags in the configuration file to
49!! activate some sub-models like routing, irrigation, fire, herbivory, ... 
50!!
51!! DESCRIPTION  : None
52!!
53!! RECENT CHANGE(S): None
54!!
55!! MAIN OUTPUT VARIABLE(S): None
56!!
57!! REFERENCE(S) : None
58!!
59!! FLOWCHART    : None
60!! \n
61!_ ================================================================================================================================
62
63  SUBROUTINE activate_sub_models()
64
65    IMPLICIT NONE
66
67    !! 0. Variables and parameters declaration
68
69    !! 0.4 Local variables
70
71    !_ ================================================================================================================================
72
73    IF (ok_stomate) THEN
74
75       !Config Key   = HERBIVORES
76       !Config Desc  = herbivores allowed?
77       !Config If    = OK_STOMATE
78       !Config Def   = n
79       !Config Help  = With this variable, you can determine
80       !Config         if herbivores are activated
81       !Config Units = [FLAG]
82       CALL getin_p('HERBIVORES', ok_herbivores)
83       !
84       !Config Key   = TREAT_EXPANSION
85       !Config Desc  = treat expansion of PFTs across a grid cell?
86       !Config If    = OK_STOMATE
87       !Config Def   = n
88       !Config Help  = With this variable, you can determine
89       !Config         whether we treat expansion of PFTs across a
90       !Config         grid cell.
91       !Config Units = [FLAG]
92       CALL getin_p('TREAT_EXPANSION', treat_expansion)
93
94       !Config Key   = LPJ_GAP_CONST_MORT
95       !Config Desc  = Constant mortality
96       !Config If    = OK_STOMATE AND NOT OK_DGVM
97       !Config Def   = y/n depending on OK_DGVM
98       !Config Help  = set to TRUE if constant mortality is to be activated
99       !Config         
100       !Config Units = [FLAG]
101
102       ! Set Default value different if DGVM is activated.
103       IF ( ok_dgvm ) THEN
104          lpj_gap_const_mort=.FALSE.
105       ELSE
106          lpj_gap_const_mort=.TRUE.
107       END IF
108       CALL getin_p('LPJ_GAP_CONST_MORT', lpj_gap_const_mort)
109
110       IF (ok_dgvm .AND. lpj_gap_const_mort) THEN
111          CALL ipslerr_p(1,"activate_sub_models","Both OK_DGVM and LPJ_GAP_CONST_MORT are activated.",&
112               "This combination is possible but unusual","The simulation will continue with these flags activated." )
113       ELSEIF (.NOT. ok_dgvm  .AND. .NOT. lpj_gap_const_mort) THEN
114           CALL ipslerr_p(3,"activate_sub_models", &
115                "The combination of OK_DGVM=false and LPJ_GAP_CONST_MORT=false is not operational in this version", &
116                "Some parts of the code should first be revised.","" )
117       END IF
118
119       !Config Key   = HARVEST_AGRI
120       !Config Desc  = Harvest model for agricultural PFTs.
121       !Config If    = OK_STOMATE
122       !Config Def   = y
123       !Config Help  = Compute harvest above ground biomass for agriculture.
124       !Config         Change daily turnover.
125       !Config Units = [FLAG]
126       CALL getin_p('HARVEST_AGRI', harvest_agri)
127       !
128       !Config Key   = FIRE_DISABLE
129       !Config Desc  = no fire allowed
130       !Config If    = OK_STOMATE
131       !Config Def   = y
132       !Config Help  = With this variable, you can allow or not
133       !Config         the estimation of CO2 lost by fire
134       !Config Units = [FLAG]
135       CALL getin_p('FIRE_DISABLE', disable_fire)
136       !
137       !Config Key   = SPINUP_ANALYTIC
138       !Config Desc  = Activation of the analytic resolution of the spinup.
139       !Config If    = OK_STOMATE
140       !Config Def   = n
141       !Config Help  = Activate this option if you want to solve the spinup by the Gauss-Jordan method.
142       !Config Units = BOOLEAN   
143       CALL getin_p('SPINUP_ANALYTIC',spinup_analytic)
144
145    ENDIF
146
147    !
148    ! Check consistency (see later)
149    !
150!!$        IF(.NOT.(ok_routing) .AND. (doirrigation .OR. dofloodplains)) THEN
151!!$           CALL ipslerr_p(2,'activate_sub_models', &
152!!$               &     'Problem :you tried to activate the irrigation and floodplains without activating the routing',&
153!!$               &     'Are you sure ?', &
154!!$               &     '(check your parameters).')
155!!$        ENDIF
156
157!!$        IF(.NOT.(ok_stomate) .AND. (ok_herbivores .OR. treat_expansion .OR. lpj_gap_const_mort &
158!!$            & .OR. harvest_agri .OR. disable_fire)) THEN
159!!$          CALL ipslerr_p(2,'activate_sub_models', &
160!!$               &     'Problem : try to activate the following options : herbivory, treat_expansion, fire,',&
161!!$               &     'harvest_agri and constant mortality without stomate activated.',&
162!!$               &     '(check your parameters).')
163!!$        ENDIF
164
165
166  END SUBROUTINE activate_sub_models
167
168!! ================================================================================================================================
169!! SUBROUTINE   : veget_config
170!!
171!>\BRIEF         This subroutine reads the flags controlling the configuration for
172!! the vegetation : impose_veg, veget_mpa, lai_map, etc...       
173!!
174!! DESCRIPTION  : None
175!!
176!! RECENT CHANGE(S): None
177!!
178!! MAIN OUTPUT VARIABLE(S):
179!!
180!! REFERENCE(S) :
181!!
182!! FLOWCHART    :
183!! \n
184!_ ================================================================================================================================
185
186  SUBROUTINE veget_config
187
188    IMPLICIT NONE
189
190    !! 0. Variables and parameters declaration
191
192    !! 0.4 Local variables 
193
194    !_ ================================================================================================================================
195
196    !Config Key   = AGRICULTURE
197    !Config Desc  = agriculture allowed?
198    !Config If    = OK_SECHIBA or OK_STOMATE
199    !Config Def   = y
200    !Config Help  = With this variable, you can determine
201    !Config         whether agriculture is allowed
202    !Config Units = [FLAG]
203    CALL getin_p('AGRICULTURE', agriculture)
204    !
205    !Config Key   = IMPOSE_VEG
206    !Config Desc  = Should the vegetation be prescribed ?
207    !Config If    = OK_SECHIBA or OK_STOMATE
208    !Config Def   = n
209    !Config Help  = This flag allows the user to impose a vegetation distribution
210    !Config         and its characteristics. It is espacially interesting for 0D
211    !Config         simulations. On the globe it does not make too much sense as
212    !Config         it imposes the same vegetation everywhere
213    !Config Units = [FLAG]
214    CALL getin_p('IMPOSE_VEG', impveg)
215
216    IF (impveg) THEN
217       !Config Key   = IMPOSE_SOILT
218       !Config Desc  = Should the soil type be prescribed ?
219       !Config Def   = n
220       !Config If    = IMPOSE_VEG
221       !Config Help  = This flag allows the user to impose a soil type distribution.
222       !Config         It is espacially interesting for 0D
223       !Config         simulations. On the globe it does not make too much sense as
224       !Config         it imposes the same soil everywhere
225       !Config Units = [FLAG]
226       CALL getin_p('IMPOSE_SOILT', impsoilt)     
227    ENDIF
228
229    !Config Key   = LAI_MAP
230    !Config Desc  = Read the LAI map
231    !Config If    = OK_SECHIBA or OK_STOMATE
232    !Config Def   = n
233    !Config Help  = It is possible to read a 12 month LAI map which will
234    !Config         then be interpolated to daily values as needed.
235    !Config Units = [FLAG]
236    CALL getin_p('LAI_MAP',read_lai)
237
238    !Config Key   = MAP_PFT_FORMAT
239    !Config Desc  = Read a land use vegetation map on PFT format
240    !Config If    = OK_SECHIBA or OK_STOMATE
241    !Config Def   = y
242    !Config Help  = pft values are needed, max time axis is 293
243    !Config Units = [FLAG]
244    CALL getin_p('MAP_PFT_FORMAT',map_pft_format)
245
246    IF(map_pft_format) THEN
247       !Config Key   = VEGET_REINIT
248       !Config Desc  = booleen to indicate that a new LAND USE file will be used.
249       !Config If    = MAP_PFT_FORMAT
250       !Config Def   = y
251       !Config Help  = The parameter is used to bypass veget_year count
252       !Config         and reinitialize it with VEGET_YEAR parameter.
253       !Config         Then it is possible to change LAND USE file.
254       !Config Units = [FLAG]
255       CALL getin_p('VEGET_REINIT', veget_reinit)
256       !
257       !Config Key   = VEGET_YEAR
258       !Config Desc  = Year of the vegetation map to be read
259       !Config If    = MAP_PFT_FORMAT
260       !Config Def   = 1
261       !Config Help  = First year for land use vegetation (2D map by pft).
262       !Config         If VEGET_YEAR is set to 0, this means there is no time axis.
263       !Config Units = [FLAG]
264       CALL getin_p('VEGET_YEAR', veget_year_orig)
265    ENDIF
266
267
268!!$        ! DS : Add warning in case of a wrong configuration (need to be discussed)
269!!$        ! 4.
270!!$        IF ( .NOT.(impveg) .AND. impsoilt) THEN
271!!$           CALL ipslerr_p(2,'veget_config', &
272!!$               &     'Problem : try to activate impose_soilt without activating impose_veg.',&
273!!$               &     'Are you sure ?', &
274!!$               &     '(check your parameters).')
275!!$        ENDIF
276!!$
277
278  END SUBROUTINE veget_config
279
280
281!! ================================================================================================================================
282!! SUBROUTINE   : veget_config
283!!
284!>\BRIEF         This subroutine reads in the configuration file the imposed values of the parameters for all SECHIBA modules. 
285!!
286!! DESCRIPTION  : None
287!!
288!! RECENT CHANGE(S): None
289!!
290!! MAIN OUTPUT VARIABLE(S):
291!!
292!! REFERENCE(S) :
293!!
294!! FLOWCHART    :
295!! \n
296!_ ================================================================================================================================
297
298  SUBROUTINE config_sechiba_parameters
299
300    IMPLICIT NONE
301
302    !! 0. Variables and parameters declaration
303
304    !! 0.4 Local variables
305    REAL(r_std) :: nudge_tau_mc     !! Temporary variable read from run.def
306    REAL(r_std) :: nudge_tau_snow   !! Temporary variable read from run.def
307
308    !_ ================================================================================================================================
309
310    ! Global : parameters used by many modules
311    CALL getin_p('TESTPFT',testpft)
312
313    !
314    !Config Key   = MAXMASS_SNOW
315    !Config Desc  = The maximum mass of a snow
316    !Config If    = OK_SECHIBA or HYDROL_CWRR
317    !Config Def   = 3000.
318    !Config Help  =
319    !Config Units = [kg/m^2] 
320    CALL getin_p('MAXMASS_SNOW',maxmass_snow)
321    !
322    !Config Key   = SNOWCRI
323    !Config Desc  = Sets the amount above which only sublimation occures
324    !Config If    = OK_SECHIBA or HYDROL_CWRR
325    !Config Def   = 1.5
326    !Config Help  =
327    !Config Units = [kg/m^2] 
328    CALL getin_p('SNOWCRI',snowcri)
329    !
330    !! Initialization of sneige
331    sneige = snowcri/mille
332    !
333    !Config Key   = MIN_WIND
334    !Config Desc  = Minimum wind speed
335    !Config If    = OK_SECHIBA
336    !Config Def   = 0.1
337    !Config Help  =
338    !Config Units = [m/s]
339    CALL getin_p('MIN_WIND',min_wind)
340    !
341    !Config Key   = MAX_SNOW_AGE
342    !Config Desc  = Maximum period of snow aging
343    !Config If    = OK_SECHIBA
344    !Config Def   = 50.
345    !Config Help  =
346    !Config Units = [days?]
347    CALL getin_p('MAX_SNOW_AGE',max_snow_age)
348    !
349    !Config Key   = SNOW_TRANS
350    !Config Desc  = Transformation time constant for snow
351    !Config If    = OK_SECHIBA
352    !Config Def   = 0.2
353    !Config Help  = optimized on 04/07/2016
354    !Config Units = [m]   
355    CALL getin_p('SNOW_TRANS',snow_trans)
356
357   
358    !Config Key   = OK_NUDGE_MC
359    !Config Desc  = Activate nudging of soil moisture
360    !Config Def   = n
361    !Config If    = HYDROL_CWRR
362    !Config Help  =
363    !Config Units = [FLAG]
364    ok_nudge_mc = .FALSE.
365    CALL getin_p('OK_NUDGE_MC', ok_nudge_mc)
366
367    !Config Key   = NUDGE_TAU_MC
368    !Config Desc  = Relaxation time for nudging of soil moisture expressed in fraction of the day
369    !Config Def   = 1
370    !Config If    = OK_NUDGE_MC
371    !Config Help  =
372    !Config Units = [-]
373    nudge_tau_mc = 1.0
374    CALL getin_p('NUDGE_TAU_MC', nudge_tau_mc)
375    IF (nudge_tau_mc < dt_sechiba/one_day) CALL ipslerr_p(3, 'hydrol_initialize', &
376         'NUDGE_TAU_MC is smaller than the time step in sechiba which is not allowed.', &
377         'Set NUDGE_TAU_MC higher or equal to dt_sechiba/one_day','')
378    ! Calculate alpha to be used in hydrol
379    alpha_nudge_mc = dt_sechiba/(one_day*nudge_tau_mc)
380    IF (printlev>=2) WRITE(numout, *) 'ok_nudge_mc, nudge_tau_mc, alpha_nudge_mc =', &
381         ok_nudge_mc, nudge_tau_mc, alpha_nudge_mc
382
383
384    !Config Key   = OK_NUDGE_SNOW
385    !Config Desc  = Activate nudging of snow variables
386    !Config Def   = n
387    !Config If    = HYDROL_CWRR
388    !Config Help  =
389    !Config Units = [FLAG]
390    ok_nudge_snow = .FALSE.
391    CALL getin_p('OK_NUDGE_SNOW', ok_nudge_snow)
392
393    !Config Key   = NUDGE_TAU_SNOW
394    !Config Desc  = Relaxation time for nudging of snow variables
395    !Config Def   = 1
396    !Config If    = OK_NUDGE_SNOW
397    !Config Help  =
398    !Config Units = [-]
399    nudge_tau_snow = 1.0
400    CALL getin_p('NUDGE_TAU_SNOW', nudge_tau_snow)
401    IF (nudge_tau_snow < dt_sechiba/one_day) CALL ipslerr_p(3, 'hydrol_initialize', &
402         'NUDGE_TAU_SNOW is smaller than the time step in sechiba which is not allowed.', &
403         'Set NUDGE_TAU_SNOW higher or equal to dt_sechiba/one_day','')
404    ! Calculate alpha to be used in hydrol
405    alpha_nudge_snow = dt_sechiba/(one_day*nudge_tau_snow)
406    IF (printlev>=2) WRITE(numout, *) 'ok_nudge_snow, nudge_tau_snow, alpha_nudge_snow =', &
407         ok_nudge_snow, nudge_tau_snow, alpha_nudge_snow
408
409
410    !Config Key   = NUDGE_INTERPOL_WITH_XIOS
411    !Config Desc  = Activate reading and interpolation with XIOS for nudging fields
412    !Config Def   = n
413    !Config If    = OK_NUDGE_MC or OK_NUDGE_SNOW
414    !Config Help  =
415    !Config Units = [FLAG]
416    nudge_interpol_with_xios = .FALSE.
417    CALL getin_p('NUDGE_INTERPOL_WITH_XIOS', nudge_interpol_with_xios)
418
419    !-
420    ! condveg
421    !-
422    !
423    !Config Key   = HEIGHT_DISPLACEMENT
424    !Config Desc  = Magic number which relates the height to the displacement height.
425    !Config If    = OK_SECHIBA
426    !Config Def   = 0.75
427    !Config Help  =
428    !Config Units = [m] 
429    CALL getin_p('HEIGHT_DISPLACEMENT',height_displacement)
430    !
431    !Config Key   = Z0_BARE
432    !Config Desc  = bare soil roughness length
433    !Config If    = OK_SECHIBA
434    !Config Def   = 0.01
435    !Config Help  =
436    !Config Units = [m]   
437    CALL getin_p('Z0_BARE',z0_bare)
438    !
439    !Config Key   = Z0_ICE
440    !Config Desc  = ice roughness length
441    !Config If    = OK_SECHIBA
442    !Config Def   = 0.001
443    !Config Help  =
444    !Config Units = [m]   
445    CALL getin_p('Z0_ICE',z0_ice)
446    !
447    !Config Key   = TCST_SNOWA
448    !Config Desc  = Time constant of the albedo decay of snow
449    !Config If    = OK_SECHIBA
450    !Config Def   = 10.0
451    !Config Help  = optimized on 04/07/2016
452    !Config Units = [days]
453    CALL getin_p('TCST_SNOWA',tcst_snowa)
454    !
455    !Config Key   = SNOWCRI_ALB
456    !Config Desc  = Critical value for computation of snow albedo
457    !Config If    = OK_SECHIBA
458    !Config Def   = 10.
459    !Config Help  =
460    !Config Units = [cm] 
461    CALL getin_p('SNOWCRI_ALB',snowcri_alb)
462    !
463    !
464    !Config Key   = VIS_DRY
465    !Config Desc  = The correspondance table for the soil color numbers and their albedo
466    !Config If    = OK_SECHIBA
467    !Config Def   = 0.24, 0.22, 0.20, 0.18, 0.16, 0.14, 0.12, 0.10, 0.27
468    !Config Help  =
469    !Config Units = [-] 
470    CALL getin_p('VIS_DRY',vis_dry)
471    !
472    !Config Key   = NIR_DRY
473    !Config Desc  = The correspondance table for the soil color numbers and their albedo
474    !Config If    = OK_SECHIBA
475    !Config Def   = 0.48, 0.44, 0.40, 0.36, 0.32, 0.28, 0.24, 0.20, 0.55
476    !Config Help  =
477    !Config Units = [-]   
478    CALL getin_p('NIR_DRY',nir_dry)
479    !
480    !Config Key   = VIS_WET
481    !Config Desc  = The correspondance table for the soil color numbers and their albedo
482    !Config If    = OK_SECHIBA 
483    !Config Def   = 0.12, 0.11, 0.10, 0.09, 0.08, 0.07, 0.06, 0.05, 0.15
484    !Config Help  =
485    !Config Units = [-]   
486    CALL getin_p('VIS_WET',vis_wet)
487    !
488    !Config Key   = NIR_WET
489    !Config Desc  = The correspondance table for the soil color numbers and their albedo
490    !Config If    = OK_SECHIBA
491    !Config Def   = 0.24, 0.22, 0.20, 0.18, 0.16, 0.14, 0.12, 0.10, 0.31
492    !Config Help  =
493    !Config Units = [-]   
494    CALL getin_p('NIR_WET',nir_wet)
495    !
496    !Config Key   = ALBSOIL_VIS
497    !Config Desc  =
498    !Config If    = OK_SECHIBA
499    !Config Def   = 0.18, 0.16, 0.16, 0.15, 0.12, 0.105, 0.09, 0.075, 0.25
500    !Config Help  =
501    !Config Units = [-] 
502    CALL getin_p('ALBSOIL_VIS',albsoil_vis)
503    !
504    !Config Key   = ALBSOIL_NIR
505    !Config Desc  =
506    !Config If    = OK_SECHIBA
507    !Config Def   = 0.36, 0.34, 0.34, 0.33, 0.30, 0.25, 0.20, 0.15, 0.45
508    !Config Help  =
509    !Config Units = [-] 
510    CALL getin_p('ALBSOIL_NIR',albsoil_nir)
511    !-
512    !
513    !Config Key   = ALB_DEADLEAF
514    !Config Desc  = albedo of dead leaves, VIS+NIR
515    !Config If    = OK_SECHIBA
516    !Config Def   = 0.12, 0.35
517    !Config Help  =
518    !Config Units = [-]     
519    CALL getin_p('ALB_DEADLEAF',alb_deadleaf)
520    !
521    !Config Key   = ALB_ICE
522    !Config Desc  = albedo of ice, VIS+NIR
523    !Config If    = OK_SECHIBA
524    !Config Def   = 0.60, 0.20
525    !Config Help  =
526    !Config Units = [-] 
527    CALL getin_p('ALB_ICE',alb_ice)
528    !
529    ! Get the fixed snow albedo if needed
530    !
531    !Config Key   = CONDVEG_SNOWA
532    !Config Desc  = The snow albedo used by SECHIBA
533    !Config Def   = 1.E+20
534    !Config if    = OK_SECHIBA
535    !Config Help  = This option allows the user to impose a snow albedo.
536    !Config         Default behaviour is to use the model of snow albedo
537    !Config         developed by Chalita (1993).
538    !Config Units = [-]
539    CALL getin_p('CONDVEG_SNOWA',fixed_snow_albedo)
540    !
541    !Config Key   = ALB_BARE_MODEL
542    !Config Desc  = Switch bare soil albedo dependent (if TRUE) on soil wetness
543    !Config Def   = n
544    !Config if    = OK_SECHIBA
545    !Config Help  = If TRUE, the model for bare soil albedo is the old formulation.
546    !Config         Then it depend on the soil dry or wetness. If FALSE, it is the
547    !Config         new computation that is taken, it is the mean of soil albedo.
548    !Config Units = [FLAG]
549    CALL getin_p('ALB_BARE_MODEL',alb_bare_model)
550    !
551    !Config Key   = ALB_BG_MODIS
552    !Config Desc  = Read bare soil albedo from file with background MODIS data
553    !Config Def   = y
554    !Config if    = OK_SECHIBA
555    !Config Help  = If TRUE, the bare soil albedo is read from file
556    !Config         based on background MODIS data. 
557    !Config         If FALSE, computaion depends on ALB_BARE_MODEL
558    !Config Units = [FLAG]
559    CALL getin_p('ALB_BG_MODIS',alb_bg_modis)
560    !
561    !Config Key   = IMPOSE_AZE
562    !Config Desc  = Should the surface parameters be prescribed
563    !Config Def   = n
564    !Config if    = OK_SECHIBA
565    !Config Help  = This flag allows the user to impose the surface parameters
566    !Config         (Albedo Roughness and Emissivity). It is espacially interesting for 0D
567    !Config         simulations. On the globe it does not make too much sense as
568    !Config         it imposes the same vegetation everywhere
569    !Config Units = [FLAG]
570    CALL getin_p('IMPOSE_AZE',impaze)
571    !
572    IF(impaze) THEN
573       !
574       !Config Key   = CONDVEG_Z0
575       !Config Desc  = Surface roughness
576       !Config Def   = 0.15
577       !Config If    = IMPOSE_AZE
578       !Config Help  = Surface rougness to be used on the point if a 0-dim version
579       !Config         of SECHIBA is used. Look at the description of the forcing 
580       !Config         data for the correct value.
581       !Config Units = [m]
582       CALL getin_p('CONDVEG_Z0', z0_scal) 
583       !
584       !Config Key   = ROUGHHEIGHT
585       !Config Desc  = Height to be added to the height of the first level
586       !Config Def   = 0.0
587       !Config If    = IMPOSE_AZE
588       !Config Help  = ORCHIDEE assumes that the atmospheric level height is counted
589       !Config         from the zero wind level. Thus to take into account the roughness
590       !Config         of tall vegetation we need to correct this by a certain fraction
591       !Config         of the vegetation height. This is called the roughness height in
592       !Config         ORCHIDEE talk.
593       !Config Units = [m]
594       CALL getin_p('ROUGHHEIGHT', roughheight_scal)
595       !
596       !Config Key   = CONDVEG_ALBVIS
597       !Config Desc  = SW visible albedo for the surface
598       !Config Def   = 0.25
599       !Config If    = IMPOSE_AZE
600       !Config Help  = Surface albedo in visible wavelengths to be used
601       !Config         on the point if a 0-dim version of SECHIBA is used.
602       !Config         Look at the description of the forcing data for
603       !Config         the correct value.
604       !Config Units = [-]
605       CALL getin_p('CONDVEG_ALBVIS', albedo_scal(ivis))
606       !
607       !Config Key   = CONDVEG_ALBNIR
608       !Config Desc  = SW near infrared albedo for the surface
609       !Config Def   = 0.25
610       !Config If    = IMPOSE_AZE
611       !Config Help  = Surface albedo in near infrared wavelengths to be used
612       !Config         on the point if a 0-dim version of SECHIBA is used.
613       !Config         Look at the description of the forcing data for
614       !Config         the correct value.
615       !Config Units = [-] 
616       CALL getin_p('CONDVEG_ALBNIR', albedo_scal(inir))
617       !
618       !Config Key   = CONDVEG_EMIS
619       !Config Desc  = Emissivity of the surface for LW radiation
620       !Config Def   = 1.0
621       !Config If    = IMPOSE_AZE
622       !Config Help  = The surface emissivity used for compution the LE emission
623       !Config         of the surface in a 0-dim version. Values range between
624       !Config         0.97 and 1.. The GCM uses 0.98.
625       !Config Units = [-]
626       CALL getin_p('CONDVEG_EMIS', emis_scal)
627    ENDIF
628
629    CALL getin_p('NEW_WATSTRESS',new_watstress)
630    IF(new_watstress) THEN
631       CALL getin_p('ALPHA_WATSTRESS',alpha_watstress)
632    ENDIF
633
634    !
635    !Config Key   = ROUGH_DYN
636    !Config Desc  = Account for a dynamic roughness height
637    !Config Def   = y
638    !Config if    = OK_SECHIBA
639    !Config Help  = If this flag is set to true (y) then the roughness
640    !Config         height is computed dynamically, varying with LAI
641    !Config Units = [FLAG]
642    CALL getin_p('ROUGH_DYN',rough_dyn)
643
644    IF ( rough_dyn ) THEN
645       !
646       !Config Key   = C1
647       !Config Desc  = Constant used in the formulation of the ratio of
648       !Config         the ratio of friction velocity to the wind speed
649       !Config         at the canopy top
650       !Config         See Ershadi et al. (2015) for more info
651       !Config Def   = 0.32
652       !Config If    = ROUGH_DYN
653       !Config Help  =
654       !Config Units = [-]
655       CALL getin_p('C1', c1)
656       !
657       !Config Key   = C2
658       !Config Desc  = Constant used in the formulation of the ratio of
659       !Config         the ratio of friction velocity to the wind speed
660       !Config         at the canopy top
661       !Config         See Ershadi et al. (2015) for more info
662       !Config Def   = 0.264
663       !Config If    = ROUGH_DYN
664       !Config Help  =
665       !Config Units = [-]
666       CALL getin_p('C2', c2)
667       !
668       !Config Key   = C3
669       !Config Desc  = Constant used in the formulation of the ratio of
670       !Config         the ratio of friction velocity to the wind speed
671       !Config         at the canopy top
672       !Config         See Ershadi et al. (2015) for more info
673       !Config Def   = 15.1
674       !Config If    = ROUGH_DYN
675       !Config Help  =
676       !Config Units = [-]
677       CALL getin_p('C3', c3)
678       !
679       !Config Key   = Cdrag_foliage
680       !Config Desc  = Drag coefficient of the foliage
681       !Config         See Ershadi et al. (2015) and Su et al. (2001)
682       !Config         for more info
683       !Config Def   = 0.2
684       !Config If    = ROUGH_DYN
685       !Config Help  =
686       !Config Units = [-]
687       CALL getin_p('CDRAG_FOLIAGE', Cdrag_foliage)
688       !
689       !Config Key   = Ct
690       !Config Desc  = Heat transfer coefficient of the leaf
691       !Config         See Ershadi et al. (2015) and Su et al. (2001)
692       !Config         for more info
693       !Config Def   = 0.01
694       !Config If    = ROUGH_DYN
695       !Config Help  =
696       !Config Units = [-]
697       CALL getin_p('CT', Ct)
698       !
699       !Config Key   = Prandtl
700       !Config Desc  = Prandtl number used in the calculation of Ct*
701       !Config         See Su et al. (2001) for more info
702       !Config Def   = 0.71
703       !Config If    = ROUGH_DYN
704       !Config Help  =
705       !Config Units = [-]
706       CALL getin_p('PRANDTL', Prandtl)
707    ENDIF
708    !-
709    ! Variables related to the explicitsnow module
710    !-
711    !Config Key = xansmax
712    !Config Desc = maximum snow albedo
713    !Config If = OK_SECHIBA
714    !Config Def = 0.85
715    !Config Help =
716    !Config Units = [-]
717    CALL getin_p('XANSMAX',xansmax)
718    !
719    !Config Key = xansmin
720    !Config Desc = minimum snow albedo
721    !Config If = OK_SECHIBA
722    !Config Def = 0.50
723    !Config Help =
724    !Config Units = [-]
725    CALL getin_p('XANSMIN',xansmin)
726    !
727    !Config Key = xans_todry
728    !Config Desc = albedo decay rate for the dry snow
729    !Config If = OK_SECHIBA
730    !Config Def = 0.008
731    !Config Help =
732    !Config Units = [S-1]
733    CALL getin_p('XANSDRY',xans_todry)
734    !
735    !Config Key = xans_t
736    !Config Desc = albedo decay rate for the wet snow
737    !Config If = OK_SECHIBA
738    !Config Def = 0.24
739    !Config Help =
740    !Config Units = [S-1]
741    CALL getin_p('XANS_T',xans_t)
742
743    !Config Key = xrhosmax
744    !Config Desc = maximum snow density
745    !Config If = OK_SECHIBA
746    !Config Def = 750
747    !Config Help =
748    !Config Units = [-]
749    CALL getin_p('XRHOSMAX',xrhosmax)
750    !
751    !Config Key = xwsnowholdmax1
752    !Config Desc = snow holding capacity 1
753    !Config If = OK_SECHIBA
754    !Config Def = 0.03
755    !Config Help =
756    !Config Units = [-]
757    CALL getin_p('XWSNOWHOLDMAX1',xwsnowholdmax1)
758    !
759    !Config Key = xwsnowholdmax2
760    !Config Desc = snow holding capacity 2
761    !Config If = OK_SECHIBA
762    !Config Def = 0.10
763    !Config Help =
764    !Config Units = [-]
765    CALL getin_p('XWSNOWHOLDMAX2',xwsnowholdmax2)
766    !
767    !Config Key = xsnowrhohold
768    !Config Desc = snow density
769    !Config If = OK_SECHIBA
770    !Config Def = 200.0
771    !Config Help =
772    !Config Units = [kg/m3]
773    CALL getin_p('XSNOWRHOHOLD',xsnowrhohold)
774    !
775    !Config Key = ZSNOWTHRMCOND1
776    !Config Desc = Thermal conductivity Coef 1
777    !Config If = OK_SECHIBA
778    !Config Def = 0.02
779    !Config Help =
780    !Config Units = [W/m/K]
781    CALL getin_p('ZSNOWTHRMCOND1',ZSNOWTHRMCOND1)
782    !
783    !Config Key = ZSNOWTHRMCOND2
784    !Config Desc = Thermal conductivity Coef 2
785    !Config If = OK_SECHIBA
786    !Config Def = 2.5E-6
787    !Config Help =
788    !Config Units = [W m5/(kg2 K)]
789    CALL getin_p('ZSNOWTHRMCOND2',ZSNOWTHRMCOND2)
790    !
791    !Config Key = ZSNOWTHRMCOND_AVAP
792    !Config Desc = Thermal conductivity Coef 1 water vapor
793    !Config If = OK_SECHIBA
794    !Config Def = -0.06023
795    !Config Help =
796    !Config Units = [W/m/K]
797    CALL getin_p('ZSNOWTHRMCOND_AVAP',ZSNOWTHRMCOND_AVAP)
798    !
799    !Config Key = ZSNOWTHRMCOND_BVAP
800    !Config Desc = Thermal conductivity Coef 2 water vapor
801    !Config If = OK_SECHIBA
802    !Config Def = -2.5425
803    !Config Help =
804    !Config Units = [W/m]
805    CALL getin_p('ZSNOWTHRMCOND_BVAP',ZSNOWTHRMCOND_BVAP)
806    !
807    !Config Key = ZSNOWTHRMCOND_CVAP
808    !Config Desc = Thermal conductivity Coef 3 water vapor
809    !Config If = OK_SECHIBA
810    !Config Def = -289.99
811    !Config Help =
812    !Config Units = [K]
813    CALL getin_p('ZSNOWTHRMCOND_CVAP',ZSNOWTHRMCOND_CVAP)
814
815    !Snow compaction factors
816    !Config Key = ZSNOWCMPCT_RHOD
817    !Config Desc = Snow compaction coefficent
818    !Config If = OK_SECHIBA
819    !Config Def = 150.0
820    !Config Help =
821    !Config Units = [kg/m3]
822    CALL getin_p('ZSNOWCMPCT_RHOD',ZSNOWCMPCT_RHOD)
823
824    !Config Key = ZSNOWCMPCT_ACM
825    !Config Desc = Coefficent for the thermal conductivity
826    !Config If = OK_SECHIBA
827    !Config Def = 2.8e-6
828    !Config Help =
829    !Config Units = [1/s]
830    CALL getin_p('ZSNOWCMPCT_ACM',ZSNOWCMPCT_ACM)
831
832    !Config Key = ZSNOWCMPCT_BCM
833    !Config Desc = Coefficent for the thermal conductivity
834    !Config If = OK_SECHIBA
835    !Config Def = 0.04
836    !Config Help =
837    !Config Units = [1/K]
838    CALL getin_p('ZSNOWCMPCT_BCM',ZSNOWCMPCT_BCM)
839
840    !Config Key = ZSNOWCMPCT_CCM
841    !Config Desc = Coefficent for the thermal conductivity
842    !Config If = OK_SECHIBA
843    !Config Def = 460.
844    !Config Help =
845    !Config Units = [m3/kg]
846    CALL getin_p('ZSNOWCMPCT_CCM',ZSNOWCMPCT_CCM)
847
848    !Config Key = ZSNOWCMPCT_V0
849    !Config Desc = Vapor coefficent for the thermal conductivity
850    !Config If = OK_SECHIBA
851    !Config Def = 3.7e7
852    !Config Help =
853    !Config Units = [Pa/s]
854    CALL getin_p('ZSNOWCMPCT_V0',ZSNOWCMPCT_V0)
855
856    !Config Key = ZSNOWCMPCT_VT
857    !Config Desc = Vapor coefficent for the thermal conductivity
858    !Config If = OK_SECHIBA
859    !Config Def = 0.081
860    !Config Help =
861    !Config Units = [1/K]
862    CALL getin_p('ZSNOWCMPCT_VT',ZSNOWCMPCT_VT)
863
864    !Config Key = ZSNOWCMPCT_VR
865    !Config Desc = Vapor coefficent for the thermal conductivity
866    !Config If = OK_SECHIBA
867    !Config Def = 0.018
868    !Config Help =
869    !Config Units = [m3/kg]
870    CALL getin_p('ZSNOWCMPCT_VR',ZSNOWCMPCT_VR)
871
872
873    !Surface resistance
874    !
875    !Config Key = CB
876    !Config Desc = Constant of the Louis scheme
877    !Config If = OK_SECHIBA
878    !Config Def = 5.0
879    !Config Help =
880    !Config Units = [-]
881    CALL getin_p('CB',cb)
882    !
883    !Config Key = CC
884    !Config Desc = Constant of the Louis scheme
885    !Config If = OK_SECHIBA
886    !Config Def = 5.0
887    !Config Help =
888    !Config Units = [-]
889    CALL getin_p('CC',cc)
890    !
891    !Config Key = CD
892    !Config Desc = Constant of the Louis scheme
893    !Config If = OK_SECHIBA
894    !Config Def = 5.0
895    !Config Help =
896    !Config Units = [-]
897    CALL getin_p('CD',cd)
898    !
899    !Config Key = RAYT_CSTE
900    !Config Desc = Constant in the computation of surface resistance 
901    !Config If = OK_SECHIBA
902    !Config Def = 125
903    !Config Help =
904    !Config Units = [W.m^{-2}]
905    CALL getin_p('RAYT_CSTE',rayt_cste)
906    !
907    !Config Key = DEFC_PLUS
908    !Config Desc = Constant in the computation of surface resistance 
909    !Config If = OK_SECHIBA
910    !Config Def = 23.E-3
911    !Config Help =
912    !Config Units = [K.W^{-1}]
913    CALL getin_p('DEFC_PLUS',defc_plus)
914    !
915    !Config Key = DEFC_MULT
916    !Config Desc = Constant in the computation of surface resistance 
917    !Config If = OK_SECHIBA
918    !Config Def = 1.5
919    !Config Help =
920    !Config Units = [K.W^{-1}]
921    CALL getin_p('DEFC_MULT',defc_mult)
922    !
923
924    !
925    !-
926    ! diffuco
927    !-
928    !
929    !Config Key   = NLAI
930    !Config Desc  = Number of LAI levels
931    !Config If    = OK_SECHIBA
932    !Config Def   = 20
933    !Config Help  =
934    !Config Units = [-] 
935    CALL getin_p('NLAI',nlai)
936    !
937    !Config Key   = LAIMAX
938    !Config Desc  = Maximum LAI
939    !Config If    = OK_SECHIBA
940    !Config Def   =
941    !Config Help  =
942    !Config Units = [m^2/m^2]   
943    CALL getin_p('LAIMAX',laimax)
944    !
945    !Config Key   = DEW_VEG_POLY_COEFF
946    !Config Desc  = coefficients of the polynome of degree 5 for the dew
947    !Config If    = OK_SECHIBA
948    !Config Def   = 0.887773, 0.205673, 0.110112, 0.014843, 0.000824, 0.000017
949    !Config Help  =
950    !Config Units = [-]   
951    CALL getin_p('DEW_VEG_POLY_COEFF',dew_veg_poly_coeff)
952    !
953    !Config Key   = DOWNREGULATION_CO2
954    !Config Desc  = Activation of CO2 downregulation
955    !Config If    = OK_SECHIBA
956    !Config Def   = y
957    !Config Help  =
958    !Config Units = [FLAG]   
959    CALL getin_p('DOWNREGULATION_CO2',downregulation_co2)
960    !
961    !Config Key   = DOWNREGULATION_CO2_BASELEVEL
962    !Config Desc  = CO2 base level
963    !Config If    = OK_SECHIBA
964    !Config Def   = 380.
965    !Config Help  =
966    !Config Units = [ppm]   
967    CALL getin_p('DOWNREGULATION_CO2_BASELEVEL',downregulation_co2_baselevel)
968
969   
970    !Config Key   = GB_REF
971    !Config Desc  = Leaf bulk boundary layer resistance
972    !Config If    = OK_CO2
973    !Config Def   = 1./25.
974    !Config Help  =
975    !Config Units = [s m-1]   
976    CALL getin_p('GB_REF',gb_ref)
977
978
979    !-
980    ! slowproc
981    !-
982    !
983    !Config Key   = CLAYFRACTION_DEFAULT
984    !Config Desc  = default fraction of clay
985    !Config If    = OK_SECHIBA
986    !Config Def   = 0.2
987    !Config Help  =
988    !Config Units = [-]   
989    CALL getin_p('CLAYFRACTION_DEFAULT',clayfraction_default)
990    !
991    !Config Key   = SANDFRACTION_DEFAULT
992    !Config Desc  = default fraction of sand
993    !Config If    = OK_SECHIBA
994    !Config Def   = 0.4
995    !Config Help  =
996    !Config Units = [-]   
997    CALL getin_p('SANDFRACTION_DEFAULT',sandfraction_default)
998    !
999    !Config Key   = SILTFRACTION_DEFAULT
1000    !Config Desc  = default fraction of silt
1001    !Config If    = OK_SECHIBA
1002    !Config Def   = 0.4
1003    !Config Help  =
1004    !Config Units = [-]   
1005    CALL getin_p('SILTFRACTION_DEFAULT',siltfraction_default)
1006
1007
1008    IF ( ABS(clayfraction_default+sandfraction_default+siltfraction_default-1) > min_sechiba) THEN
1009       WRITE(numout,*) 'Incoherence found. clayfraction_default=', clayfraction_default, ' sandfraction_default=',&
1010            sandfraction_default,' siltfraction_default=',siltfraction_default
1011       CALL ipslerr_p(3,"config_sechiba_parameters",&
1012            "Inconsistecy between CLAYFRACTION_DEFAULT, SANDFRACTION_DEFAULT and SILTFRACTION_DEFAULT set in run.def",&
1013            "The sum should be equal 1 but this is not the case.","Modify run.def and restart the model")
1014    END IF
1015    !
1016    !Config Key   = MIN_VEGFRAC
1017    !Config Desc  = Minimal fraction of mesh a vegetation type can occupy
1018    !Config If    = OK_SECHIBA
1019    !Config Def   = 0.001
1020    !Config Help  =
1021    !Config Units = [-] 
1022    CALL getin_p('MIN_VEGFRAC',min_vegfrac)
1023    !
1024    !Config Key   = STEMPDIAG_BID
1025    !Config Desc  = only needed for an initial LAI if there is no restart file
1026    !Config If    = OK_SECHIBA
1027    !Config Def   = 280.
1028    !Config Help  =
1029    !Config Units = [K]
1030    CALL getin_p('STEMPDIAG_BID',stempdiag_bid)
1031    !
1032
1033  END SUBROUTINE config_sechiba_parameters
1034
1035
1036!! ================================================================================================================================
1037!! SUBROUTINE   : config_co2_parameters
1038!!
1039!>\BRIEF        This subroutine reads in the configuration file all the parameters
1040!! needed when OK_CO2 is set to true. (ie : when the photosynthesis is activated)
1041!!
1042!! DESCRIPTION  : None
1043!!
1044!! RECENT CHANGE(S): None
1045!!
1046!! MAIN OUTPUT VARIABLE(S): None
1047!!
1048!! REFERENCE(S) :
1049!!
1050!! FLOWCHART    :
1051!! \n
1052!_ ================================================================================================================================
1053
1054  SUBROUTINE config_co2_parameters
1055
1056    IMPLICIT NONE
1057
1058    !! 0. Variables and parameters declaration
1059
1060    !! 0.4 Local variables
1061
1062    !_ ================================================================================================================================
1063
1064    !
1065    !Config Key   = LAI_LEVEL_DEPTH
1066    !Config Desc  =
1067    !Config If    = OK_CO2
1068    !Config Def   = 0.15
1069    !Config Help  =
1070    !Config Units = [-] 
1071    CALL getin_p('LAI_LEVEL_DEPTH',lai_level_depth)
1072    !
1073    !Config Key   = Oi
1074    !Config Desc  = Intercellular oxygen partial pressure
1075    !Config If    = OK_CO2
1076    !Config Def   = 210000.
1077    !Config Help  = See Legend of Figure 6 of Yin et al. (2009)
1078    !Config Units = [ubar] 
1079    CALL getin_p('Oi',Oi)
1080
1081
1082  END SUBROUTINE config_co2_parameters
1083
1084
1085!! ================================================================================================================================
1086!! SUBROUTINE   : config_stomate_parameters
1087!!
1088!>\BRIEF        This subroutine reads in the configuration file all the parameters
1089!! needed when stomate is activated (ie : when OK_STOMATE is set to true).
1090!!
1091!! DESCRIPTION  : None
1092!!
1093!! RECENT CHANGE(S): None
1094!!
1095!! MAIN OUTPUT VARIABLE(S):
1096!!
1097!! REFERENCE(S) :
1098!!
1099!! FLOWCHART    :
1100!! \n
1101!_ ================================================================================================================================
1102
1103  SUBROUTINE config_stomate_parameters
1104
1105    IMPLICIT NONE
1106
1107    !! 0. Variables and parameters declaration
1108
1109    !! 0.4 Local variables   
1110
1111
1112    !_ ================================================================================================================================
1113
1114    !-
1115    ! constraints_parameters
1116    !-
1117    !
1118    !Config Key   = TOO_LONG
1119    !Config Desc  = longest sustainable time without regeneration (vernalization)
1120    !Config If    = OK_STOMATE
1121    !Config Def   = 5.
1122    !Config Help  =
1123    !Config Units = [days]   
1124    CALL getin_p('TOO_LONG',too_long)
1125
1126    !-
1127    ! fire parameters
1128    !-
1129    !
1130    !Config Key   = TAU_FIRE
1131    !Config Desc  = Time scale for memory of the fire index (days). Validated for one year in the DGVM.
1132    !Config If    = OK_STOMATE
1133    !Config Def   = 30.
1134    !Config Help  =
1135    !Config Units = [days]   
1136    CALL getin_p('TAU_FIRE',tau_fire)
1137    !
1138    !Config Key   = LITTER_CRIT
1139    !Config Desc  = Critical litter quantity for fire
1140    !Config If    = OK_STOMATE
1141    !Config Def   = 200.
1142    !Config Help  =
1143    !Config Units = [gC/m^2] 
1144    CALL getin_p('LITTER_CRIT',litter_crit)
1145    !
1146    !Config Key   = FIRE_RESIST_STRUCT
1147    !Config Desc  =
1148    !Config If    = OK_STOMATE
1149    !Config Def   = 0.5
1150    !Config Help  =
1151    !Config Units = [-] 
1152    CALL getin_p('FIRE_RESIST_STRUCT',fire_resist_struct)
1153    !
1154    !
1155    !Config Key   = CO2FRAC
1156    !Config Desc  = What fraction of a burned plant compartment goes into the atmosphere
1157    !Config If    = OK_STOMATE
1158    !Config Def   = 0.95, 0.95, 0., 0.3, 0., 0., 0.95, 0.95
1159    !Config Help  =
1160    !Config Units = [-] 
1161    CALL getin_p('CO2FRAC',co2frac)
1162    !
1163    !Config Key   = BCFRAC_COEFF
1164    !Config Desc  =
1165    !Config If    = OK_STOMATE
1166    !Config Def   = 0.3, 1.3, 88.2
1167    !Config Help  =
1168    !Config Units = [-] 
1169    CALL getin_p('BCFRAC_COEFF',bcfrac_coeff)
1170    !
1171    !Config Key   = FIREFRAC_COEFF
1172    !Config Desc  =
1173    !Config If    = OK_STOMATE
1174    !Config Def   = 0.45, 0.8, 0.6, 0.13
1175    !Config Help  =
1176    !Config Units = [-]   
1177    CALL getin_p('FIREFRAC_COEFF',firefrac_coeff)
1178
1179    !Config Key   = REF_GREFF
1180    !Config Desc  = Asymptotic maximum mortality rate
1181    !Config If    = OK_STOMATE
1182    !Config Def   = 0.035
1183    !Config Help  = Set asymptotic maximum mortality rate from Sitch 2003
1184    !Config         (they use 0.01) (year^{-1})
1185    !Config Units = [1/year] 
1186    CALL getin_p('REF_GREFF',ref_greff)
1187    !-
1188    ! allocation parameters
1189    !-
1190    !
1191    !Config Key   = OK_MINRES
1192    !Config Desc  = Do we try to reach a minimum reservoir even if we are severely stressed?
1193    !Config If    = OK_STOMATE
1194    !Config Def   = y
1195    !Config Help  =
1196    !Config Units = [FLAG]
1197    CALL getin_p('OK_MINRES',ok_minres)
1198    !
1199    !Config Key   = RESERVE_TIME_TREE
1200    !Config Desc  = maximum time during which reserve is used (trees)
1201    !Config If    = OK_STOMATE
1202    !Config Def   = 30.
1203    !Config Help  =
1204    !Config Units = [days]   
1205    CALL getin_p('RESERVE_TIME_TREE',reserve_time_tree)
1206    !
1207    !Config Key   = RESERVE_TIME_GRASS
1208    !Config Desc  = maximum time during which reserve is used (grasses)
1209    !Config If    = OK_STOMATE
1210    !Config Def   = 20.
1211    !Config Help  =
1212    !Config Units = [days]   
1213    CALL getin_p('RESERVE_TIME_GRASS',reserve_time_grass)
1214    !
1215    !Config Key   = F_FRUIT
1216    !Config Desc  = Standard fruit allocation
1217    !Config If    = OK_STOMATE
1218    !Config Def   = 0.1
1219    !Config Help  =
1220    !Config Units = [-]   
1221    CALL getin_p('F_FRUIT',f_fruit)
1222    !
1223    !Config Key   = ALLOC_SAP_ABOVE_GRASS
1224    !Config Desc  = fraction of sapwood allocation above ground
1225    !Config If    = OK_STOMATE
1226    !Config Def   = 1.0
1227    !Config Help  =
1228    !Config Units = [-]   
1229    CALL getin_p('ALLOC_SAP_ABOVE_GRASS',alloc_sap_above_grass)
1230    !
1231    !Config Key   = MIN_LTOLSR
1232    !Config Desc  = extrema of leaf allocation fraction
1233    !Config If    = OK_STOMATE
1234    !Config Def   = 0.2
1235    !Config Help  =
1236    !Config Units = [-]   
1237    CALL getin_p('MIN_LTOLSR',min_LtoLSR)
1238    !
1239    !Config Key   = MAX_LTOLSR
1240    !Config Desc  = extrema of leaf allocation fraction
1241    !Config If    = OK_STOMATE
1242    !Config Def   = 0.5
1243    !Config Help  =
1244    !Config Units = [-]   
1245    CALL getin_p('MAX_LTOLSR',max_LtoLSR)
1246    !
1247    !Config Key   = Z_NITROGEN
1248    !Config Desc  = scaling depth for nitrogen limitation
1249    !Config If    = OK_STOMATE
1250    !Config Def   = 0.2
1251    !Config Help  =
1252    !Config Units = [m] 
1253    CALL getin_p('Z_NITROGEN',z_nitrogen)
1254    !
1255    !Config Key   = NLIM_TREF
1256    !Config Desc  =
1257    !Config If    = OK_STOMATE
1258    !Config Def   = 25.
1259    !Config Help  =
1260    !Config Units = [C] 
1261    CALL getin_p('NLIM_TREF',Nlim_tref) 
1262
1263    !-
1264    ! data parameters
1265    !-
1266    !
1267    !Config Key   = PIPE_TUNE1
1268    !Config Desc  = crown area = pipe_tune1. stem diameter**(1.6) (Reinicke's theory)
1269    !Config If    = OK_STOMATE
1270    !Config Def   = 100.0
1271    !Config Help  =
1272    !Config Units = [-]   
1273    CALL getin_p('PIPE_TUNE1',pipe_tune1)
1274    !
1275    !Config Key   = PIPE_TUNE2
1276    !Config Desc  = height=pipe_tune2 * diameter**pipe_tune3
1277    !Config If    = OK_STOMATE
1278    !Config Def   = 40.0
1279    !Config Help  =
1280    !Config Units = [-]     
1281    CALL getin_p('PIPE_TUNE2',pipe_tune2) 
1282    !
1283    !Config Key   = PIPE_TUNE3
1284    !Config Desc  = height=pipe_tune2 * diameter**pipe_tune3
1285    !Config If    = OK_STOMATE
1286    !Config Def   = 0.5
1287    !Config Help  =
1288    !Config Units = [-]   
1289    CALL getin_p('PIPE_TUNE3',pipe_tune3)
1290    !
1291    !Config Key   = PIPE_TUNE4
1292    !Config Desc  = needed for stem diameter
1293    !Config If    = OK_STOMATE
1294    !Config Def   = 0.3
1295    !Config Help  =
1296    !Config Units = [-] 
1297    CALL getin_p('PIPE_TUNE4',pipe_tune4)
1298    !
1299    !Config Key   = PIPE_DENSITY
1300    !Config Desc  = Density
1301    !Config If    = OK_STOMATE
1302    !Config Def   = 2.e5
1303    !Config Help  =
1304    !Config Units = [-] 
1305    CALL getin_p('PIPE_DENSITY',pipe_density)
1306    !
1307    !Config Key   = PIPE_K1
1308    !Config Desc  =
1309    !Config If    = OK_STOMATE
1310    !Config Def   = 8.e3
1311    !Config Help  =
1312    !Config Units = [-]   
1313    CALL getin_p('PIPE_K1',pipe_k1)
1314    !
1315    !Config Key   = PIPE_TUNE_EXP_COEFF
1316    !Config Desc  = pipe tune exponential coeff
1317    !Config If    = OK_STOMATE
1318    !Config Def   = 1.6
1319    !Config Help  =
1320    !Config Units = [-]   
1321    CALL getin_p('PIPE_TUNE_EXP_COEFF',pipe_tune_exp_coeff)
1322    !
1323    !
1324    !Config Key   = PRECIP_CRIT
1325    !Config Desc  = minimum precip
1326    !Config If    = OK_STOMATE
1327    !Config Def   = 100.
1328    !Config Help  =
1329    !Config Units = [mm/year] 
1330    CALL getin_p('PRECIP_CRIT',precip_crit)
1331    !
1332    !Config Key   = GDD_CRIT_ESTAB
1333    !Config Desc  = minimum gdd for establishment of saplings
1334    !Config If    = OK_STOMATE
1335    !Config Def   = 150.
1336    !Config Help  =
1337    !Config Units = [-] 
1338    CALL getin_p('GDD_CRIT_ESTAB',gdd_crit_estab)
1339    !
1340    !Config Key   = FPC_CRIT
1341    !Config Desc  = critical fpc, needed for light competition and establishment
1342    !Config If    = OK_STOMATE
1343    !Config Def   = 0.95
1344    !Config Help  =
1345    !Config Units = [-] 
1346    CALL getin_p('FPC_CRIT',fpc_crit)
1347    !
1348    !Config Key   = ALPHA_GRASS
1349    !Config Desc  = sapling characteristics : alpha's
1350    !Config If    = OK_STOMATE
1351    !Config Def   = 0.5
1352    !Config Help  =
1353    !Config Units = [-]   
1354    CALL getin_p('ALPHA_GRASS',alpha_grass)
1355    !
1356    !Config Key   = ALPHA_TREE
1357    !Config Desc  = sapling characteristics : alpha's
1358    !Config If    = OK_STOMATE
1359    !Config Def   = 1.
1360    !Config Help  =
1361    !Config Units = [-]   
1362    CALL getin_p('ALPHA_TREE',alpha_tree)
1363    !-
1364    !
1365    !Config Key   = MASS_RATIO_HEART_SAP
1366    !Config Desc  = mass ratio (heartwood+sapwood)/sapwood
1367    !Config If    = OK_STOMATE
1368    !Config Def   = 3.
1369    !Config Help  =
1370    !Config Units = [-]   
1371    CALL getin_p('MASS_RATIO_HEART_SAP',mass_ratio_heart_sap)
1372    !
1373    !Config Key   = TAU_HUM_MONTH
1374    !Config Desc  = time scales for phenology and other processes
1375    !Config If    = OK_STOMATE
1376    !Config Def   = 20.
1377    !Config Help  =
1378    !Config Units = [days] 
1379    CALL getin_p('TAU_HUM_MONTH',tau_hum_month)
1380    !
1381    !Config Key   = TAU_HUM_WEEK
1382    !Config Desc  = time scales for phenology and other processes
1383    !Config If    = OK_STOMATE
1384    !Config Def   = 7.
1385    !Config Help  =
1386    !Config Units = [days]   
1387    CALL getin_p('TAU_HUM_WEEK',tau_hum_week)
1388    !
1389    !Config Key   = TAU_T2M_MONTH
1390    !Config Desc  = time scales for phenology and other processes
1391    !Config If    = OK_STOMATE
1392    !Config Def   = 20.
1393    !Config Help  =
1394    !Config Units = [days]     
1395    CALL getin_p('TAU_T2M_MONTH',tau_t2m_month)
1396    !
1397    !Config Key   = TAU_T2M_WEEK
1398    !Config Desc  = time scales for phenology and other processes
1399    !Config If    = OK_STOMATE
1400    !Config Def   = 7.
1401    !Config Help  =
1402    !Config Units = [days]   
1403    CALL getin_p('TAU_T2M_WEEK',tau_t2m_week)
1404    !
1405    !Config Key   = TAU_TSOIL_MONTH
1406    !Config Desc  = time scales for phenology and other processes
1407    !Config If    = OK_STOMATE
1408    !Config Def   = 20.
1409    !Config Help  =
1410    !Config Units = [days]     
1411    CALL getin_p('TAU_TSOIL_MONTH',tau_tsoil_month)
1412    !
1413    !Config Key   = TAU_SOILHUM_MONTH
1414    !Config Desc  = time scales for phenology and other processes
1415    !Config If    = OK_STOMATE
1416    !Config Def   = 20.
1417    !Config Help  =
1418    !Config Units = [days]   
1419    CALL getin_p('TAU_SOILHUM_MONTH',tau_soilhum_month)
1420    !
1421    !Config Key   = TAU_GPP_WEEK
1422    !Config Desc  = time scales for phenology and other processes
1423    !Config If    = OK_STOMATE
1424    !Config Def   = 7.
1425    !Config Help  =
1426    !Config Units = [days]   
1427    CALL getin_p('TAU_GPP_WEEK',tau_gpp_week)
1428    !
1429    !Config Key   = TAU_GDD
1430    !Config Desc  = time scales for phenology and other processes
1431    !Config If    = OK_STOMATE
1432    !Config Def   = 40.
1433    !Config Help  =
1434    !Config Units = [days]   
1435    CALL getin_p('TAU_GDD',tau_gdd)
1436    !
1437    !Config Key   = TAU_NGD
1438    !Config Desc  = time scales for phenology and other processes
1439    !Config If    = OK_STOMATE
1440    !Config Def   = 50.
1441    !Config Help  =
1442    !Config Units = [days]   
1443    CALL getin_p('TAU_NGD',tau_ngd)
1444    !
1445    !Config Key   = COEFF_TAU_LONGTERM
1446    !Config Desc  = time scales for phenology and other processes
1447    !Config If    = OK_STOMATE
1448    !Config Def   = 3.
1449    !Config Help  =
1450    !Config Units = [days]   
1451    CALL getin_p('COEFF_TAU_LONGTERM',coeff_tau_longterm)
1452    !-
1453    !
1454    !Config Key   = BM_SAPL_CARBRES
1455    !Config Desc  =
1456    !Config If    = OK_STOMATE
1457    !Config Def   = 5.
1458    !Config Help  =
1459    !Config Units = [-]   
1460    CALL getin_p('BM_SAPL_CARBRES',bm_sapl_carbres)
1461    !
1462    !Config Key   = BM_SAPL_SAPABOVE
1463    !Config Desc  =
1464    !Config If    = OK_STOMATE
1465    !Config Def   = 0.5
1466    !Config Help  =
1467    !Config Units = [-]   
1468    CALL getin_p('BM_SAPL_SAPABOVE',bm_sapl_sapabove)
1469    !
1470    !Config Key   = BM_SAPL_HEARTABOVE
1471    !Config Desc  =
1472    !Config If    = OK_STOMATE
1473    !Config Def   = 2.
1474    !Config Help  =
1475    !Config Units = [-]   
1476    CALL getin_p('BM_SAPL_HEARTABOVE',bm_sapl_heartabove)
1477    !
1478    !Config Key   = BM_SAPL_HEARTBELOW
1479    !Config Desc  =
1480    !Config If    = OK_STOMATE
1481    !Config Def   = 2.
1482    !Config Help  =
1483    !Config Units = [-]   
1484    CALL getin_p('BM_SAPL_HEARTBELOW',bm_sapl_heartbelow)
1485    !
1486    !Config Key   = INIT_SAPL_MASS_LEAF_NAT
1487    !Config Desc  =
1488    !Config If    = OK_STOMATE
1489    !Config Def   = 0.1
1490    !Config Help  =
1491    !Config Units = [-]   
1492    CALL getin_p('INIT_SAPL_MASS_LEAF_NAT',init_sapl_mass_leaf_nat)
1493    !
1494    !Config Key   = INIT_SAPL_MASS_LEAF_AGRI
1495    !Config Desc  =
1496    !Config If    = OK_STOMATE
1497    !Config Def   = 1.
1498    !Config Help  =
1499    !Config Units = [-]   
1500    CALL getin_p('INIT_SAPL_MASS_LEAF_AGRI',init_sapl_mass_leaf_agri)
1501    !
1502    !Config Key   = INIT_SAPL_MASS_CARBRES
1503    !Config Desc  =
1504    !Config If    = OK_STOMATE
1505    !Config Def   = 5.
1506    !Config Help  =
1507    !Config Units = [-]   
1508    CALL getin_p('INIT_SAPL_MASS_CARBRES',init_sapl_mass_carbres)
1509    !
1510    !Config Key   = INIT_SAPL_MASS_ROOT
1511    !Config Desc  =
1512    !Config If    = OK_STOMATE
1513    !Config Def   = 0.1
1514    !Config Help  =
1515    !Config Units = [-]   
1516    CALL getin_p('INIT_SAPL_MASS_ROOT',init_sapl_mass_root)
1517    !
1518    !Config Key   = INIT_SAPL_MASS_FRUIT
1519    !Config Desc  =
1520    !Config If    = OK_STOMATE
1521    !Config Def   = 0.3
1522    !Config Help  =
1523    !Config Units = [-]   
1524    CALL getin_p('INIT_SAPL_MASS_FRUIT',init_sapl_mass_fruit)
1525    !
1526    !Config Key   = CN_SAPL_INIT
1527    !Config Desc  =
1528    !Config If    = OK_STOMATE
1529    !Config Def   = 0.5
1530    !Config Help  =
1531    !Config Units = [-]   
1532    CALL getin_p('CN_SAPL_INIT',cn_sapl_init)
1533    !
1534    !Config Key   = MIGRATE_TREE
1535    !Config Desc  =
1536    !Config If    = OK_STOMATE
1537    !Config Def   = 10000.
1538    !Config Help  =
1539    !Config Units = [m/year]   
1540    CALL getin_p('MIGRATE_TREE',migrate_tree)
1541    !
1542    !Config Key   = MIGRATE_GRASS
1543    !Config Desc  =
1544    !Config If    = OK_STOMATE
1545    !Config Def   = 10000.
1546    !Config Help  =
1547    !Config Units = [m/year]   
1548    CALL getin_p('MIGRATE_GRASS',migrate_grass)
1549    !
1550    !Config Key   = LAI_INITMIN_TREE
1551    !Config Desc  =
1552    !Config If    = OK_STOMATE
1553    !Config Def   = 0.3
1554    !Config Help  =
1555    !Config Units = [m^2/m^2] 
1556    CALL getin_p('LAI_INITMIN_TREE',lai_initmin_tree)
1557    !
1558    !Config Key   = LAI_INITMIN_GRASS
1559    !Config Desc  =
1560    !Config If    = OK_STOMATE
1561    !Config Def   = 0.1
1562    !Config Help  =
1563    !Config Units = [m^2/m^2]   
1564    CALL getin_p('LAI_INITMIN_GRASS',lai_initmin_grass)
1565    !
1566    !Config Key   = DIA_COEFF
1567    !Config Desc  =
1568    !Config If    = OK_STOMATE
1569    !Config Def   = 4., 0.5
1570    !Config Help  =
1571    !Config Units = [-]   
1572    CALL getin_p('DIA_COEFF',dia_coeff)
1573    !
1574    !Config Key   = MAXDIA_COEFF
1575    !Config Desc  =
1576    !Config If    = OK_STOMATE
1577    !Config Def   = 100., 0.01
1578    !Config Help  =
1579    !Config Units = [-]   
1580    CALL getin_p('MAXDIA_COEFF',maxdia_coeff)
1581    !
1582    !Config Key   = BM_SAPL_LEAF
1583    !Config Desc  =
1584    !Config If    = OK_STOMATE
1585    !Config Def   = 4., 4., 0.8, 5.
1586    !Config Help  =
1587    !Config Units = [-] 
1588    CALL getin_p('BM_SAPL_LEAF',bm_sapl_leaf)
1589
1590    !-
1591    ! litter parameters
1592    !-
1593    !
1594    !Config Key   = METABOLIC_REF_FRAC
1595    !Config Desc  =
1596    !Config If    = OK_STOMATE
1597    !Config Def   = 0.85 
1598    !Config Help  =
1599    !Config Units = [-]
1600    CALL getin_p('METABOLIC_REF_FRAC',metabolic_ref_frac)
1601    !
1602    !Config Key   = Z_DECOMP
1603    !Config Desc  = scaling depth for soil activity
1604    !Config If    = OK_STOMATE
1605    !Config Def   = 0.2
1606    !Config Help  =
1607    !Config Units = [m]   
1608    CALL getin_p('Z_DECOMP',z_decomp)
1609    !
1610    !Config Key   = CN
1611    !Config Desc  = C/N ratio
1612    !Config If    = OK_STOMATE
1613    !Config Def   = 40., 40., 40., 40., 40., 40., 40., 40.
1614    !Config Help  =
1615    !Config Units = [-] 
1616    CALL getin_p('CN',CN)
1617    !
1618    !Config Key   = LC
1619    !Config Desc  = Lignine/C ratio of the different plant parts
1620    !Config If    = OK_STOMATE
1621    !Config Def   = 0.22, 0.35, 0.35, 0.35, 0.35, 0.22, 0.22, 0.22
1622    !Config Help  =
1623    !Config Units = [-]   
1624    CALL getin_p('LC',LC)
1625    !
1626    !Config Key   = FRAC_SOIL_STRUCT_AA
1627    !Config Desc  = frac_soil(istructural,iactive,iabove)
1628    !Config If    = OK_STOMATE
1629    !Config Def   = 0.55
1630    !Config Help  =
1631    !Config Units = [-]
1632    CALL getin_p('FRAC_SOIL_STRUCT_AA',frac_soil_struct_aa)
1633    !
1634    !Config Key   = FRAC_SOIL_STRUCT_A
1635    !Config Desc  = frac_soil(istructural,iactive,ibelow)
1636    !Config If    = OK_STOMATE
1637    !Config Def   = 0.45
1638    !Config Help  =
1639    !Config Units = [-]
1640    CALL getin_p('FRAC_SOIL_STRUCT_AB',frac_soil_struct_ab)
1641    !
1642    !Config Key   = FRAC_SOIL_STRUCT_SA
1643    !Config Desc  = frac_soil(istructural,islow,iabove)
1644    !Config If    = OK_STOMATE
1645    !Config Def   = 0.7 
1646    !Config Help  =
1647    !Config Units = [-]   
1648    CALL getin_p('FRAC_SOIL_STRUCT_SA',frac_soil_struct_sa)
1649    !
1650    !Config Key   = FRAC_SOIL_STRUCT_SB
1651    !Config Desc  = frac_soil(istructural,islow,ibelow)
1652    !Config If    = OK_STOMATE
1653    !Config Def   = 0.7 
1654    !Config Help  =
1655    !Config Units = [-]   
1656    CALL getin_p('FRAC_SOIL_STRUCT_SB',frac_soil_struct_sb)
1657    !
1658    !Config Key   = FRAC_SOIL_METAB_AA
1659    !Config Desc  = frac_soil(imetabolic,iactive,iabove)
1660    !Config If    = OK_STOMATE
1661    !Config Def   = 0.45
1662    !Config Help  =
1663    !Config Units = [-]   
1664    CALL getin_p('FRAC_SOIL_METAB_AA',frac_soil_metab_aa)
1665    !
1666    !Config Key   = FRAC_SOIL_METAB_AB
1667    !Config Desc  = frac_soil(imetabolic,iactive,ibelow)
1668    !Config If    = OK_STOMATE
1669    !Config Def   = 0.45 
1670    !Config Help  =
1671    !Config Units = [-]   
1672    CALL getin_p('FRAC_SOIL_METAB_AB',frac_soil_metab_ab)
1673    !
1674    !
1675    !Config Key   = METABOLIC_LN_RATIO
1676    !Config Desc  =
1677    !Config If    = OK_STOMATE
1678    !Config Def   = 0.018 
1679    !Config Help  =
1680    !Config Units = [-]   
1681    CALL getin_p('METABOLIC_LN_RATIO',metabolic_LN_ratio) 
1682    !
1683    !Config Key   = TAU_METABOLIC
1684    !Config Desc  =
1685    !Config If    = OK_STOMATE
1686    !Config Def   = 0.066
1687    !Config Help  =
1688    !Config Units = [days]
1689    CALL getin_p('TAU_METABOLIC',tau_metabolic)
1690    !
1691    !Config Key   = TAU_STRUCT
1692    !Config Desc  =
1693    !Config If    = OK_STOMATE
1694    !Config Def   = 0.245
1695    !Config Help  =
1696    !Config Units = [days]
1697    CALL getin_p('TAU_STRUCT',tau_struct)
1698    !
1699    !Config Key   = SOIL_Q10
1700    !Config Desc  =
1701    !Config If    = OK_STOMATE
1702    !Config Def   = 0.69 (=ln2)
1703    !Config Help  =
1704    !Config Units = [-]
1705    CALL getin_p('SOIL_Q10',soil_Q10)
1706    !
1707    !Config Key   = TSOIL_REF
1708    !Config Desc  =
1709    !Config If    = OK_STOMATE
1710    !Config Def   = 30.
1711    !Config Help  =
1712    !Config Units = [C]   
1713    CALL getin_p('TSOIL_REF',tsoil_ref)
1714    !
1715    !Config Key   = LITTER_STRUCT_COEF
1716    !Config Desc  =
1717    !Config If    = OK_STOMATE
1718    !Config Def   = 3.
1719    !Config Help  =
1720    !Config Units = [-]   
1721    CALL getin_p('LITTER_STRUCT_COEF',litter_struct_coef)
1722    !
1723    !Config Key   = MOIST_COEFF
1724    !Config Desc  =
1725    !Config If    = OK_STOMATE
1726    !Config Def   = 1.1, 2.4, 0.29
1727    !Config Help  =
1728    !Config Units = [-]   
1729    CALL getin_p('MOIST_COEFF',moist_coeff)
1730    !
1731    !Config Key   = MOISTCONT_MIN
1732    !Config Desc  = minimum soil wetness to limit the heterotrophic respiration
1733    !Config If    = OK_STOMATE
1734    !Config Def   = 0.25
1735    !Config Help  =
1736    !Config Units = [-]
1737    CALL getin_p('MOISTCONT_MIN',moistcont_min)
1738
1739    !-
1740    ! lpj parameters
1741    !-
1742    !
1743    !Config Key   = FRAC_TURNOVER_DAILY
1744    !Config Desc  =
1745    !Config If    = OK_STOMATE
1746    !Config Def   = 0.55
1747    !Config Help  =
1748    !Config Units = [-]
1749    CALL getin_p('FRAC_TURNOVER_DAILY',frac_turnover_daily)   
1750
1751    !-
1752    ! npp parameters
1753    !-
1754    !
1755    !Config Key   = TAX_MAX
1756    !Config Desc  = maximum fraction of allocatable biomass used for maintenance respiration
1757    !Config If    = OK_STOMATE
1758    !Config Def   = 0.8
1759    !Config Help  =
1760    !Config Units = [-]   
1761    CALL getin_p('TAX_MAX',tax_max) 
1762
1763    !-
1764    ! phenology parameters
1765    !-
1766    !Config Key   = MIN_GROWTHINIT_TIME
1767    !Config Desc  = minimum time since last beginning of a growing season
1768    !Config If    = OK_STOMATE
1769    !Config Def   = 300.
1770    !Config Help  =
1771    !Config Units = [days] 
1772    CALL getin_p('MIN_GROWTHINIT_TIME',min_growthinit_time)
1773    !
1774    !Config Key   = MOIAVAIL_ALWAYS_TREE
1775    !Config Desc  = moisture availability above which moisture tendency doesn't matter
1776    !Config If    = OK_STOMATE
1777    !Config Def   = 1.0
1778    !Config Help  =
1779    !Config Units = [-]   
1780    CALL getin_p('MOIAVAIL_ALWAYS_TREE',moiavail_always_tree)
1781    !
1782    !Config Key   = MOIAVAIL_ALWAYS_GRASS
1783    !Config Desc  = moisture availability above which moisture tendency doesn't matter
1784    !Config If    = OK_STOMATE
1785    !Config Def   = 0.6
1786    !Config Help  =
1787    !Config Units = [-]   
1788    CALL getin_p('MOIAVAIL_ALWAYS_GRASS',moiavail_always_grass)
1789    !
1790    !Config Key   = T_ALWAYS_ADD
1791    !Config Desc  = monthly temp. above which temp. tendency doesn't matter
1792    !Config If    = OK_STOMATE
1793    !Config Def   = 10.
1794    !Config Help  =
1795    !Config Units = [C]   
1796    CALL getin_p('T_ALWAYS_ADD',t_always_add)
1797    !
1798    !
1799    !Config Key   = GDDNCD_REF
1800    !Config Desc  =
1801    !Config If    = OK_STOMATE
1802    !Config Def   = 603.
1803    !Config Help  =
1804    !Config Units = [-]   
1805    CALL getin_p('GDDNCD_REF',gddncd_ref)
1806    !
1807    !Config Key   = GDDNCD_CURVE
1808    !Config Desc  =
1809    !Config If    = OK_STOMATE
1810    !Config Def   = 0.0091
1811    !Config Help  =
1812    !Config Units = [-] 
1813    CALL getin_p('GDDNCD_CURVE',gddncd_curve)
1814    !
1815    !Config Key   = GDDNCD_OFFSET
1816    !Config Desc  =
1817    !Config If    = OK_STOMATE
1818    !Config Def   = 64.
1819    !Config Help  =
1820    !Config Units = [-] 
1821    CALL getin_p('GDDNCD_OFFSET',gddncd_offset)
1822    !-
1823    ! prescribe parameters
1824    !-
1825    !
1826    !Config Key   = BM_SAPL_RESCALE
1827    !Config Desc  =
1828    !Config If    = OK_STOMATE
1829    !Config Def   = 40.
1830    !Config Help  =
1831    !Config Units = [-] 
1832    CALL getin_p('BM_SAPL_RESCALE',bm_sapl_rescale)
1833
1834    !-
1835    ! respiration parameters
1836    !-
1837    !
1838    !Config Key   = MAINT_RESP_MIN_VMAX
1839    !Config Desc  =
1840    !Config If    = OK_STOMATE
1841    !Config Def   = 0.3
1842    !Config Help  =
1843    !Config Units = [-] 
1844    CALL getin_p('MAINT_RESP_MIN_VMAX',maint_resp_min_vmax) 
1845    !
1846    !Config Key   = MAINT_RESP_COEFF
1847    !Config Desc  =
1848    !Config If    = OK_STOMATE
1849    !Config Def   = 1.4
1850    !Config Help  =
1851    !Config Units = [-]
1852    CALL getin_p('MAINT_RESP_COEFF',maint_resp_coeff)
1853
1854    !-
1855    ! soilcarbon parameters
1856    !-
1857    !
1858    !Config Key   = FRAC_CARB_AP
1859    !Config Desc  = frac carb coefficients from active pool: depends on clay content
1860    !Config if    = OK_STOMATE
1861    !Config Def   = 0.004
1862    !Config Help  = fraction of the active pool going into the passive pool
1863    !Config Units = [-]
1864    CALL getin_p('FRAC_CARB_AP',frac_carb_ap) 
1865    !
1866    !Config Key   = FRAC_CARB_SA
1867    !Config Desc  = frac_carb_coefficients from slow pool
1868    !Config if    = OK_STOMATE
1869    !Config Def   = 0.42
1870    !Config Help  = fraction of the slow pool going into the active pool
1871    !Config Units = [-]
1872    CALL getin_p('FRAC_CARB_SA',frac_carb_sa)
1873    !
1874    !Config Key   = FRAC_CARB_SP
1875    !Config Desc  = frac_carb_coefficients from slow pool
1876    !Config if    = OK_STOMATE
1877    !Config Def   = 0.03
1878    !Config Help  = fraction of the slow pool going into the passive pool
1879    !Config Units = [-]
1880    CALL getin_p('FRAC_CARB_SP',frac_carb_sp)
1881    !
1882    !Config Key   = FRAC_CARB_PA
1883    !Config Desc  = frac_carb_coefficients from passive pool
1884    !Config if    = OK_STOMATE
1885    !Config Def   = 0.45
1886    !Config Help  = fraction of the passive pool going into the active pool
1887    !Config Units = [-]
1888    CALL getin_p('FRAC_CARB_PA',frac_carb_pa)
1889    !
1890    !Config Key   = FRAC_CARB_PS
1891    !Config Desc  = frac_carb_coefficients from passive pool
1892    !Config if    = OK_STOMATE
1893    !Config Def   = 0.0
1894    !Config Help  = fraction of the passive pool going into the slow pool
1895    !Config Units = [-]
1896    CALL getin_p('FRAC_CARB_PS',frac_carb_ps)
1897    !
1898    !Config Key   = ACTIVE_TO_PASS_CLAY_FRAC
1899    !Config Desc  =
1900    !Config if    = OK_STOMATE
1901    !Config Def   = 0.68 
1902    !Config Help  =
1903    !Config Units = [-]
1904    CALL getin_p('ACTIVE_TO_PASS_CLAY_FRAC',active_to_pass_clay_frac)
1905    !
1906    !Config Key   = CARBON_TAU_IACTIVE
1907    !Config Desc  = residence times in carbon pools
1908    !Config if    = OK_STOMATE
1909    !Config Def   = 0.149
1910    !Config Help  =
1911    !Config Units =  [days]
1912    CALL getin_p('CARBON_TAU_IACTIVE',carbon_tau_iactive)
1913    !
1914    !Config Key   = CARBON_TAU_ISLOW
1915    !Config Desc  = residence times in carbon pools
1916    !Config if    = OK_STOMATE
1917    !Config Def   = 7.0
1918    !Config Help  =
1919    !Config Units = [days]
1920    CALL getin_p('CARBON_TAU_ISLOW',carbon_tau_islow)
1921    !
1922    !Config Key   = CARBON_TAU_IPASSIVE
1923    !Config Desc  = residence times in carbon pools
1924    !Config if    = OK_STOMATE
1925    !Config Def   = 300.
1926    !Config Help  = residence time in the passive pool
1927    !Config Units = [days]
1928    CALL getin_p('CARBON_TAU_IPASSIVE',carbon_tau_ipassive)
1929    !
1930    !Config Key   = FLUX_TOT_COEFF
1931    !Config Desc  =
1932    !Config if    = OK_STOMATE
1933    !Config Def   = 1.2, 1.4,.75
1934    !Config Help  =
1935    !Config Units = [days]
1936    CALL getin_p('FLUX_TOT_COEFF',flux_tot_coeff)
1937
1938    !-
1939    ! turnover parameters
1940    !-
1941    !
1942    !Config Key   = NEW_TURNOVER_TIME_REF
1943    !Config Desc  =
1944    !Config If    = OK_STOMATE
1945    !Config Def   = 20.
1946    !Config Help  =
1947    !Config Units = [days] 
1948    CALL getin_p('NEW_TURNOVER_TIME_REF',new_turnover_time_ref)
1949
1950    !Config Key   = LEAF_AGE_CRIT_TREF
1951    !Config Desc  =
1952    !Config If    = OK_STOMATE
1953    !Config Def   = 20.
1954    !Config Help  =
1955    !Config Units = [days] 
1956    CALL getin_p('LEAF_AGE_CRIT_TREF',leaf_age_crit_tref)
1957    !
1958    !Config Key   = LEAF_AGE_CRIT_COEFF
1959    !Config Desc  =
1960    !Config If    = OK_STOMATE
1961    !Config Def   = 1.5, 0.75, 10.
1962    !Config Help  =
1963    !Config Units = [-]
1964    CALL getin_p('LEAF_AGE_CRIT_COEFF',leaf_age_crit_coeff)
1965
1966    !-
1967    ! vmax parameters
1968    !-
1969    !
1970    !Config Key   = VMAX_OFFSET
1971    !Config Desc  = offset (minimum relative vcmax)
1972    !Config If    = OK_STOMATE
1973    !Config Def   = 0.3
1974    !Config Help  = offset (minimum vcmax/vmax_opt)
1975    !Config Units = [-] 
1976    CALL getin_p('VMAX_OFFSET',vmax_offset)
1977    !
1978    !Config Key   = LEAFAGE_FIRSTMAX
1979    !Config Desc  = leaf age at which vmax attains vcmax_opt (in fraction of critical leaf age)
1980    !Config If    = OK_STOMATE
1981    !Config Def   = 0.03
1982    !Config Help  = relative leaf age at which vmax attains vcmax_opt
1983    !Config Units = [-]
1984    CALL getin_p('LEAFAGE_FIRSTMAX',leafage_firstmax)
1985    !
1986    !Config Key   = LEAFAGE_LASTMAX
1987    !Config Desc  = leaf age at which vmax falls below vcmax_opt (in fraction of critical leaf age)
1988    !Config If    = OK_STOMATE
1989    !Config Def   = 0.5
1990    !Config Help  = relative leaf age at which vmax falls below vcmax_opt
1991    !Config Units = [-] 
1992    CALL getin_p('LEAFAGE_LASTMAX',leafage_lastmax)
1993    !
1994    !Config Key   = LEAFAGE_OLD
1995    !Config Desc  = leaf age at which vmax attains its minimum (in fraction of critical leaf age)
1996    !Config If    = OK_STOMATE
1997    !Config Def   = 1.
1998    !Config Help  = relative leaf age at which vmax attains its minimum
1999    !Config Units = [-] 
2000    CALL getin_p('LEAFAGE_OLD',leafage_old)
2001
2002    !-
2003    ! season parameters
2004    !-
2005    !
2006    !Config Key   = GPPFRAC_DORMANCE
2007    !Config Desc  = rapport maximal GPP/GGP_max pour dormance
2008    !Config If    = OK_STOMATE
2009    !Config Def   = 0.2
2010    !Config Help  =
2011    !Config Units = [-]
2012    CALL getin_p('GPPFRAC_DORMANCE',gppfrac_dormance)
2013    !
2014    !Config Key   = TAU_CLIMATOLOGY
2015    !Config Desc  = tau for "climatologic variables
2016    !Config If    = OK_STOMATE
2017    !Config Def   = 20
2018    !Config Help  =
2019    !Config Units = [days]
2020    CALL getin_p('TAU_CLIMATOLOGY',tau_climatology)
2021    !
2022    !Config Key   = HVC1
2023    !Config Desc  = parameters for herbivore activity
2024    !Config If    = OK_STOMATE
2025    !Config Def   = 0.019
2026    !Config Help  =
2027    !Config Units = [-] 
2028    CALL getin_p('HVC1',hvc1)
2029    !
2030    !Config Key   = HVC2
2031    !Config Desc  = parameters for herbivore activity
2032    !Config If    = OK_STOMATE
2033    !Config Def   = 1.38
2034    !Config Help  =
2035    !Config Units = [-] 
2036    CALL getin_p('HVC2',hvc2)
2037    !
2038    !Config Key   = LEAF_FRAC_HVC
2039    !Config Desc  = parameters for herbivore activity
2040    !Config If    = OK_STOMATE
2041    !Config Def   = 0.33
2042    !Config Help  =
2043    !Config Units = [-]
2044    CALL getin_p('LEAF_FRAC_HVC',leaf_frac_hvc)
2045    !
2046    !Config Key   = TLONG_REF_MAX
2047    !Config Desc  = maximum reference long term temperature
2048    !Config If    = OK_STOMATE
2049    !Config Def   = 303.1
2050    !Config Help  =
2051    !Config Units = [K] 
2052    CALL getin_p('TLONG_REF_MAX',tlong_ref_max)
2053    !
2054    !Config Key   = TLONG_REF_MIN
2055    !Config Desc  = minimum reference long term temperature
2056    !Config If    = OK_STOMATE
2057    !Config Def   = 253.1
2058    !Config Help  =
2059    !Config Units = [K] 
2060    CALL getin_p('TLONG_REF_MIN',tlong_ref_min)
2061    !
2062    !Config Key   = NCD_MAX_YEAR
2063    !Config Desc  =
2064    !Config If    = OK_STOMATE
2065    !Config Def   = 3.
2066    !Config Help  = NCD : Number of Chilling Days
2067    !Config Units = [days]
2068    CALL getin_p('NCD_MAX_YEAR',ncd_max_year)
2069    !
2070    !Config Key   = GDD_THRESHOLD
2071    !Config Desc  =
2072    !Config If    = OK_STOMATE
2073    !Config Def   = 5.
2074    !Config Help  = GDD : Growing-Degree-Day
2075    !Config Units = [days]
2076    CALL getin_p('GDD_THRESHOLD',gdd_threshold)
2077    !
2078    !Config Key   = GREEN_AGE_EVER
2079    !Config Desc  =
2080    !Config If    = OK_STOMATE
2081    !Config Def   = 2.
2082    !Config Help  =
2083    !Config Units = [-] 
2084    CALL getin_p('GREEN_AGE_EVER',green_age_ever)
2085    !
2086    !Config Key   = GREEN_AGE_DEC
2087    !Config Desc  =
2088    !Config If    = OK_STOMATE
2089    !Config Def   = 0.5
2090    !Config Help  =
2091    !Config Units = [-]
2092    CALL getin_p('GREEN_AGE_DEC',green_age_dec)
2093
2094  END SUBROUTINE config_stomate_parameters
2095
2096!! ================================================================================================================================
2097!! SUBROUTINE   : config_dgvm_parameters
2098!!
2099!>\BRIEF        This subroutine reads in the configuration file all the parameters
2100!! needed when the DGVM model is activated (ie : when ok_dgvm is set to true).
2101!!
2102!! DESCRIPTION  : None
2103!!
2104!! RECENT CHANGE(S): None
2105!!
2106!! MAIN OUTPUT VARIABLE(S):
2107!!
2108!! REFERENCE(S) :
2109!!
2110!! FLOWCHART    :
2111!! \n
2112!_ ================================================================================================================================
2113
2114  SUBROUTINE config_dgvm_parameters   
2115
2116    IMPLICIT NONE
2117
2118    !! 0. Variables and parameters declaration
2119
2120    !! 0.4 Local variables
2121
2122    !_ ================================================================================================================================   
2123
2124    !-
2125    ! establish parameters
2126    !-
2127    !
2128    !Config Key   = ESTAB_MAX_TREE
2129    !Config Desc  = Maximum tree establishment rate
2130    !Config If    = OK_DGVM
2131    !Config Def   = 0.12
2132    !Config Help  =
2133    !Config Units = [-]   
2134    CALL getin_p('ESTAB_MAX_TREE',estab_max_tree)
2135    !
2136    !Config Key   = ESTAB_MAX_GRASS
2137    !Config Desc  = Maximum grass establishment rate
2138    !Config If    = OK_DGVM
2139    !Config Def   = 0.12
2140    !Config Help  =
2141    !Config Units = [-] 
2142    CALL getin_p('ESTAB_MAX_GRASS',estab_max_grass)
2143    !
2144    !Config Key   = ESTABLISH_SCAL_FACT
2145    !Config Desc  =
2146    !Config If    = OK_DGVM
2147    !Config Def   = 5.
2148    !Config Help  =
2149    !Config Units = [-]
2150    CALL getin_p('ESTABLISH_SCAL_FACT',establish_scal_fact)
2151    !
2152    !Config Key   = MAX_TREE_COVERAGE
2153    !Config Desc  =
2154    !Config If    = OK_DGVM
2155    !Config Def   = 0.98
2156    !Config Help  =
2157    !Config Units = [-]
2158    CALL getin_p('MAX_TREE_COVERAGE',max_tree_coverage)
2159    !
2160    !Config Key   = IND_0_ESTAB
2161    !Config Desc  =
2162    !Config If    = OK_DGVM
2163    !Config Def   = 0.2
2164    !Config Help  =
2165    !Config Units = [-] 
2166    CALL getin_p('IND_0_ESTAB',ind_0_estab)
2167
2168    !-
2169    ! light parameters
2170    !-
2171    !
2172    !Config Key   = ANNUAL_INCREASE
2173    !Config Desc  = for diagnosis of fpc increase, compare today's fpc to last year's maximum (T) or to fpc of last time step (F)?
2174    !Config If    = OK_DGVM
2175    !Config Def   = y
2176    !Config Help  =
2177    !Config Units = [FLAG]
2178    CALL getin_p('ANNUAL_INCREASE',annual_increase)
2179    !
2180    !Config Key   = MIN_COVER
2181    !Config Desc  = For trees, minimum fraction of crown area occupied
2182    !Config If    = OK_DGVM
2183    !Config Def   = 0.05
2184    !Config Help  =
2185    !Config Units = [-] 
2186    CALL getin_p('MIN_COVER',min_cover)
2187
2188    !-
2189    ! pftinout parameters
2190    !
2191    !Config Key   = IND_0
2192    !Config Desc  = initial density of individuals
2193    !Config If    = OK_DGVM
2194    !Config Def   = 0.02
2195    !Config Help  =
2196    !Config Units = [-] 
2197    CALL getin_p('IND_0',ind_0)
2198    !
2199    !Config Key   = MIN_AVAIL
2200    !Config Desc  = minimum availability
2201    !Config If    = OK_DGVM
2202    !Config Def   = 0.01
2203    !Config Help  =
2204    !Config Units = [-] 
2205    CALL getin_p('MIN_AVAIL',min_avail)
2206    !
2207    !Config Key   = RIP_TIME_MIN
2208    !Config Desc  =
2209    !Config If    = OK_DGVM
2210    !Config Def   = 1.25
2211    !Config Help  =
2212    !Config Units = [year] 
2213    CALL getin_p('RIP_TIME_MIN',RIP_time_min)
2214    !
2215    !Config Key   = NPP_LONGTERM_INIT
2216    !Config Desc  =
2217    !Config If    = OK_DGVM
2218    !Config Def   = 10.
2219    !Config Help  =
2220    !Config Units = [gC/m^2/year]
2221    CALL getin_p('NPP_LONGTERM_INIT',npp_longterm_init)
2222    !
2223    !Config Key   = EVERYWHERE_INIT
2224    !Config Desc  =
2225    !Config If    = OK_DGVM
2226    !Config Def   = 0.05
2227    !Config Help  =
2228    !Config Units = [-]
2229    CALL getin_p('EVERYWHERE_INIT',everywhere_init)
2230
2231
2232  END SUBROUTINE config_dgvm_parameters
2233
2234
2235!! ================================================================================================================================
2236!! FUNCTION   : get_printlev
2237!!
2238!>\BRIEF        Read global PRINTLEV parmeter and local PRINTLEV_modname
2239!!
2240!! DESCRIPTION  : The first time this function is called the parameter PRINTLEV is read from run.def file.
2241!!                It is stored in the variable named printlev which is declared in constantes_var.f90. printlev
2242!!                can be accesed each module in ORCHIDEE which makes use of constantes_var module.
2243!!
2244!!                This function also reads the parameter PRINTLEV_modname for run.def file. modname is the
2245!!                intent(in) character string to this function. If the variable is set in run.def file, the corresponding
2246!!                value is returned. Otherwise the value of printlev is returnd as default.
2247!!
2248!! RECENT CHANGE(S): None
2249!!
2250!! MAIN OUTPUT VARIABLE(S): The local output level for the module set as intent(in) argument.
2251!!
2252!! REFERENCE(S) :
2253!!
2254!! FLOWCHART    :
2255!! \n
2256!_ ================================================================================================================================
2257
2258  FUNCTION get_printlev ( modname )
2259
2260    !! 0.1 Input arguments
2261    CHARACTER(LEN=*), INTENT(IN) :: modname
2262
2263    !! 0.2 Returned variable
2264    INTEGER(i_std)               :: get_printlev
2265
2266    !! 0.3 Local variables
2267    LOGICAL, SAVE :: first=.TRUE.
2268
2269    !_ ================================================================================================================================
2270
2271    !! 1.0  Read the global PRINTLEV from run.def. This is only done at first call to this function.
2272    IF (first) THEN
2273       !Config Key   = PRINTLEV
2274       !Config Desc  = Print level for text output
2275       !Config If    =
2276       !Config Help  = Possible values are:
2277       !Config         0    No output,
2278       !Config         1    Minimum writing for long simulations,
2279       !Config         2    More basic information for long simulations,
2280       !Config         3    First debug level,
2281       !Config         4    Higher debug level
2282       !Config Def   = 2
2283       !Config Units = [0, 1, 2, 3, 4]
2284       ! Default value is set in constantes_var
2285       CALL getin_p('PRINTLEV',printlev)
2286       first=.FALSE.
2287
2288       !Config Key   = PRINTLEV_modname
2289       !Config Desc  = Specific print level of text output for the module "modname". Default as PRINTLEV.
2290       !Config Def   = PRINTLEV
2291       !Config If    =
2292       !Config Help  = Use this option to activate a different level of text output
2293       !Config         for a specific module. This can be activated for several modules
2294       !Config         at the same time. Use for example PRINTLEV_sechiba.
2295       !Config Units = [0, 1, 2, 3, 4]
2296    END IF
2297
2298    ! Set default value as the standard printlev
2299    get_printlev=printlev
2300    ! Read optional value from run.def file
2301    CALL getin_p('PRINTLEV_'//modname, get_printlev)
2302
2303  END FUNCTION get_printlev
2304
2305
2306END MODULE constantes
Note: See TracBrowser for help on using the repository browser.