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

Last change on this file since 6395 was 6395, checked in by josefine.ghattas, 5 years ago

Added link to ticket for information

  • Property svn:keywords set to Date Revision
File size: 74.3 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 (used for CMIP6 version 6.1.0-6.1.10)
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_NEW
962    !Config Desc  = Activation of CO2 downregulation (used for CMIP6 version 6.1.11 and later)
963    !Config If    = OK_SECHIBA
964    !Config Def   = n
965    !Config Help  = See also information in the ticket
966    !Config         http://forge.ipsl.jussieu.fr/orchidee/ticket/641
967    !Config Units = [FLAG]   
968    CALL getin_p('DOWNREGULATION_CO2_NEW',downregulation_co2_new)
969   
970    IF (downregulation_co2_new .AND. downregulation_co2) THEN
971       downregulation_co2=.FALSE.
972       CALL ipslerr_p(2,"config_sechiba_parameters",&
973            "Both DOWNREGULATION_CO2 and DOWNREGULATION_CO2_NEW were set to TRUE.",&
974            "DOWNREGULATION_CO2_NEW will be kept to TRUE.", &
975            "DOWNREGULATION_CO2 will be set to FALSE.")
976    END IF
977
978    !Config Key   = DOWNREGULATION_CO2_BASELEVEL
979    !Config Desc  = CO2 base level
980    !Config If    = DOWNREGULATION_CO2 or DOWNREGULATION_CO2_NEW
981    !Config Def   = 380.
982    !Config Help  =
983    !Config Units = [ppm]   
984    CALL getin_p('DOWNREGULATION_CO2_BASELEVEL',downregulation_co2_baselevel)
985   
986    !Config Key   = DOWNREGULATION_CO2_MINIMUM
987    !Config Desc  = CO2 value above which downregulation is taken into account
988    !Config If    = DOWNREGULATION_CO2_NEW
989    !Config Def   = 280.
990    !Config Help  =
991    !Config Units = [ppm]   
992    CALL getin_p('DOWNREGULATION_CO2_MINIMUM',downregulation_co2_minimum)
993 
994    !Config Key   = GB_REF
995    !Config Desc  = Leaf bulk boundary layer resistance
996    !Config If    = OK_CO2
997    !Config Def   = 1./25.
998    !Config Help  =
999    !Config Units = [s m-1]   
1000    CALL getin_p('GB_REF',gb_ref)
1001
1002
1003    !-
1004    ! slowproc
1005    !-
1006    !
1007    !Config Key   = CLAYFRACTION_DEFAULT
1008    !Config Desc  = default fraction of clay
1009    !Config If    = OK_SECHIBA
1010    !Config Def   = 0.2
1011    !Config Help  =
1012    !Config Units = [-]   
1013    CALL getin_p('CLAYFRACTION_DEFAULT',clayfraction_default)
1014    !
1015    !Config Key   = SANDFRACTION_DEFAULT
1016    !Config Desc  = default fraction of sand
1017    !Config If    = OK_SECHIBA
1018    !Config Def   = 0.4
1019    !Config Help  =
1020    !Config Units = [-]   
1021    CALL getin_p('SANDFRACTION_DEFAULT',sandfraction_default)
1022    !
1023    !Config Key   = SILTFRACTION_DEFAULT
1024    !Config Desc  = default fraction of silt
1025    !Config If    = OK_SECHIBA
1026    !Config Def   = 0.4
1027    !Config Help  =
1028    !Config Units = [-]   
1029    CALL getin_p('SILTFRACTION_DEFAULT',siltfraction_default)
1030
1031
1032    IF ( ABS(clayfraction_default+sandfraction_default+siltfraction_default-1) > min_sechiba) THEN
1033       WRITE(numout,*) 'Incoherence found. clayfraction_default=', clayfraction_default, ' sandfraction_default=',&
1034            sandfraction_default,' siltfraction_default=',siltfraction_default
1035       CALL ipslerr_p(3,"config_sechiba_parameters",&
1036            "Inconsistecy between CLAYFRACTION_DEFAULT, SANDFRACTION_DEFAULT and SILTFRACTION_DEFAULT set in run.def",&
1037            "The sum should be equal 1 but this is not the case.","Modify run.def and restart the model")
1038    END IF
1039    !
1040    !Config Key   = MIN_VEGFRAC
1041    !Config Desc  = Minimal fraction of mesh a vegetation type can occupy
1042    !Config If    = OK_SECHIBA
1043    !Config Def   = 0.001
1044    !Config Help  =
1045    !Config Units = [-] 
1046    CALL getin_p('MIN_VEGFRAC',min_vegfrac)
1047    !
1048    !Config Key   = STEMPDIAG_BID
1049    !Config Desc  = only needed for an initial LAI if there is no restart file
1050    !Config If    = OK_SECHIBA
1051    !Config Def   = 280.
1052    !Config Help  =
1053    !Config Units = [K]
1054    CALL getin_p('STEMPDIAG_BID',stempdiag_bid)
1055    !
1056
1057  END SUBROUTINE config_sechiba_parameters
1058
1059
1060!! ================================================================================================================================
1061!! SUBROUTINE   : config_co2_parameters
1062!!
1063!>\BRIEF        This subroutine reads in the configuration file all the parameters
1064!! needed when OK_CO2 is set to true. (ie : when the photosynthesis is activated)
1065!!
1066!! DESCRIPTION  : None
1067!!
1068!! RECENT CHANGE(S): None
1069!!
1070!! MAIN OUTPUT VARIABLE(S): None
1071!!
1072!! REFERENCE(S) :
1073!!
1074!! FLOWCHART    :
1075!! \n
1076!_ ================================================================================================================================
1077
1078  SUBROUTINE config_co2_parameters
1079
1080    IMPLICIT NONE
1081
1082    !! 0. Variables and parameters declaration
1083
1084    !! 0.4 Local variables
1085
1086    !_ ================================================================================================================================
1087
1088    !
1089    !Config Key   = LAI_LEVEL_DEPTH
1090    !Config Desc  =
1091    !Config If    = OK_CO2
1092    !Config Def   = 0.15
1093    !Config Help  =
1094    !Config Units = [-] 
1095    CALL getin_p('LAI_LEVEL_DEPTH',lai_level_depth)
1096    !
1097    !Config Key   = Oi
1098    !Config Desc  = Intercellular oxygen partial pressure
1099    !Config If    = OK_CO2
1100    !Config Def   = 210000.
1101    !Config Help  = See Legend of Figure 6 of Yin et al. (2009)
1102    !Config Units = [ubar] 
1103    CALL getin_p('Oi',Oi)
1104
1105
1106  END SUBROUTINE config_co2_parameters
1107
1108
1109!! ================================================================================================================================
1110!! SUBROUTINE   : config_stomate_parameters
1111!!
1112!>\BRIEF        This subroutine reads in the configuration file all the parameters
1113!! needed when stomate is activated (ie : when OK_STOMATE is set to true).
1114!!
1115!! DESCRIPTION  : None
1116!!
1117!! RECENT CHANGE(S): None
1118!!
1119!! MAIN OUTPUT VARIABLE(S):
1120!!
1121!! REFERENCE(S) :
1122!!
1123!! FLOWCHART    :
1124!! \n
1125!_ ================================================================================================================================
1126
1127  SUBROUTINE config_stomate_parameters
1128
1129    IMPLICIT NONE
1130
1131    !! 0. Variables and parameters declaration
1132
1133    !! 0.4 Local variables   
1134
1135
1136    !_ ================================================================================================================================
1137
1138    !-
1139    ! constraints_parameters
1140    !-
1141    !
1142    !Config Key   = TOO_LONG
1143    !Config Desc  = longest sustainable time without regeneration (vernalization)
1144    !Config If    = OK_STOMATE
1145    !Config Def   = 5.
1146    !Config Help  =
1147    !Config Units = [days]   
1148    CALL getin_p('TOO_LONG',too_long)
1149
1150    !-
1151    ! fire parameters
1152    !-
1153    !
1154    !Config Key   = TAU_FIRE
1155    !Config Desc  = Time scale for memory of the fire index (days). Validated for one year in the DGVM.
1156    !Config If    = OK_STOMATE
1157    !Config Def   = 30.
1158    !Config Help  =
1159    !Config Units = [days]   
1160    CALL getin_p('TAU_FIRE',tau_fire)
1161    !
1162    !Config Key   = LITTER_CRIT
1163    !Config Desc  = Critical litter quantity for fire
1164    !Config If    = OK_STOMATE
1165    !Config Def   = 200.
1166    !Config Help  =
1167    !Config Units = [gC/m^2] 
1168    CALL getin_p('LITTER_CRIT',litter_crit)
1169    !
1170    !Config Key   = FIRE_RESIST_STRUCT
1171    !Config Desc  =
1172    !Config If    = OK_STOMATE
1173    !Config Def   = 0.5
1174    !Config Help  =
1175    !Config Units = [-] 
1176    CALL getin_p('FIRE_RESIST_STRUCT',fire_resist_struct)
1177    !
1178    !
1179    !Config Key   = CO2FRAC
1180    !Config Desc  = What fraction of a burned plant compartment goes into the atmosphere
1181    !Config If    = OK_STOMATE
1182    !Config Def   = 0.95, 0.95, 0., 0.3, 0., 0., 0.95, 0.95
1183    !Config Help  =
1184    !Config Units = [-] 
1185    CALL getin_p('CO2FRAC',co2frac)
1186    !
1187    !Config Key   = BCFRAC_COEFF
1188    !Config Desc  =
1189    !Config If    = OK_STOMATE
1190    !Config Def   = 0.3, 1.3, 88.2
1191    !Config Help  =
1192    !Config Units = [-] 
1193    CALL getin_p('BCFRAC_COEFF',bcfrac_coeff)
1194    !
1195    !Config Key   = FIREFRAC_COEFF
1196    !Config Desc  =
1197    !Config If    = OK_STOMATE
1198    !Config Def   = 0.45, 0.8, 0.6, 0.13
1199    !Config Help  =
1200    !Config Units = [-]   
1201    CALL getin_p('FIREFRAC_COEFF',firefrac_coeff)
1202
1203    !Config Key   = REF_GREFF
1204    !Config Desc  = Asymptotic maximum mortality rate
1205    !Config If    = OK_STOMATE
1206    !Config Def   = 0.035
1207    !Config Help  = Set asymptotic maximum mortality rate from Sitch 2003
1208    !Config         (they use 0.01) (year^{-1})
1209    !Config Units = [1/year] 
1210    CALL getin_p('REF_GREFF',ref_greff)
1211    !-
1212    ! allocation parameters
1213    !-
1214    !
1215    !Config Key   = OK_MINRES
1216    !Config Desc  = Do we try to reach a minimum reservoir even if we are severely stressed?
1217    !Config If    = OK_STOMATE
1218    !Config Def   = y
1219    !Config Help  =
1220    !Config Units = [FLAG]
1221    CALL getin_p('OK_MINRES',ok_minres)
1222    !
1223    !Config Key   = RESERVE_TIME_TREE
1224    !Config Desc  = maximum time during which reserve is used (trees)
1225    !Config If    = OK_STOMATE
1226    !Config Def   = 30.
1227    !Config Help  =
1228    !Config Units = [days]   
1229    CALL getin_p('RESERVE_TIME_TREE',reserve_time_tree)
1230    !
1231    !Config Key   = RESERVE_TIME_GRASS
1232    !Config Desc  = maximum time during which reserve is used (grasses)
1233    !Config If    = OK_STOMATE
1234    !Config Def   = 20.
1235    !Config Help  =
1236    !Config Units = [days]   
1237    CALL getin_p('RESERVE_TIME_GRASS',reserve_time_grass)
1238    !
1239    !Config Key   = F_FRUIT
1240    !Config Desc  = Standard fruit allocation
1241    !Config If    = OK_STOMATE
1242    !Config Def   = 0.1
1243    !Config Help  =
1244    !Config Units = [-]   
1245    CALL getin_p('F_FRUIT',f_fruit)
1246    !
1247    !Config Key   = ALLOC_SAP_ABOVE_GRASS
1248    !Config Desc  = fraction of sapwood allocation above ground
1249    !Config If    = OK_STOMATE
1250    !Config Def   = 1.0
1251    !Config Help  =
1252    !Config Units = [-]   
1253    CALL getin_p('ALLOC_SAP_ABOVE_GRASS',alloc_sap_above_grass)
1254    !
1255    !Config Key   = MIN_LTOLSR
1256    !Config Desc  = extrema of leaf allocation fraction
1257    !Config If    = OK_STOMATE
1258    !Config Def   = 0.2
1259    !Config Help  =
1260    !Config Units = [-]   
1261    CALL getin_p('MIN_LTOLSR',min_LtoLSR)
1262    !
1263    !Config Key   = MAX_LTOLSR
1264    !Config Desc  = extrema of leaf allocation fraction
1265    !Config If    = OK_STOMATE
1266    !Config Def   = 0.5
1267    !Config Help  =
1268    !Config Units = [-]   
1269    CALL getin_p('MAX_LTOLSR',max_LtoLSR)
1270    !
1271    !Config Key   = Z_NITROGEN
1272    !Config Desc  = scaling depth for nitrogen limitation
1273    !Config If    = OK_STOMATE
1274    !Config Def   = 0.2
1275    !Config Help  =
1276    !Config Units = [m] 
1277    CALL getin_p('Z_NITROGEN',z_nitrogen)
1278    !
1279    !Config Key   = NLIM_TREF
1280    !Config Desc  =
1281    !Config If    = OK_STOMATE
1282    !Config Def   = 25.
1283    !Config Help  =
1284    !Config Units = [C] 
1285    CALL getin_p('NLIM_TREF',Nlim_tref) 
1286
1287    !-
1288    ! data parameters
1289    !-
1290    !
1291    !Config Key   = PIPE_TUNE1
1292    !Config Desc  = crown area = pipe_tune1. stem diameter**(1.6) (Reinicke's theory)
1293    !Config If    = OK_STOMATE
1294    !Config Def   = 100.0
1295    !Config Help  =
1296    !Config Units = [-]   
1297    CALL getin_p('PIPE_TUNE1',pipe_tune1)
1298    !
1299    !Config Key   = PIPE_TUNE2
1300    !Config Desc  = height=pipe_tune2 * diameter**pipe_tune3
1301    !Config If    = OK_STOMATE
1302    !Config Def   = 40.0
1303    !Config Help  =
1304    !Config Units = [-]     
1305    CALL getin_p('PIPE_TUNE2',pipe_tune2) 
1306    !
1307    !Config Key   = PIPE_TUNE3
1308    !Config Desc  = height=pipe_tune2 * diameter**pipe_tune3
1309    !Config If    = OK_STOMATE
1310    !Config Def   = 0.5
1311    !Config Help  =
1312    !Config Units = [-]   
1313    CALL getin_p('PIPE_TUNE3',pipe_tune3)
1314    !
1315    !Config Key   = PIPE_TUNE4
1316    !Config Desc  = needed for stem diameter
1317    !Config If    = OK_STOMATE
1318    !Config Def   = 0.3
1319    !Config Help  =
1320    !Config Units = [-] 
1321    CALL getin_p('PIPE_TUNE4',pipe_tune4)
1322    !
1323    !Config Key   = PIPE_DENSITY
1324    !Config Desc  = Density
1325    !Config If    = OK_STOMATE
1326    !Config Def   = 2.e5
1327    !Config Help  =
1328    !Config Units = [-] 
1329    CALL getin_p('PIPE_DENSITY',pipe_density)
1330    !
1331    !Config Key   = PIPE_K1
1332    !Config Desc  =
1333    !Config If    = OK_STOMATE
1334    !Config Def   = 8.e3
1335    !Config Help  =
1336    !Config Units = [-]   
1337    CALL getin_p('PIPE_K1',pipe_k1)
1338    !
1339    !Config Key   = PIPE_TUNE_EXP_COEFF
1340    !Config Desc  = pipe tune exponential coeff
1341    !Config If    = OK_STOMATE
1342    !Config Def   = 1.6
1343    !Config Help  =
1344    !Config Units = [-]   
1345    CALL getin_p('PIPE_TUNE_EXP_COEFF',pipe_tune_exp_coeff)
1346    !
1347    !
1348    !Config Key   = PRECIP_CRIT
1349    !Config Desc  = minimum precip
1350    !Config If    = OK_STOMATE
1351    !Config Def   = 100.
1352    !Config Help  =
1353    !Config Units = [mm/year] 
1354    CALL getin_p('PRECIP_CRIT',precip_crit)
1355    !
1356    !Config Key   = GDD_CRIT_ESTAB
1357    !Config Desc  = minimum gdd for establishment of saplings
1358    !Config If    = OK_STOMATE
1359    !Config Def   = 150.
1360    !Config Help  =
1361    !Config Units = [-] 
1362    CALL getin_p('GDD_CRIT_ESTAB',gdd_crit_estab)
1363    !
1364    !Config Key   = FPC_CRIT
1365    !Config Desc  = critical fpc, needed for light competition and establishment
1366    !Config If    = OK_STOMATE
1367    !Config Def   = 0.95
1368    !Config Help  =
1369    !Config Units = [-] 
1370    CALL getin_p('FPC_CRIT',fpc_crit)
1371    !
1372    !Config Key   = ALPHA_GRASS
1373    !Config Desc  = sapling characteristics : alpha's
1374    !Config If    = OK_STOMATE
1375    !Config Def   = 0.5
1376    !Config Help  =
1377    !Config Units = [-]   
1378    CALL getin_p('ALPHA_GRASS',alpha_grass)
1379    !
1380    !Config Key   = ALPHA_TREE
1381    !Config Desc  = sapling characteristics : alpha's
1382    !Config If    = OK_STOMATE
1383    !Config Def   = 1.
1384    !Config Help  =
1385    !Config Units = [-]   
1386    CALL getin_p('ALPHA_TREE',alpha_tree)
1387    !-
1388    !
1389    !Config Key   = MASS_RATIO_HEART_SAP
1390    !Config Desc  = mass ratio (heartwood+sapwood)/sapwood
1391    !Config If    = OK_STOMATE
1392    !Config Def   = 3.
1393    !Config Help  =
1394    !Config Units = [-]   
1395    CALL getin_p('MASS_RATIO_HEART_SAP',mass_ratio_heart_sap)
1396    !
1397    !Config Key   = TAU_HUM_MONTH
1398    !Config Desc  = time scales for phenology and other processes
1399    !Config If    = OK_STOMATE
1400    !Config Def   = 20.
1401    !Config Help  =
1402    !Config Units = [days] 
1403    CALL getin_p('TAU_HUM_MONTH',tau_hum_month)
1404    !
1405    !Config Key   = TAU_HUM_WEEK
1406    !Config Desc  = time scales for phenology and other processes
1407    !Config If    = OK_STOMATE
1408    !Config Def   = 7.
1409    !Config Help  =
1410    !Config Units = [days]   
1411    CALL getin_p('TAU_HUM_WEEK',tau_hum_week)
1412    !
1413    !Config Key   = TAU_T2M_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_T2M_MONTH',tau_t2m_month)
1420    !
1421    !Config Key   = TAU_T2M_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_T2M_WEEK',tau_t2m_week)
1428    !
1429    !Config Key   = TAU_TSOIL_MONTH
1430    !Config Desc  = time scales for phenology and other processes
1431    !Config If    = OK_STOMATE
1432    !Config Def   = 20.
1433    !Config Help  =
1434    !Config Units = [days]     
1435    CALL getin_p('TAU_TSOIL_MONTH',tau_tsoil_month)
1436    !
1437    !Config Key   = TAU_SOILHUM_MONTH
1438    !Config Desc  = time scales for phenology and other processes
1439    !Config If    = OK_STOMATE
1440    !Config Def   = 20.
1441    !Config Help  =
1442    !Config Units = [days]   
1443    CALL getin_p('TAU_SOILHUM_MONTH',tau_soilhum_month)
1444    !
1445    !Config Key   = TAU_GPP_WEEK
1446    !Config Desc  = time scales for phenology and other processes
1447    !Config If    = OK_STOMATE
1448    !Config Def   = 7.
1449    !Config Help  =
1450    !Config Units = [days]   
1451    CALL getin_p('TAU_GPP_WEEK',tau_gpp_week)
1452    !
1453    !Config Key   = TAU_GDD
1454    !Config Desc  = time scales for phenology and other processes
1455    !Config If    = OK_STOMATE
1456    !Config Def   = 40.
1457    !Config Help  =
1458    !Config Units = [days]   
1459    CALL getin_p('TAU_GDD',tau_gdd)
1460    !
1461    !Config Key   = TAU_NGD
1462    !Config Desc  = time scales for phenology and other processes
1463    !Config If    = OK_STOMATE
1464    !Config Def   = 50.
1465    !Config Help  =
1466    !Config Units = [days]   
1467    CALL getin_p('TAU_NGD',tau_ngd)
1468    !
1469    !Config Key   = COEFF_TAU_LONGTERM
1470    !Config Desc  = time scales for phenology and other processes
1471    !Config If    = OK_STOMATE
1472    !Config Def   = 3.
1473    !Config Help  =
1474    !Config Units = [days]   
1475    CALL getin_p('COEFF_TAU_LONGTERM',coeff_tau_longterm)
1476    !-
1477    !
1478    !Config Key   = BM_SAPL_CARBRES
1479    !Config Desc  =
1480    !Config If    = OK_STOMATE
1481    !Config Def   = 5.
1482    !Config Help  =
1483    !Config Units = [-]   
1484    CALL getin_p('BM_SAPL_CARBRES',bm_sapl_carbres)
1485    !
1486    !Config Key   = BM_SAPL_SAPABOVE
1487    !Config Desc  =
1488    !Config If    = OK_STOMATE
1489    !Config Def   = 0.5
1490    !Config Help  =
1491    !Config Units = [-]   
1492    CALL getin_p('BM_SAPL_SAPABOVE',bm_sapl_sapabove)
1493    !
1494    !Config Key   = BM_SAPL_HEARTABOVE
1495    !Config Desc  =
1496    !Config If    = OK_STOMATE
1497    !Config Def   = 2.
1498    !Config Help  =
1499    !Config Units = [-]   
1500    CALL getin_p('BM_SAPL_HEARTABOVE',bm_sapl_heartabove)
1501    !
1502    !Config Key   = BM_SAPL_HEARTBELOW
1503    !Config Desc  =
1504    !Config If    = OK_STOMATE
1505    !Config Def   = 2.
1506    !Config Help  =
1507    !Config Units = [-]   
1508    CALL getin_p('BM_SAPL_HEARTBELOW',bm_sapl_heartbelow)
1509    !
1510    !Config Key   = INIT_SAPL_MASS_LEAF_NAT
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_LEAF_NAT',init_sapl_mass_leaf_nat)
1517    !
1518    !Config Key   = INIT_SAPL_MASS_LEAF_AGRI
1519    !Config Desc  =
1520    !Config If    = OK_STOMATE
1521    !Config Def   = 1.
1522    !Config Help  =
1523    !Config Units = [-]   
1524    CALL getin_p('INIT_SAPL_MASS_LEAF_AGRI',init_sapl_mass_leaf_agri)
1525    !
1526    !Config Key   = INIT_SAPL_MASS_CARBRES
1527    !Config Desc  =
1528    !Config If    = OK_STOMATE
1529    !Config Def   = 5.
1530    !Config Help  =
1531    !Config Units = [-]   
1532    CALL getin_p('INIT_SAPL_MASS_CARBRES',init_sapl_mass_carbres)
1533    !
1534    !Config Key   = INIT_SAPL_MASS_ROOT
1535    !Config Desc  =
1536    !Config If    = OK_STOMATE
1537    !Config Def   = 0.1
1538    !Config Help  =
1539    !Config Units = [-]   
1540    CALL getin_p('INIT_SAPL_MASS_ROOT',init_sapl_mass_root)
1541    !
1542    !Config Key   = INIT_SAPL_MASS_FRUIT
1543    !Config Desc  =
1544    !Config If    = OK_STOMATE
1545    !Config Def   = 0.3
1546    !Config Help  =
1547    !Config Units = [-]   
1548    CALL getin_p('INIT_SAPL_MASS_FRUIT',init_sapl_mass_fruit)
1549    !
1550    !Config Key   = CN_SAPL_INIT
1551    !Config Desc  =
1552    !Config If    = OK_STOMATE
1553    !Config Def   = 0.5
1554    !Config Help  =
1555    !Config Units = [-]   
1556    CALL getin_p('CN_SAPL_INIT',cn_sapl_init)
1557    !
1558    !Config Key   = MIGRATE_TREE
1559    !Config Desc  =
1560    !Config If    = OK_STOMATE
1561    !Config Def   = 10000.
1562    !Config Help  =
1563    !Config Units = [m/year]   
1564    CALL getin_p('MIGRATE_TREE',migrate_tree)
1565    !
1566    !Config Key   = MIGRATE_GRASS
1567    !Config Desc  =
1568    !Config If    = OK_STOMATE
1569    !Config Def   = 10000.
1570    !Config Help  =
1571    !Config Units = [m/year]   
1572    CALL getin_p('MIGRATE_GRASS',migrate_grass)
1573    !
1574    !Config Key   = LAI_INITMIN_TREE
1575    !Config Desc  =
1576    !Config If    = OK_STOMATE
1577    !Config Def   = 0.3
1578    !Config Help  =
1579    !Config Units = [m^2/m^2] 
1580    CALL getin_p('LAI_INITMIN_TREE',lai_initmin_tree)
1581    !
1582    !Config Key   = LAI_INITMIN_GRASS
1583    !Config Desc  =
1584    !Config If    = OK_STOMATE
1585    !Config Def   = 0.1
1586    !Config Help  =
1587    !Config Units = [m^2/m^2]   
1588    CALL getin_p('LAI_INITMIN_GRASS',lai_initmin_grass)
1589    !
1590    !Config Key   = DIA_COEFF
1591    !Config Desc  =
1592    !Config If    = OK_STOMATE
1593    !Config Def   = 4., 0.5
1594    !Config Help  =
1595    !Config Units = [-]   
1596    CALL getin_p('DIA_COEFF',dia_coeff)
1597    !
1598    !Config Key   = MAXDIA_COEFF
1599    !Config Desc  =
1600    !Config If    = OK_STOMATE
1601    !Config Def   = 100., 0.01
1602    !Config Help  =
1603    !Config Units = [-]   
1604    CALL getin_p('MAXDIA_COEFF',maxdia_coeff)
1605    !
1606    !Config Key   = BM_SAPL_LEAF
1607    !Config Desc  =
1608    !Config If    = OK_STOMATE
1609    !Config Def   = 4., 4., 0.8, 5.
1610    !Config Help  =
1611    !Config Units = [-] 
1612    CALL getin_p('BM_SAPL_LEAF',bm_sapl_leaf)
1613
1614    !-
1615    ! litter parameters
1616    !-
1617    !
1618    !Config Key   = METABOLIC_REF_FRAC
1619    !Config Desc  =
1620    !Config If    = OK_STOMATE
1621    !Config Def   = 0.85 
1622    !Config Help  =
1623    !Config Units = [-]
1624    CALL getin_p('METABOLIC_REF_FRAC',metabolic_ref_frac)
1625    !
1626    !Config Key   = Z_DECOMP
1627    !Config Desc  = scaling depth for soil activity
1628    !Config If    = OK_STOMATE
1629    !Config Def   = 0.2
1630    !Config Help  =
1631    !Config Units = [m]   
1632    CALL getin_p('Z_DECOMP',z_decomp)
1633    !
1634    !Config Key   = CN
1635    !Config Desc  = C/N ratio
1636    !Config If    = OK_STOMATE
1637    !Config Def   = 40., 40., 40., 40., 40., 40., 40., 40.
1638    !Config Help  =
1639    !Config Units = [-] 
1640    CALL getin_p('CN',CN)
1641    !
1642    !Config Key   = LC
1643    !Config Desc  = Lignine/C ratio of the different plant parts
1644    !Config If    = OK_STOMATE
1645    !Config Def   = 0.22, 0.35, 0.35, 0.35, 0.35, 0.22, 0.22, 0.22
1646    !Config Help  =
1647    !Config Units = [-]   
1648    CALL getin_p('LC',LC)
1649    !
1650    !Config Key   = FRAC_SOIL_STRUCT_AA
1651    !Config Desc  = frac_soil(istructural,iactive,iabove)
1652    !Config If    = OK_STOMATE
1653    !Config Def   = 0.55
1654    !Config Help  =
1655    !Config Units = [-]
1656    CALL getin_p('FRAC_SOIL_STRUCT_AA',frac_soil_struct_aa)
1657    !
1658    !Config Key   = FRAC_SOIL_STRUCT_A
1659    !Config Desc  = frac_soil(istructural,iactive,ibelow)
1660    !Config If    = OK_STOMATE
1661    !Config Def   = 0.45
1662    !Config Help  =
1663    !Config Units = [-]
1664    CALL getin_p('FRAC_SOIL_STRUCT_AB',frac_soil_struct_ab)
1665    !
1666    !Config Key   = FRAC_SOIL_STRUCT_SA
1667    !Config Desc  = frac_soil(istructural,islow,iabove)
1668    !Config If    = OK_STOMATE
1669    !Config Def   = 0.7 
1670    !Config Help  =
1671    !Config Units = [-]   
1672    CALL getin_p('FRAC_SOIL_STRUCT_SA',frac_soil_struct_sa)
1673    !
1674    !Config Key   = FRAC_SOIL_STRUCT_SB
1675    !Config Desc  = frac_soil(istructural,islow,ibelow)
1676    !Config If    = OK_STOMATE
1677    !Config Def   = 0.7 
1678    !Config Help  =
1679    !Config Units = [-]   
1680    CALL getin_p('FRAC_SOIL_STRUCT_SB',frac_soil_struct_sb)
1681    !
1682    !Config Key   = FRAC_SOIL_METAB_AA
1683    !Config Desc  = frac_soil(imetabolic,iactive,iabove)
1684    !Config If    = OK_STOMATE
1685    !Config Def   = 0.45
1686    !Config Help  =
1687    !Config Units = [-]   
1688    CALL getin_p('FRAC_SOIL_METAB_AA',frac_soil_metab_aa)
1689    !
1690    !Config Key   = FRAC_SOIL_METAB_AB
1691    !Config Desc  = frac_soil(imetabolic,iactive,ibelow)
1692    !Config If    = OK_STOMATE
1693    !Config Def   = 0.45 
1694    !Config Help  =
1695    !Config Units = [-]   
1696    CALL getin_p('FRAC_SOIL_METAB_AB',frac_soil_metab_ab)
1697    !
1698    !
1699    !Config Key   = METABOLIC_LN_RATIO
1700    !Config Desc  =
1701    !Config If    = OK_STOMATE
1702    !Config Def   = 0.018 
1703    !Config Help  =
1704    !Config Units = [-]   
1705    CALL getin_p('METABOLIC_LN_RATIO',metabolic_LN_ratio) 
1706    !
1707    !Config Key   = TAU_METABOLIC
1708    !Config Desc  =
1709    !Config If    = OK_STOMATE
1710    !Config Def   = 0.066
1711    !Config Help  =
1712    !Config Units = [days]
1713    CALL getin_p('TAU_METABOLIC',tau_metabolic)
1714    !
1715    !Config Key   = TAU_STRUCT
1716    !Config Desc  =
1717    !Config If    = OK_STOMATE
1718    !Config Def   = 0.245
1719    !Config Help  =
1720    !Config Units = [days]
1721    CALL getin_p('TAU_STRUCT',tau_struct)
1722    !
1723    !Config Key   = SOIL_Q10
1724    !Config Desc  =
1725    !Config If    = OK_STOMATE
1726    !Config Def   = 0.69 (=ln2)
1727    !Config Help  =
1728    !Config Units = [-]
1729    CALL getin_p('SOIL_Q10',soil_Q10)
1730    !
1731    !Config Key   = TSOIL_REF
1732    !Config Desc  =
1733    !Config If    = OK_STOMATE
1734    !Config Def   = 30.
1735    !Config Help  =
1736    !Config Units = [C]   
1737    CALL getin_p('TSOIL_REF',tsoil_ref)
1738    !
1739    !Config Key   = LITTER_STRUCT_COEF
1740    !Config Desc  =
1741    !Config If    = OK_STOMATE
1742    !Config Def   = 3.
1743    !Config Help  =
1744    !Config Units = [-]   
1745    CALL getin_p('LITTER_STRUCT_COEF',litter_struct_coef)
1746    !
1747    !Config Key   = MOIST_COEFF
1748    !Config Desc  =
1749    !Config If    = OK_STOMATE
1750    !Config Def   = 1.1, 2.4, 0.29
1751    !Config Help  =
1752    !Config Units = [-]   
1753    CALL getin_p('MOIST_COEFF',moist_coeff)
1754    !
1755    !Config Key   = MOISTCONT_MIN
1756    !Config Desc  = minimum soil wetness to limit the heterotrophic respiration
1757    !Config If    = OK_STOMATE
1758    !Config Def   = 0.25
1759    !Config Help  =
1760    !Config Units = [-]
1761    CALL getin_p('MOISTCONT_MIN',moistcont_min)
1762
1763    !-
1764    ! lpj parameters
1765    !-
1766    !
1767    !Config Key   = FRAC_TURNOVER_DAILY
1768    !Config Desc  =
1769    !Config If    = OK_STOMATE
1770    !Config Def   = 0.55
1771    !Config Help  =
1772    !Config Units = [-]
1773    CALL getin_p('FRAC_TURNOVER_DAILY',frac_turnover_daily)   
1774
1775    !-
1776    ! npp parameters
1777    !-
1778    !
1779    !Config Key   = TAX_MAX
1780    !Config Desc  = maximum fraction of allocatable biomass used for maintenance respiration
1781    !Config If    = OK_STOMATE
1782    !Config Def   = 0.8
1783    !Config Help  =
1784    !Config Units = [-]   
1785    CALL getin_p('TAX_MAX',tax_max) 
1786
1787    !-
1788    ! phenology parameters
1789    !-
1790    !Config Key   = MIN_GROWTHINIT_TIME
1791    !Config Desc  = minimum time since last beginning of a growing season
1792    !Config If    = OK_STOMATE
1793    !Config Def   = 300.
1794    !Config Help  =
1795    !Config Units = [days] 
1796    CALL getin_p('MIN_GROWTHINIT_TIME',min_growthinit_time)
1797    !
1798    !Config Key   = MOIAVAIL_ALWAYS_TREE
1799    !Config Desc  = moisture availability above which moisture tendency doesn't matter
1800    !Config If    = OK_STOMATE
1801    !Config Def   = 1.0
1802    !Config Help  =
1803    !Config Units = [-]   
1804    CALL getin_p('MOIAVAIL_ALWAYS_TREE',moiavail_always_tree)
1805    !
1806    !Config Key   = MOIAVAIL_ALWAYS_GRASS
1807    !Config Desc  = moisture availability above which moisture tendency doesn't matter
1808    !Config If    = OK_STOMATE
1809    !Config Def   = 0.6
1810    !Config Help  =
1811    !Config Units = [-]   
1812    CALL getin_p('MOIAVAIL_ALWAYS_GRASS',moiavail_always_grass)
1813    !
1814    !Config Key   = T_ALWAYS_ADD
1815    !Config Desc  = monthly temp. above which temp. tendency doesn't matter
1816    !Config If    = OK_STOMATE
1817    !Config Def   = 10.
1818    !Config Help  =
1819    !Config Units = [C]   
1820    CALL getin_p('T_ALWAYS_ADD',t_always_add)
1821    !
1822    !
1823    !Config Key   = GDDNCD_REF
1824    !Config Desc  =
1825    !Config If    = OK_STOMATE
1826    !Config Def   = 603.
1827    !Config Help  =
1828    !Config Units = [-]   
1829    CALL getin_p('GDDNCD_REF',gddncd_ref)
1830    !
1831    !Config Key   = GDDNCD_CURVE
1832    !Config Desc  =
1833    !Config If    = OK_STOMATE
1834    !Config Def   = 0.0091
1835    !Config Help  =
1836    !Config Units = [-] 
1837    CALL getin_p('GDDNCD_CURVE',gddncd_curve)
1838    !
1839    !Config Key   = GDDNCD_OFFSET
1840    !Config Desc  =
1841    !Config If    = OK_STOMATE
1842    !Config Def   = 64.
1843    !Config Help  =
1844    !Config Units = [-] 
1845    CALL getin_p('GDDNCD_OFFSET',gddncd_offset)
1846    !-
1847    ! prescribe parameters
1848    !-
1849    !
1850    !Config Key   = BM_SAPL_RESCALE
1851    !Config Desc  =
1852    !Config If    = OK_STOMATE
1853    !Config Def   = 40.
1854    !Config Help  =
1855    !Config Units = [-] 
1856    CALL getin_p('BM_SAPL_RESCALE',bm_sapl_rescale)
1857
1858    !-
1859    ! respiration parameters
1860    !-
1861    !
1862    !Config Key   = MAINT_RESP_MIN_VMAX
1863    !Config Desc  =
1864    !Config If    = OK_STOMATE
1865    !Config Def   = 0.3
1866    !Config Help  =
1867    !Config Units = [-] 
1868    CALL getin_p('MAINT_RESP_MIN_VMAX',maint_resp_min_vmax) 
1869    !
1870    !Config Key   = MAINT_RESP_COEFF
1871    !Config Desc  =
1872    !Config If    = OK_STOMATE
1873    !Config Def   = 1.4
1874    !Config Help  =
1875    !Config Units = [-]
1876    CALL getin_p('MAINT_RESP_COEFF',maint_resp_coeff)
1877
1878    !-
1879    ! soilcarbon parameters
1880    !-
1881    !
1882    !Config Key   = FRAC_CARB_AP
1883    !Config Desc  = frac carb coefficients from active pool: depends on clay content
1884    !Config if    = OK_STOMATE
1885    !Config Def   = 0.004
1886    !Config Help  = fraction of the active pool going into the passive pool
1887    !Config Units = [-]
1888    CALL getin_p('FRAC_CARB_AP',frac_carb_ap) 
1889    !
1890    !Config Key   = FRAC_CARB_SA
1891    !Config Desc  = frac_carb_coefficients from slow pool
1892    !Config if    = OK_STOMATE
1893    !Config Def   = 0.42
1894    !Config Help  = fraction of the slow pool going into the active pool
1895    !Config Units = [-]
1896    CALL getin_p('FRAC_CARB_SA',frac_carb_sa)
1897    !
1898    !Config Key   = FRAC_CARB_SP
1899    !Config Desc  = frac_carb_coefficients from slow pool
1900    !Config if    = OK_STOMATE
1901    !Config Def   = 0.03
1902    !Config Help  = fraction of the slow pool going into the passive pool
1903    !Config Units = [-]
1904    CALL getin_p('FRAC_CARB_SP',frac_carb_sp)
1905    !
1906    !Config Key   = FRAC_CARB_PA
1907    !Config Desc  = frac_carb_coefficients from passive pool
1908    !Config if    = OK_STOMATE
1909    !Config Def   = 0.45
1910    !Config Help  = fraction of the passive pool going into the active pool
1911    !Config Units = [-]
1912    CALL getin_p('FRAC_CARB_PA',frac_carb_pa)
1913    !
1914    !Config Key   = FRAC_CARB_PS
1915    !Config Desc  = frac_carb_coefficients from passive pool
1916    !Config if    = OK_STOMATE
1917    !Config Def   = 0.0
1918    !Config Help  = fraction of the passive pool going into the slow pool
1919    !Config Units = [-]
1920    CALL getin_p('FRAC_CARB_PS',frac_carb_ps)
1921    !
1922    !Config Key   = ACTIVE_TO_PASS_CLAY_FRAC
1923    !Config Desc  =
1924    !Config if    = OK_STOMATE
1925    !Config Def   = 0.68 
1926    !Config Help  =
1927    !Config Units = [-]
1928    CALL getin_p('ACTIVE_TO_PASS_CLAY_FRAC',active_to_pass_clay_frac)
1929    !
1930    !Config Key   = CARBON_TAU_IACTIVE
1931    !Config Desc  = residence times in carbon pools
1932    !Config if    = OK_STOMATE
1933    !Config Def   = 0.149
1934    !Config Help  =
1935    !Config Units =  [days]
1936    CALL getin_p('CARBON_TAU_IACTIVE',carbon_tau_iactive)
1937    !
1938    !Config Key   = CARBON_TAU_ISLOW
1939    !Config Desc  = residence times in carbon pools
1940    !Config if    = OK_STOMATE
1941    !Config Def   = 7.0
1942    !Config Help  =
1943    !Config Units = [days]
1944    CALL getin_p('CARBON_TAU_ISLOW',carbon_tau_islow)
1945    !
1946    !Config Key   = CARBON_TAU_IPASSIVE
1947    !Config Desc  = residence times in carbon pools
1948    !Config if    = OK_STOMATE
1949    !Config Def   = 300.
1950    !Config Help  = residence time in the passive pool
1951    !Config Units = [days]
1952    CALL getin_p('CARBON_TAU_IPASSIVE',carbon_tau_ipassive)
1953    !
1954    !Config Key   = FLUX_TOT_COEFF
1955    !Config Desc  =
1956    !Config if    = OK_STOMATE
1957    !Config Def   = 1.2, 1.4,.75
1958    !Config Help  =
1959    !Config Units = [days]
1960    CALL getin_p('FLUX_TOT_COEFF',flux_tot_coeff)
1961
1962    !-
1963    ! turnover parameters
1964    !-
1965    !
1966    !Config Key   = NEW_TURNOVER_TIME_REF
1967    !Config Desc  =
1968    !Config If    = OK_STOMATE
1969    !Config Def   = 20.
1970    !Config Help  =
1971    !Config Units = [days] 
1972    CALL getin_p('NEW_TURNOVER_TIME_REF',new_turnover_time_ref)
1973
1974    !Config Key   = LEAF_AGE_CRIT_TREF
1975    !Config Desc  =
1976    !Config If    = OK_STOMATE
1977    !Config Def   = 20.
1978    !Config Help  =
1979    !Config Units = [days] 
1980    CALL getin_p('LEAF_AGE_CRIT_TREF',leaf_age_crit_tref)
1981    !
1982    !Config Key   = LEAF_AGE_CRIT_COEFF
1983    !Config Desc  =
1984    !Config If    = OK_STOMATE
1985    !Config Def   = 1.5, 0.75, 10.
1986    !Config Help  =
1987    !Config Units = [-]
1988    CALL getin_p('LEAF_AGE_CRIT_COEFF',leaf_age_crit_coeff)
1989
1990    !-
1991    ! vmax parameters
1992    !-
1993    !
1994    !Config Key   = VMAX_OFFSET
1995    !Config Desc  = offset (minimum relative vcmax)
1996    !Config If    = OK_STOMATE
1997    !Config Def   = 0.3
1998    !Config Help  = offset (minimum vcmax/vmax_opt)
1999    !Config Units = [-] 
2000    CALL getin_p('VMAX_OFFSET',vmax_offset)
2001    !
2002    !Config Key   = LEAFAGE_FIRSTMAX
2003    !Config Desc  = leaf age at which vmax attains vcmax_opt (in fraction of critical leaf age)
2004    !Config If    = OK_STOMATE
2005    !Config Def   = 0.03
2006    !Config Help  = relative leaf age at which vmax attains vcmax_opt
2007    !Config Units = [-]
2008    CALL getin_p('LEAFAGE_FIRSTMAX',leafage_firstmax)
2009    !
2010    !Config Key   = LEAFAGE_LASTMAX
2011    !Config Desc  = leaf age at which vmax falls below vcmax_opt (in fraction of critical leaf age)
2012    !Config If    = OK_STOMATE
2013    !Config Def   = 0.5
2014    !Config Help  = relative leaf age at which vmax falls below vcmax_opt
2015    !Config Units = [-] 
2016    CALL getin_p('LEAFAGE_LASTMAX',leafage_lastmax)
2017    !
2018    !Config Key   = LEAFAGE_OLD
2019    !Config Desc  = leaf age at which vmax attains its minimum (in fraction of critical leaf age)
2020    !Config If    = OK_STOMATE
2021    !Config Def   = 1.
2022    !Config Help  = relative leaf age at which vmax attains its minimum
2023    !Config Units = [-] 
2024    CALL getin_p('LEAFAGE_OLD',leafage_old)
2025
2026    !-
2027    ! season parameters
2028    !-
2029    !
2030    !Config Key   = GPPFRAC_DORMANCE
2031    !Config Desc  = rapport maximal GPP/GGP_max pour dormance
2032    !Config If    = OK_STOMATE
2033    !Config Def   = 0.2
2034    !Config Help  =
2035    !Config Units = [-]
2036    CALL getin_p('GPPFRAC_DORMANCE',gppfrac_dormance)
2037    !
2038    !Config Key   = TAU_CLIMATOLOGY
2039    !Config Desc  = tau for "climatologic variables
2040    !Config If    = OK_STOMATE
2041    !Config Def   = 20
2042    !Config Help  =
2043    !Config Units = [days]
2044    CALL getin_p('TAU_CLIMATOLOGY',tau_climatology)
2045    !
2046    !Config Key   = HVC1
2047    !Config Desc  = parameters for herbivore activity
2048    !Config If    = OK_STOMATE
2049    !Config Def   = 0.019
2050    !Config Help  =
2051    !Config Units = [-] 
2052    CALL getin_p('HVC1',hvc1)
2053    !
2054    !Config Key   = HVC2
2055    !Config Desc  = parameters for herbivore activity
2056    !Config If    = OK_STOMATE
2057    !Config Def   = 1.38
2058    !Config Help  =
2059    !Config Units = [-] 
2060    CALL getin_p('HVC2',hvc2)
2061    !
2062    !Config Key   = LEAF_FRAC_HVC
2063    !Config Desc  = parameters for herbivore activity
2064    !Config If    = OK_STOMATE
2065    !Config Def   = 0.33
2066    !Config Help  =
2067    !Config Units = [-]
2068    CALL getin_p('LEAF_FRAC_HVC',leaf_frac_hvc)
2069    !
2070    !Config Key   = TLONG_REF_MAX
2071    !Config Desc  = maximum reference long term temperature
2072    !Config If    = OK_STOMATE
2073    !Config Def   = 303.1
2074    !Config Help  =
2075    !Config Units = [K] 
2076    CALL getin_p('TLONG_REF_MAX',tlong_ref_max)
2077    !
2078    !Config Key   = TLONG_REF_MIN
2079    !Config Desc  = minimum reference long term temperature
2080    !Config If    = OK_STOMATE
2081    !Config Def   = 253.1
2082    !Config Help  =
2083    !Config Units = [K] 
2084    CALL getin_p('TLONG_REF_MIN',tlong_ref_min)
2085    !
2086    !Config Key   = NCD_MAX_YEAR
2087    !Config Desc  =
2088    !Config If    = OK_STOMATE
2089    !Config Def   = 3.
2090    !Config Help  = NCD : Number of Chilling Days
2091    !Config Units = [days]
2092    CALL getin_p('NCD_MAX_YEAR',ncd_max_year)
2093    !
2094    !Config Key   = GDD_THRESHOLD
2095    !Config Desc  =
2096    !Config If    = OK_STOMATE
2097    !Config Def   = 5.
2098    !Config Help  = GDD : Growing-Degree-Day
2099    !Config Units = [days]
2100    CALL getin_p('GDD_THRESHOLD',gdd_threshold)
2101    !
2102    !Config Key   = GREEN_AGE_EVER
2103    !Config Desc  =
2104    !Config If    = OK_STOMATE
2105    !Config Def   = 2.
2106    !Config Help  =
2107    !Config Units = [-] 
2108    CALL getin_p('GREEN_AGE_EVER',green_age_ever)
2109    !
2110    !Config Key   = GREEN_AGE_DEC
2111    !Config Desc  =
2112    !Config If    = OK_STOMATE
2113    !Config Def   = 0.5
2114    !Config Help  =
2115    !Config Units = [-]
2116    CALL getin_p('GREEN_AGE_DEC',green_age_dec)
2117
2118  END SUBROUTINE config_stomate_parameters
2119
2120!! ================================================================================================================================
2121!! SUBROUTINE   : config_dgvm_parameters
2122!!
2123!>\BRIEF        This subroutine reads in the configuration file all the parameters
2124!! needed when the DGVM model is activated (ie : when ok_dgvm is set to true).
2125!!
2126!! DESCRIPTION  : None
2127!!
2128!! RECENT CHANGE(S): None
2129!!
2130!! MAIN OUTPUT VARIABLE(S):
2131!!
2132!! REFERENCE(S) :
2133!!
2134!! FLOWCHART    :
2135!! \n
2136!_ ================================================================================================================================
2137
2138  SUBROUTINE config_dgvm_parameters   
2139
2140    IMPLICIT NONE
2141
2142    !! 0. Variables and parameters declaration
2143
2144    !! 0.4 Local variables
2145
2146    !_ ================================================================================================================================   
2147
2148    !-
2149    ! establish parameters
2150    !-
2151    !
2152    !Config Key   = ESTAB_MAX_TREE
2153    !Config Desc  = Maximum tree establishment rate
2154    !Config If    = OK_DGVM
2155    !Config Def   = 0.12
2156    !Config Help  =
2157    !Config Units = [-]   
2158    CALL getin_p('ESTAB_MAX_TREE',estab_max_tree)
2159    !
2160    !Config Key   = ESTAB_MAX_GRASS
2161    !Config Desc  = Maximum grass establishment rate
2162    !Config If    = OK_DGVM
2163    !Config Def   = 0.12
2164    !Config Help  =
2165    !Config Units = [-] 
2166    CALL getin_p('ESTAB_MAX_GRASS',estab_max_grass)
2167    !
2168    !Config Key   = ESTABLISH_SCAL_FACT
2169    !Config Desc  =
2170    !Config If    = OK_DGVM
2171    !Config Def   = 5.
2172    !Config Help  =
2173    !Config Units = [-]
2174    CALL getin_p('ESTABLISH_SCAL_FACT',establish_scal_fact)
2175    !
2176    !Config Key   = MAX_TREE_COVERAGE
2177    !Config Desc  =
2178    !Config If    = OK_DGVM
2179    !Config Def   = 0.98
2180    !Config Help  =
2181    !Config Units = [-]
2182    CALL getin_p('MAX_TREE_COVERAGE',max_tree_coverage)
2183    !
2184    !Config Key   = IND_0_ESTAB
2185    !Config Desc  =
2186    !Config If    = OK_DGVM
2187    !Config Def   = 0.2
2188    !Config Help  =
2189    !Config Units = [-] 
2190    CALL getin_p('IND_0_ESTAB',ind_0_estab)
2191
2192    !-
2193    ! light parameters
2194    !-
2195    !
2196    !Config Key   = ANNUAL_INCREASE
2197    !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)?
2198    !Config If    = OK_DGVM
2199    !Config Def   = y
2200    !Config Help  =
2201    !Config Units = [FLAG]
2202    CALL getin_p('ANNUAL_INCREASE',annual_increase)
2203    !
2204    !Config Key   = MIN_COVER
2205    !Config Desc  = For trees, minimum fraction of crown area occupied
2206    !Config If    = OK_DGVM
2207    !Config Def   = 0.05
2208    !Config Help  =
2209    !Config Units = [-] 
2210    CALL getin_p('MIN_COVER',min_cover)
2211
2212    !-
2213    ! pftinout parameters
2214    !
2215    !Config Key   = IND_0
2216    !Config Desc  = initial density of individuals
2217    !Config If    = OK_DGVM
2218    !Config Def   = 0.02
2219    !Config Help  =
2220    !Config Units = [-] 
2221    CALL getin_p('IND_0',ind_0)
2222    !
2223    !Config Key   = MIN_AVAIL
2224    !Config Desc  = minimum availability
2225    !Config If    = OK_DGVM
2226    !Config Def   = 0.01
2227    !Config Help  =
2228    !Config Units = [-] 
2229    CALL getin_p('MIN_AVAIL',min_avail)
2230    !
2231    !Config Key   = RIP_TIME_MIN
2232    !Config Desc  =
2233    !Config If    = OK_DGVM
2234    !Config Def   = 1.25
2235    !Config Help  =
2236    !Config Units = [year] 
2237    CALL getin_p('RIP_TIME_MIN',RIP_time_min)
2238    !
2239    !Config Key   = NPP_LONGTERM_INIT
2240    !Config Desc  =
2241    !Config If    = OK_DGVM
2242    !Config Def   = 10.
2243    !Config Help  =
2244    !Config Units = [gC/m^2/year]
2245    CALL getin_p('NPP_LONGTERM_INIT',npp_longterm_init)
2246    !
2247    !Config Key   = EVERYWHERE_INIT
2248    !Config Desc  =
2249    !Config If    = OK_DGVM
2250    !Config Def   = 0.05
2251    !Config Help  =
2252    !Config Units = [-]
2253    CALL getin_p('EVERYWHERE_INIT',everywhere_init)
2254
2255
2256  END SUBROUTINE config_dgvm_parameters
2257
2258
2259!! ================================================================================================================================
2260!! FUNCTION   : get_printlev
2261!!
2262!>\BRIEF        Read global PRINTLEV parmeter and local PRINTLEV_modname
2263!!
2264!! DESCRIPTION  : The first time this function is called the parameter PRINTLEV is read from run.def file.
2265!!                It is stored in the variable named printlev which is declared in constantes_var.f90. printlev
2266!!                can be accesed each module in ORCHIDEE which makes use of constantes_var module.
2267!!
2268!!                This function also reads the parameter PRINTLEV_modname for run.def file. modname is the
2269!!                intent(in) character string to this function. If the variable is set in run.def file, the corresponding
2270!!                value is returned. Otherwise the value of printlev is returnd as default.
2271!!
2272!! RECENT CHANGE(S): None
2273!!
2274!! MAIN OUTPUT VARIABLE(S): The local output level for the module set as intent(in) argument.
2275!!
2276!! REFERENCE(S) :
2277!!
2278!! FLOWCHART    :
2279!! \n
2280!_ ================================================================================================================================
2281
2282  FUNCTION get_printlev ( modname )
2283
2284    !! 0.1 Input arguments
2285    CHARACTER(LEN=*), INTENT(IN) :: modname
2286
2287    !! 0.2 Returned variable
2288    INTEGER(i_std)               :: get_printlev
2289
2290    !! 0.3 Local variables
2291    LOGICAL, SAVE :: first=.TRUE.
2292
2293    !_ ================================================================================================================================
2294
2295    !! 1.0  Read the global PRINTLEV from run.def. This is only done at first call to this function.
2296    IF (first) THEN
2297       !Config Key   = PRINTLEV
2298       !Config Desc  = Print level for text output
2299       !Config If    =
2300       !Config Help  = Possible values are:
2301       !Config         0    No output,
2302       !Config         1    Minimum writing for long simulations,
2303       !Config         2    More basic information for long simulations,
2304       !Config         3    First debug level,
2305       !Config         4    Higher debug level
2306       !Config Def   = 2
2307       !Config Units = [0, 1, 2, 3, 4]
2308       ! Default value is set in constantes_var
2309       CALL getin_p('PRINTLEV',printlev)
2310       first=.FALSE.
2311
2312       !Config Key   = PRINTLEV_modname
2313       !Config Desc  = Specific print level of text output for the module "modname". Default as PRINTLEV.
2314       !Config Def   = PRINTLEV
2315       !Config If    =
2316       !Config Help  = Use this option to activate a different level of text output
2317       !Config         for a specific module. This can be activated for several modules
2318       !Config         at the same time. Use for example PRINTLEV_sechiba.
2319       !Config Units = [0, 1, 2, 3, 4]
2320    END IF
2321
2322    ! Set default value as the standard printlev
2323    get_printlev=printlev
2324    ! Read optional value from run.def file
2325    CALL getin_p('PRINTLEV_'//modname, get_printlev)
2326
2327  END FUNCTION get_printlev
2328
2329
2330END MODULE constantes
Note: See TracBrowser for help on using the repository browser.