Changeset 257
- Timestamp:
- 2011-06-17T14:02:17+02:00 (13 years ago)
- Location:
- branches/ORCHIDEE_EXT/ORCHIDEE
- Files:
-
- 59 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ORCHIDEE_EXT/ORCHIDEE/AA_make
r64 r257 1 #- $Id: AA_make ,v 1.4 2007/09/20 13:32:32 ssipsl Exp$2 all : libpara meters libparallelliborglob libstomate libsechiba1 #- $Id: AA_make 41 2011-01-01 19:56:53Z mmaipsl $ 2 all : libparallel libparameters liborglob libstomate libsechiba 3 3 4 4 libparameters : -
branches/ORCHIDEE_EXT/ORCHIDEE/AA_make.ldef
r64 r257 1 #- $Id: AA_make.ldef ,v 1.1 2007/06/21 09:11:58 ssipsl Exp$1 #- $Id: AA_make.ldef 12 2010-11-05 15:42:13Z mmaipsl $ 2 2 #--------------------------------------------------------------------- 3 3 #- -
branches/ORCHIDEE_EXT/ORCHIDEE/src_global/AA_make
r64 r257 1 1 #- 2 #- $Id: AA_make ,v 1.5 2010/04/06 14:26:07 ssipsl Exp$2 #- $Id: AA_make 41 2011-01-01 19:56:53Z mmaipsl $ 3 3 #- 4 4 PARAM_LIB = $(LIBDIR)/libparameters.a … … 21 21 #- 22 22 all: 23 $(M_K) libparallel 23 24 $(M_K) libparameters 24 25 $(M_K) m_all … … 26 27 27 28 m_all: $(MODEL_LIB)($(OBJSMODS1)) 29 30 libparallel: 31 (cd ../src_parallel; $(M_K) -f Makefile) 28 32 29 33 libparameters: -
branches/ORCHIDEE_EXT/ORCHIDEE/src_global/AA_make.ldef
r64 r257 1 1 #- 2 #- $Id: AA_make.ldef ,v 1.2 2008/01/08 11:49:07 ssipsl Exp$2 #- $Id: AA_make.ldef 12 2010-11-05 15:42:13Z mmaipsl $ 3 3 #- 4 4 #--------------------------------------------------------------------- -
branches/ORCHIDEE_EXT/ORCHIDEE/src_global/grid.f90
r64 r257 4 4 !! @call sechiba_main 5 5 !! @Version : $Revision: 1.8 $, $Date: 2009/01/28 08:32:45 $ 6 !! @Version : $Revision: 42 $, $Date: 2011-01-01 21:15:03 +0100 (Sat, 01 Jan 2011) $ 6 7 !! 7 8 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_global/grid.f90,v 1.8 2009/01/28 08:32:45 ssipsl Exp $ 9 !< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_global/grid.f90 $ 10 !< $Date: 2011-01-01 21:15:03 +0100 (Sat, 01 Jan 2011) $ 11 !< $Author: mmaipsl $ 12 !< $Revision: 42 $ 8 13 !! 9 14 !! @author Marie-Alice Foujols, Jan Polcher and Martial Mancip … … 23 28 ! default resolution (m) 24 29 REAL(r_std), PARAMETER :: default_resolution = 250000. 25 !26 30 ! 27 31 ! VARIABLES … … 189 193 ! ========================================================================= 190 194 191 192 193 195 IF ( bavard .GE. 4 ) WRITE(numout,*) 'Entering grid_stuff' 194 196 … … 239 241 ! initialize output 240 242 neighbours_g(:,:) = -1 241 resolution_g(:,:) = 0.243 resolution_g(:,:) = zero 242 244 min_resol(:) = 1.e6 243 max_resol(:) = -1.245 max_resol(:) = moins_un 244 246 245 247 correspondance(:,:) = -1 -
branches/ORCHIDEE_EXT/ORCHIDEE/src_global/interpol_help.f90
r64 r257 8 8 ! 9 9 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_global/interpol_help.f90,v 1.7 2010/04/06 14:30:23 ssipsl Exp $ 10 ! 11 !< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_global/interpol_help.f90 $ 12 !< $Date: 2011-01-01 20:56:53 +0100 (Sat, 01 Jan 2011) $ 13 !< $Author: mmaipsl $ 14 !< $Revision: 41 $ 10 15 ! 11 16 ! -
branches/ORCHIDEE_EXT/ORCHIDEE/src_global/solar.f90
r64 r257 3 3 !! @call sechiba_main 4 4 !! @Version : $Revision: 1.1 $, $Date: 2010/04/06 14:26:07 $ 5 !! @Version : $Revision: 42 $, $Date: 2011-01-01 21:15:03 +0100 (Sat, 01 Jan 2011) $ 5 6 !! 6 7 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_global/solar.f90,v 1.1 2010/04/06 14:26:07 ssipsl Exp $ 8 ! 9 !< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_global/solar.f90 $ 10 !< $Date: 2011-01-01 21:15:03 +0100 (Sat, 01 Jan 2011) $ 11 !< $Author: mmaipsl $ 12 !< $Revision: 42 $ 7 13 !! 8 14 !! @author Marie-Alice Foujols, Jan Polcher and Martial Mancip … … 54 60 !--------------------------------------------------------------------- 55 61 ! 56 ! pi = 4.*ATAN(1.)57 62 IF (check) WRITE(numout,*) 'We get the right calendar information' 58 63 !- … … 132 137 llat = llatd*pi/180. 133 138 csang(ilon,ilat) = & 134 & MAX( 0.,SIN(dec)*SIN(llat)+COS(dec)*COS(llat)*COS(omega))139 & MAX(zero,SIN(dec)*SIN(llat)+COS(dec)*COS(llat)*COS(omega)) 135 140 ENDDO 136 141 ENDDO -
branches/ORCHIDEE_EXT/ORCHIDEE/src_parallel/AA_make
r64 r257 1 1 #- 2 #- $Id: AA_make ,v 1.6 2010/04/06 14:34:32 ssipsl Exp$2 #- $Id: AA_make 41 2011-01-01 19:56:53Z mmaipsl $ 3 3 #- 4 MODS1 = timer.f90 \5 data_para.f90 \4 MODS1 = data_para.f90 \ 5 timer.f90 \ 6 6 transfert_para.f90 \ 7 7 ioipsl_para.f90 \ -
branches/ORCHIDEE_EXT/ORCHIDEE/src_parallel/AA_make.ldef
r64 r257 1 1 #- 2 #- $Id: AA_make.ldef ,v 1.3 2008/01/08 11:49:07 ssipsl Exp$2 #- $Id: AA_make.ldef 12 2010-11-05 15:42:13Z mmaipsl $ 3 3 #- 4 4 #--------------------------------------------------------------------- -
branches/ORCHIDEE_EXT/ORCHIDEE/src_parallel/data_para.f90
r64 r257 11 11 !- 12 12 USE defprec 13 USE constantes14 13 USE ioipsl 15 14 !- 16 15 #include "src_parallel.h" 17 16 !- 17 !- 18 ! Unit for output messages 19 INTEGER(i_std), SAVE :: numout = 6 20 18 21 INTEGER, SAVE :: mpi_size !! Number of parallel processes 19 22 INTEGER, SAVE :: mpi_rank !! my rank num … … 203 206 204 207 SUBROUTINE init_data_para(iim,jjm,nbpoints,index_x) 205 USE constantes 208 206 209 IMPLICIT NONE 207 210 #ifdef CPP_PARA … … 457 460 SUBROUTINE Write_Load_balance(times) 458 461 IMPLICIT NONE 459 REAL ,INTENT(IN) :: times462 REAL(r_std),INTENT(IN) :: times 460 463 461 464 #ifdef CPP_PARA -
branches/ORCHIDEE_EXT/ORCHIDEE/src_parallel/ioipsl_para.f90
r64 r257 9 9 USE data_para 10 10 USE transfert_para 11 USE constantes12 11 !- 13 12 IMPLICIT NONE -
branches/ORCHIDEE_EXT/ORCHIDEE/src_parallel/orch_write_field.f90
r64 r257 7 7 module orch_Write_Field 8 8 9 USE constantes9 USE data_para 10 10 11 11 IMPLICIT NONE -
branches/ORCHIDEE_EXT/ORCHIDEE/src_parallel/timer.f90
r64 r257 7 7 MODULE timer 8 8 9 USE constantes9 USE data_para 10 10 11 11 INTEGER, PARAMETER :: nb_timer=2 -
branches/ORCHIDEE_EXT/ORCHIDEE/src_parallel/tools_para.f90
r64 r257 11 11 USE timer 12 12 USE data_para 13 USE constantes14 13 !- 15 14 #include "src_parallel.h" -
branches/ORCHIDEE_EXT/ORCHIDEE/src_parallel/transfert_para.f90
r64 r257 9 9 USE data_para 10 10 USE timer 11 USE constantes12 11 !- 13 12 IMPLICIT NONE … … 552 551 USE data_para 553 552 USE timer 554 USE constantes555 553 556 554 IMPLICIT NONE … … 599 597 USE data_para 600 598 USE timer 601 USE constantes602 599 603 600 IMPLICIT NONE … … 647 644 USE data_para 648 645 USE timer 649 USE constantes650 646 651 647 IMPLICIT NONE … … 1953 1949 USE data_para 1954 1950 USE timer 1955 USE constantes1956 1951 1957 1952 IMPLICIT NONE … … 1985 1980 USE data_para 1986 1981 USE timer 1987 USE constantes1988 1982 1989 1983 IMPLICIT NONE … … 2018 2012 USE data_para 2019 2013 USE timer 2020 USE constantes2021 2014 2022 2015 IMPLICIT NONE … … 2050 2043 USE data_para 2051 2044 USE timer 2052 USE constantes2053 2045 2054 2046 IMPLICIT NONE … … 2084 2076 USE data_para 2085 2077 USE timer 2086 USE constantes2087 2078 2088 2079 IMPLICIT NONE … … 2139 2130 USE data_para 2140 2131 USE timer 2141 USE constantes2142 2132 2143 2133 IMPLICIT NONE … … 2195 2185 USE data_para 2196 2186 USE timer 2197 USE constantes2198 2187 2199 2188 IMPLICIT NONE … … 2250 2239 USE data_para 2251 2240 USE timer 2252 USE constantes2253 2241 2254 2242 IMPLICIT NONE … … 2319 2307 USE data_para 2320 2308 USE timer 2321 USE constantes2322 2309 2323 2310 IMPLICIT NONE … … 2387 2374 USE data_para 2388 2375 USE timer 2389 USE constantes2390 2376 2391 2377 IMPLICIT NONE … … 2456 2442 USE data_para, iim=>iim_g,jjm=>jjm_g 2457 2443 USE timer 2458 USE constantes2459 2444 2460 2445 IMPLICIT NONE … … 2521 2506 USE data_para, iim=>iim_g,jjm=>jjm_g 2522 2507 USE timer 2523 USE constantes2524 2508 2525 2509 IMPLICIT NONE … … 2590 2574 USE data_para, iim=>iim_g,jjm=>jjm_g 2591 2575 USE timer 2592 USE constantes2593 2576 2594 2577 IMPLICIT NONE … … 2655 2638 USE data_para, iim=>iim_g,jjm=>jjm_g 2656 2639 USE timer 2657 USE constantes2658 2640 2659 2641 IMPLICIT NONE … … 2733 2715 USE data_para, iim=>iim_g,jjm=>jjm_g 2734 2716 USE timer 2735 USE constantes2736 2717 2737 2718 IMPLICIT NONE … … 2810 2791 USE data_para, iim=>iim_g,jjm=>jjm_g 2811 2792 USE timer 2812 USE constantes2813 2793 2814 2794 IMPLICIT NONE … … 2887 2867 USE data_para 2888 2868 USE timer 2889 USE constantes2890 2869 2891 2870 IMPLICIT NONE … … 2922 2901 USE data_para 2923 2902 USE timer 2924 USE constantes2925 2903 2926 2904 IMPLICIT NONE -
branches/ORCHIDEE_EXT/ORCHIDEE/src_parameters/AA_make
r64 r257 1 1 #- 2 #- $Id: AA_make ,v 1.17 2010/04/06 14:34:32 ssipsl Exp$2 #- $Id: AA_make 41 2011-01-01 19:56:53Z mmaipsl $ 3 3 #- 4 4 IOIPSL_LIB = $(LIBDIR)/libioipsl.a … … 8 8 #-Q- eshpux SXIOIPSL_LIB = $(LIBDIR)/libsxioipsl.a 9 9 #-Q- sx8brodie SXIOIPSL_LIB = $(LIBDIR)/libsxioipsl.a 10 #- 11 PARALLEL_LIB = $(LIBDIR)/libparallel.a 12 SXPARALLEL_LIB = $(PARALLEL_LIB) 13 #-Q- sxnec SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 14 #-Q- sx6nec SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 15 #-Q- eshpux SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 16 #-Q- sx8brodie SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 10 17 #- 11 18 MODS1 = constantes.f90 \ … … 23 30 all: 24 31 $(M_K) libioipsl 32 $(M_K) libparallel 25 33 $(M_K) m_all 26 34 @echo parameter is OK … … 30 38 libioipsl: 31 39 (cd ../../IOIPSL/src; $(M_K) -f Makefile) 40 41 libparallel: 42 (cd ../src_parallel; $(M_K) -f Makefile) 32 43 33 44 $(MODEL_LIB)(%.o): %.f90 … … 57 68 $(MODEL_LIB)(constantes_mtc.o) 58 69 $(MODEL_LIB)(constantes.o): \ 70 $(PARALLEL_LIB) \ 59 71 $(IOIPSL_LIB) 60 72 -
branches/ORCHIDEE_EXT/ORCHIDEE/src_parameters/AA_make.ldef
r64 r257 1 1 #- 2 #- $Id: AA_make.ldef ,v 1.7 2008/01/08 11:49:07 ssipsl Exp$2 #- $Id: AA_make.ldef 12 2010-11-05 15:42:13Z mmaipsl $ 3 3 #- 4 4 #--------------------------------------------------------------------- -
branches/ORCHIDEE_EXT/ORCHIDEE/src_parameters/constantes.f90
r251 r257 8 8 !!-------------------------------------------------------------------- 9 9 USE defprec 10 USE ioipsl10 USE parallel 11 11 !- 12 12 IMPLICIT NONE … … 21 21 !---------------- 22 22 23 ! Unit for output messages24 INTEGER(i_std), SAVE :: numout = 625 23 !- 26 24 ! To set for more printing … … 185 183 INTEGER(i_std),PARAMETER :: ipassive = 3 186 184 INTEGER(i_std),PARAMETER :: ncarb = 3 185 ! 186 ! transformation between types of surface (DS : not used in the code?) 187 INTEGER(i_std),PARAMETER :: ito_natagri = 1 188 INTEGER(i_std),PARAMETER :: ito_total = 2 189 187 190 188 191 … … 197 200 REAL(r_std), PARAMETER :: pi = 4.*ATAN(1.) 198 201 ! e 199 REAL(r_std),PARAMETER :: euler = 2.71828182846 202 REAL(r_std),PARAMETER :: euler = 2.71828182846 !or euler = EXP(1.) 200 203 !- 201 204 ! Integer constant set to zero … … 230 233 ! 231 234 ! radius of the Earth (m) 235 ! comment : 236 ! Earth radius ~= Equatorial radius 237 ! The Earth's equatorial radius a, or semi-major axis, is the distance from its center to the equator and equals 6,378.1370 km. 238 ! The equatorial radius is often used to compare Earth with other planets. 232 239 REAL(r_std), PARAMETER :: R_Earth = 6378000. 240 !The meridional mean is well approximated by the semicubic mean of the two axe yielding 6367.4491 km 241 ! or less accurately by the quadratic mean of the two axes about 6,367.454 km 242 ! or even just the mean of the two axes about 6,367.445 km. 243 !- 233 244 ! standard pressure 234 245 REAL(r_std), PARAMETER :: pb_std = 1013. … … 333 344 334 345 335 !----------------------------------------------- 336 !---------------------------------------------- 337 ! SCALAR PARAMETERS EXTERNALIZED 338 !---------------------------------------------- 339 !----------------------------------------------- 340 !------------------------------------------ 341 ! SECHIBA, SOIL AND VEGETATION parameters 342 !----------------------------------------- 343 344 !!--------------------------------------- 345 !! Parameters for soil type distribution 346 !!--------------------------------------- 347 ! 348 ! Default soil texture distribution in the following order : 349 ! sand, loam and clay 350 REAL(r_std),SAVE, DIMENSION(nstm) :: soiltype_default = (/ 0.0, 1.0, 0.0 /) 351 352 !!---------------------------------------- 353 !! Constantes from the Choisnel hydrology 354 !!---------------------------------------- 346 347 !------------------------! 348 ! SECHIBA PARAMETERS ! 349 !------------------------! 350 351 ! DS Maybe should I move these constants in the modules they belong 352 !- 353 ! Specific parameters for the CWRR hydrology module 354 !- 355 ! 356 ! CWRR linearisation 357 INTEGER(i_std),PARAMETER :: imin = 1 358 ! number of interval for CWRR 359 INTEGER(i_std),PARAMETER :: nbint = 100 360 ! number of points for CWRR 361 INTEGER(i_std),PARAMETER :: imax = nbint+1 362 363 !- 364 ! diffuco 365 !- 366 REAL(r_std),PARAMETER :: Tetens_1 = 0.622 367 REAL(r_std),PARAMETER :: Tetens_2 = 0.378 368 REAL(r_std),PARAMETER :: std_ci_frac = 0.667 369 REAL(r_std),PARAMETER :: alpha_j = 0.8855 370 REAL(r_std),PARAMETER :: curve_assim = 0.7 371 REAL(r_std),PARAMETER :: WJ_coeff1 = 4.5 372 REAL(r_std),PARAMETER :: WJ_coeff2 = 10.5 373 REAL(r_std),PARAMETER :: Vc_to_Rd_ratio = 0.011 374 REAL(r_std),PARAMETER :: O2toCO2_stoechio = 1.6 375 REAL(r_std),PARAMETER :: mmol_to_m_1 = 0.0244 376 REAL(r_std),PARAMETER :: RG_to_PAR = 0.5 377 REAL(r_std),PARAMETER :: W_to_mmol = 4.6 ! W_to_mmol * RG_to_PAR = 2.3 378 379 380 381 !-----------! 382 ! Global ! 383 !-----------! 384 ! The minimum wind 385 REAL(r_std),SAVE :: min_wind = 0.1 386 ! Sets the amount above which only sublimation occures [Kg/m^2] 387 REAL(r_std),SAVE :: snowcri=1.5 388 ! Transforms leaf area index into size of interception reservoir 389 REAL(r_std),SAVE :: qsintcst = 0.1 390 ! Total depth of soil reservoir (for hydrolc) 391 REAL(r_std),SAVE :: dpu_cste = deux 392 ! Total depth of soil reservoir (m) 393 REAL(r_std),SAVE,DIMENSION(nstm) :: dpu = (/ 2.0_r_std, 2.0_r_std, 2.0_r_std /) 394 395 ! FLAGS 396 397 ! allow agricultural PFTs 398 LOGICAL,SAVE :: agriculture = .TRUE. !(read in slowproc) 399 ! Do we treat PFT expansion across a grid point after introduction? 400 ! default = .FALSE. 401 LOGICAL,SAVE :: treat_expansion = .FALSE. 402 ! herbivores? 403 LOGICAL,SAVE :: ok_herbivores = .FALSE. 404 ! harvesting ? 405 LOGICAL,SAVE :: harvest_agri = .TRUE. 406 ! constant moratlity 407 LOGICAL,SAVE :: lpj_gap_const_mort=.TRUE. 408 409 ! Parameters used by both hydrology models 410 411 ! Maximum period of snow aging 412 REAL(r_std),SAVE :: max_snow_age = 50._r_std 413 ! Transformation time constant for snow (m) 414 REAL(r_std),SAVE :: snow_trans = 0.3_r_std 415 ! Lower limit of snow amount 416 REAL(r_std),SAVE :: sneige 417 ! The maximum mass (kg/m^2) of a glacier. 418 REAL(r_std),SAVE :: maxmass_glacier = 3000. 419 ! Maximum quantity of water (Kg/M3) 420 REAL(r_std),SAVE :: mx_eau_eau = 150. 421 422 ! UNKNOW 423 424 ! Is veget_ori array stored in restart file 425 !!$! DS: Where is it used ? 426 ! LOGICAL,PARAMETER :: ldveget_ori_on_restart = .TRUE. 427 !- 428 !!$! DS not used in the code ? 429 ! Limit of air temperature for snow 430 REAL(r_std),SAVE :: tsnow=273. 431 432 433 434 435 !-------------! 436 ! condveg.f90 ! 437 !-------------! 438 439 ! 1. Scalar 440 441 ! to get z0 from height 442 REAL(r_std), SAVE :: z0_over_height = un/16. 443 ! Magic number which relates the height to the displacement height. 444 REAL(r_std), SAVE :: height_displacement = 0.75 445 ! bare soil roughness length (m) 446 REAL(r_std),SAVE :: z0_bare = 0.01 447 ! ice roughness length (m) 448 REAL(r_std),SAVE :: z0_ice = 0.001 449 ! Time constant of the albedo decay of snow 450 REAL(r_std),SAVE :: tcst_snowa = 5.0 451 ! Critical value for computation of snow albedo [Kg/m^2] 452 REAL(r_std),SAVE :: snowcri_alb=10. 453 454 ! 2. Arrays 455 456 ! albedo of dead leaves, VIS+NIR 457 REAL(r_std),DIMENSION(2),SAVE :: alb_deadleaf = (/ .12, .35/) 458 ! albedo of ice, VIS+NIR 459 REAL(r_std),DIMENSION(2),SAVE :: alb_ice = (/ .60, .20/) 460 ! The correspondance table for the soil color numbers and their albedo 461 ! 462 REAL(r_std), DIMENSION(classnb) :: vis_dry = (/0.24, 0.22, 0.20, 0.18, 0.16, 0.14, 0.12, 0.10, 0.27/) 463 REAL(r_std), DIMENSION(classnb) :: nir_dry = (/0.48, 0.44, 0.40, 0.36, 0.32, 0.28, 0.24, 0.20, 0.55/) 464 REAL(r_std), DIMENSION(classnb) :: vis_wet = (/0.12, 0.11, 0.10, 0.09, 0.08, 0.07, 0.06, 0.05, 0.15/) 465 REAL(r_std), DIMENSION(classnb) :: nir_wet = (/0.24, 0.22, 0.20, 0.18, 0.16, 0.14, 0.12, 0.10, 0.31/) 466 ! 467 ! Nathalie, introduction d'un albedo moyen, VIS+NIR 468 ! Les valeurs suivantes correspondent a la moyenne des valeurs initiales 469 ! REAL(stnd), DIMENSION(classnb) :: albsoil_vis = (/0.18, 0.165, 0.15, 0.135, 0.12, 0.105, 0.09, 0.075, 0.21/) 470 ! REAL(stnd), DIMENSION(classnb) :: albsoil_nir = (/0.36, 0.33, 0.30, 0.27, 0.24, 0.21, 0.18, 0.15, 0.43/) 471 ! les valeurs retenues accentuent le contraste entre equateur et Sahara. 472 ! On diminue aussi l'albedo des deserts (tous sauf Sahara) 473 REAL(r_std), DIMENSION(classnb) :: albsoil_vis = (/0.18, 0.16, 0.16, 0.15, 0.12, 0.105, 0.09, 0.075, 0.25/) 474 REAL(r_std), DIMENSION(classnb) :: albsoil_nir = (/0.36, 0.34, 0.34, 0.33, 0.30, 0.25, 0.20, 0.15, 0.45/) 475 476 477 !-------------! 478 ! diffuco.f90 ! 479 !-------------! 480 481 ! 1. Scalar 482 483 INTEGER(i_std), SAVE :: nlai = 20 ! dimension de tableau 484 ! used in diffuco_trans 485 REAL(r_std), SAVE :: laimax = 12. 486 REAL(r_std), SAVE :: xc4_1 = .83 487 REAL(r_std), SAVE :: xc4_2 = .93 488 ! Set to .TRUE. if you want q_cdrag coming from GCM 489 LOGICAL,SAVE :: ldq_cdrag_from_gcm = .FALSE. 490 491 ! 2; Arrays 492 493 ! 3. Coefficients of equations 494 495 REAL(r_std), SAVE :: lai_level_depth = .15 496 REAL(r_std), SAVE :: x1_coef = 0.177 497 REAL(r_std), SAVE :: x1_Q10 = 0.069 498 REAL(r_std), SAVE :: quantum_yield = 0.092 499 REAL(r_std), SAVE :: kt_coef = 0.7 500 REAL(r_std), SAVE :: kc_coef = 39.09 501 REAL(r_std), SAVE :: Ko_Q10 = .085 502 REAL(r_std), SAVE :: Oa = 210000. 503 REAL(r_std), SAVE :: Ko_coef = 2.412 504 REAL(r_std), SAVE :: CP_0 = 42. 505 REAL(r_std), SAVE :: CP_temp_coef = 9.46 506 REAL(r_std), SAVE :: CP_temp_ref = 25. 507 ! 508 REAL(r_std), SAVE, DIMENSION(2) :: rt_coef = (/ 0.8, 1.3 /) 509 REAL(r_std), SAVE, DIMENSION(2) :: vc_coef = (/ 0.39, 0.3 /) 510 ! 511 ! coefficients of the polynome of degree 5 used inthe equation of coeff_dew_veg 512 REAL(r_std), SAVE, DIMENSION(6) :: dew_veg_poly_coeff = & 513 & (/ 0.887773, 0.205673, 0.110112, 0.014843, 0.000824, 0.000017 /) 514 515 516 517 !-------------! 518 ! hydrolc.f90 ! 519 !-------------! 520 521 ! 1. Scalar 522 355 523 ! 356 524 ! Wilting point (Has a numerical role for the moment) 357 525 REAL(r_std),SAVE :: qwilt = 5.0 358 ! Total depth of soil reservoir (for hydrolc)359 REAL(r_std),SAVE :: dpu_cste = deux360 526 ! The minimal size we allow for the upper reservoir (m) 361 527 REAL(r_std),SAVE :: min_resdis = 2.e-5 … … 369 535 REAL(r_std),SAVE :: exp_drain = 1.5 370 536 !- 371 ! Transforms leaf area index into size of interception reservoir372 REAL(r_std),SAVE :: qsintcst = 0.1373 ! Maximum quantity of water (Kg/M3)374 REAL(r_std),SAVE :: mx_eau_eau = 150.375 !-376 537 ! Constant in the computation of resistance for bare soil evaporation 377 538 REAL(r_std),SAVE :: rsol_cste = 33.E3 … … 380 541 REAL(r_std),SAVE :: hcrit_litter=0.08_r_std 381 542 382 !!--------------------------------------------------- 383 !! Specific parameters for the CWRR hydrology module 384 !!--------------------------------------------------- 385 ! 386 !!$ DS To externalise ? 387 !!$ advice of MM : to put in hydrol 388 ! CWRR linearisation 389 INTEGER(i_std),PARAMETER :: imin = 1 390 ! number of interval for CWRR 391 INTEGER(i_std),PARAMETER :: nbint = 100 392 ! number of points for CWRR 393 INTEGER(i_std),PARAMETER :: imax = nbint+1 543 544 545 546 !-------------! 547 ! hydrol.f90 ! 548 !-------------! 549 550 551 ! 1. Scalar 552 553 ! Allowed moisture above mcs (boundary conditions) 554 REAL(r_std), SAVE :: dmcs = 0.002 555 ! Allowed moisture below mcr (boundary conditions) 556 REAL(r_std), SAVE :: dmcr = 0.002 557 558 ! 2. Arrays 559 394 560 !- 395 561 ! externalise w_time (some bug in hydrol) … … 406 572 ! Saturated soil water content 407 573 REAL(r_std),SAVE,DIMENSION(nstm) :: mcs = (/ 0.41_r_std, 0.43_r_std, 0.41_r_std /) 408 ! Total depth of soil reservoir (m)409 REAL(r_std),SAVE,DIMENSION(nstm) :: dpu = (/ 2.0_r_std, 2.0_r_std, 2.0_r_std /)410 574 !- 411 575 ! dpu must be constant over the different soil types … … 427 591 428 592 429 !!----------------------------------------------------- 430 !! Vegetation parameters (previously in constantes_veg) 431 !!----------------------------------------------------- 432 ! 433 ! Value for frac_nobio for tests in 0-dim simulations 593 594 !-------------! 595 ! routing.f90 ! 596 !-------------! 597 598 ! 1. Scalar 599 600 ! Parameter for the Kassel irrigation parametrization linked to the crops 601 REAL(r_std), SAVE :: crop_coef = 1.5 602 603 604 605 !--------------! 606 ! slowproc.f90 ! 607 !--------------! 608 609 610 ! 1. Scalar 611 612 REAL(r_std), SAVE :: clayfraction_default = 0.2 613 ! Minimal fraction of mesh a vegetation type can occupy 614 REAL(r_std),SAVE :: min_vegfrac=0.001 615 ! Value for frac_nobio for tests in 0-dim simulations 434 616 ! laisser ca tant qu'il n'y a que de la glace (pas de lacs) 435 617 !DS : used in slowproc 436 618 REAL(r_std),SAVE :: frac_nobio_fixed_test_1 = 0.0 437 !- 438 ! Is veget_ori array stored in restart file 439 !!$ DS: Where is it used ? 440 ! LOGICAL,PARAMETER :: ldveget_ori_on_restart = .TRUE. 441 !- 442 ! Set to .TRUE. if you want q_cdrag coming from GCM 443 ! used in diffuco 444 LOGICAL,SAVE :: ldq_cdrag_from_gcm = .FALSE. 445 !- 446 ! allow agricultural PFTs 447 LOGICAL,SAVE :: agriculture = .TRUE. 448 !- 449 ! The maximum mass (kg/m^2) of a glacier. 450 REAL(r_std),SAVE :: maxmass_glacier = 3000. 451 !- 452 ! Minimal fraction of mesh a vegetation type can occupy 453 REAL(r_std),SAVE :: min_vegfrac=0.001 454 !- 455 !!$ DS not used in the code ? 456 ! Limit of air temperature for snow 457 REAL(r_std),SAVE :: tsnow=273. 458 !- 459 ! Sets the amount above which only sublimation occures [Kg/m^2] 460 REAL(r_std),SAVE :: snowcri=1.5 461 ! Critical value for computation of snow albedo [Kg/m^2] 462 REAL(r_std),SAVE :: snowcri_alb=10. 463 ! Lower limit of snow amount 464 REAL(r_std),SAVE :: sneige 465 !- 466 ! The minimum wind 467 REAL(r_std),SAVE :: min_wind = 0.1 468 ! bare soil roughness length (m) 469 REAL(r_std),SAVE :: z0_bare = 0.01 470 ! ice roughness length (m) 471 REAL(r_std),SAVE :: z0_ice = 0.001 472 !- 473 ! Time constant of the albedo decay of snow 474 REAL(r_std),SAVE :: tcst_snowa = cinq 475 ! Maximum period of snow aging 476 REAL(r_std),SAVE :: max_snow_age = 50._r_std 477 ! Transformation time constant for snow (m) 478 REAL(r_std),SAVE :: snow_trans = 0.3_r_std 479 !- 480 ! albedo of dead leaves, VIS+NIR 481 REAL(r_std),DIMENSION(2),SAVE :: alb_deadleaf = (/ .12, .35/) 482 ! albedo of ice, VIS+NIR 483 REAL(r_std),DIMENSION(2),SAVE :: alb_ice = (/ .60, .20/) 484 485 !!-------------------------------- 486 !! SECHIBA specific parameters 487 !!-------------------------------- 488 ! 489 !- 490 ! condveg 619 620 ! 2. Arrays 621 622 ! Default soil texture distribution in the following order : 623 ! sand, loam and clay 624 REAL(r_std),SAVE, DIMENSION(nstm) :: soiltype_default = (/ 0.0, 1.0, 0.0 /) 625 626 627 628 629 !-----------------------------! 630 ! STOMATE AND LPJ PARAMETERS ! 631 !-----------------------------! 632 633 !- 634 ! stomate_alloc 491 635 !- 492 ! to get z0 from height 493 REAL(r_std), SAVE :: z0_over_height = un/16. 494 ! Magic number which relates the height to the displacement height. 495 REAL(r_std), SAVE :: height_displacement = 0.75 496 !- 497 ! diffuco 498 !- 499 INTEGER(i_std), SAVE :: nlai = 20 ! dimension de tableau 500 ! used in diffuco_trans 501 REAL(r_std), SAVE :: laimax = 12. 502 REAL(r_std), SAVE :: xc4_1 = .83 503 REAL(r_std), SAVE :: xc4_2 = .93 504 !- 505 ! hydrol. 506 !- 507 ! Allowed moisture above mcs (boundary conditions) 508 REAL(r_std), SAVE :: dmcs = 0.002 509 ! Allowed moisture below mcr (boundary conditions) 510 REAL(r_std), SAVE :: dmcr = 0.002 511 !- 512 ! routing 513 !- 514 ! Parameter for the Kassel irrigation parametrization linked to the crops 515 REAL(r_std), SAVE :: crop_coef = 1.5 516 !- 517 ! slowproc 518 !- 519 REAL(r_std), SAVE :: clayfraction_default = 0.2 636 REAL(r_std), PARAMETER :: max_possible_lai = 10. 637 REAL(r_std), PARAMETER :: Nlim_Q10 = 10. 638 !- 639 ! stomate_litter 640 !- 641 REAL(r_std), PARAMETER :: Q10 = 10. 642 ! 643 644 ! DS 31/03/2011 test new organization 645 ! List of Externalized Parameters by modules 646 647 648 !----------------------! 649 ! lpj_constraints.f90 ! 650 !----------------------! 651 520 652 521 !----------------------------- 522 ! STOMATE AND LPJ PARAMETERS 523 !----------------------------- 524 ! 525 !- 526 ! lpj_constraints 527 !- 653 ! 1. Scalar 654 528 655 ! longest sustainable time without regeneration (vernalization) 529 656 REAL(r_std), SAVE :: too_long = 5. 530 ! 531 !- 532 ! lpj_fire 533 !- 657 658 659 !--------------------! 660 ! lpj_establish.f90 ! 661 !--------------------! 662 663 ! 1. Scalar 664 ! Maximum tree establishment rate 665 REAL(r_std),SAVE :: estab_max_tree = 0.12 666 ! Maximum grass establishment rate 667 REAL(r_std),SAVE :: estab_max_grass = 0.12 668 669 ! 3. Coefficients of equations 670 671 REAL(r_std), SAVE :: establish_scal_fact = 15. 672 REAL(r_std), SAVE :: fpc_crit_max = .075 673 REAL(r_std), SAVE :: fpc_crit_min= .05 674 675 676 !---------------! 677 ! lpj_fire.f90 ! 678 !---------------! 679 680 ! 1. Scalar 681 534 682 ! Time scale for memory of the fire index (days). Validated for one year in the DGVM. 535 683 REAL(r_std), SAVE :: tau_fire = 30. 536 684 ! Critical litter quantity for fire 537 685 REAL(r_std), SAVE :: litter_crit = 200. 538 ! 539 !- 540 ! lpj_light 541 !- 686 687 ! 2. Arrays 688 689 ! What fraction of a burned plant compartment goes into the atmosphere 690 ! (rest into litter) 691 REAL(r_std), SAVE, DIMENSION(nparts) :: co2frac = (/ .95, .95, 0., 0.3, 0., 0., .95, .95 /) 692 693 694 ! 3. Coefficients of equations 695 696 REAL(r_std), SAVE, DIMENSION(3) :: bcfrac_coeff = (/ .3, 1.3, 88.2 /) 697 REAL(r_std), SAVE, DIMENSION(4) :: firefrac_coeff = (/ 0.45, 0.8, 0.6, 0.13 /) 698 699 700 !--------------! 701 ! lpj_gap.f90 ! 702 !--------------! 703 704 ! 1. Scalar 705 ! DS 15/06/2011 : the name of the parameter constant_mortality was replaced by its keyword 706 !!$ ! which kind of mortality 707 !!$ LOGICAL, SAVE :: constant_mortality = .TRUE. 708 709 ! 3. Coefficients of equations 710 711 REAL(r_std), SAVE :: availability_fact = 0.02 712 REAL(r_std), SAVE :: vigour_ref = 0.17 713 REAL(r_std), SAVE :: vigour_coeff = 70. 714 715 716 !----------------! 717 ! lpj_light.f90 ! 718 !----------------! 719 720 ! 1. Scalar 721 542 722 ! maximum total number of grass individuals in a closed canopy 543 723 REAL(r_std), SAVE :: grass_mercy = 0.01 … … 547 727 ! to fpc of last time step (F)? 548 728 LOGICAL, SAVE :: annual_increase = .TRUE. 549 ! 550 !- 551 ! lpj_pftinout 552 !- 729 ! For trees, minimum fraction of crown area occupied 730 ! (due to its branches etc.) 731 ! This means that only a small fraction of its crown area 732 ! can be invaded by other trees. 733 REAL(r_std),SAVE :: min_cover = 0.05 734 735 736 !------------------! 737 ! lpj_pftinout.f90 ! 738 !------------------! 739 740 ! 1. Scalar 741 553 742 ! minimum availability 554 743 REAL(r_std), SAVE :: min_avail = 0.01 555 ! 556 !- 557 ! stomate_alloc 558 !- 744 ! initial density of individuals 745 REAL(r_std),SAVE :: ind_0 = 0.02 746 747 ! 2. Arrays 748 749 ! 3. Coefficients of equations 750 751 REAL(r_std), SAVE :: RIP_time_min = 1.25 752 REAL(r_std), SAVE :: npp_longterm_init = 10. 753 REAL(r_std), SAVE :: everywhere_init = 0.05 754 755 756 757 !-------------------! 758 ! stomate_alloc.f90 ! 759 !-------------------! 760 761 ! 1. Scalar 762 559 763 ! Do we try to reach a minimum reservoir even if we are severely stressed? 560 764 LOGICAL, SAVE :: ok_minres = .TRUE. … … 582 786 ! scaling depth for nitrogen limitation (m) 583 787 REAL(r_std), SAVE :: z_nitrogen = 0.2 584 ! 585 !- 586 ! stomate_data 587 !- 588 !!------------------------------- 589 !! Parameters for the pipe model 590 !!------------------------------ 591 !- 788 789 790 ! 2. Arrays 791 792 793 ! 3. Coefficients of equations 794 795 REAL(r_std), SAVE :: lai_max_to_happy = 0.5 796 REAL(r_std), SAVE :: Nlim_tref = 25. 797 798 799 !------------------! 800 ! stomate_data.f90 ! 801 !------------------! 802 ! 1. Scalar 803 804 ! 805 ! 1.1 Parameters for the pipe model 806 ! 592 807 ! crown area = pipe_tune1. stem diameter**(1.6) (Reinicke's theory) 593 808 REAL(r_std),SAVE :: pipe_tune1 = 100.0 … … 601 816 ! one more SAVE 602 817 REAL(r_std),SAVE :: pipe_k1 = 8.e3 603 ! 604 !- 605 ! Maximum tree establishment rate 606 REAL(r_std),SAVE :: estab_max_tree = 0.12 607 ! Maximum grass establishment rate 608 REAL(r_std),SAVE :: estab_max_grass = 0.12 609 ! initial density of individuals 610 REAL(r_std),SAVE :: ind_0 = 0.02 611 ! For trees, minimum fraction of crown area occupied 612 ! (due to its branches etc.) 613 ! This means that only a small fraction of its crown area 614 ! can be invaded by other trees. 615 REAL(r_std),SAVE :: min_cover = 0.05 616 !- 617 ! alpha's : ? 618 REAL(r_std),SAVE :: alpha_grass = .5 619 REAL(r_std),SAVE :: alpha_tree = 1. 620 !- 621 ! maximum reference long term temperature (K) 622 REAL(r_std),SAVE :: tlong_ref_max = 303.1 623 ! minimum reference long term temperature (K) 624 REAL(r_std),SAVE :: tlong_ref_min = 253.1 625 ! 626 !! LOGICAL 627 !- 628 ! Do we treat PFT expansion across a grid point after introduction? 629 ! default = .FALSE. 630 LOGICAL,SAVE :: treat_expansion = .FALSE. 631 ! 632 ! herbivores? 633 LOGICAL,SAVE :: ok_herbivores = .FALSE. 634 ! 635 ! harvesting ? 636 LOGICAL,SAVE :: harvest_agri = .TRUE. 637 !!---------------------- 638 !! climatic parameters 639 !!--------------------- 818 ! pipe tune exponential coeff 819 REAL(r_std), SAVE :: pipe_tune_exp_coeff = 1.6 820 821 ! 822 ! 1.2 climatic parameters 640 823 ! 641 824 ! minimum precip, in mm/year … … 645 828 ! critical fpc, needed for light competition and establishment 646 829 REAL(r_std),SAVE :: fpc_crit = 0.95 647 !- 648 ! fraction of GPP which is lost as growth respiration 649 REAL(r_std),SAVE :: frac_growthresp = 0.28 650 ! 651 !- 830 831 ! 832 ! 1.3 sapling characteristics 833 ! 834 ! alpha's : ? 835 REAL(r_std),SAVE :: alpha_grass = .5 836 REAL(r_std),SAVE :: alpha_tree = 1. 652 837 ! mass ratio (heartwood+sapwood)/sapwood 653 838 REAL(r_std), SAVE :: mass_ratio_heart_sap = 3. 654 ! 655 !!--------------------------------------------------------- 656 ! time scales for phenology and other processes (in days) 657 !!--------------------------------------------------------- 839 ! fraction of GPP which is lost as growth respiration 840 REAL(r_std),SAVE :: frac_growthresp = 0.28 841 842 ! 843 ! 1.4 time scales for phenology and other processes (in days) 658 844 ! 659 845 REAL(r_std), SAVE :: tau_hum_month = 20. … … 667 853 REAL(r_std), SAVE :: tau_ngd = 50. 668 854 REAL(r_std), SAVE :: coeff_tau_longterm = 3. 669 ! used in stomate_data and in stomate_season670 855 REAL(r_std), SAVE :: tau_longterm 671 ! 672 !- 673 ! stomate_litter 674 !- 675 ! scaling depth for soil activity (m) 676 REAL(r_std), SAVE :: z_decomp = 0.2 677 ! 678 !- 679 ! stomate_lpj 680 !- 681 REAL(r_std), SAVE :: frac_turnover_daily = 0.55 682 ! 683 !- 684 ! stomate_npp 685 !- 686 ! maximum fraction of allocatable biomass used for maintenance respiration 687 REAL(r_std), SAVE :: tax_max = 0.8 688 ! 689 !- 690 ! stomate_phenology 691 !- 692 ! take carbon from atmosphere if carbohydrate reserve too small? 693 LOGICAL, SAVE :: always_init = .FALSE. 694 ! minimum time (d) since last beginning of a growing season 695 REAL(r_std), SAVE :: min_growthinit_time = 300. 696 ! moisture availability above which moisture tendency doesn't matter 697 REAL(r_std), SAVE :: moiavail_always_tree = 1.0 698 REAL(r_std), SAVE :: moiavail_always_grass = 0.6 699 ! monthly temp. above which temp. tendency doesn't matter 700 REAL(r_std), SAVE :: t_always 701 REAL(r_std), SAVE :: t_always_add = 10. 702 ! 703 !- 704 ! stomate_season 705 !- 706 ! rapport maximal GPP/GGP_max pour dormance 707 REAL(r_std), SAVE :: gppfrac_dormance = 0.2 708 ! minimum gpp considered as not "lowgpp" 709 REAL(r_std), SAVE :: min_gpp_allowed = 0.3 710 ! tau (year) for "climatologic variables 711 REAL(r_std), SAVE :: tau_climatology = 20 712 ! parameters for herbivore activity 713 REAL(r_std), SAVE :: hvc1 = 0.019 714 REAL(r_std), SAVE :: hvc2 = 1.38 715 REAL(r_std), SAVE :: leaf_frac_hvc =.33 716 ! 717 !- 718 ! stomate_vmax 719 !- 720 ! offset (minimum relative vcmax) 721 REAL(r_std), SAVE :: vmax_offset = 0.3 722 ! leaf age at which vmax attains vcmax_opt (in fraction of critical leaf age) 723 REAL(r_std), SAVE :: leafage_firstmax = 0.03 724 ! leaf age at which vmax falls below vcmax_opt (in fraction of critical leaf age) 725 REAL(r_std), SAVE :: leafage_lastmax = 0.5 726 ! leaf age at which vmax attains its minimum (in fraction of critical leaf age) 727 REAL(r_std), SAVE :: leafage_old = 1. 728 729 730 !-------------------------- 731 !-------------------------- 732 ! ARRAYS-PARAMETERS 733 !-------------------------- 734 !-------------------------- 735 !- 736 ! condveg 737 !- 738 ! The correspondance table for the soil color numbers and their albedo 739 ! 740 REAL(r_std), DIMENSION(classnb) :: vis_dry = (/0.24, 0.22, 0.20, 0.18, 0.16, 0.14, 0.12, 0.10, 0.27/) 741 REAL(r_std), DIMENSION(classnb) :: nir_dry = (/0.48, 0.44, 0.40, 0.36, 0.32, 0.28, 0.24, 0.20, 0.55/) 742 REAL(r_std), DIMENSION(classnb) :: vis_wet = (/0.12, 0.11, 0.10, 0.09, 0.08, 0.07, 0.06, 0.05, 0.15/) 743 REAL(r_std), DIMENSION(classnb) :: nir_wet = (/0.24, 0.22, 0.20, 0.18, 0.16, 0.14, 0.12, 0.10, 0.31/) 744 ! 745 ! Nathalie, introduction d'un albedo moyen, VIS+NIR 746 ! Les valeurs suivantes correspondent a la moyenne des valeurs initiales 747 ! REAL(stnd), DIMENSION(classnb) :: albsoil_vis = (/0.18, 0.165, 0.15, 0.135, 0.12, 0.105, 0.09, 0.075, 0.21/) 748 ! REAL(stnd), DIMENSION(classnb) :: albsoil_nir = (/0.36, 0.33, 0.30, 0.27, 0.24, 0.21, 0.18, 0.15, 0.43/) 749 ! les valeurs retenues accentuent le contraste entre equateur et Sahara. 750 ! On diminue aussi l'albedo des deserts (tous sauf Sahara) 751 REAL(r_std), DIMENSION(classnb) :: albsoil_vis = (/0.18, 0.16, 0.16, 0.15, 0.12, 0.105, 0.09, 0.075, 0.25/) 752 REAL(r_std), DIMENSION(classnb) :: albsoil_nir = (/0.36, 0.34, 0.34, 0.33, 0.30, 0.25, 0.20, 0.15, 0.45/) 753 754 !- 755 ! lpj_fire 756 !- 757 758 ! What fraction of a burned plant compartment goes into the atmosphere 759 ! (rest into litter) 760 REAL(r_std), SAVE, DIMENSION(nparts) :: co2frac = (/ .95, .95, 0., 0.3, 0., 0., .95, .95 /) 761 762 !- 763 ! stomate_litter 764 !- 765 766 ! C/N ratio 767 REAL(r_std), SAVE, DIMENSION(nparts) :: CN = 40.0 768 ! Lignine/C ratio of the different plant parts 769 REAL(r_std), SAVE, DIMENSION(nparts) :: LC = (/ 0.22, 0.35, 0.35, 0.35, 0.35, 0.22, 0.22, 0.22 /) 770 ! corresponding to frac_soil(istructural,iactive,iabove) 771 REAL(r_std), SAVE :: frac_soil_struct_aa = .55 772 ! corresponding to frac_soil(istructural,iactive,ibelow) 773 REAL(r_std), SAVE :: frac_soil_struct_ab = .45 774 ! corresponding to frac_soil(istructural,islow,iabove) 775 REAL(r_std), SAVE :: frac_soil_struct_sa = .7 776 ! corresponding to frac_soil(istructural,islow,ibelow) 777 REAL(r_std), SAVE :: frac_soil_struct_sb = .7 778 ! corresponding to frac_soil(imetabolic,iactive,iabove) 779 REAL(r_std), SAVE :: frac_soil_metab_aa = .45 780 ! corresponding to frac_soil(imetabolic,iactive,ibelow) 781 REAL(r_std), SAVE :: frac_soil_metab_ab = .45 782 !- 783 ! stomate_soilcarbon 784 !- 785 ! frac_carb_coefficients 786 ! from active pool: depends on clay content 787 ! correspnding to frac_carb(:,iactive,iactive) 788 REAL(r_std), SAVE :: frac_carb_aa = 0.0 789 ! correspnding to frac_carb(:,iactive,ipassive) 790 REAL(r_std), SAVE :: frac_carb_ap = 0.004 791 !frac_carb(;;iactive,islow) is computed in stomate_soilcarbon.f90 792 !- 793 ! from slow pool 794 ! correspnding to frac_carb(:,islow,islow) 795 REAL(r_std), SAVE :: frac_carb_ss = 0.0 796 ! correspnding to frac_carb(:,islow,iactive) 797 REAL(r_std), SAVE :: frac_carb_sa = .42 798 ! correspnding to frac_carb(:,islow,ipassive) 799 REAL(r_std), SAVE :: frac_carb_sp = .03 800 !- 801 ! from passive pool 802 ! correspnding to frac_carb(:,ipassive,ipassive) 803 REAL(r_std), SAVE :: frac_carb_pp = .0 804 ! correspnding to frac_carb(:,ipassive,iactive) 805 REAL(r_std), SAVE :: frac_carb_pa = .45 806 ! correspnding to frac_carb(:,ipassive,islow) 807 REAL(r_std), SAVE :: frac_carb_ps = .0 808 809 810 !---------------------------------------- 811 !--------------------------------------- 812 ! COEFFICIENTS OF EQUATIONS 813 !------------------------------------- 814 !--------------------------------------- 815 816 !--------- 817 ! SECHIBA 818 !--------- 819 !- 820 ! diffuco 821 !- 822 REAL(r_std),PARAMETER :: Tetens_1 = 0.622 823 REAL(r_std),PARAMETER :: Tetens_2 = 0.378 824 REAL(r_std),PARAMETER :: std_ci_frac = 0.667 825 REAL(r_std),PARAMETER :: alpha_j = 0.8855 826 REAL(r_std),PARAMETER :: curve_assim = 0.7 827 REAL(r_std),PARAMETER :: WJ_coeff1 = 4.5 828 REAL(r_std),PARAMETER :: WJ_coeff2 = 10.5 829 REAL(r_std),PARAMETER :: Vc_to_Rd_ratio = 0.011 830 REAL(r_std),PARAMETER :: O2toCO2_stoechio = 1.6 831 REAL(r_std),PARAMETER :: mmol_to_m_1 = 0.0244 832 REAL(r_std),PARAMETER :: RG_to_PAR = 0.5 833 REAL(r_std),PARAMETER :: W_to_mmol = 4.6 ! W_to_mmol * RG_to_PAR = 2.3 834 ! 835 REAL(r_std), SAVE :: lai_level_depth = .15 836 REAL(r_std), SAVE :: x1_coef = 0.177 837 REAL(r_std), SAVE :: x1_Q10 = 0.069 838 REAL(r_std), SAVE :: quantum_yield = 0.092 839 REAL(r_std), SAVE :: kt_coef = 0.7 840 REAL(r_std), SAVE :: kc_coef = 39.09 841 REAL(r_std), SAVE :: Ko_Q10 = .085 842 REAL(r_std), SAVE :: Oa = 210000. 843 REAL(r_std), SAVE :: Ko_coef = 2.412 844 REAL(r_std), SAVE :: CP_0 = 42. 845 REAL(r_std), SAVE :: CP_temp_coef = 9.46 846 REAL(r_std), SAVE :: CP_temp_ref = 25. 847 ! 848 REAL(r_std), SAVE, DIMENSION(2) :: rt_coef = (/ 0.8, 1.3 /) 849 REAL(r_std), SAVE, DIMENSION(2) :: vc_coef = (/ 0.39, 0.3 /) 850 ! 851 ! coefficients of the polynome of degree 5 used inthe equation of coeff_dew_veg 852 REAL(r_std), SAVE, DIMENSION(6) :: dew_veg_poly_coeff = & 853 & (/ 0.887773, 0.205673, 0.110112, 0.014843, 0.000824, 0.000017 /) 854 855 !--------- 856 ! LPJ 857 !--------- 858 !- 859 ! lpj_crown 860 !- 861 REAL(r_std), SAVE :: pipe_tune_exp_coeff = 1.6 862 ! 863 !- 864 ! lpj_establish 865 !- 866 REAL(r_std), SAVE :: establish_scal_fact = 15. 867 REAL(r_std), SAVE :: fpc_crit_max = .075 868 REAL(r_std), SAVE :: fpc_crit_min= .05 869 ! 870 !- 871 ! lpj_fire 872 !- 873 REAL(r_std), SAVE, DIMENSION(3) :: bcfrac_coeff = (/ .3, 1.3, 88.2 /) 874 REAL(r_std), SAVE, DIMENSION(4) :: firefrac_coeff = (/ 0.45, 0.8, 0.6, 0.13 /) 875 ! 876 !- 877 ! lpj_gap 878 !- 879 REAL(r_std), SAVE :: availability_fact = 0.02 880 REAL(r_std), SAVE :: vigour_ref = 0.17 881 REAL(r_std), SAVE :: vigour_coeff = 70. 882 !- 883 ! lpj_pftinout 884 !- 885 REAL(r_std), SAVE :: RIP_time_min = 1.25 886 REAL(r_std), SAVE :: npp_longterm_init = 10. 887 REAL(r_std), SAVE :: everywhere_init = 0.05 888 ! 889 890 !--------- 891 ! STOMATE 892 !--------- 893 !- 894 ! stomate_alloc 895 !- 896 REAL(r_std), PARAMETER :: max_possible_lai = 10. 897 REAL(r_std), PARAMETER :: Nlim_Q10 = 10. 898 ! 899 REAL(r_std), SAVE :: lai_max_to_happy = 0.5 900 REAL(r_std), SAVE :: Nlim_tref = 25. 901 ! 902 !- 903 ! stomate_data 904 !- 856 857 ! 3. Coefficients of equations 858 905 859 REAL(r_std), SAVE :: bm_sapl_carbres = 5. 906 860 REAL(r_std), SAVE :: bm_sapl_sapabove = 0.5 … … 920 874 REAL(r_std), SAVE, DIMENSION(2) :: maxdia_coeff =(/ 100., 0.01/) 921 875 REAL(r_std), SAVE, DIMENSION(4) :: bm_sapl_leaf = (/ 4., 4., .8, 5./) 922 ! 923 !- 924 ! stomate_litter 925 !- 926 REAL(r_std), PARAMETER :: Q10 = 10. 927 ! 928 REAL(r_std), SAVE :: metabolic_ref_frac = 0.85 876 877 878 879 !--------------------! 880 ! stomate_litter.f90 ! 881 !--------------------! 882 883 884 ! 1. Scalar 885 886 ! scaling depth for soil activity (m) 887 REAL(r_std), SAVE :: z_decomp = 0.2 888 889 ! 2. Arrays 890 891 ! C/N ratio 892 REAL(r_std), SAVE, DIMENSION(nparts) :: CN = 40.0 893 ! Lignine/C ratio of the different plant parts 894 REAL(r_std), SAVE, DIMENSION(nparts) :: LC = (/ 0.22, 0.35, 0.35, 0.35, 0.35, 0.22, 0.22, 0.22 /) 895 ! corresponding to frac_soil(istructural,iactive,iabove) 896 REAL(r_std), SAVE :: frac_soil_struct_aa = .55 897 ! corresponding to frac_soil(istructural,iactive,ibelow) 898 REAL(r_std), SAVE :: frac_soil_struct_ab = .45 899 ! corresponding to frac_soil(istructural,islow,iabove) 900 REAL(r_std), SAVE :: frac_soil_struct_sa = .7 901 ! corresponding to frac_soil(istructural,islow,ibelow) 902 REAL(r_std), SAVE :: frac_soil_struct_sb = .7 903 ! corresponding to frac_soil(imetabolic,iactive,iabove) 904 REAL(r_std), SAVE :: frac_soil_metab_aa = .45 905 ! corresponding to frac_soil(imetabolic,iactive,ibelow) 906 REAL(r_std), SAVE :: frac_soil_metab_ab = .45 907 908 ! 3. Coefficients of equations 909 910 REAL(r_std), SAVE :: metabolic_ref_frac = 0.85 ! used by litter and soilcarbon 929 911 REAL(r_std), SAVE :: metabolic_LN_ratio = 0.018 930 912 REAL(r_std), SAVE :: tau_metabolic = .066 … … 934 916 REAL(r_std), SAVE :: litter_struct_coef = 3. 935 917 REAL(r_std), SAVE, DIMENSION(3) :: moist_coeff = (/ 1.1, 2.4, 0.29 /) 936 ! 937 !- 938 ! stomate_phenology 939 !- 918 919 920 921 !-----------------! 922 ! stomate_lpj.f90 ! 923 !-----------------! 924 925 ! 1. Scalar 926 927 REAL(r_std), SAVE :: frac_turnover_daily = 0.55 928 929 930 !-----------------! 931 ! stomate_npp.f90 ! 932 !-----------------! 933 934 ! 1. Scalar 935 936 ! maximum fraction of allocatable biomass used for maintenance respiration 937 REAL(r_std), SAVE :: tax_max = 0.8 938 939 940 !-----------------------! 941 ! stomate_phenology.f90 ! 942 !-----------------------! 943 944 945 946 ! 1. Scalar 947 948 ! take carbon from atmosphere if carbohydrate reserve too small? 949 LOGICAL, SAVE :: always_init = .FALSE. 950 ! minimum time (d) since last beginning of a growing season 951 REAL(r_std), SAVE :: min_growthinit_time = 300. 952 ! moisture availability above which moisture tendency doesn't matter 953 REAL(r_std), SAVE :: moiavail_always_tree = 1.0 954 REAL(r_std), SAVE :: moiavail_always_grass = 0.6 955 ! monthly temp. above which temp. tendency doesn't matter 956 REAL(r_std), SAVE :: t_always 957 REAL(r_std), SAVE :: t_always_add = 10. 958 959 ! 3. Coefficients of equations 960 940 961 REAL(r_std), SAVE :: gddncd_ref = 603. 941 962 REAL(r_std), SAVE :: gddncd_curve = 0.0091 942 963 REAL(r_std), SAVE :: gddncd_offset = 64. 943 ! 944 !- 945 ! stomate_prescribe 946 !- 964 965 966 967 968 !-----------------------! 969 ! stomate_prescribe.f90 ! 970 !-----------------------! 971 972 ! 3. Coefficients of equations 973 947 974 REAL(r_std), SAVE :: cn_tree = 4. 948 975 REAL(r_std), SAVE :: bm_sapl_rescale = 40. 949 ! 950 !- 951 ! stomate_resp 952 !- 976 977 978 979 !------------------! 980 ! stomate_resp.f90 ! 981 !------------------! 982 983 ! 3. Coefficients of equations 984 953 985 REAL(r_std), SAVE :: maint_resp_min_vmax = 0.3 954 986 REAL(r_std), SAVE :: maint_resp_coeff = 1.4 955 ! 956 !- 957 ! stomate_season 958 !- 959 REAL(r_std), SAVE :: ncd_max_year = 3. 960 REAL(r_std), SAVE :: gdd_threshold = 5. 961 REAL(r_std), SAVE :: green_age_ever = 2. 962 REAL(r_std), SAVE :: green_age_dec = 0.5 963 !- 964 ! stomate_soilcarbon 965 !- 987 988 989 990 !------------------------! 991 ! stomate_soilcarbon.f90 ! 992 !------------------------! 993 994 ! 2. Arrays 995 996 ! frac_carb_coefficients 997 ! from active pool: depends on clay content 998 ! correspnding to frac_carb(:,iactive,iactive) 999 REAL(r_std), SAVE :: frac_carb_aa = 0.0 1000 ! correspnding to frac_carb(:,iactive,ipassive) 1001 REAL(r_std), SAVE :: frac_carb_ap = 0.004 1002 !frac_carb(;;iactive,islow) is computed in stomate_soilcarbon.f90 1003 !- 1004 ! from slow pool 1005 ! correspnding to frac_carb(:,islow,islow) 1006 REAL(r_std), SAVE :: frac_carb_ss = 0.0 1007 ! correspnding to frac_carb(:,islow,iactive) 1008 REAL(r_std), SAVE :: frac_carb_sa = .42 1009 ! correspnding to frac_carb(:,islow,ipassive) 1010 REAL(r_std), SAVE :: frac_carb_sp = .03 1011 !- 1012 ! from passive pool 1013 ! correspnding to frac_carb(:,ipassive,ipassive) 1014 REAL(r_std), SAVE :: frac_carb_pp = .0 1015 ! correspnding to frac_carb(:,ipassive,iactive) 1016 REAL(r_std), SAVE :: frac_carb_pa = .45 1017 ! correspnding to frac_carb(:,ipassive,islow) 1018 REAL(r_std), SAVE :: frac_carb_ps = .0 1019 1020 1021 ! 3. Coefficients of equations 1022 966 1023 REAL(r_std), SAVE :: active_to_pass_clay_frac = .68 967 1024 !residence times in carbon pools (days) … … 971 1028 ! 972 1029 REAL(r_std), SAVE, DIMENSION(3) :: flux_tot_coeff = (/ 1.2, 1.4, .75/) 973 ! 974 !- 975 ! stomate_turnover 976 !- 1030 1031 1032 1033 !----------------------! 1034 ! stomate_turnover.f90 ! 1035 !----------------------! 1036 1037 ! 3.Coefficients of equations 1038 977 1039 REAL(r_std), SAVE :: new_turnover_time_ref = 20. 978 1040 REAL(r_std), SAVE :: dt_turnover_time = 10. … … 980 1042 REAL(r_std), SAVE, DIMENSION(3) :: leaf_age_crit_coeff = (/ 1.5, 0.75, 10./) 981 1043 982 !************************************************************** 1044 1045 1046 1047 !------------------! 1048 ! stomate_vmax.f90 ! 1049 !------------------! 1050 1051 ! 1. Scalar 1052 1053 ! offset (minimum relative vcmax) 1054 REAL(r_std), SAVE :: vmax_offset = 0.3 1055 ! leaf age at which vmax attains vcmax_opt (in fraction of critical leaf age) 1056 REAL(r_std), SAVE :: leafage_firstmax = 0.03 1057 ! leaf age at which vmax falls below vcmax_opt (in fraction of critical leaf age) 1058 REAL(r_std), SAVE :: leafage_lastmax = 0.5 1059 ! leaf age at which vmax attains its minimum (in fraction of critical leaf age) 1060 REAL(r_std), SAVE :: leafage_old = 1. 1061 1062 1063 1064 !--------------------! 1065 ! stomate_season.f90 ! 1066 !--------------------! 1067 1068 1069 ! 1. Scalar 1070 1071 ! rapport maximal GPP/GGP_max pour dormance 1072 REAL(r_std), SAVE :: gppfrac_dormance = 0.2 1073 ! minimum gpp considered as not "lowgpp" 1074 REAL(r_std), SAVE :: min_gpp_allowed = 0.3 1075 ! tau (year) for "climatologic variables 1076 REAL(r_std), SAVE :: tau_climatology = 20 1077 ! parameters for herbivore activity 1078 REAL(r_std), SAVE :: hvc1 = 0.019 1079 REAL(r_std), SAVE :: hvc2 = 1.38 1080 REAL(r_std), SAVE :: leaf_frac_hvc =.33 1081 ! maximum reference long term temperature (K) 1082 REAL(r_std),SAVE :: tlong_ref_max = 303.1 1083 ! minimum reference long term temperature (K) 1084 REAL(r_std),SAVE :: tlong_ref_min = 253.1 1085 1086 ! 3. Coefficients of equations 1087 1088 REAL(r_std), SAVE :: ncd_max_year = 3. 1089 REAL(r_std), SAVE :: gdd_threshold = 5. 1090 REAL(r_std), SAVE :: green_age_ever = 2. 1091 REAL(r_std), SAVE :: green_age_dec = 0.5 1092 1093 983 1094 984 1095 CONTAINS 985 1096 986 ! Subroutine called for getin the new parameters values used in sechiba 987 ! 988 SUBROUTINE getin_sechiba_parameters 989 990 IMPLICIT NONE 991 ! first call 992 LOGICAL, SAVE :: first_call = .TRUE. 993 994 IF(first_call) THEN 995 996 !!$ CALL getin('DIAG_QSAT',diag_qsat) 997 ! 998 CALL getin('QWILT',qwilt) 999 CALL getin('MIN_RESDIS',min_resdis) 1000 CALL getin('MIN_DRAIN',min_drain) 1001 CALL getin('MAX_DRAIN',max_drain) 1002 CALL getin('EXP_DRAIN',exp_drain) 1003 CALL getin('MX_EAU_EAU',mx_eau_eau) 1004 CALL getin('RSOL_CSTE',rsol_cste) 1005 CALL getin('HCRIT_LITTER',hcrit_litter) 1006 !- 1007 CALL getin('SOILTYPE_DEFAULT',soiltype_default) 1008 !- 1009 CALL getin('MAXMASS_GLACIER',maxmass_glacier) 1010 CALL getin('MIN_VEGFRAC',min_vegfrac) 1011 !- 1012 CALL getin('SNOWCRI',snowcri) 1013 !- 1014 CALL getin('SNOWCRI_ALB',snowcri_alb) 1015 CALL getin('MIN_WIND',min_wind) 1016 CALL getin('Z0_BARE',z0_bare) 1017 CALL getin('Z0_ICE',z0_ice) 1018 CALL getin('TCST_SNOWA',tcst_snowa) 1019 CALL getin('MAX_SNOW_AGE',max_snow_age) 1020 CALL getin('SNOW_TRANS',snow_trans) 1021 CALL getin('ALB_DEADLEAF',alb_deadleaf) 1022 CALL getin('ALB_ICE',alb_ice) 1023 !- 1024 CALL getin('Z0_OVER_HEIGHT',z0_over_height) 1025 CALL getin('HEIGHT_DISPLACEMENT',height_displacement) 1026 !- 1027 CALL getin('NLAI',nlai) 1028 CALL getin('LAIMAX',laimax) 1029 CALL getin('XC4_1',xc4_1) 1030 CALL getin('XC4_2',xc4_2) 1031 !- 1032 CALL getin('DMCS',dmcs) 1033 CALL getin('DMCR',dmcr) 1034 !- 1035 CALL getin('VIS_DRY',vis_dry) 1036 CALL getin('NIR_DRY',nir_dry) 1037 CALL getin('VIS_WET',vis_wet) 1038 CALL getin('NIR_WET',nir_wet) 1039 CALL getin('ALBSOIL_VIS',albsoil_vis) 1040 CALL getin('ALBSOIL_NIR',albsoil_nir) 1041 !- 1042 CALL getin('CLAYFRACTION_DEFAULT',clayfraction_default) 1043 ! 1044 CALL getin('DEW_VEG_POLY_COEFF',dew_veg_poly_coeff) 1045 1046 first_call =.FALSE. 1047 1048 ENDIF 1049 1050 END SUBROUTINE getin_sechiba_parameters 1051 1052 !********************************************************* 1053 1054 ! Subroutine called only if river_routing is activated 1055 1056 SUBROUTINE getin_routing_parameters 1057 1058 IMPLICIT NONE 1059 1060 LOGICAL, SAVE :: first_call = .TRUE. 1061 1062 IF(first_call) THEN 1063 1064 CALL getin('CROP_COEF',crop_coef) 1065 1066 first_call =.FALSE. 1067 1068 ENDIF 1069 1070 END SUBROUTINE getin_routing_parameters 1071 1072 !******************************************************* 1073 1074 ! Subroutine called only if hydrol_cwrr is activated 1075 1076 SUBROUTINE getin_hydrol_cwrr_parameters 1077 1078 IMPLICIT NONE 1079 1080 LOGICAL, SAVE :: first_call = .TRUE. 1081 1097 SUBROUTINE getin_sechiba_parameters 1098 1099 IMPLICIT NONE 1100 ! first call 1101 LOGICAL, SAVE :: first_call = .TRUE. 1102 1103 IF(first_call) THEN 1104 1105 ! Global 1106 ! DS by global I mean the parameters used by two or more modules 1107 ! Example : the common parameters for both hydrology models 1108 CALL getin_p('MAXMASS_GLACIER',maxmass_glacier) 1109 CALL getin_p('SNOWCRI',snowcri) 1110 CALL getin_p('SECHIBA_QSINT', qsintcst) 1111 WRITE(numout, *)' SECHIBA_QSINT, qsintcst = ', qsintcst 1112 CALL getin_p("HYDROL_SOIL_DEPTH", dpu_cste) 1113 ! 1114 CALL getin_p('MIN_WIND',min_wind) 1115 CALL getin_p('MAX_SNOW_AGE',max_snow_age) 1116 CALL getin_p('SNOW_TRANS',snow_trans) 1117 CALL getin_p('MX_EAU_EAU',mx_eau_eau) 1118 !- 1119 ! condveg 1120 CALL getin_p('Z0_OVER_HEIGHT',z0_over_height) 1121 CALL getin_p('HEIGHT_DISPLACEMENT',height_displacement) 1122 CALL getin_p('Z0_BARE',z0_bare) 1123 CALL getin_p('Z0_ICE',z0_ice) 1124 CALL getin_p('TCST_SNOWA',tcst_snowa) 1125 CALL getin_p('SNOWCRI_ALB',snowcri_alb) 1126 ! 1127 CALL getin_p('VIS_DRY',vis_dry) 1128 CALL getin_p('NIR_DRY',nir_dry) 1129 CALL getin_p('VIS_WET',vis_wet) 1130 CALL getin_p('NIR_WET',nir_wet) 1131 CALL getin_p('ALBSOIL_VIS',albsoil_vis) 1132 CALL getin_p('ALBSOIL_NIR',albsoil_nir) 1133 !- 1134 CALL getin_p('ALB_DEADLEAF',alb_deadleaf) 1135 CALL getin_p('ALB_ICE',alb_ice) 1136 !- 1137 ! diffuco 1138 ! DS the rest of diffuco parameters are only read when ok_co2 is set to TRUE 1139 CALL getin_p('NLAI',nlai) 1140 CALL getin_p('LAIMAX',laimax) 1141 CALL getin_p('XC4_1',xc4_1) 1142 CALL getin_p('XC4_2',xc4_2) 1143 CALL getin_p('DEW_VEG_POLY_COEFF',dew_veg_poly_coeff) 1144 !- 1145 ! slowproc 1146 CALL getin_p('CLAYFRACTION_DEFAULT',clayfraction_default) 1147 CALL getin_p('MIN_VEGFRAC',min_vegfrac) 1148 CALL getin_p('SOILTYPE_DEFAULT',soiltype_default) 1149 1150 1151 first_call =.FALSE. 1152 1153 ENDIF 1154 1155 END SUBROUTINE getin_sechiba_parameters 1156 ! 1157 != 1158 ! 1159 ! Subroutine called only if ok_co2 is activated 1160 ! only for diffuco_trans_co2 1161 1162 SUBROUTINE getin_co2_parameters 1163 1164 IMPLICIT NONE 1165 1166 LOGICAL, SAVE :: first_call = .TRUE. 1167 1168 IF(first_call) THEN 1169 1170 CALL getin_p('LAI_LEVEL_DEPTH',lai_level_depth) 1171 CALL getin_p('X1_COEF',x1_coef) 1172 CALL getin_p('X1_Q10',x1_Q10) 1173 CALL getin_p('QUANTUM_YIELD',quantum_yield) 1174 CALL getin_p('KT_COEF',kt_coef) 1175 CALL getin_p('KC_COEF',kc_coef) 1176 CALL getin_p('KO_Q10',Ko_Q10) 1177 CALL getin_p('OA',Oa) 1178 CALL getin_p('KO_COEF',Ko_coef) 1179 CALL getin_p('CP_0',CP_0) 1180 CALL getin_p('CP_TEMP_COEF',cp_temp_coef) 1181 CALL getin_p('CP_TEMP_REF',cp_temp_ref) 1182 CALL getin_p('RT_COEF',rt_coef) 1183 CALL getin_p('VC_COEF',vc_coef) 1184 1185 first_call =.FALSE. 1186 1187 ENDIF 1188 1189 END SUBROUTINE getin_co2_parameters 1190 ! 1191 != 1192 ! 1193 SUBROUTINE getin_hydrolc_parameters 1194 1195 LOGICAL, SAVE :: first_call = .TRUE. 1196 1197 IF(first_call) THEN 1198 1199 CALL getin_p('QWILT',qwilt) 1200 CALL getin_p('MIN_RESDIS',min_resdis) 1201 CALL getin_p('MIN_DRAIN',min_drain) 1202 CALL getin_p('MAX_DRAIN',max_drain) 1203 CALL getin_p('EXP_DRAIN',exp_drain) 1204 CALL getin_p('RSOL_CSTE',rsol_cste) 1205 CALL getin_p('HCRIT_LITTER',hcrit_litter) 1206 1207 first_call =.FALSE. 1208 1209 ENDIF 1210 1211 END SUBROUTINE getin_hydrolc_parameters 1212 1213 ! 1214 != 1215 ! 1216 ! Subroutine called only if hydrol_cwrr is activated 1217 1218 SUBROUTINE getin_hydrol_cwrr_parameters 1219 1220 IMPLICIT NONE 1221 1222 LOGICAL, SAVE :: first_call = .TRUE. 1223 1224 IF(first_call) THEN 1225 1226 CALL getin_p('W_TIME',w_time) 1227 CALL getin_p('NVAN',nvan) 1228 CALL getin_p('AVAN',avan) 1229 CALL getin_p('MCR',mcr) 1230 CALL getin_p('MCS',mcs) 1231 CALL getin_p('KS',ks) 1232 CALL getin_p('PCENT',pcent) 1233 CALL getin_p('FREE_DRAIN_MAX',free_drain_max) 1234 CALL getin_p('MCF',mcf) 1235 CALL getin_p('MCW',mcw) 1236 CALL getin_p('MC_AWET',mc_awet) 1237 1238 first_call =.FALSE. 1239 1240 ENDIF 1241 1242 END SUBROUTINE getin_hydrol_cwrr_parameters 1243 ! 1244 != 1245 ! 1246 SUBROUTINE getin_routing_parameters 1247 1248 IMPLICIT NONE 1249 1250 LOGICAL, SAVE :: first_call = .TRUE. 1251 1252 IF(first_call) THEN 1253 1254 CALL getin_p('CROP_COEF',crop_coef) 1255 1256 first_call =.FALSE. 1257 1258 ENDIF 1259 1260 END SUBROUTINE getin_routing_parameters 1261 ! 1262 != 1263 ! 1264 SUBROUTINE getin_stomate_parameters 1265 1266 IMPLICIT NONE 1267 1268 LOGICAL, SAVE :: first_call = .TRUE. 1269 1082 1270 IF(first_call) THEN 1083 1084 CALL getin('W_TIME',w_time) 1085 CALL getin('NVAN',nvan) 1086 CALL getin('AVAN',avan) 1087 CALL getin('MCR',mcr) 1088 CALL getin('MCS',mcs) 1089 CALL getin('KS',ks) 1090 CALL getin('PCENT',pcent) 1091 CALL getin('FREE_DRAIN_MAX',free_drain_max) 1092 CALL getin('MCF',mcf) 1093 CALL getin('MCW',mcw) 1094 CALL getin('MC_AWET',mc_awet) 1095 1096 first_call =.FALSE. 1097 1271 1272 ! constraints_parameters 1273 CALL getin_p('TOO_LONG',too_long) 1274 !- 1275 ! fire parameters 1276 CALL getin_p('TAU_FIRE',tau_fire) 1277 CALL getin_p('LITTER_CRIT',litter_crit) 1278 CALL getin_p('CO2FRAC',co2frac) 1279 CALL getin_p('BCFRAC_COEFF',bcfrac_coeff) 1280 CALL getin_p('FIREFRAC_COEFF',firefrac_coeff) 1281 !- 1282 ! gap parameters (+ lpj_const_mort) 1283 CALL getin_p('AVAILABILITY_FACT', availability_fact) 1284 CALL getin_p('VIGOUR_REF',vigour_ref) 1285 CALL getin_p('VIGOUR_COEFF',vigour_coeff) 1286 !- 1287 ! allocation parameters 1288 CALL getin_p('OK_MINRES',ok_minres) 1289 CALL getin_p('TAU_LEAFINIT', tau_leafinit) 1290 CALL getin_p('RESERVE_TIME_TREE',reserve_time_tree) 1291 CALL getin_p('RESERVE_TIME_GRASS',reserve_time_grass) 1292 CALL getin_p('R0',R0) 1293 CALL getin_p('S0',S0) 1294 CALL getin_p('F_FRUIT',f_fruit) 1295 CALL getin_p('ALLOC_SAP_ABOVE_TREE',alloc_sap_above_tree) 1296 CALL getin_p('ALLOC_SAP_ABOVE_GRASS',alloc_sap_above_grass) 1297 CALL getin_p('MIN_LTOLSR',min_LtoLSR) 1298 CALL getin_p('MAX_LTOLSR',max_LtoLSR) 1299 CALL getin_p('Z_NITROGEN',z_nitrogen) 1300 CALL getin_p('LAI_MAX_TO_HAPPY',lai_max_to_happy) 1301 CALL getin_p('NLIM_TREF',Nlim_tref) 1302 !- 1303 ! data parameters 1304 CALL getin_p('PIPE_TUNE1',pipe_tune1) 1305 CALL getin_p('PIPE_TUNE2',pipe_tune2) 1306 CALL getin_p('PIPE_TUNE3',pipe_tune3) 1307 CALL getin_p('PIPE_TUNE4',pipe_tune4) 1308 CALL getin_p('PIPE_DENSITY',pipe_density) 1309 CALL getin_p('PIPE_K1',pipe_k1) 1310 CALL getin_p('PIPE_TUNE_EXP_COEFF',pipe_tune_exp_coeff) 1311 ! 1312 CALL getin_p('PRECIP_CRIT',precip_crit) 1313 CALL getin_p('GDD_CRIT_ESTAB',gdd_crit_estab) 1314 CALL getin_p('FPC_CRIT',fpc_crit) 1315 CALL getin_p('ALPHA_GRASS',alpha_grass) 1316 CALL getin_p('ALPHA_TREE',alpha_tree) 1317 !- 1318 CALL getin_p('MASS_RATIO_HEART_SAP',mass_ratio_heart_sap) 1319 CALL getin_p('FRAC_GROWTHRESP',frac_growthresp) 1320 CALL getin_p('TAU_HUM_MONTH',tau_hum_month) 1321 CALL getin_p('TAU_HUM_WEEK',tau_hum_week) 1322 CALL getin_p('TAU_T2M_MONTH',tau_t2m_month) 1323 CALL getin_p('TAU_T2M_WEEK',tau_t2m_week) 1324 CALL getin_p('TAU_TSOIL_MONTH',tau_tsoil_month) 1325 CALL getin_p('TAU_SOILHUM_MONTH',tau_soilhum_month) 1326 CALL getin_p('TAU_GPP_WEEK',tau_gpp_week) 1327 CALL getin_p('TAU_GDD',tau_gdd) 1328 CALL getin_p('TAU_NGD',tau_ngd) 1329 CALL getin_p('COEFF_TAU_LONGTERM',coeff_tau_longterm) 1330 !- 1331 CALL getin_p('BM_SAPL_CARBRES',bm_sapl_carbres) 1332 CALL getin_p('BM_SAPL_SAPABOVE',bm_sapl_sapabove) 1333 CALL getin_p('BM_SAPL_HEARTABOVE',bm_sapl_heartabove) 1334 CALL getin_p('BM_SAPL_HEARTBELOW',bm_sapl_heartbelow) 1335 CALL getin_p('INIT_SAPL_MASS_LEAF_NAT',init_sapl_mass_leaf_nat) 1336 CALL getin_p('INIT_SAPL_MASS_LEAF_AGRI',init_sapl_mass_leaf_agri) 1337 CALL getin_p('INIT_SAPL_MASS_CARBRES',init_sapl_mass_carbres) 1338 CALL getin_p('INIT_SAPL_MASS_ROOT',init_sapl_mass_root) 1339 CALL getin_p('INIT_SAPL_MASS_FRUIT',init_sapl_mass_fruit) 1340 CALL getin_p('CN_SAPL_INIT',cn_sapl_init) 1341 CALL getin_p('MIGRATE_TREE',migrate_tree) 1342 CALL getin_p('MIGRATE_GRASS',migrate_grass) 1343 CALL getin_p('MAXDIA_COEFF',maxdia_coeff) 1344 CALL getin_p('LAI_INITMIN_TREE',lai_initmin_tree) 1345 CALL getin_p('LAI_INITMIN_GRASS',lai_initmin_grass) 1346 CALL getin_p('DIA_COEFF',dia_coeff) 1347 CALL getin_p('MAXDIA_COEFF',maxdia_coeff) 1348 CALL getin_p('BM_SAPL_LEAF',bm_sapl_leaf) 1349 !- 1350 ! litter parameters 1351 CALL getin_p('METABOLIC_REF_FRAC',metabolic_ref_frac) 1352 CALL getin_p('Z_DECOMP',z_decomp) 1353 CALL getin_p('CN',CN) 1354 CALL getin_p('LC',LC) 1355 CALL getin_p('FRAC_SOIL_STRUCT_AA',frac_soil_struct_aa) 1356 CALL getin_p('FRAC_SOIL_STRUCT_AB',frac_soil_struct_ab) 1357 CALL getin_p('FRAC_SOIL_STRUCT_SA',frac_soil_struct_sa) 1358 CALL getin_p('FRAC_SOIL_STRUCT_SB',frac_soil_struct_sb) 1359 CALL getin_p('FRAC_SOIL_METAB_AA',frac_soil_metab_aa) 1360 CALL getin_p('FRAC_SOIL_METAB_AB',frac_soil_metab_ab) 1361 ! 1362 CALL getin_p('METABOLIC_LN_RATIO',metabolic_LN_ratio) 1363 CALL getin_p('TAU_METABOLIC',tau_metabolic) 1364 CALL getin_p('TAU_STRUCT',tau_struct) 1365 CALL getin_p('SOIL_Q10',soil_Q10) 1366 CALL getin_p('TSOIL_REF',tsoil_ref) 1367 CALL getin_p('LITTER_STRUCT_COEF',litter_struct_coef) 1368 CALL getin_p('MOIST_COEFF',moist_coeff) 1369 !- 1370 ! lpj parameters 1371 CALL getin_p('FRAC_TURNOVER_DAILY',frac_turnover_daily) 1372 !- 1373 ! npp parameters 1374 CALL getin_p('TAX_MAX',tax_max) 1375 !- 1376 ! phenology parameters 1377 CALL getin_p('ALWAYS_INIT',always_init) 1378 CALL getin_p('MIN_GROWTHINIT_TIME',min_growthinit_time) 1379 CALL getin_p('MOIAVAIL_ALWAYS_TREE',moiavail_always_tree) 1380 CALL getin_p('MOIAVAIL_ALWAYS_GRASS',moiavail_always_grass) 1381 CALL getin_p('T_ALWAYS_ADD',t_always_add) 1382 ! 1383 CALL getin_p('GDDNCD_REF',gddncd_ref) 1384 CALL getin_p('GDDNCD_CURVE',gddncd_curve) 1385 CALL getin_p('GDDNCD_OFFSET',gddncd_offset) 1386 !- 1387 ! prescribe parameters 1388 CALL getin_p('CN_TREE',cn_tree) 1389 CALL getin_p('BM_SAPL_RESCALE',bm_sapl_rescale) 1390 !- 1391 ! respiration parameters 1392 CALL getin_p('MAINT_RESP_MIN_VMAX',maint_resp_min_vmax) 1393 CALL getin_p('MAINT_RESP_COEFF',maint_resp_coeff) 1394 !- 1395 ! soilcarbon parameters 1396 CALL getin_p('FRAC_CARB_AA',frac_carb_aa) 1397 CALL getin_p('FRAC_CARB_AP',frac_carb_ap) 1398 CALL getin_p('FRAC_CARB_SS',frac_carb_ss) 1399 CALL getin_p('FRAC_CARB_SA',frac_carb_sa) 1400 CALL getin_p('FRAC_CARB_SP',frac_carb_sp) 1401 CALL getin_p('FRAC_CARB_PP',frac_carb_pp) 1402 CALL getin_p('FRAC_CARB_PA',frac_carb_pa) 1403 CALL getin_p('FRAC_CARB_PS',frac_carb_ps) 1404 ! 1405 CALL getin_p('ACTIVE_TO_PASS_CLAY_FRAC',active_to_pass_clay_frac) 1406 CALL getin_p('CARBON_TAU_IACTIVE',carbon_tau_iactive) 1407 CALL getin_p('CARBON_TAU_ISLOW',carbon_tau_islow) 1408 CALL getin_p('CARBON_TAU_IPASSIVE',carbon_tau_ipassive) 1409 CALL getin_p('FLUX_TOT_COEFF',flux_tot_coeff) 1410 !- 1411 ! turnover parameters 1412 CALL getin_p('NEW_TURNOVER_TIME_REF',new_turnover_time_ref) 1413 CALL getin_p('DT_TURNOVER_TIME',dt_turnover_time) 1414 CALL getin_p('LEAF_AGE_CRIT_TREF',leaf_age_crit_tref) 1415 CALL getin_p('LEAF_AGE_CRIT_COEFF',leaf_age_crit_coeff) 1416 !- 1417 ! vmax parameters 1418 CALL getin_p('VMAX_OFFSET',vmax_offset) 1419 CALL getin_p('LEAFAGE_FIRSTMAX',leafage_firstmax) 1420 CALL getin_p('LEAFAGE_LASTMAX',leafage_lastmax) 1421 CALL getin_p('LEAFAGE_OLD',leafage_old) 1422 !- 1423 ! season parameters 1424 CALL getin_p('GPPFRAC_DORMANCE',gppfrac_dormance) 1425 CALL getin_p('MIN_GPP_ALLOWED',min_gpp_allowed) 1426 CALL getin_p('TAU_CLIMATOLOGY',tau_climatology) 1427 CALL getin_p('HVC1',hvc1) 1428 CALL getin_p('HVC2',hvc2) 1429 CALL getin_p('LEAF_FRAC_HVC',leaf_frac_hvc) 1430 ! 1431 CALL getin_p('TLONG_REF_MAX',tlong_ref_max) 1432 CALL getin_p('TLONG_REF_MIN',tlong_ref_min) 1433 ! 1434 CALL getin_p('NCD_MAX_YEAR',ncd_max_year) 1435 CALL getin_p('GDD_THRESHOLD',gdd_threshold) 1436 CALL getin_p('GREEN_AGE_EVER',green_age_ever) 1437 CALL getin_p('GREEN_AGE_DEC',green_age_dec) 1438 1439 first_call = .FALSE. 1440 1098 1441 ENDIF 1099 1100 END SUBROUTINE getin_hydrol_cwrr_parameters 1101 !-------------------------------------------- 1102 1103 ! Subroutine called only if ok_co2 is activated 1104 ! only for diffuco_trans_co2 1105 1106 SUBROUTINE getin_co2_parameters 1107 1108 IMPLICIT NONE 1109 1110 LOGICAL, SAVE :: first_call = .TRUE. 1111 1442 1443 END SUBROUTINE getin_stomate_parameters 1444 ! 1445 != 1446 ! 1447 SUBROUTINE getin_dgvm_parameters 1448 1449 IMPLICIT NONE 1450 1451 LOGICAL, SAVE :: first_call = .TRUE. 1452 1112 1453 IF(first_call) THEN 1113 1114 CALL getin('LAI_LEVEL_DEPTH',lai_level_depth) 1115 CALL getin('X1_COEF',x1_coef) 1116 CALL getin('X1_Q10',x1_Q10) 1117 CALL getin('QUANTUM_YIELD',quantum_yield) 1118 CALL getin('KT_COEF',kt_coef) 1119 CALL getin('KC_COEF',kc_coef) 1120 CALL getin('KO_Q10',Ko_Q10) 1121 CALL getin('OA',Oa) 1122 CALL getin('KO_COEF',Ko_coef) 1123 CALL getin('CP_0',CP_0) 1124 CALL getin('CP_TEMP_COEF',cp_temp_coef) 1125 CALL getin('CP_TEMP_REF',cp_temp_ref) 1126 CALL getin('RT_COEF',rt_coef) 1127 CALL getin('VC_COEF',vc_coef) 1128 1129 first_call =.FALSE. 1130 1131 ENDIF 1132 1133 END SUBROUTINE getin_co2_parameters 1134 1135 !********************************************************** 1136 1137 ! Subroutine called only if stomate is activated 1138 1139 SUBROUTINE getin_stomate_parameters 1140 1141 IMPLICIT NONE 1142 1143 LOGICAL, SAVE :: first_call = .TRUE. 1144 1145 IF(first_call) THEN 1454 1455 ! establish parameters 1456 CALL getin_p('ESTAB_MAX_TREE',estab_max_tree) 1457 CALL getin_p('ESTAB_MAX_GRASS',estab_max_grass) 1458 CALL getin_p('ESTABLISH_SCAL_FACT',establish_scal_fact) 1459 CALL getin_p('FPC_CRIT_MAX',fpc_crit_max) 1460 CALL getin_p('FPC_CRIT_MIN',fpc_crit_min) 1461 !- 1462 ! light parameters 1463 CALL getin_p('GRASS_MERCY',grass_mercy) 1464 CALL getin_p('TREE_MERCY',tree_mercy) 1465 CALL getin_p('ANNUAL_INCREASE',annual_increase) 1466 CALL getin_p('MIN_COVER',min_cover) 1467 !- 1468 ! pftinout parameters 1469 CALL getin_p('IND_0',ind_0) 1470 CALL getin_p('MIN_AVAIL',min_avail) 1471 CALL getin_p('RIP_TIME_MIN',RIP_time_min) 1472 CALL getin_p('NPP_LONGTERM_INIT',npp_longterm_init) 1473 CALL getin_p('EVERYWHERE_INIT',everywhere_init) 1474 1475 first_call = .FALSE. 1476 1477 ENDIF 1146 1478 1147 CALL getin('TOO_LONG',too_long) 1148 !- 1149 CALL getin('TAU_FIRE',tau_fire) 1150 CALL getin('LITTER_CRIT',litter_crit) 1151 !- 1152 CALL getin('OK_MINRES',ok_minres) 1153 CALL getin('TAU_LEAFINIT', tau_leafinit) 1154 CALL getin('RESERVE_TIME_TREE',reserve_time_tree) 1155 CALL getin('RESERVE_TIME_GRASS',reserve_time_grass) 1156 CALL getin('R0',R0) 1157 CALL getin('S0',S0) 1158 CALL getin('F_FRUIT',f_fruit) 1159 CALL getin('ALLOC_SAP_ABOVE_TREE',alloc_sap_above_tree) 1160 CALL getin('ALLOC_SAP_ABOVE_GRASS',alloc_sap_above_grass) 1161 CALL getin('MIN_LTOLSR',min_LtoLSR) 1162 CALL getin('MAX_LTOLSR',max_LtoLSR) 1163 CALL getin('Z_NITROGEN',z_nitrogen) 1164 !- 1165 CALL getin('PIPE_TUNE_EXP_COEFF',pipe_tune_exp_coeff) 1166 CALL getin('PIPE_TUNE1',pipe_tune1) 1167 CALL getin('PIPE_TUNE2',pipe_tune2) 1168 CALL getin('PIPE_TUNE3',pipe_tune3) 1169 CALL getin('PIPE_TUNE4',pipe_tune4) 1170 CALL getin('PIPE_DENSITY',pipe_density) 1171 CALL getin('PIPE_K1',pipe_k1) 1172 CALL getin('ESTAB_MAX_TREE',estab_max_tree) 1173 CALL getin('ESTAB_MAX_GRASS',estab_max_grass) 1174 CALL getin('IND_0',ind_0) 1175 CALL getin('MIN_COVER',min_cover) 1176 CALL getin('PRECIP_CRIT',precip_crit) 1177 CALL getin('GDD_CRIT_ESTAB',gdd_crit_estab) 1178 CALL getin('FPC_CRIT',fpc_crit) 1179 CALL getin('FRAC_GROWTHRESP',frac_growthresp) 1180 CALL getin('ALPHA_GRASS',alpha_grass) 1181 CALL getin('ALPHA_TREE',alpha_tree) 1182 CALL getin('TLONG_REF_MAX',tlong_ref_max) 1183 CALL getin('TLONG_REF_MIN',tlong_ref_min) 1184 !- 1185 CALL getin('MASS_RATIO_HEART_SAP',mass_ratio_heart_sap) 1186 CALL getin('TAU_HUM_MONTH',tau_hum_month) 1187 CALL getin('TAU_HUM_WEEK',tau_hum_week) 1188 CALL getin('TAU_T2M_MONTH',tau_t2m_month) 1189 CALL getin('TAU_T2M_WEEK',tau_t2m_week) 1190 CALL getin('TAU_TSOIL_MONTH',tau_tsoil_month) 1191 CALL getin('TAU_SOILHUM_MONTH',tau_soilhum_month) 1192 CALL getin('TAU_GPP_WEEK',tau_gpp_week) 1193 CALL getin('TAU_GDD',tau_gdd) 1194 CALL getin('TAU_NGD',tau_ngd) 1195 CALL getin('COEFF_TAU_LONGTERM',coeff_tau_longterm) 1196 ! 1197 CALL getin('FRAC_TURNOVER_DAILY',frac_turnover_daily) 1198 !- 1199 CALL getin('Z_DECOMP',z_decomp) 1200 !- 1201 CALL getin('TAX_MAX',tax_max) 1202 !- 1203 CALL getin('ALWAYS_INIT',always_init) 1204 CALL getin('MIN_GROWTHINIT_TIME',min_growthinit_time) 1205 CALL getin('MOIAVAIL_ALWAYS_TREE',moiavail_always_tree) 1206 CALL getin('MOIAVAIL_ALWAYS_GRASS',moiavail_always_grass) 1207 CALL getin('T_ALWAYS_ADD',t_always_add) 1208 !- 1209 CALL getin('VMAX_OFFSET',vmax_offset) 1210 CALL getin('LEAFAGE_FIRSTMAX',leafage_firstmax) 1211 CALL getin('LEAFAGE_LASTMAX',leafage_lastmax) 1212 CALL getin('LEAFAGE_OLD',leafage_old) 1213 !- 1214 CALL getin('GPPFRAC_DORMANCE',gppfrac_dormance) 1215 CALL getin('MIN_GPP_ALLOWED',min_gpp_allowed) 1216 CALL getin('TAU_CLIMATOLOGY',tau_climatology) 1217 CALL getin('HVC1',hvc1) 1218 CALL getin('HVC2',hvc2) 1219 CALL getin('LEAF_FRAC_HVC',leaf_frac_hvc) 1220 !- 1221 CALL getin('CO2FRAC',co2frac) 1222 CALL getin('CN',CN) 1223 CALL getin('LC',LC) 1224 !- 1225 CALL getin('FRAC_SOIL_STRUCT_AA',frac_soil_struct_aa) 1226 CALL getin('FRAC_SOIL_STRUCT_AB',frac_soil_struct_ab) 1227 CALL getin('FRAC_SOIL_STRUCT_SA',frac_soil_struct_sa) 1228 CALL getin('FRAC_SOIL_STRUCT_SB',frac_soil_struct_sb) 1229 CALL getin('FRAC_SOIL_METAB_AA',frac_soil_metab_aa) 1230 CALL getin('FRAC_SOIL_METAB_AB',frac_soil_metab_ab) 1231 !- 1232 CALL getin('FRAC_CARB_AA',frac_carb_aa) 1233 CALL getin('FRAC_CARB_AP',frac_carb_ap) 1234 CALL getin('FRAC_CARB_SS',frac_carb_ss) 1235 CALL getin('FRAC_CARB_SA',frac_carb_sa) 1236 CALL getin('FRAC_CARB_SP',frac_carb_sp) 1237 CALL getin('FRAC_CARB_PP',frac_carb_pp) 1238 CALL getin('FRAC_CARB_PA',frac_carb_pa) 1239 CALL getin('FRAC_CARB_PS',frac_carb_ps) 1240 1241 !--------------------------------------- 1242 ! COEFFICIENTS OF EQUATIONS 1243 !------------------------------------- 1244 ! 1245 !- 1246 CALL getin('BCFRAC_COEFF',bcfrac_coeff) 1247 CALL getin('FIREFRAC_COEFF',firefrac_coeff) 1248 !- 1249 CALL getin('AVAILABILITY_FACT', availability_fact) 1250 CALL getin('VIGOUR_REF',vigour_ref) 1251 CALL getin('VIGOUR_COEFF',vigour_coeff) 1252 !- 1253 CALL getin('RIP_TIME_MIN',RIP_time_min) 1254 CALL getin('NPP_LONGTERM_INIT',npp_longterm_init) 1255 CALL getin('EVERYWHERE_INIT',everywhere_init) 1256 ! 1257 !- 1258 CALL getin('LAI_MAX_TO_HAPPY',lai_max_to_happy) 1259 CALL getin('NLIM_TREF',Nlim_tref) 1260 !- 1261 CALL getin('BM_SAPL_CARBRES',bm_sapl_carbres) 1262 CALL getin('BM_SAPL_SAPABOVE',bm_sapl_sapabove) 1263 CALL getin('BM_SAPL_HEARTABOVE',bm_sapl_heartabove) 1264 CALL getin('BM_SAPL_HEARTBELOW',bm_sapl_heartbelow) 1265 CALL getin('INIT_SAPL_MASS_LEAF_NAT',init_sapl_mass_leaf_nat) 1266 CALL getin('INIT_SAPL_MASS_LEAF_AGRI',init_sapl_mass_leaf_agri) 1267 CALL getin('INIT_SAPL_MASS_CARBRES',init_sapl_mass_carbres) 1268 CALL getin('INIT_SAPL_MASS_ROOT',init_sapl_mass_root) 1269 CALL getin('INIT_SAPL_MASS_FRUIT',init_sapl_mass_fruit) 1270 CALL getin('CN_SAPL_INIT',cn_sapl_init) 1271 CALL getin('MIGRATE_TREE',migrate_tree) 1272 CALL getin('MIGRATE_GRASS',migrate_grass) 1273 CALL getin('MAXDIA_COEFF',maxdia_coeff) 1274 CALL getin('LAI_INITMIN_TREE',lai_initmin_tree) 1275 CALL getin('LAI_INITMIN_GRASS',lai_initmin_grass) 1276 CALL getin('DIA_COEFF',dia_coeff) 1277 CALL getin('MAXDIA_COEFF',maxdia_coeff) 1278 CALL getin('BM_SAPL_LEAF',bm_sapl_leaf) 1279 !- 1280 CALL getin('METABOLIC_REF_FRAC',metabolic_ref_frac) 1281 CALL getin('METABOLIC_LN_RATIO',metabolic_LN_ratio) 1282 CALL getin('TAU_METABOLIC',tau_metabolic) 1283 CALL getin('TAU_STRUCT',tau_struct) 1284 CALL getin('SOIL_Q10',soil_Q10) 1285 CALL getin('TSOIL_REF',tsoil_ref) 1286 CALL getin('LITTER_STRUCT_COEF',litter_struct_coef) 1287 CALL getin('MOIST_COEFF',moist_coeff) 1288 !- 1289 CALL getin('GDDNCD_REF',gddncd_ref) 1290 CALL getin('GDDNCD_CURVE',gddncd_curve) 1291 CALL getin('GDDNCD_OFFSET',gddncd_offset) 1292 !- 1293 CALL getin('CN_TREE',cn_tree) 1294 CALL getin('BM_SAPL_RESCALE',bm_sapl_rescale) 1295 !- 1296 CALL getin('MAINT_RESP_MIN_VMAX',maint_resp_min_vmax) 1297 CALL getin('MAINT_RESP_COEFF',maint_resp_coeff) 1298 !- 1299 CALL getin('NCD_MAX_YEAR',ncd_max_year) 1300 CALL getin('GDD_THRESHOLD',gdd_threshold) 1301 CALL getin('GREEN_AGE_EVER',green_age_ever) 1302 CALL getin('GREEN_AGE_DEC',green_age_dec) 1303 !- 1304 CALL getin('ACTIVE_TO_PASS_CLAY_FRAC',active_to_pass_clay_frac) 1305 CALL getin('CARBON_TAU_IACTIVE',carbon_tau_iactive) 1306 CALL getin('CARBON_TAU_ISLOW',carbon_tau_islow) 1307 CALL getin('CARBON_TAU_IPASSIVE',carbon_tau_ipassive) 1308 CALL getin('FLUX_TOT_COEFF',flux_tot_coeff) 1309 !- 1310 CALL getin('NEW_TURNOVER_TIME_REF',new_turnover_time_ref) 1311 CALL getin('DT_TURNOVER_TIME',dt_turnover_time) 1312 CALL getin('LEAF_AGE_CRIT_TREF',leaf_age_crit_tref) 1313 CALL getin('LEAF_AGE_CRIT_COEFF',leaf_age_crit_coeff) 1314 1315 first_call = .FALSE. 1316 1317 ENDIF 1318 1319 END SUBROUTINE getin_stomate_parameters 1320 1321 !****************************************** 1322 1323 SUBROUTINE getin_dgvm_parameters 1324 1325 IMPLICIT NONE 1326 1327 LOGICAL, SAVE :: first_call = .TRUE. 1328 1329 IF(first_call) THEN 1330 1331 CALL getin('ESTABLISH_SCAL_FACT',establish_scal_fact) 1332 CALL getin('FPC_CRIT_MAX',fpc_crit_max) 1333 CALL getin('FPC_CRIT_MIN',fpc_crit_min) 1334 ! 1335 CALL getin('GRASS_MERCY',grass_mercy) 1336 CALL getin('TREE_MERCY',tree_mercy) 1337 CALL getin('ANNUAL_INCREASE',annual_increase) 1338 ! 1339 CALL getin('MIN_AVAIL',min_avail) 1340 CALL getin('RIP_TIME_MIN',RIP_time_min) 1341 CALL getin('NPP_LONGTERM_INIT',npp_longterm_init) 1342 CALL getin('EVERYWHERE_INIT',everywhere_init) 1343 1344 first_call = .FALSE. 1345 1346 ENDIF 1347 1348 1349 END SUBROUTINE getin_dgvm_parameters 1479 1480 END SUBROUTINE getin_dgvm_parameters 1481 1350 1482 1351 1483 !-------------------- -
branches/ORCHIDEE_EXT/ORCHIDEE/src_parameters/constantes_mtc.f90
r64 r257 75 75 & .TRUE., .TRUE., .TRUE., .TRUE., .FALSE., & 76 76 & .FALSE., .FALSE., .FALSE. /) 77 !- 77 ! used in diffuco 78 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: rveg_mtc = & 79 & (/ 1., 1., 1., 1., 1., 1. ,1. ,1. ,1. ,1. ,1. ,1., 1. /) 80 ! 78 81 !- 79 82 ! 2 .Stomate … … 95 98 & .TRUE., .TRUE., .TRUE., .TRUE., .FALSE., .FALSE. /) 96 99 100 !>> DS new for merge in the trunk ! 15/06/2011 101 ! Add for writing history files in stomate_lpj.f90 'treeFracPrimDec' and 'treeFracPrimEver' 102 ! is PFT deciduous ? 103 LOGICAL, PARAMETER, DIMENSION(nvmc) :: is_deciduous_mtc = & 104 & (/ .FALSE., .FALSE., .TRUE., .FALSE., .FALSE., .TRUE., .FALSE., & 105 & .TRUE., .TRUE., .FALSE., .FALSE., .FALSE., .FALSE. /) 106 ! is PFT evergreen ? 107 LOGICAL, PARAMETER, DIMENSION(nvmc) :: is_evergreen_mtc = & 108 & (/ .FALSE., .TRUE., .FALSE., .TRUE., .TRUE., .FALSE., .TRUE., & 109 & .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /) 110 ! is PFT C3 ? 111 LOGICAL, PARAMETER, DIMENSION(nvmc) :: is_c3_mtc = & 112 & (/.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE., & 113 & .FALSE.,.FALSE.,.FALSE.,.TRUE.,.FALSE.,.TRUE.,.FALSE. /) 114 115 !------------------------------- 116 ! Evapotranspiration - sechiba 117 !------------------------------- 118 ! 119 ! Structural resistance. 120 ! Value for rstruct_const : one for each vegetation type 121 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: rstruct_const_mtc = & 122 & (/ 0.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, & 123 & 25.0, 25.0, 2.5, 2.0, 2.0, 2.0 /) 124 !- 125 ! A vegetation dependent constant used in the calculation 126 ! of the surface resistance. 127 ! Value for kzero one for each vegetation type 128 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: kzero_mtc = & 129 & (/0.0, 12.E-5, 12.E-5, 12.e-5, 12.e-5, 25.e-5, 12.e-5,& 130 & 25.e-5, 25.e-5, 30.e-5, 30.e-5, 30.e-5, 30.e-5 /) 131 132 133 !------------------- 134 ! Water - sechiba 135 !------------------- 136 ! 137 ! Maximum field capacity for each of the vegetations (Temporary). 138 ! Value of wmax_veg : max quantity of water : 139 ! one for each vegetation type en Kg/M3 140 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: wmax_veg_mtc = & 141 & (/ 150., 150., 150., 150., 150., 150., 150., & 142 & 150., 150., 150., 150., 150., 150. /) 143 !- 144 ! Root profile description for the different vegetation types. 145 ! These are the factor in the exponential which gets 146 ! the root density as a function of depth 147 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: humcste_mtc = & 148 & (/5., .8, .8, 1., .8, .8, 1., 1., .8, 4., 4., 4., 4./) 149 ! used in both hydrology modules 150 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: throughfall_by_mtc = & 151 & (/ 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30. /) 152 153 !------------------ 154 ! Albedo - sechiba 155 !------------------ 156 ! 157 ! Initial snow albedo value for each vegetation type 158 ! as it will be used in condveg_snow 159 ! Values are from the Thesis of S. Chalita (1992) 160 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: snowa_ini_mtc = & 161 & (/ 0.35, 0., 0., 0.14, 0.14, & 162 & 0.14, 0.14, 0.14, 0.14, 0.18, & 163 & 0.18, 0.18, 0.18 /) 164 !- 165 ! Decay rate of snow albedo value for each vegetation type 166 ! as it will be used in condveg_snow 167 ! Values are from the Thesis of S. Chalita (1992) 168 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: snowa_dec_mtc = & 169 & (/ 0.45, 0., 0., 0.06, 0.06, & 170 & 0.11, 0.06, 0.11, 0.11, 0.52, & 171 & 0.52, 0.52, 0.52 /) 172 !- 173 ! leaf albedo of vegetation type, visible albedo 174 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: alb_leaf_vis_mtc = & 175 & (/ .00, .04, .06, .06, .06, & 176 & .06, .06, .06, .06, .10, & 177 & .10, .10, .10 /) 178 ! leaf albedo of vegetation type, near infrared albedo 179 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: alb_leaf_nir_mtc = & 180 & (/ .00, .20, .22, .22, .22, & 181 & .22, .22, .22, .22, .30, & 182 & .30, .30, .30 /) 183 184 185 !------------------------ 186 ! Soil - vegetation 187 !------------------------ 188 ! 189 ! Table which contains the correlation between the soil types 190 ! and vegetation type. Two modes exist : 191 ! 1) pref_soil_veg = 0 then we have an equidistribution 192 ! of vegetation on soil types 193 ! 2) Else for each pft the prefered soil type is given : 194 ! 1=sand, 2=loan, 3=clay 195 ! The variable is initialized in slowproc. 196 INTEGER(i_std), PARAMETER, DIMENSION(nvmc) :: pref_soil_veg_sand_mtc = & 197 & (/ 1, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 /) 198 199 INTEGER(i_std), PARAMETER, DIMENSION(nvmc) :: pref_soil_veg_loan_mtc = & 200 & (/ 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 /) 201 202 INTEGER(i_std), PARAMETER, DIMENSION(nvmc) :: pref_soil_veg_clay_mtc = & 203 & (/ 3, 1, 1, 1, 1, 1 ,1 ,1 ,1 ,1 ,1 ,1, 1 /) 97 204 98 205 !---------------- … … 104 211 ! flag for C4 vegetation types 105 212 LOGICAL,PARAMETER, DIMENSION(nvmc) :: is_c4_mtc = & 106 & (/. false.,.false.,.false.,.false.,.false.,.false., &107 & . false.,.false.,.false.,.false.,.true.,.false.,.true. /)213 & (/.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE., & 214 & .FALSE.,.FALSE.,.FALSE.,.FALSE.,.TRUE.,.FALSE.,.TRUE. /) 108 215 !- 109 216 ! Slope of the gs/A relation (Ball & al.) … … 409 516 & (/ undef, 5., 5., 5., 5., 5., 5., & 410 517 & 5., 5., undef, undef, undef, undef /) 518 519 !>> DS new for merge in the trunk 520 ! 15/06/2011 : add leaflife_mtc for the new formalism used for calculate sla 521 REAL(r_std) ,PARAMETER , DIMENSION(nvmc) :: leaflife_mtc = & 522 & (/ undef, .5, 2., .33, 1., 2., .33, & 523 & 2., 2., 2., 2., 2., 2. /) 524 411 525 !- 412 526 ! 3. Senescence … … 493 607 494 608 495 !------------------------------- 496 ! Evapotranspiration - sechiba 497 !------------------------------- 498 ! 499 ! Structural resistance. 500 ! Value for rstruct_const : one for each vegetation type 501 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: rstruct_const_mtc = & 502 & (/ 0.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, & 503 & 25.0, 25.0, 2.5, 2.0, 2.0, 2.0 /) 504 !- 505 ! A vegetation dependent constant used in the calculation 506 ! of the surface resistance. 507 ! Value for kzero one for each vegetation type 508 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: kzero_mtc = & 509 & (/0.0, 12.E-5, 12.E-5, 12.e-5, 12.e-5, 25.e-5, 12.e-5,& 510 & 25.e-5, 25.e-5, 30.e-5, 30.e-5, 30.e-5, 30.e-5 /) 511 512 513 !------------------- 514 ! Water - sechiba 515 !------------------- 516 ! 517 ! Maximum field capacity for each of the vegetations (Temporary). 518 ! Value of wmax_veg : max quantity of water : 519 ! one for each vegetation type en Kg/M3 520 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: wmax_veg_mtc = & 521 & (/ 150., 150., 150., 150., 150., 150., 150., & 522 & 150., 150., 150., 150., 150., 150. /) 523 !- 524 ! Root profile description for the different vegetation types. 525 ! These are the factor in the exponential which gets 526 ! the root density as a function of depth 527 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: humcste_mtc = & 528 & (/5., .8, .8, 1., .8, .8, 1., 1., .8, 4., 4., 4., 4./) 529 530 531 !------------------ 532 ! Albedo - sechiba 533 !------------------ 534 ! 535 ! Initial snow albedo value for each vegetation type 536 ! as it will be used in condveg_snow 537 ! Values are from the Thesis of S. Chalita (1992) 538 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: snowa_ini_mtc = & 539 & (/ 0.35, 0., 0., 0.14, 0.14, & 540 & 0.14, 0.14, 0.14, 0.14, 0.18, & 541 & 0.18, 0.18, 0.18 /) 542 !- 543 ! Decay rate of snow albedo value for each vegetation type 544 ! as it will be used in condveg_snow 545 ! Values are from the Thesis of S. Chalita (1992) 546 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: snowa_dec_mtc = & 547 & (/ 0.45, 0., 0., 0.06, 0.06, & 548 & 0.11, 0.06, 0.11, 0.11, 0.52, & 549 & 0.52, 0.52, 0.52 /) 550 !- 551 ! leaf albedo of vegetation type, visible albedo 552 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: alb_leaf_vis_mtc = & 553 & (/ .00, .04, .06, .06, .06, & 554 & .06, .06, .06, .06, .10, & 555 & .10, .10, .10 /) 556 ! leaf albedo of vegetation type, near infrared albedo 557 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: alb_leaf_nir_mtc = & 558 & (/ .00, .20, .22, .22, .22, & 559 & .22, .22, .22, .22, .30, & 560 & .30, .30, .30 /) 561 562 563 ! 564 !------------------------ 565 ! Soil - vegetation 566 !------------------------ 567 568 ! Table which contains the correlation between the soil types 569 ! and vegetation type. Two modes exist : 570 ! 1) pref_soil_veg = 0 then we have an equidistribution 571 ! of vegetation on soil types 572 ! 2) Else for each pft the prefered soil type is given : 573 ! 1=sand, 2=loan, 3=clay 574 ! The variable is initialized in slowproc. 575 INTEGER(i_std), PARAMETER, DIMENSION(nvmc) :: pref_soil_veg_sand_mtc = & 576 & (/ 1, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 /) 577 578 INTEGER(i_std), PARAMETER, DIMENSION(nvmc) :: pref_soil_veg_loan_mtc = & 579 & (/ 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 /) 580 581 INTEGER(i_std), PARAMETER, DIMENSION(nvmc) :: pref_soil_veg_clay_mtc = & 582 & (/ 3, 1, 1, 1, 1, 1 ,1 ,1 ,1 ,1 ,1 ,1, 1 /) 583 584 585 ! 586 !------------------------------- 587 ! Parameters already externalised (from sechiba) 588 ! to classify 589 !---------------------------------- 590 ! 591 ! used in hydrolc 592 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: throughfall_by_mtc = & 593 & (/ 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30. /) 594 ! used in diffuco 595 REAL(r_std), PARAMETER, DIMENSION(nvmc) :: rveg_mtc = & 596 & (/ 1., 1., 1., 1., 1., 1. ,1. ,1. ,1. ,1. ,1. ,1., 1. /) 597 598 609 !------------------------ 599 610 END MODULE constantes_mtc -
branches/ORCHIDEE_EXT/ORCHIDEE/src_parameters/pft_parameters.f90
r115 r257 1 ! 09/20101 ! Version 0: 26/06/2010 2 2 ! This is the module where we define the number of pfts and the values of the 3 3 ! parameters … … 9 9 USE constantes 10 10 USE ioipsl 11 USE parallel 11 12 USE defprec 12 13 … … 50 51 ! Is the vegetation type a tree ? 51 52 LOGICAL,ALLOCATABLE, SAVE, DIMENSION (:) :: is_tree 53 !>> DS new for merge in the trunk ! 15/06/2011 54 ! Add for writing history files in stomate_lpj.f90 'treeFracPrimDec' and 'treeFracPrimEver' 55 ! is PFT deciduous ? 56 LOGICAL,ALLOCATABLE, SAVE, DIMENSION (:) :: is_deciduous 57 LOGICAL,ALLOCATABLE, SAVE, DIMENSION (:) :: is_evergreen 58 LOGICAL,ALLOCATABLE, SAVE, DIMENSION (:) :: is_c3 59 ! used in diffuco !! Nathalie le 28 mars 2006 - sur proposition de Fred Hourdin, ajout 60 !! d'un potentiometre pour regler la resistance de la vegetation 61 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: rveg_pft 62 52 63 !- 53 64 ! 2 .Stomate … … 61 72 LOGICAL, ALLOCATABLE, SAVE, DIMENSION (:) :: natural 62 73 74 !------------------------------- 75 ! Evapotranspiration - sechiba 76 !------------------------------- 77 !- 78 ! Structural resistance. 79 ! Value for rstruct_const : one for each vegetation type 80 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: rstruct_const 81 ! 82 ! A vegetation dependent constant used in the calculation 83 ! of the surface resistance. 84 ! Value for kzero one for each vegetation type 85 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: kzero 86 87 88 !------------------- 89 ! Water - sechiba 90 !------------------- 91 !- 92 ! Maximum field capacity for each of the vegetations (Temporary). 93 ! Value of wmax_veg : max quantity of water : 94 ! one for each vegetation type en Kg/M3 95 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: wmax_veg 96 ! Root profile description for the different vegetation types. 97 ! These are the factor in the exponential which gets 98 ! the root density as a function of depth 99 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: humcste 100 ! used in hydrolc 101 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: throughfall_by_pft 102 103 104 !------------------ 105 ! Albedo - sechiba 106 !------------------ 107 !- 108 ! Initial snow albedo value for each vegetation type 109 ! as it will be used in condveg_snow 110 ! Values are from the Thesis of S. Chalita (1992) 111 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: snowa_ini 112 ! 113 ! Decay rate of snow albedo value for each vegetation type 114 ! as it will be used in condveg_snow 115 ! Values are from the Thesis of S. Chalita (1992) 116 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: snowa_dec 117 ! 118 ! leaf albedo of vegetation type, visible albedo 119 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: alb_leaf_vis 120 ! leaf albedo of vegetation type, near infrared albedo 121 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: alb_leaf_nir 122 ! leaf albedo of vegetation type, VIS+NIR 123 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: alb_leaf 124 125 126 !------------------------ 127 ! Soil - vegetation 128 !------------------------ 129 ! 130 ! Table which contains the correlation between the soil types 131 ! and vegetation type. Two modes exist : 132 ! 1) pref_soil_veg = 0 then we have an equidistribution 133 ! of vegetation on soil types 134 ! 2) Else for each pft the prefered soil type is given : 135 ! 1=sand, 2=loan, 3=clay 136 ! The variable is initialized in slowproc. 137 INTEGER(i_std), ALLOCATABLE, SAVE, DIMENSION (:,:) :: pref_soil_veg 138 INTEGER(i_std), ALLOCATABLE, SAVE, DIMENSION (:) :: pref_soil_veg_sand 139 INTEGER(i_std), ALLOCATABLE, SAVE, DIMENSION (:) :: pref_soil_veg_loan 140 INTEGER(i_std), ALLOCATABLE, SAVE, DIMENSION (:) :: pref_soil_veg_clay 63 141 64 142 !---------------- … … 163 241 ! for carbohydrate reserve, tabulated 164 242 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) ::cm_zero_carbres 243 165 244 166 167 168 245 !---------------- 169 246 ! Fire - stomate 170 247 !---------------- 171 248 ! 172 249 ! flamability: critical fraction of water holding capacity 173 250 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: flam 174 251 ! fire resistance 175 252 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: resist 176 177 253 178 254 … … 195 271 ! 1 .Stomate 196 272 !- 197 !198 273 ! maximum LAI, PFT-specific 199 274 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: lai_max … … 235 310 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: alloc_max 236 311 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: demi_alloc 312 !>> DS new for merge in the trunk 313 ! 15/06/2011 : add leaflife_mtc for the new formalism used for calculate sla 314 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: leaflife_tab 237 315 !- 238 316 ! 3. Senescence … … 282 360 283 361 284 !-------------------------------285 ! Evapotranspiration - sechiba286 !-------------------------------287 !-288 ! Structural resistance.289 ! Value for rstruct_const : one for each vegetation type290 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: rstruct_const291 !292 ! A vegetation dependent constant used in the calculation293 ! of the surface resistance.294 ! Value for kzero one for each vegetation type295 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: kzero296 297 298 !-------------------299 ! Water - sechiba300 !-------------------301 !-302 ! Maximum field capacity for each of the vegetations (Temporary).303 ! Value of wmax_veg : max quantity of water :304 ! one for each vegetation type en Kg/M3305 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: wmax_veg306 ! Root profile description for the different vegetation types.307 ! These are the factor in the exponential which gets308 ! the root density as a function of depth309 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: humcste310 311 312 !------------------313 ! Albedo - sechiba314 !------------------315 !-316 ! Initial snow albedo value for each vegetation type317 ! as it will be used in condveg_snow318 ! Values are from the Thesis of S. Chalita (1992)319 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: snowa_ini320 !321 ! Decay rate of snow albedo value for each vegetation type322 ! as it will be used in condveg_snow323 ! Values are from the Thesis of S. Chalita (1992)324 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: snowa_dec325 !326 ! leaf albedo of vegetation type, visible albedo327 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: alb_leaf_vis328 ! leaf albedo of vegetation type, near infrared albedo329 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: alb_leaf_nir330 ! leaf albedo of vegetation type, VIS+NIR331 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: alb_leaf332 333 334 !335 !------------------------336 ! Soil - vegetation337 !------------------------338 339 ! Table which contains the correlation between the soil types340 ! and vegetation type. Two modes exist :341 ! 1) pref_soil_veg = 0 then we have an equidistribution342 ! of vegetation on soil types343 ! 2) Else for each pft the prefered soil type is given :344 ! 1=sand, 2=loan, 3=clay345 ! The variable is initialized in slowproc.346 INTEGER(i_std), ALLOCATABLE, SAVE, DIMENSION (:,:) :: pref_soil_veg347 INTEGER(i_std), ALLOCATABLE, SAVE, DIMENSION (:) :: pref_soil_veg_sand348 INTEGER(i_std), ALLOCATABLE, SAVE, DIMENSION (:) :: pref_soil_veg_loan349 INTEGER(i_std), ALLOCATABLE, SAVE, DIMENSION (:) :: pref_soil_veg_clay350 351 352 !353 362 !-------------------------------------------- 354 363 ! Internal parameters used in stomate_data … … 370 379 371 380 372 !-------------------------------373 ! Parameters already externalised (from sechiba)374 ! to classify375 !----------------------------------376 !377 ! used in hydrolc and hydrol378 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: throughfall_by_pft379 ! used in diffuco !! Nathalie le 28 mars 2006 - sur proposition de Fred Hourdin, ajout380 !! d'un potentiometre pour regler la resistance de la vegetation381 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: rveg_pft382 383 381 384 382 CONTAINS … … 397 395 IF(l_first_define_pft) THEN 398 396 397 ! 1. First time step 399 398 IF(long_print) THEN 400 399 WRITE(numout,*) 'l_first_define_pft :we read the parameters from the def files' 401 400 ENDIF 402 401 402 ! 2. Memory allocation 403 403 ! Allocation of memory for the pfts-parameters 404 404 CALL pft_parameters_alloc 405 405 406 ! 3. Correspondance table 407 408 ! 3.1 Initialisation of the correspondance table 406 409 ! Initialisation of the correspondance table 407 410 pft_to_mtc (:) = undef_integer 408 411 409 ! Reading of the conrrespondance table in the .def file 410 CALL getin('PFT_TO_MTC',pft_to_mtc) 411 412 ! Add the standard configuration 412 ! 3.2 Reading of the conrrespondance table in the .def file 413 CALL getin_p('PFT_TO_MTC',pft_to_mtc) 414 415 ! 3.3 If the user want to use the standard configuration, he needn't to fill the correspondance array 416 ! If the configuration is wrong, send a error message to the user. 413 417 IF(nvm .EQ. 13 ) THEN 414 418 IF(pft_to_mtc(1) .EQ. undef_integer) THEN … … 422 426 ENDIF 423 427 424 ! What happened if pft_to_mtc(j) > nvmc (if the mtc doesn't exist)? 428 ! 3.4 Some error messages 429 430 ! 3.4.1 What happened if pft_to_mtc(j) > nvmc (if the mtc doesn't exist)? 425 431 DO i = 1, nvm 426 432 IF(pft_to_mtc(i) .GT. nvmc) THEN … … 431 437 432 438 433 ! Verifyif pft_to_mtc(1) = 1439 ! 3.4.2 Check if pft_to_mtc(1) = 1 434 440 IF(pft_to_mtc(1) .NE. 1) THEN 435 441 WRITE(numout,*) 'the first pft has to be the bare soil' … … 445 451 446 452 447 ! Initialisation of the pfts-parameters453 ! 4.Initialisation of the pfts-parameters 448 454 CALL pft_parameters_init 449 455 450 ! Could be useful: correspondance between the number of the pft456 ! 5. A useful message to the user: correspondance between the number of the pft 451 457 ! and the name of the associated mtc 452 458 DO i = 1,nvm … … 454 460 ENDDO 455 461 456 457 !------------------------------------------------------! 458 ! Initialisation of tables 2D which are used in the code ! 459 !------------------------------------------------------! 460 ! 462 ! 6. Initialisation of 2D arrays used in the code 463 464 !-alb_leaf 465 alb_leaf(:) = zero 466 467 !- pref_soil_veg 468 pref_soil_veg(:,:) = zero_int 469 461 470 !- pheno_gdd_crit 462 471 pheno_gdd_crit(:,:) = zero … … 470 479 !-coeff_maint_zero 471 480 coeff_maint_zero(:,:) = zero 472 ! 473 !-alb_leaf 474 alb_leaf(:) = zero 475 !- pref_soil_veg (see slowproc) 481 482 ! 7. End message 483 IF(long_print) THEN 484 WRITE(numout,*) 'pft_parameters_done' 485 ENDIF 476 486 477 487 ELSE 478 488 479 489 l_first_define_pft = .FALSE. 480 490 481 491 RETURN 482 492 483 493 ENDIF … … 496 506 !------------ 497 507 498 ! Initialisation !! not all the parameters are initialized 499 500 !---------------------- 508 ! 509 ! 1. Initialisation !! not all the parameters are initialized 510 ! 511 512 !- 501 513 ! Vegetation structure 502 !- ---------------------503 ! -514 !- 515 ! 504 516 ! 1 .Sechiba 505 ! -517 ! 506 518 veget_ori_fixed_test_1(:) = zero 507 519 llaimax(:) = zero 508 520 llaimin(:) = zero 509 521 height_presc(:) = zero 510 !- 522 rveg_pft(:) = zero 523 ! 511 524 ! 2 .Stomate 512 525 ! 513 526 leaf_tab(:) = zero_int 514 527 sla(:) = zero 515 !---------------- 528 !- 529 ! Evapotranspiration - sechiba 530 !- 531 rstruct_const(:) = zero 532 kzero(:) = zero 533 !- 534 ! Water - sechiba 535 !- 536 wmax_veg(:) = zero 537 humcste(:) = zero 538 throughfall_by_pft(:) = zero 539 !- 540 ! Albedo - sechiba 541 !- 542 snowa_ini(:) = zero 543 snowa_dec(:) = zero 544 alb_leaf_vis(:) = zero 545 alb_leaf_nir(:) = zero 546 !- 547 ! Soil - vegetation 548 !- 549 pref_soil_veg_sand(:) = zero_int 550 pref_soil_veg_loan(:) = zero_int 551 pref_soil_veg_clay(:) = zero_int 552 !- 516 553 ! Photosynthesis 517 !- ---------------518 ! -554 !- 555 ! 519 556 ! 1 .CO2 520 ! -557 ! 521 558 gsslope(:) = zero 522 559 gsoffset(:) = zero … … 526 563 co2_topt_fix(:) = zero 527 564 co2_tmax_fix(:) = zero 528 !- 565 ext_coeff(:) = zero 566 ! 529 567 ! 2 .Stomate 530 !- 531 ext_coeff(:) = zero 568 ! 532 569 vcmax_opt(:) = zero 533 570 vjmax_opt(:) = zero … … 541 578 tphoto_max_b(:) = zero 542 579 tphoto_max_c(:) = zero 543 !- ---------------------580 !- 544 581 ! Respiration - stomate 545 !---------------------- 546 ! 582 !- 547 583 maint_resp_slope_c(:) = zero 548 584 maint_resp_slope_b(:) = zero … … 556 592 cm_zero_fruit(:) = zero 557 593 cm_zero_carbres(:) = zero 558 !- ---------------594 !- 559 595 ! Fire - stomate 560 !- --------------596 !- 561 597 ! 562 598 flam(:) = zero 563 599 resist(:) = zero 564 !- ---------------600 !- 565 601 ! Flux - LUC 566 !--------------- 567 ! 602 !- 568 603 coeff_lcchange_1(:) = zero 569 604 coeff_lcchange_10(:) = zero 570 605 coeff_lcchange_100(:) = zero 571 ! 572 !----------- 606 !- 573 607 ! Phenology 574 !- ----------575 ! -608 !- 609 ! 576 610 ! 1 .Stomate 577 ! -611 ! 578 612 lai_max(:) = zero 579 613 pheno_type(:) = zero_int 580 ! -614 ! 581 615 ! 2. Leaf Onset 582 ! -616 ! 583 617 pheno_gdd_crit_c(:) = zero 584 618 pheno_gdd_crit_b(:) = zero … … 595 629 alloc_max(:) = zero 596 630 demi_alloc(:) = zero 597 !- 631 !>> DS new for merge in the trunk 15/06/2011 632 leaflife_tab(:) = zero 633 ! 598 634 ! 3. Senescence 599 ! -635 ! 600 636 leaffall(:) = zero 601 637 leafagecrit(:) = zero … … 608 644 senescence_temp_b(:) = zero 609 645 senescence_temp_a(:) = zero 610 !- ----------646 !- 611 647 ! DGVM 612 !----------- 613 ! 648 !- 614 649 residence_time(:) = zero 615 650 tmin_crit(:) = zero 616 651 tcm_crit(:) = zero 617 !------------------------------- 618 ! Evapotranspiration - sechiba 619 !------------------------------- 620 !- 621 rstruct_const(:) = zero 622 kzero(:) = zero 623 !------------------- 624 ! Water - sechiba 625 !------------------- 626 !- 627 wmax_veg(:) = zero 628 humcste(:) = zero 629 !------------------ 630 ! Albedo - sechiba 631 !------------------ 632 !- 633 snowa_ini(:) = zero 634 snowa_dec(:) = zero 635 alb_leaf_vis(:) = zero 636 alb_leaf_nir(:) = zero 637 !------------------------ 638 ! Soil - vegetation 639 !------------------------ 640 pref_soil_veg(:,:) = zero_int 641 642 !------------------------ 652 !- 643 653 ! Internal_parameters 644 !- -----------------------654 !- 645 655 lai_initmin(:) = zero 646 656 bm_sapl(:,:) = zero … … 649 659 cn_sapl(:) = zero 650 660 leaf_timecst(:) = zero 651 !------------------------------- 652 ! Parameters already externalised (from sechiba) 653 ! to classify 654 !---------------------------------- 655 throughfall_by_pft(:) = zero 656 rveg_pft(:) = zero 657 658 659 !-------------------------------------------------------------! 660 ! Correspondance between the PFTs values and thes MTCs values ! 661 !-------------------------------------------------------------! 661 662 663 ! 664 ! 2. Correspondance between the PFTs values and thes MTCs values 665 ! 662 666 663 667 DO j= 1, nvm … … 666 670 PFT_name(j) = MTC_name(pft_to_mtc(j)) 667 671 668 !- ---------------------672 !- 669 673 ! Vegetation structure 670 !- ---------------------671 ! -674 !- 675 ! 672 676 ! 1 .Sechiba 673 ! -677 ! 674 678 veget_ori_fixed_test_1(j) = veget_ori_fixed_mtc(pft_to_mtc(j)) 675 679 llaimax(j) = llaimax_mtc(pft_to_mtc(j)) … … 678 682 type_of_lai(j) = type_of_lai_mtc(pft_to_mtc(j)) 679 683 is_tree(j) = is_tree_mtc(pft_to_mtc(j)) 680 !- 684 rveg_pft(j) = rveg_mtc(pft_to_mtc(j)) 685 686 !>> DS new for merge in the trunk ! 15/06/2011 687 ! Add for writing history files in stomate_lpj.f90 'treeFracPrimDec' and 'treeFracPrimEver' 688 is_deciduous(j) = is_deciduous_mtc(pft_to_mtc(j)) 689 is_evergreen(j) = is_evergreen_mtc(pft_to_mtc(j)) 690 is_c3(j) = is_c3(pft_to_mtc(j)) 691 692 ! 681 693 ! 2 .Stomate 682 ! -694 ! 683 695 leaf_tab(j) = leaf_tab_mtc(pft_to_mtc(j)) 684 696 sla(j) = sla_mtc(pft_to_mtc(j)) 685 697 natural(j) = natural_mtc(pft_to_mtc(j)) 686 !---------------- 698 699 !- 700 ! Evapotranspiration - sechiba 701 !- 702 rstruct_const(j) = rstruct_const_mtc(pft_to_mtc(j)) 703 kzero(j) = kzero_mtc(pft_to_mtc(j)) 704 !- 705 ! Water - sechiba 706 !- 707 wmax_veg(j) = wmax_veg_mtc(pft_to_mtc(j)) 708 humcste(j) = humcste_mtc(pft_to_mtc(j)) 709 throughfall_by_pft(j) = throughfall_by_mtc(pft_to_mtc(j)) 710 !- 711 ! Albedo - sechiba 712 !- 713 snowa_ini(j) = snowa_ini_mtc(pft_to_mtc(j)) 714 snowa_dec(j) = snowa_dec_mtc(pft_to_mtc(j)) 715 alb_leaf_vis(j) = alb_leaf_vis_mtc(pft_to_mtc(j)) 716 alb_leaf_nir(j) = alb_leaf_nir_mtc(pft_to_mtc(j)) 717 !- 718 ! Soil - vegetation 719 !- 720 pref_soil_veg_sand(j) = pref_soil_veg_sand_mtc(pft_to_mtc(j)) 721 pref_soil_veg_loan(j) = pref_soil_veg_loan_mtc(pft_to_mtc(j)) 722 pref_soil_veg_clay(j) = pref_soil_veg_clay_mtc(pft_to_mtc(j)) 723 724 !- 687 725 ! Photosynthesis 688 !- ---------------689 ! -726 !- 727 ! 690 728 ! 1 .CO2 691 ! -729 ! 692 730 is_c4(j) = is_c4_mtc(pft_to_mtc(j)) 693 731 gsslope(j) = gsslope_mtc(pft_to_mtc(j)) … … 698 736 co2_topt_fix(j) = co2_topt_fix_mtc(pft_to_mtc(j)) 699 737 co2_tmax_fix(j) = co2_tmax_fix_mtc(pft_to_mtc(j)) 700 ! -738 ! 701 739 ! 2 .Stomate 702 ! -740 ! 703 741 ext_coeff(j) = ext_coeff_mtc(pft_to_mtc(j)) 704 742 vcmax_opt(j) = vcmax_opt_mtc(pft_to_mtc(j)) … … 713 751 tphoto_max_b(j) = tphoto_max_b_mtc(pft_to_mtc(j)) 714 752 tphoto_max_c(j) = tphoto_max_c_mtc(pft_to_mtc(j)) 715 !- ---------------------753 !- 716 754 ! Respiration - stomate 717 !- ---------------------755 !- 718 756 maint_resp_slope_c(j) = maint_resp_slope_c_mtc(pft_to_mtc(j)) 719 757 maint_resp_slope_b(j) = maint_resp_slope_b_mtc(pft_to_mtc(j)) … … 727 765 cm_zero_fruit(j) = cm_zero_fruit_mtc(pft_to_mtc(j)) 728 766 cm_zero_carbres(j) = cm_zero_carbres_mtc(pft_to_mtc(j)) 729 !- ---------------767 !- 730 768 ! Fire - stomate 731 !- --------------769 !- 732 770 flam(j) = flam_mtc(pft_to_mtc(j)) 733 771 resist(j) = resist_mtc(pft_to_mtc(j)) 734 !- ---------------772 !- 735 773 ! Flux - LUC 736 !- --------------774 !- 737 775 coeff_lcchange_1(j) = coeff_lcchange_1_mtc(pft_to_mtc(j)) 738 776 coeff_lcchange_10(j) = coeff_lcchange_10_mtc(pft_to_mtc(j)) 739 777 coeff_lcchange_100(j) = coeff_lcchange_100_mtc(pft_to_mtc(j)) 740 !- ----------778 !- 741 779 ! Phenology 742 !- ----------743 ! -780 !- 781 ! 744 782 ! 1 .Stomate 745 ! -783 ! 746 784 lai_max(j) = lai_max_mtc(pft_to_mtc(j)) 747 785 pheno_model(j) = pheno_model_mtc(pft_to_mtc(j)) 748 786 pheno_type(j) = pheno_type_mtc(pft_to_mtc(j)) 749 ! -787 ! 750 788 ! 2. Leaf Onset 751 ! -789 ! 752 790 pheno_gdd_crit_c(j) = pheno_gdd_crit_c_mtc(pft_to_mtc(j)) 753 791 pheno_gdd_crit_b(j) = pheno_gdd_crit_b_mtc(pft_to_mtc(j)) … … 764 802 alloc_max(j) = alloc_max_mtc(pft_to_mtc(j)) 765 803 demi_alloc(j) = demi_alloc_mtc(pft_to_mtc(j)) 766 !- 804 !>> DS new for merge in the trunk ! 15/06/2011 805 leaflife_tab(j) = leaflife_mtc(pft_to_mtc(j)) 806 ! 767 807 ! 3. Senescence 768 ! -808 ! 769 809 leaffall(j) = leaffall_mtc(pft_to_mtc(j)) 770 810 leafagecrit(j) = leafagecrit_mtc(pft_to_mtc(j)) … … 778 818 senescence_temp_b(j) = senescence_temp_b_mtc(pft_to_mtc(j)) 779 819 senescence_temp_a(j) = senescence_temp_a_mtc(pft_to_mtc(j)) 780 !- ----------820 !- 781 821 ! DGVM 782 !-----------783 822 residence_time(j) = residence_time_mtc(pft_to_mtc(j)) 784 823 tmin_crit(j) = tmin_crit_mtc(pft_to_mtc(j)) 785 824 tcm_crit(j) = tcm_crit_mtc(pft_to_mtc(j)) 786 825 787 !------------------------------- 788 ! Evapotranspiration - sechiba 789 !------------------------------- 790 !- 791 rstruct_const(j) = rstruct_const_mtc(pft_to_mtc(j)) 792 kzero(j) = kzero_mtc(pft_to_mtc(j)) 793 !------------------- 794 ! Water - sechiba 795 !------------------- 796 !- 797 wmax_veg(j) = wmax_veg_mtc(pft_to_mtc(j)) 798 humcste(j) = humcste_mtc(pft_to_mtc(j)) 799 !------------------ 800 ! Albedo - sechiba 801 !------------------ 802 !- 803 snowa_ini(j) = snowa_ini_mtc(pft_to_mtc(j)) 804 snowa_dec(j) = snowa_dec_mtc(pft_to_mtc(j)) 805 alb_leaf_vis(j) = alb_leaf_vis_mtc(pft_to_mtc(j)) 806 alb_leaf_nir(j) = alb_leaf_nir_mtc(pft_to_mtc(j)) 807 !------------------------ 808 ! Soil - vegetation 809 !------------------------ 810 pref_soil_veg_sand(j) = pref_soil_veg_sand_mtc(pft_to_mtc(j)) 811 pref_soil_veg_loan(j) = pref_soil_veg_loan_mtc(pft_to_mtc(j)) 812 pref_soil_veg_clay(j) = pref_soil_veg_clay_mtc(pft_to_mtc(j)) 813 !------------------------------- 814 ! Parameters already externalised (from sechiba) 815 ! to classify 816 !---------------------------------- 817 throughfall_by_pft(j) = throughfall_by_mtc(pft_to_mtc(j)) 818 rveg_pft(j) = rveg_mtc(pft_to_mtc(j)) 819 820 ! end loop over nvm 821 ENDDO 826 ENDDO ! end loop over nvm 822 827 823 828 END SUBROUTINE pft_parameters_init … … 840 845 l_error = l_error .OR. (ier .NE. 0) 841 846 !- 847 !>> DS new for merge in the trunk ! 15/06/2011 848 ! Add for writing history files in stomate_lpj.f90 'treeFracPrimDec' and 'treeFracPrimEver' 849 ALLOCATE(is_deciduous(nvm),stat=ier) 850 l_error = l_error .OR. (ier .NE. 0) 851 ALLOCATE(is_evergreen(nvm),stat=ier) 852 l_error = l_error .OR. (ier .NE. 0) 853 ALLOCATE(is_c3(nvm),stat=ier) 854 l_error = l_error .OR. (ier .NE. 0) 855 ALLOCATE(leaflife_tab(nvm),stat=ier) 856 l_error = l_error .OR. (ier .NE. 0) 857 ! >> END 858 842 859 ALLOCATE(veget_ori_fixed_test_1(nvm),stat=ier) 843 860 l_error = l_error .OR. (ier .NE. 0) … … 1066 1083 1067 1084 END SUBROUTINE pft_parameters_alloc 1085 ! 1086 != 1087 ! 1088 SUBROUTINE getin_sechiba_pft_parameters 1089 1090 IMPLICIT NONE 1091 1092 LOGICAL, SAVE :: first_call = .TRUE. 1093 1094 IF(first_call) THEN 1095 1096 ! No calling to getin for veget_ori_fixed_test_1, llaimax and height_presc 1097 ! use of setvar in slowproc.f90 1098 1099 !- 1100 ! Vegetation structure 1101 !- 1102 CALL getin_p('LLAIMIN',llaimin) 1103 CALL getin('TYPE_OF_LAI',type_of_lai) 1104 CALL getin_p('IS_TREE',is_tree) 1105 CALL getin_p('NATURAL',natural) 1106 1107 !>> DS new for merge in the trunk ! 15/06/2011 1108 ! Add for writing history files in stomate_lpj.f90 'treeFracPrimDec' and 'treeFracPrimEver' 1109 CALL getin('IS_DECIDUOUS',is_deciduous) 1110 CALL getin('IS_EVERGREEN',is_evergreen) 1111 CALL getin_p('IS_C3',is_c3) 1112 1113 !- 1114 ! Photosynthesis 1115 !- 1116 CALL getin_p('IS_C4',is_c4) 1117 CALL getin_p('GSSLOPE',gsslope) 1118 CALL getin_p('GSOFFSET',gsoffset) 1119 CALL getin_p('VCMAX_FIX',vcmax_fix) 1120 CALL getin_p('VJMAX_FIX',vjmax_fix) 1121 CALL getin_p('CO2_TMIN_FIX',co2_tmin_fix) 1122 CALL getin_p('CO2_TOPT_FIX',co2_topt_fix) 1123 CALL getin_p('CO2_TMAX_FIX',co2_tmax_fix) 1124 CALL getin_p('EXT_COEFF',ext_coeff) 1125 !- 1126 ! Evapotranspiration - sechiba 1127 !- 1128 CALL getin_p('RSTRUCT_CONST',rstruct_const) 1129 CALL getin_p('KZERO',kzero) 1130 CALL getin_p('RVEG_PFT', rveg_pft) 1131 !- 1132 ! Water-hydrology - sechiba 1133 !- 1134 CALL getin_p('WMAX_VEG',wmax_veg) 1135 CALL getin_p('HYDROL_HUMCSTE', humcste) 1136 CALL getin_p('PERCENT_TROUGHFALL_PFT',throughfall_by_pft) 1137 !- 1138 ! Albedo - sechiba 1139 !- 1140 CALL getin_p('SNOWA_INI',snowa_ini) 1141 CALL getin_p('SNOWA_DEC',snowa_dec) 1142 CALL getin_p('ALB_LEAF_VIS',alb_leaf_vis) 1143 CALL getin_p('ALB_LEAF_NIR',alb_leaf_nir) 1144 !- 1145 ! Soil - vegetation 1146 !- 1147 CALL getin_p('PREF_SOIL_VEG_SAND',pref_soil_veg_sand) 1148 CALL getin_p('PREF_SOIL_VEG_LOAN',pref_soil_veg_loan) 1149 CALL getin_p('PREF_SOIL_VEG_CLAY',pref_soil_veg_clay) 1150 1151 first_call = .FALSE. 1152 1153 ENDIF 1154 1155 END SUBROUTINE getin_sechiba_pft_parameters 1156 ! 1157 != 1158 ! 1159 SUBROUTINE getin_stomate_pft_parameters 1160 1161 IMPLICIT NONE 1162 1163 LOGICAL, SAVE :: first_call = .TRUE. 1164 1165 IF(first_call) THEN 1166 1167 !- 1168 ! Vegetation structure 1169 !- 1170 CALL getin_p('LEAF_TAB',leaf_tab) 1171 CALL getin_p('SLA',sla) 1172 !- 1173 ! Photosynthesis 1174 !- 1175 CALL getin_p('VCMAX_OPT',vcmax_opt) 1176 CALL getin_p('VJMAX_OPT',vjmax_opt) 1177 CALL getin_p('TPHOTO_MIN_A',tphoto_min_a) 1178 CALL getin_p('TPHOTO_MIN_B',tphoto_min_b) 1179 CALL getin_p('TPHOTO_MIN_C',tphoto_min_c) 1180 CALL getin_p('TPHOTO_OPT_A',tphoto_opt_a) 1181 CALL getin_p('TPHOTO_OPT_B',tphoto_opt_b) 1182 CALL getin_p('TPHOTO_OPT_C',tphoto_opt_c) 1183 CALL getin_p('TPHOTO_MAX_A',tphoto_max_a) 1184 CALL getin_p('TPHOTO_MAX_B',tphoto_max_b) 1185 CALL getin_p('TPHOTO_MAX_C',tphoto_max_c) 1186 !- 1187 ! Respiration - stomate 1188 !- 1189 CALL getin_p('MAINT_RESP_SLOPE_C',maint_resp_slope_c) 1190 CALL getin_p('MAINT_RESP_SLOPE_B',maint_resp_slope_b) 1191 CALL getin_p('MAINT_RESP_SLOPE_A',maint_resp_slope_a) 1192 CALL getin_p('CM_ZERO_LEAF',cm_zero_leaf) 1193 CALL getin_p('CM_ZERO_SAPABOVE',cm_zero_sapabove) 1194 CALL getin_p('CM_ZERO_SAPBELOW',cm_zero_sapbelow) 1195 CALL getin_p('CM_ZERO_HEARTABOVE',cm_zero_heartabove) 1196 CALL getin_p('CM_ZERO_HEARTBELOW',cm_zero_heartbelow) 1197 CALL getin_p('CM_ZERO_ROOT',cm_zero_root) 1198 CALL getin_p('CM_ZERO_FRUIT',cm_zero_fruit) 1199 CALL getin_p('CM_ZERO_CARBRES',cm_zero_carbres) 1200 !- 1201 ! Fire - stomate 1202 !- 1203 CALL getin_p('FLAM',flam) 1204 CALL getin_p('RESIST',resist) 1205 !- 1206 ! Flux - LUC 1207 !- 1208 CALL getin_p('COEFF_LCCHANGE_1',coeff_lcchange_1) 1209 CALL getin_p('COEFF_LCCHANGE_10',coeff_lcchange_10) 1210 CALL getin_p('COEFF_LCCHANGE_100',coeff_lcchange_100) 1211 !- 1212 ! Phenology 1213 !- 1214 CALL getin_p('LAI_MAX',lai_max) 1215 CALL getin('PHENO_MODEL',pheno_model) 1216 CALL getin_p('PHENO_TYPE',pheno_type) 1217 !- 1218 ! Phenology : Leaf Onset 1219 !- 1220 CALL getin_p('PHENO_GDD_CRIT_C',pheno_gdd_crit_c) 1221 CALL getin_p('PHENO_GDD_CRIT_B',pheno_gdd_crit_b) 1222 CALL getin_p('PHENO_GDD_CRIT_A',pheno_gdd_crit_a) 1223 CALL getin_p('NGD_CRIT',ngd_crit) 1224 CALL getin_p('NCDGDD_TEMP', ncdgdd_temp) 1225 CALL getin_p('HUM_FRAC', hum_frac) 1226 CALL getin_p('LOWGPP_TIME', lowgpp_time) 1227 CALL getin_p('HUM_MIN_TIME', hum_min_time) 1228 CALL getin_p('TAU_SAP',tau_sap) 1229 CALL getin_p('TAU_FRUIT',tau_fruit) 1230 CALL getin_p('ECUREUIL',ecureuil) 1231 CALL getin_p('ALLOC_MIN',alloc_min) 1232 CALL getin_p('ALLOC_MAX',alloc_max) 1233 CALL getin_p('DEMI_ALLOC',demi_alloc) 1234 1235 !>> DS new for merge in the trunk 1236 ! 15/06/2011 : add leaflife_mtc for the new formalism used for calculate sla 1237 CALL getin_p('LEAFLIFE_TAB',leaflife_tab) 1238 1239 !- 1240 ! Phenology : Senescence 1241 !- 1242 CALL getin_p('LEAFFALL',leaffall) 1243 CALL getin_p('LEAFAGECRIT',leafagecrit) 1244 CALL getin('SENESCENCE_TYPE', senescence_type) 1245 CALL getin_p('SENESCENCE_HUM', senescence_hum) 1246 CALL getin_p('NOSENESCENCE_HUM', nosenescence_hum) 1247 CALL getin_p('MAX_TURNOVER_TIME',max_turnover_time) 1248 CALL getin_p('MIN_TURNOVER_TIME',min_turnover_time) 1249 CALL getin_p('MIN_LEAF_AGE_FOR_SENESCENCE', min_leaf_age_for_senescence) 1250 CALL getin_p('SENESCENCE_TEMP_C',senescence_temp_c) 1251 CALL getin_p('SENESCENCE_TEMP_B',senescence_temp_b) 1252 CALL getin_p('SENESCENCE_TEMP_A',senescence_temp_a) 1253 !- 1254 ! DGVM 1255 !- 1256 CALL getin_p('RESIDENCE_TIME',residence_time) 1257 CALL getin_p('TMIN_CRIT',tmin_crit) 1258 CALL getin_p('TCM_CRIT',tcm_crit) 1259 1260 first_call = .FALSE. 1261 1262 ENDIF 1263 1264 END SUBROUTINE getin_stomate_pft_parameters 1068 1265 ! 1069 1266 != 1070 1267 ! 1071 1268 SUBROUTINE pft_parameters_clear 1072 1269 1073 1270 l_first_define_pft = .TRUE. 1074 1271 1075 1272 IF(ALLOCATED(pft_to_mtc))DEALLOCATE(pft_to_mtc) 1076 1273 IF(ALLOCATED(PFT_name))DEALLOCATE(PFT_name) 1274 !- 1275 !>> DS new for merge in the trunk ! 15/06/2011 1276 ! Add for writing history files in stomate_lpj.f90 'treeFracPrimDec' and 'treeFracPrimEver' 1277 IF(ALLOCATED(is_deciduous))DEALLOCATE(is_deciduous) 1278 IF(ALLOCATED(is_evergreen))DEALLOCATE(is_evergreen) 1279 IF(ALLOCATED(leaflife_tab))DEALLOCATE(leaflife_tab) 1280 IF(ALLOCATED(is_c3))DEALLOCATE(is_c3) 1077 1281 !- 1078 1282 IF(ALLOCATED(veget_ori_fixed_test_1))DEALLOCATE(veget_ori_fixed_test_1) … … 1194 1398 !- 1195 1399 IF(ALLOCATED(throughfall_by_pft))DEALLOCATE(throughfall_by_pft) 1196 IF 1197 1400 IF(ALLOCATED(rveg_pft))DEALLOCATE(rveg_pft) 1401 1198 1402 END SUBROUTINE pft_parameters_clear 1199 !1200 !=1201 !1202 SUBROUTINE getin_sechiba_pft_parameters1203 1204 IMPLICIT NONE1205 1206 LOGICAL, SAVE :: first_call = .TRUE.1207 1208 IF(first_call) THEN1209 1210 !----------------------1211 ! Vegetation structure1212 !---------------------1213 !1214 CALL getin('LLAIMIN',llaimin)1215 CALL getin('TYPE_OF_LAI',type_of_lai)1216 CALL getin('IS_TREE',is_tree)1217 ! No calling to getin for1218 ! veget_ori_fixed_test_1, llaimax and height_presc1219 ! use of setvar in slowproc.f901220 1221 !-----------------1222 ! Photosynthesis1223 !-----------------1224 !-1225 CALL getin('IS_C4',is_c4)1226 CALL getin('GSSLOPE',gsslope)1227 CALL getin('GSOFFSET',gsoffset)1228 CALL getin('VCMAX_FIX',vcmax_fix)1229 CALL getin('VJMAX_FIX',vjmax_fix)1230 CALL getin('CO2_TMIN_FIX',co2_tmin_fix)1231 CALL getin('CO2_TOPT_FIX',co2_topt_fix)1232 CALL getin('CO2_TMAX_FIX',co2_tmax_fix)1233 CALL getin('EXT_COEFF',ext_coeff)1234 !-------------------------------1235 ! Evapotranspiration - sechiba1236 !-------------------------------1237 !1238 CALL getin('RSTRUCT_CONST',rstruct_const)1239 CALL getin('KZERO',kzero)1240 CALL getin('RVEG_PFT', rveg_pft)1241 !---------------------------1242 ! Water-hydrology - sechiba1243 !---------------------------1244 !1245 CALL getin('WMAX_VEG',wmax_veg)1246 CALL getin('HYDROL_HUMCSTE', humcste)1247 CALL getin('PERCENT_TROUGHFALL_PFT',throughfall_by_pft)1248 !------------------1249 ! Albedo - sechiba1250 !------------------1251 !1252 CALL getin('SNOWA_INI',snowa_ini)1253 CALL getin('SNOWA_DEC',snowa_dec)1254 CALL getin('ALB_LEAF_VIS',alb_leaf_vis)1255 CALL getin('ALB_LEAF_NIR',alb_leaf_nir)1256 1257 !------------------------1258 ! Soil - vegetation1259 !------------------------1260 !1261 CALL getin('PREF_SOIL_VEG_SAND',pref_soil_veg_sand)1262 CALL getin('PREF_SOIL_VEG_LOAN',pref_soil_veg_loan)1263 CALL getin('PREF_SOIL_VEG_CLAY',pref_soil_veg_clay)1264 1265 first_call = .FALSE.1266 1267 ENDIF1268 1269 END SUBROUTINE getin_sechiba_pft_parameters1270 !1271 !=1272 !1273 SUBROUTINE getin_stomate_pft_parameters1274 1275 IMPLICIT NONE1276 1277 LOGICAL, SAVE :: first_call = .TRUE.1278 1279 IF(first_call) THEN1280 1281 !----------------------1282 ! Vegetation structure1283 !---------------------1284 !1285 CALL getin('LEAF_TAB',leaf_tab)1286 CALL getin('SLA',sla)1287 CALL getin('NATURAL',natural)1288 !-----------------1289 ! Photosynthesis1290 !-----------------1291 !1292 CALL getin('VCMAX_OPT',vcmax_opt)1293 CALL getin('VJMAX_OPT',vjmax_opt)1294 CALL getin('TPHOTO_MIN_A',tphoto_min_a)1295 CALL getin('TPHOTO_MIN_B',tphoto_min_b)1296 CALL getin('TPHOTO_MIN_C',tphoto_min_c)1297 CALL getin('TPHOTO_OPT_A',tphoto_opt_a)1298 CALL getin('TPHOTO_OPT_B',tphoto_opt_b)1299 CALL getin('TPHOTO_OPT_C',tphoto_opt_c)1300 CALL getin('TPHOTO_MAX_A',tphoto_max_a)1301 CALL getin('TPHOTO_MAX_B',tphoto_max_b)1302 CALL getin('TPHOTO_MAX_C',tphoto_max_c)1303 !----------------------1304 ! Respiration - stomate1305 !----------------------1306 !1307 CALL getin('MAINT_RESP_SLOPE_C',maint_resp_slope_c)1308 CALL getin('MAINT_RESP_SLOPE_B',maint_resp_slope_b)1309 CALL getin('MAINT_RESP_SLOPE_A',maint_resp_slope_a)1310 CALL getin('CM_ZERO_LEAF',cm_zero_leaf)1311 CALL getin('CM_ZERO_SAPABOVE',cm_zero_sapabove)1312 CALL getin('CM_ZERO_SAPBELOW',cm_zero_sapbelow)1313 CALL getin('CM_ZERO_HEARTABOVE',cm_zero_heartabove)1314 CALL getin('CM_ZERO_HEARTBELOW',cm_zero_heartbelow)1315 CALL getin('CM_ZERO_ROOT',cm_zero_root)1316 CALL getin('CM_ZERO_FRUIT',cm_zero_fruit)1317 CALL getin('CM_ZERO_CARBRES',cm_zero_carbres)1318 1319 !----------------1320 ! Fire - stomate1321 !---------------1322 !1323 CALL getin('FLAM',flam)1324 CALL getin('RESIST',resist)1325 !----------------1326 ! Flux - LUC1327 !---------------1328 !1329 CALL getin('COEFF_LCCHANGE_1',coeff_lcchange_1)1330 CALL getin('COEFF_LCCHANGE_10',coeff_lcchange_10)1331 CALL getin('COEFF_LCCHANGE_100',coeff_lcchange_100)1332 1333 !-----------1334 ! Phenology1335 !-----------1336 !-1337 ! 1 .Stomate1338 !-1339 CALL getin('LAI_MAX',lai_max)1340 CALL getin('PHENO_MODEL',pheno_model)1341 CALL getin('PHENO_TYPE',pheno_type)1342 !-1343 ! 2. Leaf Onset1344 !-1345 CALL getin('PHENO_GDD_CRIT_C',pheno_gdd_crit_c)1346 CALL getin('PHENO_GDD_CRIT_B',pheno_gdd_crit_b)1347 CALL getin('PHENO_GDD_CRIT_A',pheno_gdd_crit_a)1348 CALL getin('NGD_CRIT',ngd_crit)1349 CALL getin('NCDGDD_TEMP', ncdgdd_temp)1350 CALL getin('HUM_FRAC', hum_frac)1351 CALL getin('LOWGPP_TIME', lowgpp_time)1352 CALL getin('HUM_MIN_TIME', hum_min_time)1353 CALL getin('TAU_SAP',tau_sap)1354 CALL getin('TAU_FRUIT',tau_fruit)1355 CALL getin('ECUREUIL',ecureuil)1356 CALL getin('ALLOC_MIN',alloc_min)1357 CALL getin('ALLOC_MAX',alloc_max)1358 CALL getin('DEMI_ALLOC',demi_alloc)1359 !-1360 ! 3. Senescence1361 !-1362 CALL getin('LEAFFALL',leaffall)1363 CALL getin('LEAFAGECRIT',leafagecrit)1364 CALL getin('SENESCENCE_TYPE', senescence_type)1365 CALL getin('SENESCENCE_HUM', senescence_hum)1366 CALL getin('NOSENESCENCE_HUM', nosenescence_hum)1367 CALL getin('MAX_TURNOVER_TIME',max_turnover_time)1368 CALL getin('MIN_TURNOVER_TIME',min_turnover_time)1369 CALL getin('MIN_LEAF_AGE_FOR_SENESCENCE', min_leaf_age_for_senescence)1370 CALL getin('SENESCENCE_TEMP_C',senescence_temp_c)1371 CALL getin('SENESCENCE_TEMP_B',senescence_temp_b)1372 CALL getin('SENESCENCE_TEMP_A',senescence_temp_a)1373 !-----------1374 ! DGVM1375 !-----------1376 CALL getin('RESIDENCE_TIME',residence_time)1377 CALL getin('TMIN_CRIT',tmin_crit)1378 CALL getin('TCM_CRIT',tcm_crit)1379 1380 first_call = .FALSE.1381 1382 ENDIF1383 1384 END SUBROUTINE getin_stomate_pft_parameters1385 1403 1386 1404 END MODULE pft_parameters -
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/AA_make
r64 r257 1 1 #- 2 #- $Id: AA_make,v 1.22 2010/04/20 13:59:56 ssipsl Exp $ 2 #- $Id: AA_make 41 2011-01-01 19:56:53Z mmaipsl $ 3 #- 4 PARALLEL_LIB = $(LIBDIR)/libparallel.a 5 SXPARALLEL_LIB = $(PARALLEL_LIB) 6 #-Q- sxnec SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 7 #-Q- sx6nec SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 8 #-Q- eshpux SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 9 #-Q- sx8brodie SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 3 10 #- 4 11 PARAM_LIB = $(LIBDIR)/libparameters.a … … 8 15 #-Q- eshpux SXPARAM_LIB = $(LIBDIR)/libsxparameters.a 9 16 #-Q- sx8brodie SXPARAM_LIB = $(LIBDIR)/libsxparameters.a 10 #-11 PARALLEL_LIB = $(LIBDIR)/libparallel.a12 SXPARALLEL_LIB = $(PARALLEL_LIB)13 #-Q- sxnec SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a14 #-Q- sx6nec SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a15 #-Q- eshpux SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a16 #-Q- sx8brodie SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a17 17 #- 18 18 ORGLOB_LIB = $(LIBDIR)/liborglob.a … … 54 54 #- 55 55 all: 56 $(M_K) libparallel 56 57 $(M_K) libparameters 57 $(M_K) lib parallel58 $(M_K) liborglob 58 59 $(M_K) libstomate 59 60 $(M_K) m_all … … 63 64 #-Q- intel m_all: WORK_MOD $(MODEL_LIB)($(OBJSMODS1)) 64 65 66 libparallel: 67 (cd ../src_parallel; $(M_K) -f Makefile) 68 65 69 libparameters: 66 70 (cd ../src_parameters; $(M_K) -f Makefile) 67 68 libparallel:69 (cd ../src_parallel; $(M_K) -f Makefile)70 71 71 72 liborglob: -
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/AA_make.ldef
r64 r257 1 1 #- 2 #- $Id: AA_make.ldef ,v 1.7 2008/01/08 11:49:07 ssipsl Exp$2 #- $Id: AA_make.ldef 12 2010-11-05 15:42:13Z mmaipsl $ 3 3 #- 4 4 #--------------------------------------------------------------------- -
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/condveg.f90
r104 r257 6 6 !! 7 7 !! @author Marie-Alice Foujols and Jan Polcher 8 !! @Version : $Revision: 1.30 $, $Date: 2009/01/07 13:39:45$8 !! @Version : $Revision: 45 $, $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 9 9 !! 10 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/condveg.f90,v 1.30 2009/01/07 13:39:45 ssipsl Exp $ 10 !< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/condveg.f90 $ 11 !< $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 12 !< $Author: mmaipsl $ 13 !< $Revision: 45 $ 11 14 !! IPSL (2006) 12 15 !! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC … … 210 213 REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (in):: veget !! Vegetation distribution 211 214 REAL(r_std),DIMENSION (kjpindex,2), INTENT (in) :: lalo !! Geographical coordinates 212 INTEGER(i_std),DIMENSION (kjpindex, 4), INTENT(in):: neighbours !! neighoring grid points if land215 INTEGER(i_std),DIMENSION (kjpindex,8), INTENT(in):: neighbours !! neighoring grid points if land 213 216 REAL(r_std), DIMENSION (kjpindex,2), INTENT(in) :: resolution !! size in x an y of the grid (m) 214 217 REAL(r_std),DIMENSION (kjpindex), INTENT(in) :: contfrac ! Fraction of land in each grid box. … … 663 666 ! snow albedo on vegetated surfaces 664 667 ! 665 fraction_veg(:) = 1.- totfrac_nobio(:)666 snowa_veg(:) = 0.668 fraction_veg(:) = un - totfrac_nobio(:) 669 snowa_veg(:) = zero 667 670 DO jv = 1, nvm 668 671 DO ji = 1, kjpindex … … 1112 1115 ENDDO 1113 1116 ! 1114 WHERE ( sumveg(:) .GT. 0.0) z0(:) = z0(:) / sumveg(:)1117 WHERE ( sumveg(:) .GT. zero ) z0(:) = z0(:) / sumveg(:) 1115 1118 ! 1116 1119 z0(:) = (un - totfrac_nobio(:)) * z0(:) … … 1166 1169 ! 1167 1170 !!$ DS :Correction 11/02/2011 : update 2D parameters 1168 !!$ before the components were updated but not the parameter itself!1169 1171 alb_leaf(1:nvm) = alb_leaf_vis(:) 1170 1172 alb_leaf(nvm+1:2*nvm) = alb_leaf_nir(:) 1171 !!$ maybe we could use directly alb_leaf_vis and alb_leaf_nir in alb_leaf_temp1172 !1173 !!$ alb_leaf_tmp(:,1) = alb_leaf_vis(:)1174 !!$ alb_leaf_tmp(:,2) = alb_leaf_nir(:)1175 1173 ! 1176 1174 alb_leaf_tmp(:,1) = alb_leaf(1:nvm) … … 1188 1186 ! 1189 1187 ! Correction Nathalie le 12 Avril 2006 - suppression de la dependance en deadleaf_cover 1190 !albedo(:,ks) = veget(:,1) * ( ( 1.-deadleaf_cover(:))*alb_bare(:) + &1188 !albedo(:,ks) = veget(:,1) * ( (un-deadleaf_cover(:))*alb_bare(:) + & 1191 1189 ! deadleaf_cover(:)*alb_deadleaf(ks) ) 1192 1190 albedo(:,ks) = veget(:,1) * alb_bare(:,ks) -
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/diffuco.f90
r105 r257 3 3 !! 4 4 !! @author Marie-Alice Foujols and Jan Polcher 5 !! @Version : $Revision: 1.35 $, $Date: 2010/04/07 09:16:40$5 !! @Version : $Revision: 42 $, $Date: 2011-01-01 21:15:03 +0100 (Sat, 01 Jan 2011) $ 6 6 !! 7 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/diffuco.f90,v 1.35 2010/04/07 09:16:40 ssipsl Exp $ 7 !< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/diffuco.f90 $ 8 !< $Date: 2011-01-01 21:15:03 +0100 (Sat, 01 Jan 2011) $ 9 !< $Author: mmaipsl $ 10 !< $Revision: 42 $ 8 11 !! IPSL (2006) 9 12 !! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC … … 38 41 !! Nathalie le 28 mars 2006 - sur proposition de Fred Hourdin, ajout 39 42 !! d'un potentiometre pour regler la resistance de la vegetation ( rveg is now in pft_parameters) 40 41 43 ! MM 42 44 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: wind !! Wind norm … … 242 244 ! beta coefficient for bare soil 243 245 ! 244 245 246 CALL diffuco_bare (kjpindex, dtradia, u, v, q_cdrag, rsol, evap_bare_lim, evapot, humrel, veget, vbeta4) 246 247 … … 744 745 IF ( zrapp .LT. un ) THEN 745 746 ! Ajout Nathalie - Juin 2006 746 vbeta23(ji,jv) = MAX(vbeta2(ji,jv) - vbeta2(ji,jv) * zrapp, 0.)747 vbeta23(ji,jv) = MAX(vbeta2(ji,jv) - vbeta2(ji,jv) * zrapp, zero) 747 748 ! Fin ajout Nathalie 748 749 vbeta2(ji,jv) = vbeta2(ji,jv) * zrapp … … 1004 1005 ! 1005 1006 DO jl = 1, nlai+1 1006 laitab(jl) = laimax*(EXP(lai_level_depth*REAL(jl-1,r_std))-1.)/(EXP(lai_level_depth*REAL(nlai,r_std))- 1.)1007 laitab(jl) = laimax*(EXP(lai_level_depth*REAL(jl-1,r_std))-1.)/(EXP(lai_level_depth*REAL(nlai,r_std))-un) 1007 1008 ENDDO 1008 1009 ! … … 1100 1101 ! 1101 1102 WHERE ( assimilate(:) ) 1102 water_lim(:) = MIN( 2.*humrel(:,jv), 1.)1103 water_lim(:) = MIN( 2.*humrel(:,jv), un ) 1103 1104 ENDWHERE 1104 1105 ! give a default value of ci for all pixel that do not assimilate … … 1255 1256 DO ji = 1, kjpindex 1256 1257 ! 1257 assimi(ji) = 0.1258 assimi(ji) = zero 1258 1259 ! 1259 1260 ENDDO … … 1288 1289 DO ji = 1, kjpindex 1289 1290 ! 1290 assimi(ji) = 0.1291 assimi(ji) = zero 1291 1292 ! 1292 1293 ENDDO … … 1383 1384 IF ( jl .EQ. 1 ) THEN 1384 1385 ! 1385 leaf_gs_top(:) = 0.1386 leaf_gs_top(:) = zero 1386 1387 ! 1387 1388 IF ( nic .GT. 0 ) then … … 1437 1438 laitab(ilai(iainia)+1) 1438 1439 ! 1439 rveget(iainia,jv) = 1./gstop(iainia)1440 rveget(iainia,jv) = un/gstop(iainia) 1440 1441 ! 1441 1442 ENDDO … … 1448 1449 ! 1449 1450 ! Correction Nathalie - le 27 Mars 2006 - Interdire a rstruct d'etre negatif 1450 !rstruct(iainia,jv) = 1./gstot(iainia) - &1451 !rstruct(iainia,jv) = un/gstot(iainia) - & 1451 1452 ! rveget(iainia,jv) 1452 rstruct(iainia,jv) = MAX( 1./gstot(iainia) - &1453 rstruct(iainia,jv) = MAX( un/gstot(iainia) - & 1453 1454 rveget(iainia,jv), min_sechiba) 1454 1455 ! … … 1556 1557 REAL(r_std) :: coeff_dew_veg 1557 1558 1558 vbeta2sum(:) = 0.1559 vbeta3sum(:) = 0.1559 vbeta2sum(:) = zero 1560 vbeta3sum(:) = zero 1560 1561 DO jv = 1, nvm 1561 1562 vbeta2sum(:) = vbeta2sum(:) + vbeta2(:,jv) … … 1593 1594 1594 1595 ! for vectorization: some arrays 1595 vegetsum(:) = 0.1596 vegetsum(:) = zero 1596 1597 DO jv = 1, nvm 1597 1598 vegetsum(:) = vegetsum(:) + veget(:,jv) 1598 1599 ENDDO 1599 vegetsum2(:) = 0.1600 vegetsum2(:) = zero 1600 1601 DO jv = 2, nvm 1601 1602 vegetsum2(:) = vegetsum2(:) + veget(:,jv) … … 1667 1668 & + dew_veg_poly_coeff(2)*lai(ji,jv) & 1668 1669 & + dew_veg_poly_coeff(1) 1669 1670 1671 1670 ELSE 1672 coeff_dew_veg= 1.1671 coeff_dew_veg=un 1673 1672 ENDIF 1674 1673 ELSE -
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/enerbil.f90
r113 r257 3 3 !! 4 4 !! @author Marie-Alice Foujols and Jan Polcher 5 !! @Version : $Revision: 1.24 $, $Date: 2009/01/07 13:39:45$5 !! @Version : $Revision: 47 $, $Date: 2011-01-01 21:34:45 +0100 (Sat, 01 Jan 2011) $ 6 6 !! 7 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/enerbil.f90,v 1.24 2009/01/07 13:39:45 ssipsl Exp $ 7 !< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/enerbil.f90 $ 8 !< $Date: 2011-01-01 21:34:45 +0100 (Sat, 01 Jan 2011) $ 9 !< $Author: mmaipsl $ 10 !< $Revision: 47 $ 8 11 !! IPSL (2006) 9 12 !! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC … … 121 124 REAL(r_std),DIMENSION (kjpindex), INTENT (inout) :: evapot !! Soil Potential Evaporation 122 125 REAL(r_std),DIMENSION (kjpindex), INTENT (inout) :: evapot_corr !! Soil Potential Evaporation Correction 126 REAL(r_std),DIMENSION (kjpindex), INTENT (inout) :: temp_sol !! Soil temperature 127 REAL(r_std),DIMENSION (kjpindex), INTENT (inout) :: qsurf !! Surface specific humidity 128 REAL(r_std),DIMENSION (kjpindex), INTENT (inout) :: fluxsens !! Sensible chaleur flux 129 REAL(r_std),DIMENSION (kjpindex), INTENT (inout) :: fluxlat !! Latent chaleur flux 130 REAL(r_std),DIMENSION (kjpindex), INTENT (inout) :: tsol_rad !! Tsol_rad 131 REAL(r_std),DIMENSION (kjpindex), INTENT (inout) :: vevapp !! Total of evaporation 132 REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (inout) :: gpp !! Assimilation, gC/m**2 total area. 133 REAL(r_std),DIMENSION (kjpindex), INTENT (inout) :: temp_sol_new !! New soil temperature 123 134 ! output fields 124 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: fluxsens !! Sensible chaleur flux125 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: fluxlat !! Latent chaleur flux126 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: vevapp !! Total of evaporation127 135 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: vevapnu !! Bare soil evaporation 128 136 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: vevapsno !! Snow evaporation 129 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: tsol_rad !! Tsol_rad130 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: temp_sol_new !! New soil temperature131 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: temp_sol !! Soil temperature132 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: qsurf !! Surface specific humidity133 137 REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out) :: transpir !! Transpiration 134 REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out) :: gpp !! Assimilation, gC/m**2 total area.135 138 REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out) :: vevapwet !! Interception 136 139 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: t2mdiag !! 2-meter temperature … … 281 284 ! output fields, they need to initialized somehow for the model forcing ORCHIDEE. 282 285 ! 283 REAL(r_std),DIMENSION (kjpindex), INTENT ( out):: temp_sol !! Soil temperature286 REAL(r_std),DIMENSION (kjpindex), INTENT (inout) :: temp_sol !! Soil temperature 284 287 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: temp_sol_new !! New soil temperature 285 288 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: qsurf !! near surface specific humidity … … 423 426 !Config the model is started without a restart file. 424 427 ! 425 CALL setvar_p (evapot, val_exp, 'ENERBIL_EVAPOT', 0.0_r_std)428 CALL setvar_p (evapot, val_exp, 'ENERBIL_EVAPOT', zero) 426 429 IF ( ok_var("evapot_corr") ) THEN 427 CALL setvar_p (evapot_corr, val_exp, 'ENERBIL_EVAPOT', 0.0_r_std)430 CALL setvar_p (evapot_corr, val_exp, 'ENERBIL_EVAPOT', zero) 428 431 ENDIF 429 432 ! … … 778 781 REAL(r_std) :: correction 779 782 REAL(r_std) :: speed, qc 783 LOGICAL,DIMENSION (kjpindex) :: warning_correction 780 784 ! initialisation 781 785 … … 840 844 ! grad_qsat(:)= (qsol_sat_new(:)- qsat_air(:)) / ((psnew(:) - epot_air(:)) / cp_air) ! * dtradia 841 845 !- Penser a sortir evapot en meme temps qu'evapot_corr tdo. 846 warning_correction(:)=.FALSE. 842 847 DO ji=1,kjpindex 843 848 … … 852 857 correction = chalev0 * rau(ji) * qc * grad_qsat(ji) * (un - vevapp(ji)/evapot(ji)) / correction 853 858 ELSE 854 WRITE(numout,*) "Denominateur de la correction de milly nul! Aucune correction appliquee"859 warning_correction(ji)=.TRUE. 855 860 ENDIF 856 861 ELSE … … 862 867 863 868 ENDDO 864 869 IF ( ANY(warning_correction) ) THEN 870 DO ji=1,kjpindex 871 IF ( warning_correction(ji) ) THEN 872 WRITE(numout,*) ji,"Denominateur de la correction de milly nul! Aucune correction appliquee" 873 ENDIF 874 ENDDO 875 ENDIF 865 876 IF (long_print) WRITE (numout,*) ' enerbil_flux done ' 866 877 … … 886 897 REAL(r_std),DIMENSION (kjpindex), INTENT (in) :: evapot !! Soil Potential Evaporation 887 898 REAL(r_std),DIMENSION (kjpindex, nvm), INTENT (in) :: humrel !! Relative humidity 888 !!$ DS 15022011 humrel was used in a previ uos version of Orchidee, developped by Nathalie. Need to be discussed if it should be introduces again899 !!$ DS 15022011 humrel was used in a previous version of Orchidee, developped by Nathalie. Need to be discussed if it should be introduces again 889 900 REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (in) :: vbeta2 !! Interception resistance 890 901 REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (in) :: vbeta3 !! Vegetation resistance … … 969 980 ELSEIF ( control%stomate_watchout ) THEN 970 981 971 gpp(:,:) = 0.0982 gpp(:,:) = zero 972 983 973 984 ENDIF … … 1001 1012 1002 1013 ! initialisation 1003 IF (long_print) WRITE (numout,*) ' enerbil_fusion start ', MINVAL(soilcap), MINLOC(soilcap),&1014 IF (long_print) WRITE (numout,*) ' enerbil_fusion start ', MINVAL(soilcap), MINLOC(soilcap),& 1004 1015 & MAXVAL(soilcap), MAXLOC(soilcap) 1005 1016 ! -
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/hydrol.f90
r112 r257 3 3 !! 4 4 !! @author Marie-Alice Foujols and Jan Polcher 5 !! @Version : $Revision: 1.36 $, $Date: 2009/01/07 13:39:45$5 !! @Version : $Revision: 45 $, $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 6 6 !! 7 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/hydrol.f90,v 1.36 2009/01/07 13:39:45 ssipsl Exp $ 7 !< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/hydrol.f90 $ 8 !< $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 9 !< $Author: mmaipsl $ 10 !< $Revision: 45 $ 8 11 !! IPSL (2006) 9 12 !! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC … … 224 227 !! We consider that any water on the ice is snow and we only peforme a water balance to have consistency. 225 228 !! The water balance is limite to + or - 10^6 so that accumulation is not endless 229 REAL(r_std),DIMENSION (kjpindex), INTENT (inout) :: runoff !! Complete runoff 230 REAL(r_std),DIMENSION (kjpindex), INTENT (inout) :: drainage !! Drainage 231 REAL(r_std),DIMENSION (kjpindex,nbdl), INTENT (inout):: shumdiag !! relative soil moisture 226 232 ! output fields 227 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: runoff !! Complete runoff228 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: drainage !! Drainage229 233 REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out) :: humrel !! Relative humidity 230 234 REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out) :: vegstress !! Veg. moisture stress (only for vegetation growth) 231 235 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: drysoil_frac !! function of litter wetness 232 REAL(r_std),DIMENSION (kjpindex,nbdl), INTENT (out):: shumdiag !! relative soil moisture233 236 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: litterhumdiag !! litter humidity 234 237 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: tot_melt !! Total melt … … 1082 1085 ! 1083 1086 DO jsl=1,nslm 1084 CALL setvar_p (us(:,:,:,jsl), val_exp, 'US_INIT', 0.0_r_std)1087 CALL setvar_p (us(:,:,:,jsl), val_exp, 'US_INIT', zero) 1085 1088 ENDDO 1086 1089 ! … … 1101 1104 !Config started without a restart file. 1102 1105 ! 1103 CALL setvar_p (ae_ns, val_exp, 'EVAPNU_SOIL', 0.0_r_std)1106 CALL setvar_p (ae_ns, val_exp, 'EVAPNU_SOIL', zero) 1104 1107 ! 1105 1108 !Config Key = HYDROL_SNOW … … 1110 1113 !Config started without a restart file. 1111 1114 ! 1112 CALL setvar_p (snow, val_exp, 'HYDROL_SNOW', 0.0_r_std)1115 CALL setvar_p (snow, val_exp, 'HYDROL_SNOW', zero) 1113 1116 ! 1114 1117 !Config Key = HYDROL_SNOWAGE … … 1119 1122 !Config started without a restart file. 1120 1123 ! 1121 CALL setvar_p (snow_age, val_exp, 'HYDROL_SNOWAGE', 0.0_r_std)1124 CALL setvar_p (snow_age, val_exp, 'HYDROL_SNOWAGE', zero) 1122 1125 ! 1123 1126 !Config Key = HYDROL_SNOW_NOBIO … … 1128 1131 !Config started without a restart file. 1129 1132 ! 1130 CALL setvar_p (snow_nobio, val_exp, 'HYDROL_SNOW_NOBIO', 0.0_r_std)1133 CALL setvar_p (snow_nobio, val_exp, 'HYDROL_SNOW_NOBIO', zero) 1131 1134 ! 1132 1135 !Config Key = HYDROL_SNOW_NOBIO_AGE … … 1137 1140 !Config started without a restart file. 1138 1141 ! 1139 CALL setvar_p (snow_nobio_age, val_exp, 'HYDROL_SNOW_NOBIO_AGE', 0.0_r_std)1142 CALL setvar_p (snow_nobio_age, val_exp, 'HYDROL_SNOW_NOBIO_AGE', zero) 1140 1143 ! 1141 1144 ! … … 1148 1151 !Config the model is started without a restart file. 1149 1152 ! 1150 CALL setvar_p (qsintveg, val_exp, 'HYDROL_QSV', 0.0_r_std)1153 CALL setvar_p (qsintveg, val_exp, 'HYDROL_QSV', zero) 1151 1154 ! 1152 1155 ! There is no need to configure the initialisation of resdist. If not available it is the vegetation map … … 1717 1720 IF (snow(ji).GT.sneige) THEN 1718 1721 ! 1719 snowmelt(ji) = ( 1.- frac_nobio(ji,iice))*(temp_sol_new(ji) - tp_00) * soilcap(ji) / chalfu01722 snowmelt(ji) = (un - frac_nobio(ji,iice))*(temp_sol_new(ji) - tp_00) * soilcap(ji) / chalfu0 1720 1723 ! 1721 1724 ! 1.3.1.1 enough snow for melting or not … … 1890 1893 REAL(r_std), DIMENSION (kjpindex,nvm) :: zqsintvegnew 1891 1894 LOGICAL, SAVE :: firstcall=.TRUE. 1892 ! REAL(r_std), SAVE, DIMENSION(nvm) :: throughfall_by_pft1893 1895 1894 1896 IF ( firstcall ) THEN … … 2078 2080 DO jv = 1, nvm 2079 2081 DO ji = 1, kjpindex 2080 IF ( ABS(qsintveg(ji,jv)) > 0..AND. ABS(qsintveg(ji,jv)) < EPS1 ) THEN2082 IF ( ABS(qsintveg(ji,jv)) > zero .AND. ABS(qsintveg(ji,jv)) < EPS1 ) THEN 2081 2083 qsintveg(ji,jv) = EPS1 2082 2084 ENDIF -
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/hydrolc.f90
r134 r257 3 3 !! 4 4 !! @author Marie-Alice Foujols and Jan Polcher 5 !! @Version : $Revision: 1.21 $, $Date: 2010/05/07 08:28:13$5 !! @Version : $Revision: 45 $, $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 6 6 !! 7 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/hydrolc.f90,v 1.21 2010/05/07 08:28:13 ssipsl Exp $ 7 !< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/hydrolc.f90 $ 8 !< $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 9 !< $Author: mmaipsl $ 10 !< $Revision: 45 $ 8 11 !! IPSL (2006) 9 12 !! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC … … 145 148 !! We consider that any water on the ice is snow and we only peforme a water balance to have consistency. 146 149 !! The water balance is limite to + or - 10^6 so that accumulation is not endless 150 REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (inout) :: humrel !! Relative humidity 151 REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (inout) :: vegstress !! Veg. moisture stress (only for vegetation growth) 152 REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (inout) :: qsintveg !! Water on vegetation due to interception 147 153 ! output fields 148 REAL(r_std),DIMENSION (kjpindex), INTENT ( out) :: run_off_tot !! Complete runoff149 REAL(r_std),DIMENSION (kjpindex), INTENT ( out) :: drainage !! Drainage150 REAL(r_std),DIMENSION (kjpindex,n vm), INTENT (out) :: humrel !! Relative humidity151 REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out) :: vegstress !! Veg. moisture stress (only for vegetation growth) 154 REAL(r_std),DIMENSION (kjpindex), INTENT (inout) :: run_off_tot !! Complete runoff 155 REAL(r_std),DIMENSION (kjpindex), INTENT (inout) :: drainage !! Drainage 156 REAL(r_std),DIMENSION (kjpindex,nbdl), INTENT (inout):: shumdiag !! relative soil moisture 157 152 158 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: rsol !! Resistence to bare soil evaporation 153 159 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: drysoil_frac !! Fraction of visibly dry soil (between 0 and 1) 154 REAL(r_std),DIMENSION (kjpindex,nbdl), INTENT (out):: shumdiag !! relative soil moisture155 160 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: litterhumdiag !! litter humidity 156 161 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: tot_melt !! Total melt 157 REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out) :: qsintveg !! Water on vegetation due to interception158 162 159 163 ! … … 293 297 CALL hydrolc_alma(kjpindex, index, .FALSE., qsintveg, snow, snow_nobio, soilwet) 294 298 ENDIF 295 296 299 297 300 ! … … 313 316 DO ji = 1, kjpindex 314 317 IF ( vegtot(ji) .GT. zero ) THEN 315 histvar(ji)=histvar(ji)+veget(ji,jv)/vegtot(ji)*MAX((0.1-dss(ji,jv))*mx_eau_eau, 0.0)318 histvar(ji)=histvar(ji)+veget(ji,jv)/vegtot(ji)*MAX((0.1-dss(ji,jv))*mx_eau_eau, zero) 316 319 ENDIF 317 320 ENDDO … … 322 325 CALL histwrite(hist_id, 'mrso', kjit, histvar, kjpindex, index) 323 326 324 histvar(:)=run_off_tot(:)/ 86400.327 histvar(:)=run_off_tot(:)/one_day 325 328 CALL histwrite(hist_id, 'mrros', kjit, histvar, kjpindex, index) 326 329 327 histvar(:)=(run_off_tot(:)+drainage(:))/ 86400.330 histvar(:)=(run_off_tot(:)+drainage(:))/one_day 328 331 CALL histwrite(hist_id, 'mrro', kjit, histvar, kjpindex, index) 329 332 330 histvar(:)=(precip_rain(:)-SUM(precisol(:,:),dim=2))/ 86400.333 histvar(:)=(precip_rain(:)-SUM(precisol(:,:),dim=2))/one_day 331 334 CALL histwrite(hist_id, 'prveg', kjit, histvar, kjpindex, index) 332 335 … … 369 372 DO ji = 1, kjpindex 370 373 IF ( vegtot(ji) .GT. zero ) THEN 371 histvar(ji)=histvar(ji)+veget(ji,jv)/vegtot(ji)*MAX((0.1-dss(ji,jv))*mx_eau_eau, 0.0)374 histvar(ji)=histvar(ji)+veget(ji,jv)/vegtot(ji)*MAX((0.1-dss(ji,jv))*mx_eau_eau, zero) 372 375 ENDIF 373 376 ENDDO … … 375 378 CALL histwrite(hist2_id, 'mrsos', kjit, histvar, kjpindex, index) 376 379 377 histvar(:)=(run_off_tot(:)+drainage(:))/ 86400.380 histvar(:)=(run_off_tot(:)+drainage(:))/one_day 378 381 CALL histwrite(hist2_id, 'mrro', kjit, histvar, kjpindex, index) 379 382 … … 772 775 !Config started without a restart file. 773 776 ! 774 CALL setvar_p (snow, val_exp, 'HYDROL_SNOW', 0.0_r_std)777 CALL setvar_p (snow, val_exp, 'HYDROL_SNOW', zero) 775 778 ! 776 779 !Config Key = HYDROL_SNOWAGE … … 781 784 !Config started without a restart file. 782 785 ! 783 CALL setvar_p (snow_age, val_exp, 'HYDROL_SNOWAGE', 0.0_r_std)786 CALL setvar_p (snow_age, val_exp, 'HYDROL_SNOWAGE', zero) 784 787 ! 785 788 !Config Key = HYDROL_SNOW_NOBIO … … 790 793 !Config started without a restart file. 791 794 ! 792 CALL setvar_p (snow_nobio, val_exp, 'HYDROL_SNOW_NOBIO', 0.0_r_std)795 CALL setvar_p (snow_nobio, val_exp, 'HYDROL_SNOW_NOBIO', zero) 793 796 ! 794 797 !Config Key = HYDROL_SNOW_NOBIO_AGE … … 799 802 !Config started without a restart file. 800 803 ! 801 CALL setvar_p (snow_nobio_age, val_exp, 'HYDROL_SNOW_NOBIO_AGE', 0.0_r_std)804 CALL setvar_p (snow_nobio_age, val_exp, 'HYDROL_SNOW_NOBIO_AGE', zero) 802 805 ! 803 806 !Config Key = HYDROL_HUMR … … 808 811 !Config started without a restart file. 809 812 ! 810 CALL setvar_p (humrel, val_exp,'HYDROL_HUMR', 1.0_r_std)811 CALL setvar_p (vegstress, val_exp,'HYDROL_HUMR', 1.0_r_std)813 CALL setvar_p (humrel, val_exp,'HYDROL_HUMR', un) 814 CALL setvar_p (vegstress, val_exp,'HYDROL_HUMR', un) 812 815 ! 813 816 !Config Key = HYDROL_BQSB … … 827 830 !Config started without a restart file. 828 831 ! 829 CALL setvar_p (gqsb, val_exp, 'HYDROL_GQSB', 0.0_r_std)832 CALL setvar_p (gqsb, val_exp, 'HYDROL_GQSB', zero) 830 833 ! 831 834 !Config Key = HYDROL_DSG … … 836 839 !Config started without a restart file. 837 840 ! 838 CALL setvar_p (dsg, val_exp, 'HYDROL_DSG', 0.0_r_std)841 CALL setvar_p (dsg, val_exp, 'HYDROL_DSG', zero) 839 842 840 843 ! set inital value for dsp if needed … … 872 875 !Config the model is started without a restart file. 873 876 ! 874 CALL setvar_p (qsintveg, val_exp, 'HYDROL_QSV', 0.0_r_std)877 CALL setvar_p (qsintveg, val_exp, 'HYDROL_QSV', zero) 875 878 ! 876 879 tmpdss = dsg - gqsb / mx_eau_eau … … 889 892 IF (.NOT. (dsg(ji,1).EQ. zero .OR. gqsb(ji,1).EQ.zero)) THEN 890 893 ! Ajouts Nathalie - Fred - le 28 Mars 2006 891 a_subgrd(ji)=MIN(MAX(dsg(ji,1)-dss(ji,1), 0.)/dsg_min,1.)894 a_subgrd(ji)=MIN(MAX(dsg(ji,1)-dss(ji,1),zero)/dsg_min,un) 892 895 ! 893 896 ENDIF … … 906 909 IF (.NOT. (dsg(ji,1).EQ. zero .OR. gqsb(ji,1).EQ.zero)) THEN 907 910 ! Ajouts Nathalie - Fred - le 28 Mars 2006 908 a_subgrd(ji)=MIN(MAX(dsg(ji,1)-dss(ji,1), 0.)/dsg_min,1.)911 a_subgrd(ji)=MIN(MAX(dsg(ji,1)-dss(ji,1),zero)/dsg_min,un) 909 912 ! 910 913 ENDIF … … 915 918 ! Correction Nathalie - le 28 Mars 2006 - re-ecriture drysoil_frac/hdry - Fred Hourdin 916 919 ! revu 22 novembre 2007 917 hdry(:) = a_subgrd(:)*dss(:,1) + ( 1.-a_subgrd(:))*dsp(:,1)920 hdry(:) = a_subgrd(:)*dss(:,1) + (un-a_subgrd(:))*dsp(:,1) 918 921 ENDIF 919 922 ! … … 1090 1093 1091 1094 ! The fraction of soil which is visibly dry (dry when dss = 0.1 m) 1092 drysoil_frac(:) = MIN(MAX(dss(:,1), 0.)*10._r_std, un)1095 drysoil_frac(:) = MIN(MAX(dss(:,1),zero)*10._r_std, un) 1093 1096 ! 1094 1097 ! Compute the resistance to bare soil evaporation … … 1102 1105 ! du fond. En gros, rsol=hdry*rsol_cste pour hdry < 1m70 1103 1106 !rsol(ji) = dss(ji,1) * rsol_cste 1104 !rsol(ji) = ( drysoil_frac(ji) + 1./(10.*(dpu_cste - drysoil_frac(ji))+1.e-10)**2 ) * rsol_cste1105 rsol(ji) = ( hdry(ji) + 1./(10.*(dpu_cste - hdry(ji))+1.e-10)**2 ) * rsol_cste1107 !rsol(ji) = ( drysoil_frac(ji) + un/(10.*(dpu_cste - drysoil_frac(ji))+1.e-10)**2 ) * rsol_cste 1108 rsol(ji) = ( hdry(ji) + un/(10.*(dpu_cste - hdry(ji))+1.e-10)**2 ) * rsol_cste 1106 1109 ENDIF 1107 1110 ENDDO … … 1124 1127 !!$ ( mean_dsg(ji) .GT. min_sechiba ) .AND. & 1125 1128 !!$ ( mean_dsg(ji) .LT. 5.E-4 ) ) THEN 1126 !!$ litterhumdiag(ji) = 0.01129 !!$ litterhumdiag(ji) = zero 1127 1130 !!$ ENDIF 1128 1131 !!$ ENDDO … … 1273 1276 IF (snow(ji).GT.sneige) THEN 1274 1277 ! 1275 snowmelt(ji) = ( 1.- frac_nobio(ji,iice))*(temp_sol_new(ji) - tp_00) * soilcap(ji) / chalfu01278 snowmelt(ji) = (un - frac_nobio(ji,iice))*(temp_sol_new(ji) - tp_00) * soilcap(ji) / chalfu0 1276 1279 ! 1277 1280 ! 1.3.1.1 enough snow for melting or not … … 1409 1412 & (un - snow_nobio_age(ji,iice)/max_snow_age) * dtradia/one_day ) * & 1410 1413 & EXP(-precip_snow(ji) / snow_trans) - snow_nobio_age(ji,iice) 1411 IF (d_age(ji) .GT. 0.) THEN1414 IF (d_age(ji) .GT. zero ) THEN 1412 1415 xx(ji) = MAX( tp_00 - temp_sol_new(ji), zero ) 1413 1416 xx(ji) = ( xx(ji) / 7._r_std ) ** 4._r_std … … 1456 1459 REAL(r_std), DIMENSION (kjpindex,nvm) :: zqsintvegnew 1457 1460 LOGICAL, SAVE :: firstcall=.TRUE. 1458 ! REAL(r_std), SAVE, DIMENSION(nvm) :: throughfall_by_pft1459 1461 1460 1462 IF ( firstcall ) THEN … … 1578 1580 ENDIF 1579 1581 ! 1580 IF (resdist(ji,jv) .GT. 0.) THEN1582 IF (resdist(ji,jv) .GT. zero) THEN 1581 1583 qsintveg2(ji,jv) = qsintveg(ji,jv)/resdist(ji,jv) 1582 1584 ELSE … … 1586 1588 ENDDO 1587 1589 ! 1588 vegchtot(:) = 0.1590 vegchtot(:) = zero 1589 1591 DO jv = 1, nvm 1590 1592 DO ji = 1, kjpindex … … 1595 1597 DO jv = 1, nvm 1596 1598 DO ji = 1, kjpindex 1597 IF ( vegchtot(ji) .GT. 0.) THEN1599 IF ( vegchtot(ji) .GT. zero ) THEN 1598 1600 gdq(ji,jv) = ABS(vmr(ji,jv)) * gqsb(ji,jv) 1599 1601 bdq(ji,jv) = ABS(vmr(ji,jv)) * bqsb(ji,jv) … … 1613 1615 DO jv = 1, nvm 1614 1616 DO ji = 1, kjpindex 1615 IF ( ( vegchtot(ji) .GT. 0. ) .AND. ( vmr(ji,jv) .LT. 0.) ) THEN1617 IF ( ( vegchtot(ji) .GT. zero ) .AND. ( vmr(ji,jv) .LT. zero ) ) THEN 1616 1618 gtr(ji) = gtr(ji) + gdq(ji,jv) 1617 1619 btr(ji) = btr(ji) + bdq(ji,jv) … … 1625 1627 DO jv = 1, nvm 1626 1628 DO ji = 1, kjpindex 1627 IF ( vegchtot(ji) .GT. 0..AND. ABS(vtr(ji)) .GT. EPS1) THEN1629 IF ( vegchtot(ji) .GT. zero .AND. ABS(vtr(ji)) .GT. EPS1) THEN 1628 1630 fra(ji) = vmr(ji,jv) / vtr(ji) 1629 IF ( vmr(ji,jv) .GT. 0.) THEN1630 IF (veget(ji,jv) .GT. 0.) THEN1631 IF ( vmr(ji,jv) .GT. zero) THEN 1632 IF (veget(ji,jv) .GT. zero) THEN 1631 1633 gqsb(ji,jv) = (resdist(ji,jv)*gqsb(ji,jv) + fra(ji)*gtr(ji))/veget(ji,jv) 1632 1634 bqsb(ji,jv) = (resdist(ji,jv)*bqsb(ji,jv) + fra(ji)*btr(ji))/veget(ji,jv) … … 2003 2005 IF (long_print) WRITE(numout,*) 'hydrolc_soil 3.0 : Vertical diffusion' 2004 2006 2005 mean_bqsb(:) = 0.2006 mean_gqsb(:) = 0.2007 mean_bqsb(:) = zero 2008 mean_gqsb(:) = zero 2007 2009 DO jv = 1, nvm 2008 2010 DO ji = 1, kjpindex … … 2030 2032 DO ji = 1, kjpindex 2031 2033 IF (lbad_ij(ji)) THEN 2032 IF ( veget(ji,jv) .GT. 0.) THEN2034 IF ( veget(ji,jv) .GT. zero ) THEN 2033 2035 ! 2034 2036 bqsb(ji,jv) = mean_bqsb(ji) … … 2056 2058 ! ! 2057 2059 ! DO ji = 1, kjpindex 2058 ! IF ( veget(ji,jv) .GT. 0.) THEN2060 ! IF ( veget(ji,jv) .GT. zero ) THEN 2059 2061 ! ! 2060 2062 ! bqsb(ji,jv) = mean_bqsb(ji) … … 2082 2084 ENDDO 2083 2085 ! 2084 mean_bqsb(:) = 0.2085 mean_gqsb(:) = 0.2086 mean_bqsb(:) = zero 2087 mean_gqsb(:) = zero 2086 2088 DO jv = 1, nvm 2087 2089 DO ji = 1, kjpindex … … 2180 2182 zhumrel_up(ji) = EXP( - humcste(jv) * dss(ji,jv)) 2181 2183 ! Ajouts Nathalie - Fred - le 28 Mars 2006 2182 a_subgrd(ji,jv)=MIN(MAX(dsg(ji,jv)-dss(ji,jv), 0.)/dsg_min,1.)2183 humrel(ji,jv)=a_subgrd(ji,jv)*zhumrel_up(ji)+( 1.-a_subgrd(ji,jv))*zhumrel_lo(ji)2184 a_subgrd(ji,jv)=MIN(MAX(dsg(ji,jv)-dss(ji,jv),zero)/dsg_min,un) 2185 humrel(ji,jv)=a_subgrd(ji,jv)*zhumrel_up(ji)+(un-a_subgrd(ji,jv))*zhumrel_lo(ji) 2184 2186 ! 2185 2187 vegstress(ji,jv) = zhumrel_lo(ji) + zhumrel_up(ji) - EXP( - humcste(jv) * dsg(ji,jv) ) … … 2221 2223 2222 2224 ! The fraction of visibly dry soil (dry when dss(:,1) = 0.1 m) 2223 drysoil_frac(:) = MIN(MAX(dss(:,1), 0.)*10._r_std, un)2225 drysoil_frac(:) = MIN(MAX(dss(:,1),zero)*10._r_std, un) 2224 2226 2225 2227 ! Correction Nathalie - le 28 Mars 2006 - re-ecriture drysoil_frac/hdry - Fred Hourdin 2226 2228 ! revu 22 novembre 2007 2227 hdry(:) = a_subgrd(:,1)*dss(:,1) + ( 1.-a_subgrd(:,1))*dsp(:,1)2229 hdry(:) = a_subgrd(:,1)*dss(:,1) + (un-a_subgrd(:,1))*dsp(:,1) 2228 2230 ! 2229 2231 ! Compute the resistance to bare soil evaporation. … … 2237 2239 ! du fond. En gros, rsol=hdry*rsol_cste pour hdry < 1m70 2238 2240 !rsol(ji) = dss(ji,1) * rsol_cste 2239 rsol(ji) = ( hdry(ji) + 1./(10.*(dpu_cste - hdry(ji))+1.e-10)**2 ) * rsol_cste2241 rsol(ji) = ( hdry(ji) + un/(10.*(dpu_cste - hdry(ji))+1.e-10)**2 ) * rsol_cste 2240 2242 ENDIF 2241 2243 ENDDO … … 2389 2391 IF ( ABS(delta_water(ji)-tot_flux(ji)) .GT. allowed_err ) THEN 2390 2392 WRITE(numout,*) 'HYDROL does not conserve water. The erroneous point is : ', ji 2391 WRITE(numout,*) 'The error in mm/d is :', (delta_water(ji)-tot_flux(ji))/dtradia , &2393 WRITE(numout,*) 'The error in mm/d is :', (delta_water(ji)-tot_flux(ji))/dtradia*one_day, & 2392 2394 & ' and in mm/dt : ', delta_water(ji)-tot_flux(ji) 2393 2395 WRITE(numout,*) 'delta_water : ', delta_water(ji), ' tot_flux : ', tot_flux(ji) … … 2520 2522 !Config Key = HYDROL_TAU_HDIFF 2521 2523 !Config Desc = time scale (s) for horizontal diffusion of water 2522 !Config Def = 86400.2524 !Config Def = one_day 2523 2525 !Config If = HYDROL_OK_HDIFF 2524 2526 !Config Help = Defines how fast diffusion occurs horizontally between … … 2526 2528 !Config diffusion. 2527 2529 2528 tau_hdiff = 86400.2530 tau_hdiff = one_day 2529 2531 CALL getin_p('HYDROL_TAU_HDIFF',tau_hdiff) 2530 2532 -
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/intersurf.f90
r116 r257 7 7 !! 8 8 !! @call sechiba_main 9 !! @Version : $Revision: 1.85 $, $Date: 2010/07/29 15:58:19$9 !! @Version : $Revision: 221 $, $Date: 2011-05-16 17:26:17 +0200 (Mon, 16 May 2011) $ 10 10 !! 11 11 !! @author Marie-Alice Foujols and Jan Polcher 12 12 !! 13 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/intersurf.f90,v 1.85 2010/07/29 15:58:19 ssipsl Exp $ 13 !< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/intersurf.f90 $ 14 !< $Date: 2011-05-16 17:26:17 +0200 (Mon, 16 May 2011) $ 15 !< $Author: martial.mancip $ 16 !< $Revision: 221 $ 14 17 !! IPSL (2006) 15 18 !! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC … … 181 184 ! 182 185 CALL ipslnlf(new_number=numout,old_number=old_fileout) 183 184 186 ! 185 187 IF (l_first_intersurf) THEN … … 225 227 IF ( ok_watchout ) THEN 226 228 IF (is_root_prc) THEN 227 zlev_mean = 0.229 zlev_mean = zero 228 230 DO ik=1, nbp_glo 229 231 j = ((index_g(ik)-1)/iim_g) + 1 … … 391 393 !!$ dt_split_watch,dt_watch,one_day 392 394 !!$ CALL solarang (julian_watch, julian0, iim, jjm, lon, lat, sinang) 393 !!$ WHERE ( sinang(:,:) .LT. EPSILON( 1.) )395 !!$ WHERE ( sinang(:,:) .LT. EPSILON(un) ) 394 396 !!$ isinang(:,:) = isinang(:,:) - 1 395 397 !!$ ENDWHERE … … 529 531 CALL histwrite (hist_id, 'riverflow',itau_sechiba, driver, kjpindex, kindex) 530 532 ! 531 CALL histwrite (hist_id, 'temp_sol', itau_sechiba, temp_sol_NEW, iim*jjm, kindex)532 CALL histwrite (hist_id, 'tsol_max', itau_sechiba, temp_sol_NEW, iim*jjm, kindex)533 CALL histwrite (hist_id, 'tsol_min', itau_sechiba, temp_sol_NEW, iim*jjm, kindex)534 CALL histwrite (hist_id, 'fluxsens', itau_sechiba, fluxsens, iim*jjm, kindex)535 CALL histwrite (hist_id, 'fluxlat', itau_sechiba, fluxlat, iim*jjm, kindex)536 CALL histwrite (hist_id, 'swnet', itau_sechiba, dswnet, iim*jjm, kindex)537 CALL histwrite (hist_id, 'swdown', itau_sechiba, dswdown, iim*jjm, kindex)538 CALL histwrite (hist_id, 'alb_vis', itau_sechiba, albedo(:,:,1), iim*jjm, kindex)539 CALL histwrite (hist_id, 'alb_nir', itau_sechiba, albedo(:,:,2), iim*jjm, kindex)540 CALL histwrite (hist_id, 'tair', itau_sechiba, temp_air, iim*jjm, kindex)541 CALL histwrite (hist_id, 'qair', itau_sechiba, qair, iim*jjm, kindex)533 CALL histwrite (hist_id, 'temp_sol', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 534 CALL histwrite (hist_id, 'tsol_max', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 535 CALL histwrite (hist_id, 'tsol_min', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 536 CALL histwrite (hist_id, 'fluxsens', itau_sechiba, fluxsens, kjpindex, kindex) 537 CALL histwrite (hist_id, 'fluxlat', itau_sechiba, fluxlat, kjpindex, kindex) 538 CALL histwrite (hist_id, 'swnet', itau_sechiba, dswnet, kjpindex, kindex) 539 CALL histwrite (hist_id, 'swdown', itau_sechiba, dswdown, kjpindex, kindex) 540 CALL histwrite (hist_id, 'alb_vis', itau_sechiba, albedo(:,:,1), kjpindex, kindex) 541 CALL histwrite (hist_id, 'alb_nir', itau_sechiba, albedo(:,:,2), kjpindex, kindex) 542 CALL histwrite (hist_id, 'tair', itau_sechiba, temp_air, kjpindex, kindex) 543 CALL histwrite (hist_id, 'qair', itau_sechiba, qair, kjpindex, kindex) 542 544 ! Ajout Nathalie - Juin 2006 - on conserve q2m/t2m 543 CALL histwrite (hist_id, 'q2m', itau_sechiba, qair, iim*jjm, kindex)544 CALL histwrite (hist_id, 't2m', itau_sechiba, temp_air, iim*jjm, kindex)545 CALL histwrite (hist_id, 'q2m', itau_sechiba, qair, kjpindex, kindex) 546 CALL histwrite (hist_id, 't2m', itau_sechiba, temp_air, kjpindex, kindex) 545 547 IF ( hist2_id > 0 ) THEN 546 548 CALL histwrite (hist2_id, 'evap', itau_sechiba, zvevapp, kjpindex, kindex) … … 548 550 CALL histwrite (hist2_id, 'riverflow',itau_sechiba, driver, kjpindex, kindex) 549 551 ! 550 CALL histwrite (hist2_id, 'temp_sol', itau_sechiba, temp_sol_NEW, iim*jjm, kindex)551 CALL histwrite (hist2_id, 'tsol_max', itau_sechiba, temp_sol_NEW, iim*jjm, kindex)552 CALL histwrite (hist2_id, 'tsol_min', itau_sechiba, temp_sol_NEW, iim*jjm, kindex)553 CALL histwrite (hist2_id, 'fluxsens', itau_sechiba, fluxsens, iim*jjm, kindex)554 CALL histwrite (hist2_id, 'fluxlat', itau_sechiba, fluxlat, iim*jjm, kindex)555 CALL histwrite (hist2_id, 'swnet', itau_sechiba, dswnet, iim*jjm, kindex)556 CALL histwrite (hist2_id, 'swdown', itau_sechiba, dswdown, iim*jjm, kindex)557 CALL histwrite (hist2_id, 'alb_vis', itau_sechiba, albedo(:,:,1), iim*jjm, kindex)558 CALL histwrite (hist2_id, 'alb_nir', itau_sechiba, albedo(:,:,2), iim*jjm, kindex)559 CALL histwrite (hist2_id, 'tair', itau_sechiba, temp_air, iim*jjm, kindex)560 CALL histwrite (hist2_id, 'qair', itau_sechiba, qair, iim*jjm, kindex)561 CALL histwrite (hist2_id, 'q2m', itau_sechiba, qair, iim*jjm, kindex)562 CALL histwrite (hist2_id, 't2m', itau_sechiba, temp_air, iim*jjm, kindex)552 CALL histwrite (hist2_id, 'temp_sol', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 553 CALL histwrite (hist2_id, 'tsol_max', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 554 CALL histwrite (hist2_id, 'tsol_min', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 555 CALL histwrite (hist2_id, 'fluxsens', itau_sechiba, fluxsens, kjpindex, kindex) 556 CALL histwrite (hist2_id, 'fluxlat', itau_sechiba, fluxlat, kjpindex, kindex) 557 CALL histwrite (hist2_id, 'swnet', itau_sechiba, dswnet, kjpindex, kindex) 558 CALL histwrite (hist2_id, 'swdown', itau_sechiba, dswdown, kjpindex, kindex) 559 CALL histwrite (hist2_id, 'alb_vis', itau_sechiba, albedo(:,:,1), kjpindex, kindex) 560 CALL histwrite (hist2_id, 'alb_nir', itau_sechiba, albedo(:,:,2), kjpindex, kindex) 561 CALL histwrite (hist2_id, 'tair', itau_sechiba, temp_air, kjpindex, kindex) 562 CALL histwrite (hist2_id, 'qair', itau_sechiba, qair, kjpindex, kindex) 563 CALL histwrite (hist2_id, 'q2m', itau_sechiba, qair, kjpindex, kindex) 564 CALL histwrite (hist2_id, 't2m', itau_sechiba, temp_air, kjpindex, kindex) 563 565 ENDIF 564 566 ELSE 565 567 CALL histwrite (hist_id, 'Evap', itau_sechiba, zvevapp, kjpindex, kindex) 566 CALL histwrite (hist_id, 'SWnet', itau_sechiba, dswnet, iim*jjm, kindex)567 CALL histwrite (hist_id, 'Qh', itau_sechiba, fluxsens, iim*jjm, kindex)568 CALL histwrite (hist_id, 'Qle', itau_sechiba, fluxlat, iim*jjm, kindex)569 CALL histwrite (hist_id, 'AvgSurfT', itau_sechiba, temp_sol_NEW, iim*jjm, kindex)570 CALL histwrite (hist_id, 'RadT', itau_sechiba, temp_sol_NEW, iim*jjm, kindex)568 CALL histwrite (hist_id, 'SWnet', itau_sechiba, dswnet, kjpindex, kindex) 569 CALL histwrite (hist_id, 'Qh', itau_sechiba, fluxsens, kjpindex, kindex) 570 CALL histwrite (hist_id, 'Qle', itau_sechiba, fluxlat, kjpindex, kindex) 571 CALL histwrite (hist_id, 'AvgSurfT', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 572 CALL histwrite (hist_id, 'RadT', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 571 573 IF ( hist2_id > 0 ) THEN 572 574 CALL histwrite (hist2_id, 'Evap', itau_sechiba, zvevapp, kjpindex, kindex) 573 CALL histwrite (hist2_id, 'SWnet', itau_sechiba, dswnet, iim*jjm, kindex)574 CALL histwrite (hist2_id, 'Qh', itau_sechiba, fluxsens, iim*jjm, kindex)575 CALL histwrite (hist2_id, 'Qle', itau_sechiba, fluxlat, iim*jjm, kindex)576 CALL histwrite (hist2_id, 'AvgSurfT', itau_sechiba, temp_sol_NEW, iim*jjm, kindex)577 CALL histwrite (hist2_id, 'RadT', itau_sechiba, temp_sol_NEW, iim*jjm, kindex)575 CALL histwrite (hist2_id, 'SWnet', itau_sechiba, dswnet, kjpindex, kindex) 576 CALL histwrite (hist2_id, 'Qh', itau_sechiba, fluxsens, kjpindex, kindex) 577 CALL histwrite (hist2_id, 'Qle', itau_sechiba, fluxlat, kjpindex, kindex) 578 CALL histwrite (hist2_id, 'AvgSurfT', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 579 CALL histwrite (hist2_id, 'RadT', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 578 580 ENDIF 579 581 ENDIF … … 780 782 ! 781 783 IF ( ok_watchout ) THEN 782 zlev_mean = 0.784 zlev_mean = zero 783 785 DO ik=1, kjpindex 784 786 … … 905 907 !!$ julian_watch = date0_shifted+((itau_sechiba-0.5)/dt_split_watch)*dt_watch/one_day 906 908 !!$ CALL solarang (julian_watch, julian0, iim, jjm, lon, lat, sinang) 907 !!$ WHERE ( sinang(:,:) .LT. EPSILON( 1.) )909 !!$ WHERE ( sinang(:,:) .LT. EPSILON(un) ) 908 910 !!$ isinang(:,:) = isinang(:,:) - 1 909 911 !!$ ENDWHERE … … 1448 1450 IF ( ok_watchout ) THEN 1449 1451 IF (is_root_prc) THEN 1450 zlev_mean = 0.1452 zlev_mean = zero 1451 1453 DO ik=1, nbp_glo 1452 1454 j = ((index_g(ik)-1)/iim_g) + 1 … … 1602 1604 !!$ julian_watch = date0_shifted+((itau_sechiba-0.5)/dt_split_watch)*dt_watch/one_day 1603 1605 !!$ CALL solarang (julian_watch, julian0, iim, jjm, tmp_lon, tmp_lat, sinang) 1604 !!$ WHERE ( sinang(:,:) .LT. EPSILON( 1.) )1606 !!$ WHERE ( sinang(:,:) .LT. EPSILON(un) ) 1605 1607 !!$ isinang(:,:) = isinang(:,:) - 1 1606 1608 !!$ ENDWHERE … … 2178 2180 IF ( ok_watchout ) THEN 2179 2181 IF (is_root_prc) THEN 2180 zlev_mean = 0.2182 zlev_mean = zero 2181 2183 DO ik=1, nbp_glo 2182 2184 j = ((index_g(ik)-1)/iim_g) + 1 … … 2332 2334 !!$ julian_watch = date0_shifted+((itau_sechiba-0.5)/dt_split_watch)*dt_watch/one_day 2333 2335 !!$ CALL solarang (julian_watch, julian0, iim, jjm, tmp_lon, tmp_lat, sinang) 2334 !!$ WHERE ( sinang(:,:) .LT. EPSILON( 1.) )2336 !!$ WHERE ( sinang(:,:) .LT. EPSILON(un) ) 2335 2337 !!$ isinang(:,:) = isinang(:,:) - 1 2336 2338 !!$ ENDWHERE … … 2586 2588 CALL tlen2itau('1Y',dt,date0,year_length) 2587 2589 IF ( TRIM(calendar_str) .EQ. 'gregorian' ) THEN 2588 year_spread= 1.02590 year_spread=un 2589 2591 ELSE 2590 2592 year_spread = one_year/365.2425 … … 2610 2612 ! Real date 2611 2613 CALL ju2ymds (in_julian, year, month, day, sec) 2612 !!$ jur= 0.2614 !!$ jur=zero 2613 2615 !!$ julian_diff = in_julian 2614 2616 !!$ month_len = ioget_mon_len (year,month) … … 2630 2632 ENDIF 2631 2633 ELSE 2632 !!$ in_julian = itau2date(istp-1, 0., dt)2634 !!$ in_julian = itau2date(istp-1, zero, dt) 2633 2635 !!$ CALL ju2ymds (in_julian, year, month, day, sec) 2634 !!$ jur= 0.2636 !!$ jur=zero 2635 2637 !!$ julian_diff = in_julian 2636 2638 !!$ month_len = ioget_mon_len (year,month) … … 2693 2695 CALL getin_p('NVM',nvm) 2694 2696 WRITE(numout,*)'the number of pfts is : ', nvm 2695 !!$DS Debug 28/01/20112696 2697 ! 2697 2698 !Config Key = LONGPRINT … … 2723 2724 ! 2724 2725 dt_watch = dt 2725 CALL getin ('DT_WATCHOUT',dt_watch)2726 CALL getin_p('DT_WATCHOUT',dt_watch) 2726 2727 dt_split_watch = dt_watch / dt 2727 2728 ! … … 2740 2741 ENDIF 2741 2742 2742 2743 2743 !!$ DS : reading of IMPOSE_PARAM 2744 2744 ! Option : do you want to change the values of the parameters 2745 2745 CALL getin_p('IMPOSE_PARAM',impose_param) 2746 ! Calling pft_parameters2747 2746 CALL pft_parameters_main 2748 2747 ! … … 2784 2783 IF ( control_flags%hydrol_cwrr ) THEN 2785 2784 CALL getin_hydrol_cwrr_parameters 2785 ELSE 2786 CALL getin_hydrolc_parameters 2787 ! we read the parameters for the choisnel hydrology 2786 2788 ENDIF 2787 2789 … … 2800 2802 CALL getin_co2_parameters 2801 2803 ENDIF 2802 2803 2804 2805 !!$ DS : reading of IMPOSE_PARAM2806 !!$ ! Option : do you want to change the values of the parameters2807 !!$ CALL getin_p('IMPOS_PARAM',impos_param)2808 !!$ ! Calling pft_parameters2809 !!$ CALL pft_main2810 2804 2811 2805 ! … … 2844 2838 WRITE(numout,*) 'It is not possible because it has to be modified ', & 2845 2839 ' to give correct values.' 2846 CALL ipslerr ( 3,'intsurf_config', &2847 & 'Use of STOMATE_OK_DGVM not allowed withthis version.',&2848 & 'ORCHIDEE will stop.', &2840 CALL ipslerr (2,'intsurf_config', & 2841 & 'Use of STOMATE_OK_DGVM is not stable for this version.',& 2842 & 'ORCHIDEE should not give correct results with this option activated.', & 2849 2843 & 'Please disable DGVM to use this version of ORCHIDEE.') 2850 2844 ENDIF … … 2965 2959 CALL getin_p('SECHIBA_reset_time', overwrite_time) 2966 2960 ! 2967 lev(:) = 0.2961 lev(:) = zero 2968 2962 itau_dep = istp 2969 2963 in_julian = itau2date(istp, date0, dt) … … 3186 3180 !Config Key = WRITE_STEP 3187 3181 !Config Desc = Frequency in seconds at which to WRITE output 3188 !Config Def = 86400.03182 !Config Def = one_day 3189 3183 !Config Help = This variables gives the frequency the output of 3190 3184 !Config the model should be written into the netCDF file. … … 3198 3192 ! 3199 3193 veg(1:nvm) = (/ (REAL(i,r_std),i=1,nvm) /) 3200 !$$ DS DEBUG3201 WRITE(numout,*)'nvm : = ', nvm3202 WRITE(numout,*)'veg : =', veg3203 !$$ nvm =13 (put the calling to getin before)3204 3194 sol(1:ngrnd) = (/ (REAL(i,r_std),i=1,ngrnd) /) 3205 3195 soltyp(1:nstm) = (/ (REAL(i,r_std),i=1,nstm) /) … … 3216 3206 WRITE(flux_sc,'("ave(X*",F8.1,")")') one_day/dt 3217 3207 !WRITE(flux_sc,'("(ave(X)*",F8.1,")")') one_day/dt 3218 WRITE(flux_insec,'("ave(X*",F8.6,")")') 1.0/dt3219 WRITE(flux_scinsec,'("ave(scatter(X*",F8.6,"))")') 1.0/dt3208 WRITE(flux_insec,'("ave(X*",F8.6,")")') un/dt 3209 WRITE(flux_scinsec,'("ave(scatter(X*",F8.6,"))")') un/dt 3220 3210 WRITE(numout,*) flux_op, one_day/dt, dt, dw 3221 3211 !- … … 3371 3361 & iim,jjm, hori_id, 1,1,1, -99, 32, once(1), dt,dw) 3372 3362 ENDIF 3373 IF ( control_flags%ok_stomate .OR. control_flags%stomate_watchout ) THEN3374 CALL histdef (hist_id,'CO2FLUX','Total output CO2 flux', 'gC/day/(m^2 tot)', &3375 & iim,jjm, hori_id, nvm, 1, nvm, vegax_id, 32, avescatter(1), dt, dw)3376 ENDIF3377 3363 !- 3378 3364 !- SECHIBA_HISTLEVEL = 2 … … 3692 3678 CALL histdef(hist_id, 'nobiofrac', 'Fraction of other surface types', '1', & 3693 3679 & iim,jjm, hori_id, nnobio, 1, nnobio, nobioax_id, 32, avescatter(3), dt,dw) 3694 IF ( control_flags%ok_stomate .OR. control_flags%stomate_watchout ) THEN3695 ! Total output CO2 flux3696 CALL histdef (hist_id,'CO2FLUX','Total output CO2 flux', 'gC/day/(m^2 tot)', &3697 & iim,jjm, hori_id, nvm, 1, nvm, vegax_id, 32, avescatter(1), dt, dw)3698 ENDIF3699 3680 !- 3700 3681 !- General energy balance … … 4033 4014 CALL histdef(hist2_id, 'emis', 'Surface emissivity', '?', & 4034 4015 & iim,jjm, hori_id2, 1,1,1, -99, 32, fluxop2(2), dt, dw2) 4035 IF ( control_flags%ok_stomate .OR. control_flags%stomate_watchout ) THEN4036 CALL histdef (hist2_id,'CO2FLUX','Total output CO2 flux', 'gC/day/(m^2 tot)', &4037 & iim,jjm, hori_id2, nvm, 1, nvm, vegax_id2, 32, avescatter2(2), dt, dw2)4038 ENDIF4039 4016 !- 4040 4017 !- SECHIBA_HISTLEVEL2 = 3 … … 4298 4275 CALL histdef(hist2_id, 'nobiofrac', 'Fraction of other surface types', '1', & 4299 4276 & iim,jjm, hori_id2, nnobio, 1, nnobio, nobioax_id2, 32, avescatter2(3), dt, dw2) 4300 IF ( control_flags%ok_stomate .OR. control_flags%stomate_watchout ) THEN4301 CALL histdef (hist2_id,'CO2FLUX','Total output CO2 flux', 'gC/day/(m^2 tot)', &4302 & iim,jjm, hori_id2, nvm, 1, nvm, vegax_id2, 32, avescatter2(1), dt, dw2)4303 ENDIF4304 4277 !- 4305 4278 !- General energy balance … … 4465 4438 hist_days_stom = 10. 4466 4439 CALL getin_p('STOMATE_HIST_DT', hist_days_stom) 4467 IF ( hist_days_stom == -1.) THEN4468 hist_dt_stom = -1.4440 IF ( hist_days_stom == moins_un ) THEN 4441 hist_dt_stom = moins_un 4469 4442 WRITE(numout,*) 'output frequency for STOMATE history file (d): one month.' 4470 4443 ELSE … … 4477 4450 dt_slow_ = one_day 4478 4451 CALL getin_p('DT_SLOW', dt_slow_) 4479 IF ( hist_days_stom /= -1.) THEN4452 IF ( hist_days_stom /= moins_un ) THEN 4480 4453 IF (dt_slow_ > hist_dt_stom) THEN 4481 4454 WRITE(numout,*) "DT_SLOW = ",dt_slow_," , STOMATE_HIST_DT = ",hist_dt_stom … … 4567 4540 !Config Help = Time step of the STOMATE IPCC history file 4568 4541 !- 4569 hist_days_stom_ipcc = 0.4542 hist_days_stom_ipcc = zero 4570 4543 CALL getin_p('STOMATE_IPCC_HIST_DT', hist_days_stom_ipcc) 4571 IF ( hist_days_stom_ipcc == -1.) THEN4572 hist_dt_stom_ipcc = -1.4544 IF ( hist_days_stom_ipcc == moins_un ) THEN 4545 hist_dt_stom_ipcc = moins_un 4573 4546 WRITE(numout,*) 'output frequency for STOMATE IPCC history file (d): one month.' 4574 4547 ELSE … … 4581 4554 dt_slow_ = one_day 4582 4555 CALL getin_p('DT_SLOW', dt_slow_) 4583 IF ( hist_days_stom_ipcc > 0.) THEN4556 IF ( hist_days_stom_ipcc > zero ) THEN 4584 4557 IF (dt_slow_ > hist_dt_stom_ipcc) THEN 4585 4558 WRITE(numout,*) "DT_SLOW = ",dt_slow_," , STOMATE_IPCC_HIST_DT = ",hist_dt_stom_ipcc … … 4822 4795 & 1,1,1, -99,32, ave(5), dt, hist_dt) 4823 4796 4824 ! MonthlyCO2 flux4825 CALL histdef (hist_id_stom, & 4826 & TRIM("CO2FLUX _MONTHLY"), &4827 & TRIM(" Monthly CO2 flux"), &4797 ! CO2 flux 4798 CALL histdef (hist_id_stom, & 4799 & TRIM("CO2FLUX "), & 4800 & TRIM("CO2 flux "), & 4828 4801 & TRIM("gC/m^2/pft/mth "), iim,jjm, hist_hori_id, & 4829 4802 & nvm,1,nvm, hist_PFTaxis_id,32, ave(1), dt, hist_dt) 4830 4803 4831 CALL histdef(hist_id_stom, &4832 & TRIM("CO2FLUX_MONTHLY_SUM "), &4833 & TRIM("Monthly CO2 flux"), &4834 & TRIM("PgC/m^2/mth "), 1,1, hist_hori_id, &4835 & 1,1,1, -99, 32, ave(1), dt, hist_dt)4804 !!$ CALL histdef(hist_id_stom, & 4805 !!$ & TRIM("CO2FLUX_MONTHLY_SUM "), & 4806 !!$ & TRIM("Monthly CO2 flux Sum "), & 4807 !!$ & TRIM("PgC/m^2/mth "), iim,jjm, hist_hori_id, & 4808 !!$ & 1,1,1, -99, 32, 'inst(scatter(X))', dt, hist_dt) 4836 4809 4837 4810 ! Output CO2 flux from fire … … 5121 5094 & TRIM("1/day "), iim,jjm, hist_hori_id, & 5122 5095 & nvm,1,nvm, hist_PFTaxis_id,32, ave(6), dt, hist_dt) 5096 5097 ! Establish tree 5098 CALL histdef (hist_id_stom, & 5099 & TRIM("ESTABTREE "), & 5100 & TRIM("Rate of tree establishement "), & 5101 & TRIM("1/day "), iim,jjm, hist_hori_id, & 5102 & 1,1,1, -99,32, ave(6), dt, hist_dt) 5103 5104 ! Establish grass 5105 CALL histdef (hist_id_stom, & 5106 & TRIM("ESTABGRASS "), & 5107 & TRIM("Rate of grass establishement "), & 5108 & TRIM("1/day "), iim,jjm, hist_hori_id, & 5109 & 1,1,1, -99,32, ave(6), dt, hist_dt) 5123 5110 5124 5111 ! Fraction of plants that dies (light competition) -
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/sechiba.f90
r142 r257 4 4 !! 5 5 !! @author Marie-Alice Foujols and Jan Polcher 6 !! @Version : $Revision: 1.46 $, $Date: 2010/05/07 08:28:13$6 !! @Version : $Revision: 45 $, $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 7 7 !! 8 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/sechiba.f90,v 1.46 2010/05/07 08:28:13 ssipsl Exp $ 8 !< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/sechiba.f90 $ 9 !< $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 10 !< $Author: mmaipsl $ 11 !< $Revision: 45 $ 9 12 !! IPSL (2006) 10 13 !! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC … … 239 242 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: tsol_rad !! Radiative surface temperature 240 243 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: vevapp !! Total of evaporation 241 REAL(r_std),DIMENSION (kjpindex), INTENT ( out) :: temp_sol_new !! New soil temperature244 REAL(r_std),DIMENSION (kjpindex), INTENT (inout) :: temp_sol_new !! New soil temperature 242 245 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: qsurf_out !! Surface specific humidity 243 246 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: z0_out !! Surface roughness (output diagnostic) … … 256 259 REAL(r_std), DIMENSION(kjpindex) :: sum_treefrac, sum_grassfrac, sum_cropfrac 257 260 INTEGER(i_std) :: jv 258 259 260 261 261 262 262 IF (long_print) WRITE(numout,*) ' kjpindex =',kjpindex … … 636 636 ENDIF 637 637 638 histvar(:)=SUM(vevapwet(:,:),dim=2)/ 86400638 histvar(:)=SUM(vevapwet(:,:),dim=2)/one_day 639 639 CALL histwrite(hist_id, 'evspsblveg', kjit, histvar, kjpindex, index) 640 640 641 histvar(:)=(vevapnu(:)+vevapsno(:))/ 86400641 histvar(:)=(vevapnu(:)+vevapsno(:))/one_day 642 642 CALL histwrite(hist_id, 'evspsblsoi', kjit, histvar, kjpindex, index) 643 643 644 histvar(:)=SUM(transpir(:,:),dim=2)/ 86400644 histvar(:)=SUM(transpir(:,:),dim=2)/one_day 645 645 CALL histwrite(hist_id, 'tran', kjit, histvar, kjpindex, index) 646 647 !------------------------------------648 649 ! histvar(:)=SUM(veget_max(:,2:9),dim=2)*100*contfrac(:)650 ! CALL histwrite(hist_id, 'treeFrac', kjit, histvar, kjpindex, index)651 652 ! histvar(:)=SUM(veget_max(:,10:11),dim=2)*100*contfrac(:)653 ! CALL histwrite(hist_id, 'grassFrac', kjit, histvar, kjpindex, index)654 655 ! histvar(:)=SUM(veget_max(:,12:13),dim=2)*100*contfrac(:)656 ! CALL histwrite(hist_id, 'cropFrac', kjit, histvar, kjpindex, index)657 646 658 647 !$$ 25/10/10 Modif DS & NViovy … … 666 655 histvar(:)= sum_cropfrac(:)*100*contfrac(:) 667 656 CALL histwrite(hist_id, 'cropFrac', kjit, histvar, kjpindex, index) 668 669 657 670 658 histvar(:)=veget_max(:,1)*100*contfrac(:) … … 1347 1335 ENDDO 1348 1336 1349 1350 1337 ! 1351 1338 ! 2. restart value … … 1372 1359 ! 1373 1360 1361 control%river_routing = control_in%river_routing 1362 control%hydrol_cwrr = control_in%hydrol_cwrr 1374 1363 control%ok_co2 = control_in%ok_co2 1375 1364 control%ok_sechiba = control_in%ok_sechiba -
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/sechiba_io.f90
r64 r257 10 10 !! 11 11 !! @author Marie-Alice Foujols and Jan Polcher 12 !! @Version : $Revision: 1 .8 $, $Date: 2008/03/21 13:56:12$12 !! @Version : $Revision: 12 $, $Date: 2010-11-05 16:42:13 +0100 (Fri, 05 Nov 2010) $ 13 13 !! 14 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/sechiba_io.f90,v 1.8 2008/03/21 13:56:12 ssipsl Exp $ 14 !< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/sechiba_io.f90 $ 15 !< $Date: 2010-11-05 16:42:13 +0100 (Fri, 05 Nov 2010) $ 16 !< $Author: mmaipsl $ 17 !< $Revision: 12 $ 15 18 !! IPSL (2006) 16 19 !! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC -
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/sechiba_io_p.f90
r64 r257 10 10 !! 11 11 !! @author Marie-Alice Foujols and Jan Polcher 12 !! @Version : $Revision: 1 .4 $, $Date: 2008/03/21 13:56:12$12 !! @Version : $Revision: 12 $, $Date: 2010-11-05 16:42:13 +0100 (Fri, 05 Nov 2010) $ 13 13 !! 14 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/sechiba_io_p.f90,v 1.4 2008/03/21 13:56:12 ssipsl Exp $ 14 !< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/sechiba_io_p.f90 $ 15 !< $Date: 2010-11-05 16:42:13 +0100 (Fri, 05 Nov 2010) $ 16 !< $Author: mmaipsl $ 17 !< $Revision: 12 $ 15 18 !! IPSL (2006) 16 19 !! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC -
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/slowproc.f90
r143 r257 2 2 ! Daily update of leaf area index etc. 3 3 ! 4 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/slowproc.f90,v 1.48 2010/04/20 14:12:04 ssipsl Exp $ 4 !< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/slowproc.f90 $ 5 !< $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 6 !< $Author: mmaipsl $ 7 !< $Revision: 45 $ 5 8 !! IPSL (2006) 6 9 !! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC … … 54 57 LOGICAL, SAVE :: old_lai = .FALSE. ! Old Lai Map interpolation 55 58 LOGICAL, SAVE :: impveg = .FALSE. 59 LOGICAL, SAVE :: impsoilt = .FALSE. 56 60 LOGICAL, SAVE :: old_veget = .FALSE. ! Old veget Map interpolation 57 61 ! … … 143 147 LOGICAL, PARAMETER :: check = .FALSE. 144 148 145 REAL(r_std), SAVE :: sec_old = 0.149 REAL(r_std), SAVE :: sec_old = zero 146 150 ! 147 151 ! do initialisation … … 299 303 ! Test each day and assert all slow processes (days and years) 300 304 ! 301 IF ( sec_old >= one_day - dtradia .AND. sec >= 0.) THEN305 IF ( sec_old >= one_day - dtradia .AND. sec >= zero ) THEN 302 306 ! 303 307 ! reset counter … … 510 514 LOGICAL, PARAMETER :: check = .FALSE. 511 515 ! 512 ! DS 15032011 add for replacing SUM(veget_max(ji,nvm-1:nvm 516 ! DS 15032011 add for replacing SUM(veget_max(ji,nvm-1:nvm)) 513 517 REAL(r_std) :: sum_veget_max 514 !515 516 518 517 519 ! … … 582 584 !Config only done once a day. 583 585 ! 584 CALL setvar_p (day_counter, val_exp, 'SECHIBA_DAY', 0.0_r_std)586 CALL setvar_p (day_counter, val_exp, 'SECHIBA_DAY', zero) 585 587 ! 586 588 !Config Key = LAI_MAP … … 733 735 CALL restget_p (rest_id, var_name, nbp_glo, nvm, 12, kjit, .TRUE., laimap) 734 736 ! 737 ELSE 738 ! 739 ALLOCATE (laimap(1,1,1)) 735 740 ENDIF 736 741 ! … … 806 811 !Config Key = DT_SLOW 807 812 !Config Desc = Time step of STOMATE and other slow processes 808 !Config Def = 86400.813 !Config Def = one_day 809 814 !Config Help = Time step (s) of regular update of vegetation 810 815 !Config cover, LAI etc. This is also the time step … … 905 910 CALL setvar_p (lai, val_exp, 'SECHIBA_LAI', llaimax) 906 911 907 908 !Config Key = SOIL_FRACTIONS909 !Config Desc = Fraction of the 3 soil types (0-dim mode)910 !Config Def = 0.28, 0.52, 0.20912 ! 913 !Config Key = IMPOSE_SOILT 914 !Config Desc = Should the soil typ be prescribed 915 !Config Def = n 911 916 !Config If = IMPOSE_VEG 912 !Config Help = Determines the fraction for the 3 soil types 913 !Config in the mesh in the following order : sand loam and clay. 914 ! 915 CALL setvar_p (soiltype, val_exp, 'SOIL_FRACTIONS', soiltype_default) 916 917 918 !Config Key = CLAY_FRACTION 919 !Config Desc = Fraction of the clay fraction (0-dim mode) 920 !Config Def = 0.2 921 !Config If = IMPOSE_VEG 922 !Config Help = Determines the fraction of clay in the grid box. 923 ! 924 CALL setvar_p (clayfraction, val_exp, 'CLAY_FRACTION', clayfraction_default) 925 917 !Config Help = This flag allows the user to impose a soil type distribution. 918 !Config It is espacially interesting for 0D 919 !Config simulations. On the globe it does not make too much sense as 920 !Config it imposes the same soil everywhere 921 ! 922 impsoilt = .FALSE. 923 CALL getin_p('IMPOSE_SOILT', impsoilt) 924 IF (impsoilt) THEN 925 !Config Key = SOIL_FRACTIONS 926 !Config Desc = Fraction of the 3 soil types (0-dim mode) 927 !Config Def = 0.28, 0.52, 0.20 928 !Config If = IMPOSE_VEG 929 !Config If = IMPOSE_SOILT 930 !Config Help = Determines the fraction for the 3 soil types 931 !Config in the mesh in the following order : sand loam and clay. 932 ! 933 CALL setvar_p (soiltype, val_exp, 'SOIL_FRACTIONS', soiltype_default) 934 935 !Config Key = CLAY_FRACTION 936 !Config Desc = Fraction of the clay fraction (0-dim mode) 937 !Config Def = 0.2 938 !Config If = IMPOSE_VEG 939 !Config If = IMPOSE_SOILT 940 !Config Help = Determines the fraction of clay in the grid box. 941 ! 942 CALL setvar_p (clayfraction, val_exp, 'CLAY_FRACTION', clayfraction_default) 943 ELSE 944 IF ( MINVAL(soiltype) .EQ. MAXVAL(soiltype) .AND. MAXVAL(soiltype) .EQ. val_exp .OR.& 945 & MINVAL(clayfraction) .EQ. MAXVAL(clayfraction) .AND. MAXVAL(clayfraction) .EQ. val_exp) THEN 946 947 CALL slowproc_soilt(kjpindex, lalo, neighbours, resolution, contfrac, soiltype, clayfraction) 948 ENDIF 949 ENDIF 926 950 ! 927 951 !Config Key = SLOWPROC_HEIGHT … … 1005 1029 ! If restart doesn't contain veget, then it is the first computation 1006 1030 CALL slowproc_update(kjpindex, lalo, neighbours, resolution, contfrac, & 1007 & veget_max, frac_nobio, veget_max, frac_nobio, veget_year, init=.TRUE.)1031 & veget_nextyear, frac_nobio_nextyear, veget_max, frac_nobio, veget_year, init=.TRUE.) 1008 1032 ! 1009 1033 IF ( control%ok_dgvm ) THEN … … 1172 1196 ! 1173 1197 CASE('MAXR') 1174 pref_soil_veg(:,1) = pref_soil_veg_sand 1175 pref_soil_veg(:,2) = pref_soil_veg_loan 1176 pref_soil_veg(:,3) = pref_soil_veg_clay 1198 pref_soil_veg(:,1) = pref_soil_veg_sand(:) 1199 pref_soil_veg(:,2) = pref_soil_veg_loan(:) 1200 pref_soil_veg(:,3) = pref_soil_veg_clay(:) 1177 1201 ! 1178 1202 ! Current default : equidistribution. … … 1365 1389 ! 1366 1390 1367 IF ( ( tau .LT. dt ) .OR. ( dt .LE. 0. ) .OR. ( tau .LE. 0.) ) THEN1391 IF ( ( tau .LT. dt ) .OR. ( dt .LE. zero ) .OR. ( tau .LE. zero ) ) THEN 1368 1392 WRITE(numout,*) 'slowproc_long: Problem with time steps' 1369 1393 WRITE(numout,*) 'dt=',dt … … 1411 1435 ! 1.1 Sum up 1412 1436 ! 1413 fracsum(:) = 0.1437 fracsum(:) = zero 1414 1438 DO jv = 1, nnobio 1415 1439 DO ji = 1, kjpindex … … 1477 1501 ENDDO 1478 1502 ENDDO 1479 1480 1503 ! 1481 1504 ! 3. if lai of a vegetation type (jv > 1) is small, increase soil part … … 1501 1524 ! Ajout Nouveau calcul (stomate-like) 1502 1525 DO ji = 1, kjpindex 1503 SUMveg = 0.01526 SUMveg = zero 1504 1527 veget(ji,1) = veget_max(ji,1) 1505 1528 DO jv = 2, nvm 1506 veget(ji,jv) = veget_max(ji,jv) * ( 1.- exp( - lai(ji,jv) * ext_coeff(jv) ) )1529 veget(ji,jv) = veget_max(ji,jv) * ( un - exp( - lai(ji,jv) * ext_coeff(jv) ) ) 1507 1530 veget(ji,1) = veget(ji,1) + (veget_max(ji,jv) - veget(ji,jv)) 1508 1531 SUMveg = SUMveg + veget(ji,jv) … … 1515 1538 ENDIF 1516 1539 ENDDO 1517 1518 1540 ! 1519 1541 ! 4. Sum up surface fractions and test if the sum is equal to 1 … … 1523 1545 ! 4.1 Sum up 1524 1546 ! 1525 fracsum(:) = 0.1547 fracsum(:) = zero 1526 1548 DO jv = 1, nnobio 1527 1549 DO ji = 1, kjpindex … … 1599 1621 REAL(r_std), DIMENSION (kjpindex,2), INTENT(in) :: resolution !! size in x an y of the grid (m) 1600 1622 1601 REAL(r_std), DIMENSION( kjpindex,nvm,12), INTENT(in):: laimap !! LAI lue1623 REAL(r_std), DIMENSION(:,:,:), INTENT(in) :: laimap !! LAI lue 1602 1624 LOGICAL, INTENT(in) :: read_lai 1603 1625 ! 0.2 Output … … 1610 1632 ! Test Nathalie. On impose LAI PFT 1 a 0 1611 1633 ! On boucle sur 2,nvm au lieu de 1,nvm 1612 lai(: ,1) = 0.01634 lai(: ,1) = zero 1613 1635 DO jv = 2,nvm 1614 1636 !!$ DO jv = 1,nvm … … 1771 1793 ! 1772 1794 WHERE ( laimaporig(:,:,:) .LT. 0 ) 1773 laimaporig(:,:,:) = 0.1795 laimaporig(:,:,:) = zero 1774 1796 ENDWHERE 1775 1797 ! … … 1831 1853 ilast = 1 1832 1854 n_origlai(:) = 0 1833 laimap(:,:,:) = 0.1855 laimap(:,:,:) = zero 1834 1856 ! 1835 1857 DO ip=1,ijml … … 1943 1965 ! Antartica 1944 1966 DO jv =1,nvm 1945 laimap(ip,jv,:) = 0.1967 laimap(ip,jv,:) = zero 1946 1968 ENDDO 1947 1969 ! … … 1949 1971 ! Artica 1950 1972 DO jv =1,nvm 1951 laimap(ip,jv,:) = 0.1973 laimap(ip,jv,:) = zero 1952 1974 ENDDO 1953 1975 ! … … 1955 1977 ! Greenland 1956 1978 DO jv =1,nvm 1957 laimap(ip,jv,:) = 0.1979 laimap(ip,jv,:) = zero 1958 1980 ENDDO 1959 1981 ! … … 2590 2612 DO ib = 1, nbpt 2591 2613 idi=1 2592 sumf= 0.2614 sumf=zero 2593 2615 DO WHILE ( sub_area(ib,idi) > zero ) 2594 2616 ip = sub_index(ib,idi,1) … … 2622 2644 IF (PRESENT(init)) THEN 2623 2645 IF (init) THEN 2624 ! veget_next(ib,:) = (/ 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. /) 2625 veget_next(ib,1) = 1. 2646 veget_next(ib,1) = un 2626 2647 veget_next(ib,2:nvm) = zero 2627 2648 ELSE … … 2658 2679 ! 2659 2680 idi=1 2660 sumf= 0.2681 sumf=zero 2661 2682 DO WHILE ( sub_area(ib,idi) > zero ) 2662 2683 ip = sub_index(ib,idi,1) … … 2763 2784 err=norm-un 2764 2785 IF (debug) & 2765 WRITE(numout,*) "ib ",ib," SUM(veget_next(ib,:)+frac_nobio_next(ib,:))- 1., sumf",err,sumf2766 IF (abs(err) > -EPSILON( 1._r_std)) THEN2786 WRITE(numout,*) "ib ",ib," SUM(veget_next(ib,:)+frac_nobio_next(ib,:))-un, sumf",err,sumf 2787 IF (abs(err) > -EPSILON(un)) THEN 2767 2788 !MM 1.9.3 2768 2789 ! IF (abs(err) > 0.) THEN … … 2775 2796 err=norm-un 2776 2797 IF (debug) & 2777 WRITE(numout,*) "ib ",ib," SUM(veget_next(ib,:)+frac_nobio_next(ib,:))- 1.",err2778 IF (abs(err) > EPSILON( 1._r_std)) THEN2798 WRITE(numout,*) "ib ",ib," SUM(veget_next(ib,:)+frac_nobio_next(ib,:))-un",err 2799 IF (abs(err) > EPSILON(un)) THEN 2779 2800 !MM 1.9.3 2780 2801 ! IF (abs(err) > 0.) THEN … … 2927 2948 ! 2928 2949 ! 2929 veget(ib,:) = 0.02930 frac_nobio (ib,:) = 0.02950 veget(ib,:) = zero 2951 frac_nobio (ib,:) = zero 2931 2952 ! 2932 2953 ENDDO … … 3063 3084 frac_origveg(:,vid) = REAL(n_origveg(:,vid),r_std) / REAL(n_found(:),r_std) 3064 3085 ELSEWHERE 3065 frac_origveg(:,vid) = 0.3086 frac_origveg(:,vid) = zero 3066 3087 ENDWHERE 3067 3088 ENDDO … … 3099 3120 IF ( lalo(ib,1) .LT. -56.0) THEN 3100 3121 ! Antartica 3101 frac_nobio(ib,:) = 0.03102 frac_nobio(ib,iice) = 1.03103 veget(ib,:) = 0.03122 frac_nobio(ib,:) = zero 3123 frac_nobio(ib,iice) = un 3124 veget(ib,:) = zero 3104 3125 ! 3105 3126 ELSE IF ( lalo(ib,1) .GT. 70.0) THEN 3106 3127 ! Artica 3107 frac_nobio(ib,:) = 0.03108 frac_nobio(ib,iice) = 1.03109 veget(ib,:) = 0.03128 frac_nobio(ib,:) = zero 3129 frac_nobio(ib,iice) = un 3130 veget(ib,:) = zero 3110 3131 ! 3111 3132 ELSE IF ( lalo(ib,1) .GT. 55.0 .AND. lalo(ib,2) .GT. -65.0 .AND. lalo(ib,2) .LT. -20.0) THEN 3112 3133 ! Greenland 3113 frac_nobio(ib,:) = 0.03114 frac_nobio(ib,iice) = 1.03115 veget(ib,:) = 0.03134 frac_nobio(ib,:) = zero 3135 frac_nobio(ib,iice) = un 3136 veget(ib,:) = zero 3116 3137 ! 3117 3138 ELSE … … 3144 3165 DO vid = 1, nvm 3145 3166 IF ( veget(ib,vid) .LT. min_vegfrac ) THEN 3146 veget(ib,vid) = 0.03167 veget(ib,vid) = zero 3147 3168 ENDIF 3148 3169 ENDDO … … 3346 3367 frac_origveg(:,vid) = n_origveg(:,vid) / n_found(:) 3347 3368 ELSEWHERE 3348 frac_origveg(:,vid) = 0.3369 frac_origveg(:,vid) = zero 3349 3370 ENDWHERE 3350 3371 ENDDO … … 3382 3403 IF ( lalo(ib,1) .LT. -56.0) THEN 3383 3404 ! Antartica 3384 frac_nobio(ib,:) = 0.03385 frac_nobio(ib,iice) = 1.03386 veget(ib,:) = 0.03405 frac_nobio(ib,:) = zero 3406 frac_nobio(ib,iice) = un 3407 veget(ib,:) = zero 3387 3408 ! 3388 3409 ELSE IF ( lalo(ib,1) .GT. 70.0) THEN 3389 3410 ! Artica 3390 frac_nobio(ib,:) = 0.03391 frac_nobio(ib,iice) = 1.03392 veget(ib,:) = 0.03411 frac_nobio(ib,:) = zero 3412 frac_nobio(ib,iice) = un 3413 veget(ib,:) = zero 3393 3414 ! 3394 3415 ELSE IF ( lalo(ib,1) .GT. 55.0 .AND. lalo(ib,2) .GT. -65.0 .AND. lalo(ib,2) .LT. -20.0) THEN 3395 3416 ! Greenland 3396 frac_nobio(ib,:) = 0.03397 frac_nobio(ib,iice) = 1.03398 veget(ib,:) = 0.03417 frac_nobio(ib,:) = zero 3418 frac_nobio(ib,iice) = un 3419 veget(ib,:) = zero 3399 3420 ! 3400 3421 ELSE … … 3427 3448 DO vid = 1, nvm 3428 3449 IF ( veget(ib,vid) .LT. min_vegfrac ) THEN 3429 veget(ib,vid) = 0.03450 veget(ib,vid) = zero 3430 3451 ENDIF 3431 3452 ENDDO … … 3554 3575 ! 3555 3576 ! 3556 veget(ib,:) = 0.03557 frac_nobio (ib,:) = 0.03577 veget(ib,:) = zero 3578 frac_nobio (ib,:) = zero 3558 3579 ! 3559 3580 ENDDO … … 3690 3711 frac_origveg(:,vid) = REAL(n_origveg(:,vid),r_std) / REAL(n_found(:),r_std) 3691 3712 ELSEWHERE 3692 frac_origveg(:,vid) = 0.3713 frac_origveg(:,vid) = zero 3693 3714 ENDWHERE 3694 3715 ENDDO … … 3726 3747 IF ( lalo(ib,1) .LT. -56.0) THEN 3727 3748 ! Antartica 3728 frac_nobio(ib,:) = 0.03729 frac_nobio(ib,iice) = 1.03730 veget(ib,:) = 0.03749 frac_nobio(ib,:) = zero 3750 frac_nobio(ib,iice) = un 3751 veget(ib,:) = zero 3731 3752 ! 3732 3753 ELSE IF ( lalo(ib,1) .GT. 70.0) THEN 3733 3754 ! Artica 3734 frac_nobio(ib,:) = 0.03735 frac_nobio(ib,iice) = 1.03736 veget(ib,:) = 0.03755 frac_nobio(ib,:) = zero 3756 frac_nobio(ib,iice) = un 3757 veget(ib,:) = zero 3737 3758 ! 3738 3759 ELSE IF ( lalo(ib,1) .GT. 55.0 .AND. lalo(ib,2) .GT. -65.0 .AND. lalo(ib,2) .LT. -20.0) THEN 3739 3760 ! Greenland 3740 frac_nobio(ib,:) = 0.03741 frac_nobio(ib,iice) = 1.03742 veget(ib,:) = 0.03761 frac_nobio(ib,:) = zero 3762 frac_nobio(ib,iice) = un 3763 veget(ib,:) = zero 3743 3764 ! 3744 3765 ELSE … … 3771 3792 DO vid = 1, nvm 3772 3793 IF ( veget(ib,vid) .LT. min_vegfrac ) THEN 3773 veget(ib,vid) = 0.03794 veget(ib,vid) = zero 3774 3795 ENDIF 3775 3796 ENDDO … … 3962 3983 frac_origveg(:,vid) = n_origveg(:,vid) / n_found(:) 3963 3984 ELSEWHERE 3964 frac_origveg(:,vid) = 0.3985 frac_origveg(:,vid) = zero 3965 3986 ENDWHERE 3966 3987 ENDDO … … 3998 4019 IF ( lalo(ib,1) .LT. -56.0) THEN 3999 4020 ! Antartica 4000 frac_nobio(ib,:) = 0.04001 frac_nobio(ib,iice) = 1.04002 veget(ib,:) = 0.04021 frac_nobio(ib,:) = zero 4022 frac_nobio(ib,iice) = un 4023 veget(ib,:) = zero 4003 4024 ! 4004 4025 ELSE IF ( lalo(ib,1) .GT. 70.0) THEN 4005 4026 ! Artica 4006 frac_nobio(ib,:) = 0.04007 frac_nobio(ib,iice) = 1.04008 veget(ib,:) = 0.04027 frac_nobio(ib,:) = zero 4028 frac_nobio(ib,iice) = un 4029 veget(ib,:) = zero 4009 4030 ! 4010 4031 ELSE IF ( lalo(ib,1) .GT. 55.0 .AND. lalo(ib,2) .GT. -65.0 .AND. lalo(ib,2) .LT. -20.0) THEN 4011 4032 ! Greenland 4012 frac_nobio(ib,:) = 0.04013 frac_nobio(ib,iice) = 1.04014 veget(ib,:) = 0.04033 frac_nobio(ib,:) = zero 4034 frac_nobio(ib,iice) = un 4035 veget(ib,:) = zero 4015 4036 ! 4016 4037 ELSE … … 4043 4064 DO vid = 1, nvm 4044 4065 IF ( veget(ib,vid) .LT. min_vegfrac ) THEN 4045 veget(ib,vid) = 0.04066 veget(ib,vid) = zero 4046 4067 ENDIF 4047 4068 ENDDO -
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/thermosoil.f90
r64 r257 3 3 !! 4 4 !! @author Marie-Alice Foujols and Jan Polcher 5 !! @Version : $Revision: 1.15 $, $Date: 2009/01/07 13:39:45$5 !! @Version : $Revision: 45 $, $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 6 6 !! 7 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/thermosoil.f90,v 1.15 2009/01/07 13:39:45 ssipsl Exp $ 7 !< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/thermosoil.f90 $ 8 !< $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 9 !< $Author: mmaipsl $ 10 !< $Revision: 45 $ 8 11 !! IPSL (2006) 9 12 !! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC … … 98 101 REAL(r_std),DIMENSION (kjpindex), INTENT (in) :: temp_sol_new !! New soil temperature 99 102 REAL(r_std),DIMENSION (kjpindex), INTENT (in) :: snow !! Snow quantity 103 REAL(r_std),DIMENSION (kjpindex,nbdl), INTENT (in) :: shumdiag !! Diagnostic of relative humidity 100 104 ! output fields 101 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: soilcap !! Soil capacity 102 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: soilflx 103 REAL(r_std),DIMENSION (kjpindex,nbdl), INTENT (in) :: shumdiag !! Diagnostic of relative humidity 104 REAL(r_std),DIMENSION (kjpindex,nbdl), INTENT (out):: stempdiag !! diagnostic temp profile 105 REAL(r_std),DIMENSION (kjpindex), INTENT (inout) :: soilcap !! Soil capacity 106 REAL(r_std),DIMENSION (kjpindex), INTENT (inout) :: soilflx 107 REAL(r_std),DIMENSION (kjpindex,nbdl), INTENT (inout):: stempdiag !! diagnostic temp profile 105 108 106 109 REAL(r_std),DIMENSION (kjpindex,ngrnd) :: temp … … 645 648 REAL(r_std), DIMENSION (kjpindex), INTENT (out) :: soilflx !! 646 649 REAL(r_std), DIMENSION (kjpindex), INTENT (out) :: z1 !! 647 REAL(r_std), DIMENSION (kjpindex,ngrnd), INTENT( out) :: pcapa !!648 REAL(r_std), DIMENSION (kjpindex,ngrnd), INTENT( out) :: pcapa_en !!649 REAL(r_std), DIMENSION (kjpindex,ngrnd), INTENT( out) :: pkappa !!650 REAL(r_std), DIMENSION (kjpindex,ngrnd), INTENT(inout) :: pcapa !! 651 REAL(r_std), DIMENSION (kjpindex,ngrnd), INTENT(inout) :: pcapa_en !! 652 REAL(r_std), DIMENSION (kjpindex,ngrnd), INTENT(inout) :: pkappa !! 650 653 REAL(r_std), DIMENSION (kjpindex,ngrnd-1), INTENT(out) :: cgrnd !! 651 654 REAL(r_std), DIMENSION (kjpindex,ngrnd-1), INTENT(out) :: dgrnd !! … … 837 840 lev_prog = prev_prog + dz2(jg) 838 841 ENDIF 839 intfact(jd,jg) = MAX(MIN(lev_diag,lev_prog)-MAX(prev_diag, prev_prog), 0.0)/(lev_diag-prev_diag)842 intfact(jd,jg) = MAX(MIN(lev_diag,lev_prog)-MAX(prev_diag, prev_prog), zero)/(lev_diag-prev_diag) 840 843 prev_prog = lev_prog 841 844 ENDDO … … 857 860 ENDIF 858 861 859 stempdiag(:,:) = 0.862 stempdiag(:,:) = zero 860 863 DO jg = 1, ngrnd 861 864 DO jd = 1, nbdl … … 907 910 lev_prog = diaglev(jg) 908 911 ENDIF 909 intfactw(jd,jg) = MAX(MIN(lev_diag,lev_prog)-MAX(prev_diag, prev_prog), 0.0)/(lev_diag-prev_diag)912 intfactw(jd,jg) = MAX(MIN(lev_diag,lev_prog)-MAX(prev_diag, prev_prog), zero)/(lev_diag-prev_diag) 910 913 prev_prog = lev_prog 911 914 ENDDO … … 927 930 ENDIF 928 931 929 wetdiag(:,:) = 0.932 wetdiag(:,:) = zero 930 933 DO jg = 1, nbdl 931 934 DO jd = 1, ngrnd -
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/watchout.f90
r64 r257 3 3 USE defprec 4 4 USE parallel 5 USE constantes 5 6 USE netcdf 6 7 … … 10 11 11 12 LOGICAL,SAVE,PUBLIC :: ok_watchout = .FALSE. 12 REAL, SAVE,PUBLIC :: dt_watch = 0.13 REAL, SAVE,PUBLIC :: dt_watch = zero 13 14 INTEGER, SAVE,PUBLIC :: last_action_watch = 0, & 14 15 & last_check_watch = 0 -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/AA_make
r66 r257 1 1 #- 2 #- $Id: AA_make,v 1.27 2010/04/06 14:34:32 ssipsl Exp $ 2 #- $Id: AA_make 41 2011-01-01 19:56:53Z mmaipsl $ 3 #- 4 PARALLEL_LIB = $(LIBDIR)/libparallel.a 5 SXPARALLEL_LIB = $(PARALLEL_LIB) 6 #-Q- sxnec SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 7 #-Q- sx6nec SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 8 #-Q- eshpux SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 9 #-Q- sx8brodie SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 3 10 #- 4 11 PARAM_LIB = $(LIBDIR)/libparameters.a … … 9 16 #-Q- sx8brodie SXPARAM_LIB = $(LIBDIR)/libsxparameters.a 10 17 #- 11 PARALLEL_LIB = $(LIBDIR)/libparallel.a12 SX PARALLEL_LIB = $(PARALLEL_LIB)13 #-Q- sxnec SX PARALLEL_LIB = $(LIBDIR)/libsxparallel.a14 #-Q- sx6nec SX PARALLEL_LIB = $(LIBDIR)/libsxparallel.a15 #-Q- eshpux SX PARALLEL_LIB = $(LIBDIR)/libsxparallel.a16 #-Q- sx8brodie SX PARALLEL_LIB = $(LIBDIR)/libsxparallel.a18 ORGLOB_LIB = $(LIBDIR)/liborglob.a 19 SXORGLOB_LIB = $(ORGLOB_LIB) 20 #-Q- sxnec SXORGLOB_LIB = $(LIBDIR)/libsxorglob.a 21 #-Q- sx6nec SXORGLOB_LIB = $(LIBDIR)/libsxorglob.a 22 #-Q- eshpux SXORGLOB_LIB = $(LIBDIR)/libsxorglob.a 23 #-Q- sx8brodie SXORGLOB_LIB = $(LIBDIR)/libsxorglob.a 17 24 #- 18 25 MODS1 = stomate_data.f90 \ … … 52 59 #- 53 60 all: 61 $(M_K) libparallel 54 62 $(M_K) libparameters 55 $(M_K) lib parallel63 $(M_K) liborglob 56 64 $(M_K) m_all 57 65 @echo stomate is OK … … 67 75 #-Q- sxnec -limit vmemoryuse unlimited 68 76 77 libparallel: 78 (cd ../src_parallel; $(M_K) -f Makefile) 79 69 80 libparameters: 70 81 (cd ../src_parameters; $(M_K) -f Makefile) 71 82 72 lib parallel:73 (cd ../src_ parallel; $(M_K) -f Makefile)83 liborglob: 84 (cd ../src_global; $(M_K) -f Makefile) 74 85 75 86 $(MODEL_LIB)(%.o): %.f90 -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/AA_make.ldef
r64 r257 1 1 #- 2 #- $Id: AA_make.ldef ,v 1.9 2008/01/08 11:49:08 ssipsl Exp$2 #- $Id: AA_make.ldef 12 2010-11-05 15:42:13Z mmaipsl $ 3 3 #- 4 4 #--------------------------------------------------------------------- -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/lpj_constraints.f90
r114 r257 129 129 130 130 WHERE ( t2m_min_daily(:) .LT. tmin_crit(j) ) 131 adapted(:,j) = 0.131 adapted(:,j) = zero 132 132 ENDWHERE 133 133 … … 135 135 ! ( adapted will approach 1) 136 136 137 adapted(:,j) = 1. - ( 1.- adapted(:,j) ) * (tau_adapt- dt)/tau_adapt137 adapted(:,j) = un - ( un - adapted(:,j) ) * (tau_adapt- dt)/tau_adapt 138 138 139 139 ENDIF … … 147 147 148 148 WHERE ( when_growthinit(:,j) .GT. too_long*one_year ) 149 adapted(:,j) = 0.149 adapted(:,j) = zero 150 150 ENDWHERE 151 151 … … 160 160 ! 2.1.3.1 several PFTs (ex: evergreen) don't need vernalization 161 161 162 regenerate(:,j) = 1.162 regenerate(:,j) = un 163 163 164 164 ELSE … … 167 167 168 168 WHERE ( t2m_month(:) .LE. tcm_crit(j) ) 169 regenerate(:,j) = 1.169 regenerate(:,j) = un 170 170 ENDWHERE 171 171 … … 181 181 182 182 WHERE ( regenerate(:,j) .LE. regenerate_min ) 183 adapted(:,j) = 0.183 adapted(:,j) = zero 184 184 ENDWHERE 185 185 … … 190 190 ! 191 191 192 adapted(:,j) = 0.193 194 regenerate(:,j) = 0.192 adapted(:,j) = zero 193 194 regenerate(:,j) = zero 195 195 196 196 ENDIF -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/lpj_cover.f90
r64 r257 23 23 24 24 SUBROUTINE cover (npts, cn_ind, ind, biomass, & 25 veget_max, veget_max_old, veget, lai, litter, carbon )25 veget_max, veget_max_old, veget, lai, litter, carbon, turnover_daily, bm_to_litter) 26 26 27 27 ! … … 37 37 ! density of individuals (1/(m**2 of ground)) 38 38 REAL(r_std), DIMENSION(npts,nvm), INTENT(in) :: ind 39 ! "maximal" coverage fraction of a PFT (LAI -> infinity) on ground at beginning of time step 39 40 REAL(r_std), DIMENSION(npts,nvm), INTENT(in) :: veget_max_old 40 41 … … 44 45 ! "maximal" coverage fraction of a PFT (LAI -> infinity) on ground 45 46 REAL(r_std), DIMENSION(npts,nvm), INTENT(inout) :: veget_max 47 ! Turnover rates (gC/(m**2 of ground)/day) 48 REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout) :: turnover_daily 49 ! conversion of biomass to litter (g/m**2 / day 50 REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout) :: bm_to_litter 46 51 47 52 ! 0.3 output … … 50 55 REAL(r_std), DIMENSION(npts,nvm), INTENT(inout) :: veget 51 56 ! leaf area index OF AN INDIVIDUAL PLANT 52 REAL(r_std), DIMENSION(npts,nvm), INTENT(in ) :: lai57 REAL(r_std), DIMENSION(npts,nvm), INTENT(inout) :: lai 53 58 54 59 ! metabolic and structural litter, above and below ground (gC/(m**2 of ground)) … … 60 65 61 66 ! index 62 INTEGER(i_std) :: i,j 67 INTEGER(i_std) :: i,j,k,m 63 68 64 69 ! Litter dilution (gC/m²) … … 68 73 69 74 ! conversion vectors 70 REAL(r_std),DIMENSION(nvm) :: delta_veg 75 REAL(r_std),DIMENSION(nvm) :: delta_veg,reduct 71 76 ! vecteur de conversion 72 REAL(r_std) :: delta_veg_sum 77 REAL(r_std) :: delta_veg_sum,diff,sr 78 REAL(r_std), DIMENSION(npts) :: frac_nat,sum_vegettree,sum_vegetgrass 79 REAL(r_std), DIMENSION(npts) :: sum_veget_natveg 73 80 74 81 ! ========================================================================= … … 81 88 IF ( control%ok_dgvm ) THEN 82 89 83 veget_max(:,ibare_sechiba) = 1. 90 ! some initialisations 91 frac_nat(:) = un 92 sum_veget_natveg(:) = zero 93 sum_vegettree(:) = zero 94 sum_vegetgrass(:) = zero 95 96 veget_max(:,ibare_sechiba) = un 84 97 85 98 DO j = 2,nvm … … 88 101 89 102 veget_max(:,j) = ind(:,j) * cn_ind(:,j) 90 91 ENDIF 92 103 sum_veget_natveg(:) = sum_veget_natveg(:) + veget_max(:,j) 104 105 ELSE 106 !fraction occupied by agriculture needs to be substracted for the DGVM 107 !this is used below to constrain veget for natural vegetation, see below 108 frac_nat(:) = frac_nat(:) - veget_max(:,j) 109 110 ENDIF 111 112 ENDDO 113 114 DO i = 1, npts 115 116 IF (sum_veget_natveg(i) .GT. frac_nat(i) .AND. frac_nat(i) .GT. min_stomate) THEN 117 118 DO j = 2,nvm 119 IF( natural(j) ) THEN 120 veget_max(i,j) = veget_max(i,j) * frac_nat(i) / sum_veget_natveg(i) 121 ENDIF 122 ENDDO 123 124 ENDIF 125 ENDDO 126 127 DO j = 2,nvm 93 128 veget_max(:,ibare_sechiba) = veget_max(:,ibare_sechiba) - veget_max(:,j) 94 95 ENDDO 96 129 ENDDO 97 130 veget_max(:,ibare_sechiba) = MAX( veget_max(:,ibare_sechiba), zero ) 98 131 132 ! 1.3 calculate carbon fluxes between PFTs to maintain mass balance 133 ! 134 135 DO i = 1, npts 136 ! Generation of the conversion vector 137 138 delta_veg(:) = veget_max(i,:)-veget_max_old(i,:) 139 delta_veg_sum = SUM(delta_veg,MASK=delta_veg.LT.zero) 140 141 dilu_lit(i,:,:) = zero 142 dilu_soil_carbon(i,:) = zero 143 DO j=1, nvm 144 IF ( delta_veg(j) < -min_stomate ) THEN 145 dilu_lit(i,:,:)= dilu_lit(i,:,:) + delta_veg(j)*litter(i,:,j,:) / delta_veg_sum 146 dilu_soil_carbon(i,:)= dilu_soil_carbon(i,:) + delta_veg(j) * carbon(i,:,j) / delta_veg_sum 147 ENDIF 148 ENDDO 149 150 DO j=1, nvm 151 IF ( delta_veg(j) > min_stomate) THEN 152 153 ! Dilution of reservoirs 154 155 ! Litter 156 litter(i,:,j,:)=(litter(i,:,j,:) * veget_max_old(i,j) + dilu_lit(i,:,:) * delta_veg(j)) / veget_max(i,j) 157 158 ! Soil carbon 159 carbon(i,:,j)=(carbon(i,:,j) * veget_max_old(i,j) + dilu_soil_carbon(i,:) * delta_veg(j)) / veget_max(i,j) 160 161 ENDIF 162 163 IF(j.GE.2.AND.veget_max_old(i,j).GT.min_stomate.AND.veget_max(i,j).GT.min_stomate) THEN 164 165 ! Correct biomass densities (i.e. also litter fall) to conserve mass 166 ! since it's defined on veget_max 167 168 biomass(i,j,:)=biomass(i,j,:)*veget_max_old(i,j)/veget_max(i,j) 169 turnover_daily(i,j,:)=turnover_daily(i,j,:)*veget_max_old(i,j)/veget_max(i,j) 170 bm_to_litter(i,j,:)=bm_to_litter(i,j,:)*veget_max_old(i,j)/veget_max(i,j) 171 172 ENDIF 173 174 ENDDO 175 ENDDO 99 176 ENDIF 100 101 DO i = 1, npts102 ! Generation of the conversion vector103 104 delta_veg(:) = veget_max(i,:)-veget_max_old(i,:)105 delta_veg_sum = SUM(delta_veg,MASK=delta_veg.LT.zero)106 107 dilu_lit(i,:,:) = zero108 dilu_soil_carbon(i,:) = zero109 DO j=1, nvm110 IF ( delta_veg(j) < -min_stomate ) THEN111 dilu_lit(i,:,:)= dilu_lit(i,:,:) - delta_veg(j)*litter(i,:,j,:) / delta_veg_sum112 dilu_soil_carbon(i,:)= dilu_soil_carbon(i,:) - delta_veg(j) * carbon(i,:,j) / delta_veg_sum113 ENDIF114 ENDDO115 116 DO j=1, nvm117 IF ( delta_veg(j) > min_stomate) THEN118 119 ! Dilution of reservoirs120 121 ! Litter122 litter(i,:,j,:)=(litter(i,:,j,:) * veget_max_old(i,j) + dilu_lit(i,:,:) * delta_veg(j)) / veget_max(i,j)123 124 ! Soil carbon125 carbon(i,:,j)=(carbon(i,:,j) * veget_max_old(i,j) + dilu_soil_carbon(i,:) * delta_veg(j)) / veget_max(i,j)126 127 ENDIF128 !SZ correct biomass to conserve mass since it's defined on veget_max129 IF(j.GE.2.AND.veget_max_old(i,j).GT.min_stomate.AND.veget_max(i,j).GT.min_stomate) THEN130 biomass(i,j,:)=biomass(i,j,:)*veget_max_old(i,j)/veget_max(i,j)131 ENDIF132 133 ENDDO134 ENDDO135 177 136 178 ! … … 140 182 ! 141 183 !MM in Soenke code but not in merge version ; must keep that ?? 184 !NV, MM : we keep those comments for compatibility with CMIP5 computations. 185 !! They have to be uncommented avec CMIP5 versions in the trunk ! 142 186 !!$ DO j = 2,nvm 143 187 !!$ lai(:,j) = biomass(:,j,ileaf,icarbon)*sla(j) … … 153 197 veget(i,j) = veget_max(i,j) 154 198 ELSE 155 veget(i,j) = veget_max(i,j) * ( 1. - exp( - lai(i,j) * ext_coeff(j) ) ) 199 IF ( control%ok_dgvm ) THEN 200 !!$SZneed to check this - this formulation will cause 100% veget, otherwise there will always 201 !!$ be some percent bare ground 202 veget(i,j) = ind(i,j) * cn_ind(i,j) * ( un - EXP( - lai(i,j) * ext_coeff(j) ) ) 203 ELSE 204 veget(i,j) = veget_max(i,j) * ( un - EXP( - lai(i,j) * ext_coeff(j) ) ) 205 ENDIF 206 ENDIF 207 208 ! check sums of fpc for natural vegetation (see correction below!) in dynamic mode 209 IF ( control%ok_dgvm ) THEN 210 211 IF(natural(j))THEN 212 IF(tree(j)) THEN 213 sum_vegettree(i)=sum_vegettree(i)+veget(i,j) 214 ELSE 215 sum_vegetgrass(i)=sum_vegetgrass(i)+veget(i,j) 216 ENDIF 217 ENDIF 218 156 219 ENDIF 157 220 ENDDO 158 221 ENDDO 159 ! 222 223 224 ! 3.1 correct gridscale fpc for dynamic vegetation 225 !!$SZ, this part should be obsolete now that veget_max is forced to 1.0 226 !!$ nevertheless maintained just for savety. Whoever wants to test 227 !!$ whether this works without is invited to do so. 228 229 ! in the DGVM mode, we can arrive at a sum of veget slighly exceeding 1.0, 230 ! because mainly of grass dynamics... 231 ! In this case, we devide the fpar over natural vegetation first such that 232 ! grasses are shadowed by trees, and in the theoretically impossible case that 233 ! this is not sufficient, reduce proportionally all veget's. 234 ! 235 IF ( control%ok_dgvm ) THEN 236 237 DO i = 1,npts 238 239 diff=sum_vegettree(i)+sum_vegetgrass(i)-frac_nat(i) 240 reduct(:) = 0. 241 ! ordinary case, the reason too much grasses 242 ! reduce grass veget to match the maximum 243 IF (diff .GT. 0. ) THEN 244 245 IF (sum_vegetgrass(i).GT.min_stomate) THEN 246 sr=0. 247 DO j=2,nvm 248 IF(natural(j).AND..NOT.tree(j)) THEN 249 reduct(j)=-MIN(diff,sum_vegetgrass(i))*veget(i,j)/sum_vegetgrass(i) 250 sr=sr+reduct(j) 251 ENDIF 252 ENDDO 253 diff=diff+sr 254 ENDIF 255 256 ENDIF 257 258 ! this is theoretically impossible, since trees can only occupy 95%, 259 ! but better be save than sorry 260 IF (diff .GT. min_stomate ) THEN 261 262 IF (sum_vegettree(i).GT.min_stomate) THEN 263 sr=0. 264 DO j=2,nvm 265 IF(natural(j).AND.tree(j)) THEN 266 reduct(j)=-MIN(diff,sum_vegettree(i))*veget(i,j)/sum_vegettree(i) 267 sr=sr+reduct(j) 268 ENDIF 269 ENDDO 270 diff=diff+sr 271 ENDIF 272 273 ENDIF 274 275 !!$ ! tell user if the problem could not be resolved 276 !!$ ! in theory the model should stop here! 277 !!$ IF (diff .GT. min_stomate ) THEN 278 !!$ 279 !!$ write(numout,*) 'ATT, DGVM!: veget exceeds bareground without vegetation left' 280 !!$ write(numout,*) 'ATT, DGVM!: is this a bug? cell: ',i 281 !!$ write(numout,*) 'ATT, DGVM!: veget ',veget(i,:) 282 !!$ 283 !!$ ENDIF 284 285 ! finally, implement the reduction. (reduc is negative!) 286 veget(i,:)=veget(i,:)+reduct(:) 287 288 ENDDO 289 290 ENDIF 291 160 292 veget(:,ibare_sechiba) = un 161 293 DO j = 2,nvm -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/lpj_crown.f90
r64 r257 6 6 !--------------------------------------------------------------------- 7 7 !- calculate individual crown area from stem mass. 8 !- SZ, I've put the woodmass calculation out of this routine 9 ! because after the very first establishment, woodmass 10 ! could not be calculated here as veget_max = zero and 11 ! d_ind not known... 8 12 !--------------------------------------------------------------------- 9 13 USE ioipsl … … 24 28 !- 25 29 SUBROUTINE crown & 26 & (npts, PFTpresent, ind, biomass, veget_max, cn_ind, height)30 & (npts, PFTpresent, ind, biomass, woodmass_ind, veget_max, cn_ind, height) 27 31 !--------------------------------------------------------------------- 28 32 ! 0 declarations … … 38 42 ! biomass (gC/(m**2 of ground)) 39 43 REAL(r_std),DIMENSION(npts,nvm,nparts),INTENT(in) :: biomass 44 ! woodmass of the individual, needed to calculate crownarea in lpj_crownarea 45 REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: woodmass_ind 40 46 !- 41 47 ! 0.2 modified fields … … 59 65 ! wood mass of an individual 60 66 !- 61 REAL(r_std),DIMENSION(npts) :: woodmass67 !!$ REAL(r_std),DIMENSION(npts) :: woodmass 62 68 !- 63 69 ! index … … 75 81 ! 1.1 check if DGVM activated 76 82 !- 77 IF (.NOT.control%ok_dgvm ) THEN83 IF (.NOT.control%ok_dgvm .AND. lpj_gap_const_mort) THEN 78 84 STOP 'crown: not to be called with static vegetation.' 79 85 ENDIF … … 81 87 ! 1.2 initialize output to zero 82 88 !- 83 cn_ind(:,:) = 0.089 cn_ind(:,:) = zero 84 90 ! no convertion, just cop 85 91 height_presc_12(1:nvm) = height_presc(1:nvm) … … 94 100 IF (natural(j)) THEN 95 101 !------ 2.1.1 natural 96 WHERE (PFTpresent(:,j) .AND.ind(:,j).GT.min_stomate) 97 !-------- 2.1.1.1 calculate individual wood mass 98 woodmass(:) = & 99 & (biomass(:,j,isapabove)+biomass(:,j,isapbelow) & 100 & +biomass(:,j,iheartabove)+biomass(:,j,iheartbelow))/ind(:,j) 102 !WHERE (PFTpresent(:,j) .AND.ind(:,j).GT.min_stomate) 103 WHERE (PFTpresent(:,j) .AND.woodmass_ind(:,j).GT.min_stomate) 104 !!$SZ note that woodmass_ind needs to be defined on the individual, hence 105 !!$ biomass*veget_max/ind, not as stated here, correction MERGE 106 !!$!-------- 2.1.1.1 calculate individual wood mass 107 !!$ woodmass(:) = & 108 !!$ & (biomass(:,j,isapabove)+biomass(:,j,isapbelow) & 109 !!$ & +biomass(:,j,iheartabove)+biomass(:,j,iheartbelow))/ind(:,j) 101 110 !-------- 2.1.1.2 stem diameter (pipe model) 102 dia(:) = (woodmass(:)/(pipe_density*pi/4.*pipe_tune2)) & 111 !!$ dia(:) = (woodmass(:)/(pipe_density*pi/4.*pipe_tune2)) & 112 dia(:) = (woodmass_ind(:,j)/(pipe_density*pi/4.*pipe_tune2)) & 103 113 & **(1./(2.+pipe_tune3)) 104 114 !-------- 2.1.1.3 height 105 115 height(:,j) = pipe_tune2*(dia(:)**pipe_tune3) 106 WHERE (height(:,j) > height_presc_12(j)) 107 dia(:) = (height_presc_12(j)/pipe_tune2)**(1./pipe_tune3) 108 height(:,j) = height_presc_12(j) 109 ENDWHERE 116 !!$SZ: The constraint on height has nothing to do with LPJ (for that purpose there's dia_max 117 !!$ cannot see why this is necessary - it also blurrs the output, hence I leave it commented 118 !!$ WHERE (height(:,j) > height_presc_12(j)) 119 !!$ dia(:) = (height_presc_12(j)/pipe_tune2)**(1./pipe_tune3) 120 !!$ height(:,j) = height_presc_12(j) 121 !!$ ENDWHERE 110 122 !-------- 2.1.1.4 crown area: for large truncs, crown area cannot 111 123 !-------- exceed a certain value, prescribed through maxdia. … … 122 134 WHERE (PFTpresent(:,j)) 123 135 !------ 2.2.1 an "individual" is 1 m**2 of grass 124 cn_ind(:,j) = 1.136 cn_ind(:,j) = un 125 137 ENDWHERE 126 138 ENDIF … … 129 141 ! ind and cn_ind are 0 if not present 130 142 !--- 131 !SZ isn't this physically inconsistent with the assumptions of sechiba?? 132 ! the actual LPJ formulation calculates fpc from maximum LAI, and fpar from actual LAI=veget 133 IF (natural(j).AND.control%ok_dgvm) THEN 134 veget_max(:,j) = ind(:,j) * cn_ind(:,j) 135 ENDIF 143 !!$SZ: since now all state variables are defined on veget_max it is very 144 !!$ dangerous to change this several times in stomate_lpj, as then GPP, turnover and allocated 145 !!$ biomass are not defined on the same space! Hence, veget_max is now kept constant 146 !!$ and updated at the end of stomate_lpj in lpj_cover.f90 147 !!$ Eventually, this routine should only be called once at the beginning and the end of stomate_lpj 148 !!$ or prefereably cn_ind made a saved state variable! 149 !!$ IF (natural(j).AND.control%ok_dgvm) THEN 150 !!$ veget_max(:,j) = ind(:,j) * cn_ind(:,j) 151 !!$ ENDIF 136 152 ENDDO 137 153 !------------------- -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/lpj_establish.f90
r64 r257 33 33 neighbours, resolution, need_adjacent, herbivores, & 34 34 precip_annual, gdd0, lm_lastyearmax, & 35 cn_ind, lai, avail_tree, avail_grass, &35 cn_ind, lai, avail_tree, avail_grass, npp_longterm, & 36 36 leaf_age, leaf_frac, & 37 ind, biomass, age, everywhere, co2_to_bm,veget_max) 38 37 ind, biomass, age, everywhere, co2_to_bm,veget_max, woodmass_ind) 39 38 ! 40 39 ! 0 declarations … … 74 73 ! space availability for grasses 75 74 REAL(r_std), DIMENSION(npts), INTENT(in) :: avail_grass 75 ! longterm NPP, for each PFT (gC/(m**2 of ground)) 76 REAL(r_std), DIMENSION(npts,nvm), INTENT(in) :: npp_longterm 76 77 ! "maximal" coverage fraction of a PFT (LAI -> infinity) on ground 77 78 REAL(r_std), DIMENSION(npts,nvm), INTENT(inout) :: veget_max … … 94 95 !NV passage 2D 95 96 REAL(r_std), DIMENSION(npts,nvm), INTENT(inout) :: co2_to_bm 97 ! woodmass of the individual, needed to calculate crownarea in lpj_crownarea 98 REAL(r_std), DIMENSION(npts,nvm), INTENT(inout) :: woodmass_ind 96 99 97 100 ! 0.3 local … … 111 114 ! total natural fpc 112 115 REAL(r_std), DIMENSION(npts) :: sumfpc 116 ! total fraction occupied by natural vegetation 117 REAL(r_std), DIMENSION(npts) :: fracnat 113 118 ! total woody fpc 114 119 REAL(r_std), DIMENSION(npts) :: sumfpc_wood … … 129 134 ! woodmass of an individual 130 135 REAL(r_std), DIMENSION(npts) :: woodmass 136 ! carbon mass in youngest leaf age class (gC/m**2 PFT) 137 REAL(r_std), DIMENSION(npts) :: leaf_mass_young 131 138 ! ratio of hw(above) to total hw, sm(above) to total sm 132 139 REAL(r_std), DIMENSION(npts) :: sm_at 133 140 ! reduction factor for establishment if many trees or grasses are present 134 141 REAL(r_std), DIMENSION(npts) :: factor 142 ! Total carbon mass for all pools 143 REAL(r_std), DIMENSION(npts) :: total_bm_c 144 ! Total sappling biomass for all pools 145 REAL(r_std), DIMENSION(npts) :: total_bm_sapl 135 146 ! from how many sides is the grid box invaded 136 147 INTEGER(i_std) :: nfrontx 137 148 INTEGER(i_std) :: nfronty 138 149 ! daily establishment rate is large compared to present number of individuals 139 LOGICAL, DIMENSION(npts) :: many_new 150 !LOGICAL, DIMENSION(npts) :: many_new 151 ! flow due to new individuals 152 ! veget_max after establishment, to get a proper estimate of carbon and nitrogen 153 REAL(r_std), DIMENSION(npts) :: vn 154 ! lai on each PFT surface 155 REAL(r_std), DIMENSION(npts) :: lai_ind 156 140 157 ! indices 141 158 INTEGER(i_std) :: i,j,k,m … … 161 178 ENDIF 162 179 163 ! 164 ! 2 recalculate fpc 165 ! 166 167 ! 168 ! 2.1 Only natural part of the grid cell 169 ! 170 171 DO j = 2,nvm 172 173 IF ( natural(j) ) THEN 174 DO i = 1, npts 175 IF (lai(i,j) == val_exp) THEN 176 fpc_nat(i,j) = cn_ind(i,j) * ind(i,j) 177 ELSE 178 fpc_nat(i,j) = cn_ind(i,j) * ind(i,j) * ( 1. - exp( -lai(i,j) * ext_coeff(j) ) ) 179 ENDIF 180 ENDDO 181 ELSE 182 183 fpc_nat(:,j) = 0.0 184 185 ENDIF 186 187 ENDDO 188 189 ! 190 ! 2.2 total natural fpc on grid 191 ! 192 193 sumfpc(:) = SUM( fpc_nat(:,:), DIM=2 ) 194 195 ! 196 ! 2.3 total woody fpc on grid and number of regenerative tree pfts 197 ! 198 199 sumfpc_wood(:) = 0.0 200 spacefight_tree(:) = 0.0 201 202 DO j = 2,nvm 203 204 IF ( tree(j) .AND. natural(j) ) THEN 205 206 ! total woody fpc 207 208 WHERE ( PFTpresent(:,j) ) 209 sumfpc_wood(:) = sumfpc_wood(:) + fpc_nat(:,j) 210 ENDWHERE 211 212 ! how many trees are competing? Count a PFT fully only if it is present 213 ! on the whole grid box. 214 215 WHERE ( PFTpresent(:,j) .AND. ( regenerate(:,j) .GT. regenerate_crit ) ) 216 spacefight_tree(:) = spacefight_tree(:) + everywhere(:,j) 217 ENDWHERE 218 219 ENDIF 220 221 ENDDO 222 223 ! 224 ! 2.4 number of natural grasses 225 ! 226 227 spacefight_grass(:) = 0.0 228 229 DO j = 2,nvm 230 231 IF ( .NOT. tree(j) .AND. natural(j) ) THEN 232 233 ! how many grasses are competing? Count a PFT fully only if it is present 234 ! on the whole grid box. 235 236 WHERE ( PFTpresent(:,j) ) 237 spacefight_grass(:) = spacefight_grass(:) + everywhere(:,j) 238 ENDWHERE 239 240 ENDIF 241 242 ENDDO 243 244 ! 245 ! 3 establishment rate 246 ! 247 248 ! 249 ! 3.1 maximum establishment rate, based on climate only 250 ! 251 252 WHERE ( ( precip_annual(:) .GE. precip_crit ) .AND. ( gdd0(:) .GE. gdd_crit_estab ) ) 253 254 estab_rate_max_climate_tree(:) = estab_max_tree 255 estab_rate_max_climate_grass(:) = estab_max_grass 256 257 ELSEWHERE 258 259 estab_rate_max_climate_tree(:) = 0.0 260 estab_rate_max_climate_grass(:) = 0.0 261 262 ENDWHERE 263 264 ! 265 ! 3.2 reduce maximum tree establishment rate if many trees present. 266 ! In the original DGVM, this is done using a step function which yields a 267 ! reduction by factor 4 if sumfpc_wood(i) .GT. fpc_crit - 0.05. 268 ! This can lead to small oscillations (without consequences however). 269 ! Here, a steady linear transition is used between fpc_crit-0.075 and 270 ! fpc_crit-0.025. 271 ! 272 273 factor(:) = 1. - establish_scal_fact * ( sumfpc_wood(:) - (fpc_crit - fpc_crit_max) ) 274 factor(:) = MAX( 0.25_r_std, MIN( un, factor(:) ) ) 275 276 estab_rate_max_tree(:) = estab_rate_max_climate_tree(:) * factor(:) 277 278 ! 279 ! 3.3 Modulate grass establishment rate. 280 ! If canopy is not closed (fpc < fpc_crit-0.05), normal establishment. 281 ! If canopy is closed, establishment is reduced by a factor 4. 282 ! Factor is linear between these two bounds. 283 ! This is different from the original DGVM where a step function is 284 ! used at fpc_crit-0.05 (This can lead to small oscillations, 285 ! without consequences however). 286 ! 287 288 factor(:) = 1. - establish_scal_fact * ( sumfpc(:) - (fpc_crit - fpc_crit_min) ) 289 factor(:) = MAX( 0.25_r_std, MIN( un, factor(:) ) ) 290 291 estab_rate_max_grass(:) = estab_rate_max_climate_grass(:) * factor(:) 292 293 ! 294 ! 4 do establishment for natural PFTs 295 ! 296 297 d_ind(:,:) = 0.0 298 299 DO j = 2,nvm 300 301 ! only for natural PFTs 302 303 IF ( natural(j) ) THEN 304 305 ! 306 ! 4.1 PFT expansion across the grid box. Not to be confused with areal 307 ! coverage. 308 ! 309 310 IF ( treat_expansion ) THEN 311 312 ! only treat plants that are regenerative and present and still can expand 313 314 DO i = 1, npts 315 316 IF ( PFTpresent(i,j) .AND. & 317 ( everywhere(i,j) .LT. 1. ) .AND. & 318 ( regenerate(i,j) .GT. regenerate_crit ) ) THEN 319 320 ! from how many sides is the grid box invaded (separate x and y directions 321 ! because resolution may be strongly anisotropic) 322 ! 323 ! For the moment we only look into 4 direction but that can be extanded (JP) 324 ! 325 nfrontx = 0 326 IF ( neighbours(i,3) .GT. 0 ) THEN 327 IF ( everywhere(neighbours(i,3),j) .GT. 1.-min_stomate ) nfrontx = nfrontx+1 328 ENDIF 329 IF ( neighbours(i,7) .GT. 0 ) THEN 330 IF ( everywhere(neighbours(i,7),j) .GT. 1.-min_stomate ) nfrontx = nfrontx+1 331 ENDIF 332 333 nfronty = 0 334 IF ( neighbours(i,1) .GT. 0 ) THEN 335 IF ( everywhere(neighbours(i,1),j) .GT. 1.-min_stomate ) nfronty = nfronty+1 336 ENDIF 337 IF ( neighbours(i,5) .GT. 0 ) THEN 338 IF ( everywhere(neighbours(i,5),j) .GT. 1.-min_stomate ) nfronty = nfronty+1 339 ENDIF 340 341 everywhere(i,j) = & 342 everywhere(i,j) + migrate(j) * dt/one_year * & 343 ( nfrontx / resolution(i,1) + nfronty / resolution(i,2) ) 344 345 IF ( .NOT. need_adjacent(i,j) ) THEN 346 347 ! in that case, we also assume that the PFT expands from places within 348 ! the grid box (e.g., oasis). 349 180 181 IF (control%ok_dgvm) THEN 182 ! 183 ! 2 recalculate fpc 184 ! 185 186 ! 187 ! 2.1 Only natural part of the grid cell 188 ! 189 190 fracnat(:) = un 191 do j = 2,nvm 192 IF ( .NOT. natural(j) ) THEN 193 fracnat(:) = fracnat(:) - veget_max(:,j) 194 ENDIF 195 ENDDO 196 197 ! 198 ! 2.2 total natural fpc on grid 199 ! 200 sumfpc(:) = zero 201 DO j = 2,nvm 202 203 IF ( natural(j) ) THEN 204 WHERE(fracnat(:).GT.min_stomate) 205 WHERE (lai(:,j) == val_exp) 206 fpc_nat(:,j) = cn_ind(:,j) * ind(:,j) / fracnat(:) 207 ELSEWHERE 208 fpc_nat(:,j) = cn_ind(:,j) * ind(:,j) / fracnat(:) & 209 * ( 1. - exp( - lm_lastyearmax(:,j) * sla(j) * ext_coeff(j) ) ) 210 ENDWHERE 211 ENDWHERE 212 213 WHERE ( PFTpresent(:,j) ) 214 sumfpc(:) = sumfpc(:) + fpc_nat(:,j) 215 ENDWHERE 216 ELSE 217 218 fpc_nat(:,j) = zero 219 220 ENDIF 221 222 ENDDO 223 224 ! 225 ! 2.3 total woody fpc on grid and number of regenerative tree pfts 226 ! 227 228 sumfpc_wood(:) = zero 229 spacefight_tree(:) = zero 230 231 DO j = 2,nvm 232 233 IF ( tree(j) .AND. natural(j) ) THEN 234 235 ! total woody fpc 236 237 WHERE ( PFTpresent(:,j) ) 238 sumfpc_wood(:) = sumfpc_wood(:) + fpc_nat(:,j) 239 ENDWHERE 240 241 ! how many trees are competing? Count a PFT fully only if it is present 242 ! on the whole grid box. 243 244 WHERE ( PFTpresent(:,j) .AND. ( regenerate(:,j) .GT. regenerate_crit ) ) 245 spacefight_tree(:) = spacefight_tree(:) + everywhere(:,j) 246 ENDWHERE 247 248 ENDIF 249 250 ENDDO 251 252 ! 253 ! 2.4 number of natural grasses 254 ! 255 256 spacefight_grass(:) = zero 257 258 DO j = 2,nvm 259 260 IF ( .NOT. tree(j) .AND. natural(j) ) THEN 261 262 ! how many grasses are competing? Count a PFT fully only if it is present 263 ! on the whole grid box. 264 265 WHERE ( PFTpresent(:,j) ) 266 spacefight_grass(:) = spacefight_grass(:) + everywhere(:,j) 267 ENDWHERE 268 269 ENDIF 270 271 ENDDO 272 273 ! 274 ! 3 establishment rate 275 ! 276 277 ! 278 ! 3.1 maximum establishment rate, based on climate only 279 ! 280 281 WHERE ( ( precip_annual(:) .GE. precip_crit ) .AND. ( gdd0(:) .GE. gdd_crit_estab ) ) 282 283 estab_rate_max_climate_tree(:) = estab_max_tree 284 estab_rate_max_climate_grass(:) = estab_max_grass 285 286 ELSEWHERE 287 288 estab_rate_max_climate_tree(:) = zero 289 estab_rate_max_climate_grass(:) = zero 290 291 ENDWHERE 292 293 ! 294 ! 3.2 reduce maximum tree establishment rate if many trees present. 295 ! In the original DGVM, this is done using a step function which yields a 296 ! reduction by factor 4 if sumfpc_wood(i) .GT. fpc_crit - 0.05. 297 ! This can lead to small oscillations (without consequences however). 298 ! Here, a steady linear transition is used between fpc_crit-0.075 and 299 ! fpc_crit-0.025. 300 ! 301 302 !factor(:) = 1. - establish_scal_fact * ( sumfpc_wood(:) - (fpc_crit - fpc_crit_max) ) 303 !factor(:) = MAX( 0.25_r_std, MIN( un, factor(:) ) ) 304 305 !SZ modified according to Smith et al. 2001, 080806 306 factor(:)=(1.0-exp(-5.0*(1.0-sumfpc_wood(:))))*(1.0-sumfpc_wood(:)) 307 308 estab_rate_max_tree(:) = estab_rate_max_climate_tree(:) * factor(:) 309 310 ! 311 ! 3.3 Modulate grass establishment rate. 312 ! If canopy is not closed (fpc < fpc_crit-0.05), normal establishment. 313 ! If canopy is closed, establishment is reduced by a factor 4. 314 ! Factor is linear between these two bounds. 315 ! This is different from the original DGVM where a step function is 316 ! used at fpc_crit-0.05 (This can lead to small oscillations, 317 ! without consequences however). 318 ! 319 320 !factor(:) = 1. - establish_scal_fact * ( sumfpc(:) - (fpc_crit - fpc_crit_min) ) 321 !factor(:) = MAX( 0.25_r_std, MIN( un, factor(:) ) ) 322 !estab_rate_max_grass(:) = estab_rate_max_climate_grass(:) * factor(:) 323 324 !SZ modified to true LPJ formulation, grasses are only allowed in the 325 !fpc fraction not occupied by trees..., 080806 326 !NVmodif estab_rate_max_grass(:)=MAX(0.98-sumfpc(:),zero) 327 estab_rate_max_grass(:)=MAX(MIN(estab_rate_max_climate_grass(:),0.98-sumfpc(:)),zero) 328 329 ! SZ: longterm grass NPP for competition between C4 and C3 grasses 330 ! to avoid equal veget_max, the idea is that more reestablishment 331 ! is possible for the more productive PFT 332 factor(:)=min_stomate 333 DO j = 2,nvm 334 IF ( natural(j) .AND. .NOT.tree(j)) & 335 factor(:)=factor(:)+npp_longterm(:,j) * & 336 lm_lastyearmax(:,j) * sla(j) 337 ENDDO 338 ! 339 ! 340 ! 341 ! 4 do establishment for natural PFTs 342 ! 343 344 d_ind(:,:) = zero 345 346 DO j = 2,nvm 347 348 ! only for natural PFTs 349 350 IF ( natural(j) ) THEN 351 352 ! 353 ! 4.1 PFT expansion across the grid box. Not to be confused with areal 354 ! coverage. 355 ! 356 357 IF ( treat_expansion ) THEN 358 359 ! only treat plants that are regenerative and present and still can expand 360 361 DO i = 1, npts 362 363 IF ( PFTpresent(i,j) .AND. & 364 ( everywhere(i,j) .LT. un ) .AND. & 365 ( regenerate(i,j) .GT. regenerate_crit ) ) THEN 366 367 ! from how many sides is the grid box invaded (separate x and y directions 368 ! because resolution may be strongly anisotropic) 369 ! 370 ! For the moment we only look into 4 direction but that can be extanded (JP) 371 ! 372 nfrontx = 0 373 IF ( neighbours(i,3) .GT. 0 ) THEN 374 IF ( everywhere(neighbours(i,3),j) .GT. 1.-min_stomate ) nfrontx = nfrontx+1 375 ENDIF 376 IF ( neighbours(i,7) .GT. 0 ) THEN 377 IF ( everywhere(neighbours(i,7),j) .GT. 1.-min_stomate ) nfrontx = nfrontx+1 378 ENDIF 379 380 nfronty = 0 381 IF ( neighbours(i,1) .GT. 0 ) THEN 382 IF ( everywhere(neighbours(i,1),j) .GT. 1.-min_stomate ) nfronty = nfronty+1 383 ENDIF 384 IF ( neighbours(i,5) .GT. 0 ) THEN 385 IF ( everywhere(neighbours(i,5),j) .GT. 1.-min_stomate ) nfronty = nfronty+1 386 ENDIF 387 350 388 everywhere(i,j) = & 351 389 everywhere(i,j) + migrate(j) * dt/one_year * & 352 2. * SQRT( pi*everywhere(i,j)/(resolution(i,1)*resolution(i,2)) ) 353 390 ( nfrontx / resolution(i,1) + nfronty / resolution(i,2) ) 391 392 IF ( .NOT. need_adjacent(i,j) ) THEN 393 394 ! in that case, we also assume that the PFT expands from places within 395 ! the grid box (e.g., oasis). 396 397 everywhere(i,j) = & 398 everywhere(i,j) + migrate(j) * dt/one_year * & 399 2. * SQRT( pi*everywhere(i,j)/(resolution(i,1)*resolution(i,2)) ) 400 401 ENDIF 402 403 everywhere(i,j) = MIN( everywhere(i,j), un ) 404 354 405 ENDIF 355 356 everywhere(i,j) = MIN( everywhere(i,j), un ) 357 358 ENDIF 359 360 ENDDO 361 362 ENDIF ! treat expansion? 363 364 ! 365 ! 4.2 establishment rate 366 ! - Is lower if the PFT is only present in a small part of the grid box 367 ! (after its introduction), therefore multiplied by "everywhere". 368 ! - Is divided by the number of PFTs that compete ("spacefight"). 369 ! - Is modulated by space availability (avail_tree, avail_grass). 370 ! 371 372 IF ( tree(j) ) THEN 373 374 ! 4.2.1 present and regenerative trees 375 376 WHERE ( PFTpresent(:,j) .AND. ( regenerate(:,j) .GT. regenerate_crit ) ) 377 378 379 d_ind(:,j) = estab_rate_max_tree(:)*everywhere(:,j)/spacefight_tree(:) * & 380 avail_tree(:) * dt/one_year 381 382 ENDWHERE 383 384 ELSE 385 386 ! 4.2.2 present and regenerative grasses 387 388 WHERE ( PFTpresent(:,j) .AND. ( regenerate(:,j) .GT. regenerate_crit ) ) 389 390 d_ind(:,j) = estab_rate_max_grass(:)*everywhere(:,j)/spacefight_grass(:) * & 391 avail_grass(:) * dt/one_year 392 393 ENDWHERE 394 395 ENDIF ! tree/grass 406 407 ENDDO 408 409 ENDIF ! treat expansion? 410 411 ! 412 ! 4.2 establishment rate 413 ! - Is lower if the PFT is only present in a small part of the grid box 414 ! (after its introduction), therefore multiplied by "everywhere". 415 ! - Is divided by the number of PFTs that compete ("spacefight"). 416 ! - Is modulated by space availability (avail_tree, avail_grass). 417 ! 418 419 IF ( tree(j) ) THEN 420 421 ! 4.2.1 present and regenerative trees 422 423 WHERE ( PFTpresent(:,j) .AND. ( regenerate(:,j) .GT. regenerate_crit ) ) 424 425 426 d_ind(:,j) = estab_rate_max_tree(:)*everywhere(:,j)/spacefight_tree(:) * & 427 avail_tree(:) * dt/one_year 428 429 ENDWHERE 430 431 ELSE 432 433 ! 4.2.2 present and regenerative grasses 434 435 WHERE ( PFTpresent(:,j) .AND. ( regenerate(:,j) .GT. regenerate_crit ) & 436 .AND.factor(:).GT.min_stomate .AND. spacefight_grass(:).GT. min_stomate) 437 438 d_ind(:,j) = estab_rate_max_grass(:)*everywhere(:,j)/spacefight_grass(:) * & 439 MAX(min_stomate,npp_longterm(:,j)*lm_lastyearmax(:,j)*sla(j)/factor(:)) * fracnat(:) * dt/one_year 440 441 ENDWHERE 442 443 ENDIF ! tree/grass 444 445 ENDIF ! if natural 446 ENDDO ! PFTs 447 448 ELSE ! lpj establishment in static case, SZ 080806, account for real LPJ dynamics in 449 ! prescribed vegetation, i.e. population dynamics within a given area of the 450 ! grid cell 451 452 d_ind(:,:) = zero 453 454 DO j = 2,nvm 455 456 ! only for natural PFTs 457 458 WHERE(ind(:,j)*cn_ind(:,j).GT.min_stomate) 459 lai_ind(:)=sla(j) * lm_lastyearmax(:,j)/(ind(:,j)*cn_ind(:,j)) 460 ELSEWHERE 461 lai_ind(:)= zero 462 ENDWHERE 463 464 IF ( natural(j) .AND. tree(j)) THEN 465 466 fpc_nat(:,j) = MIN(1.0,cn_ind(:,j) * ind(:,j) * & 467 MAX( ( 1._r_std - exp( - ext_coeff(j) * lai_ind(:) ) ), min_cover ) ) 468 !fpc_nat(:,j) = max(fpc_nat(:,j),1.-exp(-0.5*sla(j) * lm_lastyearmax(:,j))) 469 470 471 WHERE (veget_max(:,j).GT.min_stomate.AND.ind(:,j).LE.2.) 472 473 ! only establish into growing stands, ind can become very 474 ! large in the static mode because LAI is very low in poor 475 ! growing conditions, favouring continuous establishment. To avoid this 476 ! a maximum IND is set. BLARPP: This should be replaced by a 477 ! better stand density criteria 478 ! 479 factor(:)=(1.0-exp(-5.0*(1.0-fpc_nat(:,j))))*(1.0-fpc_nat(:,j)) 480 481 estab_rate_max_tree(:) = estab_max_tree * factor(:) 482 ! 483 ! 4 do establishment for natural PFTs 484 ! 485 d_ind(:,j) = MAX( zero, estab_rate_max_tree(:) * dt/one_year) 486 487 ENDWHERE 488 489 !SZ: quickfix: to simulate even aged stand, uncomment the following lines... 490 !where (ind(:,j) .LE. min_stomate) 491 !d_ind(:,j) = 0.1 !MAX( 0.0, estab_rate_max_tree(:) * dt/one_year) 492 493 WHERE (veget_max(:,j).GT.min_stomate.AND.ind(:,j).EQ.zero) 494 d_ind(:,j) = ind_0*10. 495 ! elsewhere 496 !d_ind(:,j) =0.0 497 endwhere 498 499 ELSEIF ( natural(j) .AND. .NOT.tree(j)) THEN 500 501 WHERE (veget_max(:,j).GT.min_stomate) 502 503 fpc_nat(:,j) = cn_ind(:,j) * ind(:,j) * & 504 MAX( ( 1._r_std - exp( - ext_coeff(j) * lai_ind(:) ) ), min_cover ) 505 506 d_ind(:,j) = MAX(zero , (1.0-fpc_nat(:,j)) * dt/one_year ) 507 508 ENDWHERE 509 510 WHERE (veget_max(:,j).GT.min_stomate.AND.ind(:,j).EQ.zero) 511 d_ind(:,j) = ind_0*10. 512 ENDWHERE 513 514 ENDIF 515 516 ENDDO 517 518 ENDIF ! DGVM OR NOT 519 520 DO j = 2,nvm 521 522 ! only for natural PFTs 523 524 IF ( natural(j) ) THEN 396 525 397 526 ! … … 409 538 ! 410 539 ! 4.4 be sure that ind*cn_ind does not exceed 1 411 ! 412 413 WHERE ( ( d_ind(:,j) .GT. 0.0 ) .AND. & 414 ( (ind(:,j)+d_ind(:,j))*cn_ind(:,j) .GT. 1. ) ) 415 416 d_ind(:,j) = MAX( un / cn_ind(:,j) - ind(:,j), zero) 417 418 ENDWHERE 540 !SZ This control is now moved to lpj_cover.f90 541 !SZ 542 543 !The aim is to control for sum(veget)=1., irrespective of ind*cnd (crowns can overlap as long as 544 ! there is enough light 545 ! 546 !SZ: This could be part of the dynamic vegetation problem of Orchidee 547 !in conjunction with the wrong formulation of establishment response 548 !to tree fpc above... 549 ! WHERE ( ( d_ind(:,j) .GT. zero ) .AND. & 550 ! ( (ind(:,j)+d_ind(:,j))*cn_ind(:,j) .GT. un ) ) 551 ! 552 ! d_ind(:,j) = MAX( 1._stnd / cn_ind(:,j) - ind(:,j), zero ) 553 ! 554 ! ENDWHERE 419 555 420 556 ! … … 428 564 429 565 ! compare establishment rate and present number of inidivuals 430 many_new(:) = ( d_ind(:,j) .GT. 0.1 * ind(:,j) )566 !many_new(:) = ( d_ind(:,j) .GT. 0.1 * ind(:,j) ) 431 567 432 568 ! gives a better vectorization of the VPP 433 569 434 IF ( ANY( many_new(:) ) ) THEN 435 436 DO k = 1, nparts 437 438 WHERE ( many_new(:) ) 439 440 bm_new(:) = d_ind(:,j) * bm_sapl(j,k) / veget_max (:,j) 441 442 biomass(:,j,k) = biomass(:,j,k) + bm_new(:) 443 444 !NV passage 2D 445 co2_to_bm(:,j) = co2_to_bm(:,j) + bm_new(:) / dt 446 447 ENDWHERE 448 570 !IF ( ANY( many_new(:) ) ) THEN 571 572 ! save old leaf mass to calculate leaf age 573 leaf_mass_young(:) = leaf_frac(:,j,1) * biomass(:,j,ileaf) 574 ! total biomass of existing PFT to limit biomass added from establishment 575 total_bm_c(:) = zero 576 577 DO k = 1, nparts 578 total_bm_c(:)=total_bm_c(:)+biomass(:,j,k) 579 ENDDO 580 IF(control%ok_dgvm) THEN 581 vn(:)=veget_max(:,j) 582 ELSE 583 vn(:)=1.0 584 ENDIF 585 total_bm_sapl(:)=zero 586 DO k = 1, nparts 587 WHERE(d_ind(:,j).GT.min_stomate.AND.vn(:).GT.min_stomate) 588 589 total_bm_sapl(:) = total_bm_sapl(:) + & 590 bm_sapl(j,k) * d_ind(:,j) / vn(:) 591 ENDWHERE 592 ENDDO 593 594 IF(control%ok_dgvm) THEN 595 ! SZ calculate new woodmass_ind and veget_max after establishment (needed for correct scaling!) 596 ! essential correction for MERGE! 597 IF(tree(j))THEN 598 DO i=1,npts 599 IF((d_ind(i,j)+ind(i,j)).GT.min_stomate) THEN 600 601 IF((total_bm_c(i).LE.min_stomate) .OR. (veget_max(i,j) .LE. min_stomate)) THEN 602 603 ! new wood mass of PFT 604 woodmass_ind(i,j) = & 605 & (((biomass(i,j,isapabove)+biomass(i,j,isapbelow) & 606 & +biomass(i,j,iheartabove)+biomass(i,j,iheartbelow))*veget_max(i,j)) & 607 & +(bm_sapl(j,isapabove)+bm_sapl(j,isapbelow) & 608 & +bm_sapl(j,iheartabove)+bm_sapl(j,iheartbelow))*d_ind(i,j))/(ind(i,j)+d_ind(i,j)) 609 610 ELSE 611 ! new biomass is added to the labile pool, hence there is no change in CA associated with establishment 612 woodmass_ind(i,j) = & 613 & (biomass(i,j,isapabove)+biomass(i,j,isapbelow) & 614 & +biomass(i,j,iheartabove)+biomass(i,j,iheartbelow))*veget_max(i,j) & 615 & /(ind(i,j)+d_ind(i,j)) 616 617 ENDIF 618 619 ! new diameter of PFT 620 dia(i) = (woodmass_ind(i,j)/(pipe_density*pi/4.*pipe_tune2)) & 621 & **(1./(2.+pipe_tune3)) 622 623 vn(:)=(ind(i,j)+d_ind(i,j))*pipe_tune1*MIN(dia(i),maxdia(j))**pipe_tune_exp_coeff 624 625 ENDIF 626 ENDDO 627 ELSE ! for grasses, cnd=1, so the above calculation cancels 628 vn(:)=ind(:,j)+d_ind(:,j) 629 ENDIF 630 ELSE ! static 631 DO i=1,npts 632 IF(tree(j).AND.(d_ind(i,j)+ind(i,j)).GT.min_stomate) THEN 633 IF(total_bm_c(i).LE.min_stomate) THEN 634 635 ! new wood mass of PFT 636 woodmass_ind(i,j) = & 637 & (((biomass(i,j,isapabove)+biomass(i,j,isapbelow) & 638 & +biomass(i,j,iheartabove)+biomass(i,j,iheartbelow))) & 639 & +(bm_sapl(j,isapabove)+bm_sapl(j,isapbelow) & 640 & +bm_sapl(j,iheartabove)+bm_sapl(j,iheartbelow))*d_ind(i,j))/(ind(i,j)+d_ind(i,j)) 641 642 ELSE ! new biomass is added to the labile pool, hence there is no change in CA associated with establishment 643 644 woodmass_ind(i,j) = & 645 & (biomass(i,j,isapabove)+biomass(i,j,isapbelow) & 646 & +biomass(i,j,iheartabove)+biomass(i,j,iheartbelow)) & 647 & /(ind(i,j)+d_ind(i,j)) 648 649 ENDIF 650 ENDIF 449 651 ENDDO 450 652 451 ! reset leaf ages. Should do a real calculation like in the npp routine, 452 ! but this case is rare and not worth messing around. 453 454 WHERE ( many_new(:) ) 455 leaf_age(:,j,1) = 0.0 456 leaf_frac(:,j,1) = 1.0 457 ENDWHERE 458 459 DO m = 2, nleafages 460 461 WHERE ( many_new(:) ) 462 leaf_age(:,j,m) = 0.0 463 leaf_frac(:,j,m) = 0.0 464 ENDWHERE 465 466 ENDDO 467 468 ENDIF ! establishment rate is large 469 470 WHERE ( d_ind(:,j) .GT. 0.0 ) 471 472 ! 4.5.2 age decreases 653 vn(:)=1.0 ! cannot change in static!, and veget_max implicit in d_ind 654 655 ENDIF 656 ! total biomass of PFT added by establishment defined over veget_max ... 657 total_bm_sapl(:)=zero 658 DO k = 1, nparts 659 WHERE(d_ind(:,j).GT.min_stomate.AND.total_bm_c(:).GT.min_stomate.AND.vn(:).GT.min_stomate) 660 661 total_bm_sapl(:) = total_bm_sapl(:) + & 662 bm_sapl(j,k) * d_ind(:,j) / vn(:) 663 ENDWHERE 664 665 ENDDO 666 667 DO k = 1, nparts 668 669 bm_new(:)=zero 670 671 ! first ever establishment, C flows 672 WHERE( d_ind(:,j).GT.min_stomate .AND. & 673 total_bm_c(:).LE.min_stomate .AND. & 674 vn(:).GT.min_stomate) 675 ! WHERE ( many_new(:) ) 676 677 !bm_new(:) = d_ind(:,j) * bm_sapl(j,k) / veget_max (:,j) 678 bm_new(:) = d_ind(:,j) * bm_sapl(j,k) / vn(:) 679 680 biomass(:,j,k) = biomass(:,j,k) + bm_new(:) 681 682 co2_to_bm(:,j) = co2_to_bm(:,j) + bm_new(:) / dt 683 684 ENDWHERE 685 686 ! establishment into existing population, C flows 687 WHERE(d_ind(:,j).GT.min_stomate.AND.total_bm_c(:).GT.min_stomate) 688 689 bm_new(:) = total_bm_sapl(:) * biomass(:,j,k) / total_bm_c(:) 690 691 biomass(:,j,k) = biomass(:,j,k) + bm_new(:) 692 co2_to_bm(:,j) = co2_to_bm(:,j) + bm_new(:) / dt 693 694 ENDWHERE 695 ENDDO 696 697 ! reset leaf ages. Should do a real calculation like in the npp routine, 698 ! but this case is rare and not worth messing around. 699 ! SZ 080806, added real calculation now, because otherwise leaf_age/leaf_frac 700 ! are not initialised for the calculation of vmax, and hence no growth at all. 701 ! logic follows that of stomate_npp.f90, just that it's been adjusted for the code here 702 ! 703 ! 4.5.2 Decrease leaf age in youngest class if new leaf biomass is higher than old one. 704 ! 705 706 !!$ WHERE ( many_new(:) ) 707 !!$ leaf_age(:,j,1) = zero 708 !!$ leaf_frac(:,j,1) = un 709 !!$ ENDWHERE 710 !!$ 711 !!$ DO m = 2, nleafages 712 !!$ 713 !!$ WHERE ( many_new(:) ) 714 !!$ leaf_age(:,j,m) = zero 715 !!$ leaf_frac(:,j,m) = zero 716 !!$ ENDWHERE 717 !!$ 718 !!$ ENDDO 719 720 WHERE ( d_ind(:,j) * bm_sapl(j,ileaf) .GT. min_stomate ) 721 722 leaf_age(:,j,1) = leaf_age(:,j,1) * leaf_mass_young(:) / & 723 ( leaf_mass_young(:) + d_ind(:,j) * bm_sapl(j,ileaf) ) 724 725 ENDWHERE 726 727 ! 728 leaf_mass_young(:) = leaf_mass_young(:) + d_ind(:,j) * bm_sapl(j,ileaf) 729 730 ! 731 ! new age class fractions (fraction in youngest class increases) 732 ! 733 734 ! youngest class: new mass in youngest class divided by total new mass 735 736 WHERE ( biomass(:,j,ileaf) .GT. min_stomate ) 737 738 leaf_frac(:,j,1) = leaf_mass_young(:) / biomass(:,j,ileaf) 739 740 ENDWHERE 741 742 ! other classes: old mass in leaf age class divided by new mass 743 744 DO m = 2, nleafages 745 746 WHERE ( biomass(:,j,ileaf) .GT. min_stomate ) 747 748 leaf_frac(:,j,m) = leaf_frac(:,j,m) * & 749 ( biomass(:,j,ileaf) + d_ind(:,j) * bm_sapl(j,ileaf) ) / biomass(:,j,ileaf) 750 751 ENDWHERE 752 753 ENDDO 754 755 !ENDIF ! establishment rate is large 756 757 WHERE ( d_ind(:,j) .GT. min_stomate ) 758 759 ! 4.5.3 age decreases 473 760 474 761 age(:,j) = age(:,j) * ind(:,j) / ( ind(:,j) + d_ind(:,j) ) 475 762 476 ! 4.5. 3new number of individuals763 ! 4.5.4 new number of individuals 477 764 478 765 ind(:,j) = ind(:,j) + d_ind(:,j) … … 484 771 ! 485 772 773 !SZ to clarify with Gerhard Krinner: This is theoretically inconsistent because 774 ! the allocation to sapwood and leaves do not follow the LPJ logic in stomate_alloc.f90 775 ! hence imposing this here not only solves for the uneveness of age (mixing new and average individual) 776 ! but also corrects for the discrepancy between SLAVE and LPJ logic of allocation, thus leads to excess heartwood 777 ! and thus carbon accumulation! 778 ! should be removed. 779 486 780 IF ( tree(j) ) THEN 487 781 488 sm2(:) = 0.0 489 490 WHERE ( d_ind(:,j) .GT. 0.0 ) 491 492 ! ratio of above / total sap parts 493 sm_at(:) = biomass(:,j,isapabove) / & 494 ( biomass(:,j,isapabove) + biomass(:,j,isapbelow) ) 495 496 ! woodmass of an individual 497 498 woodmass(:) = & 499 ( biomass(:,j,isapabove) + biomass(:,j,isapbelow) + & 500 biomass(:,j,iheartabove) + biomass(:,j,iheartbelow) ) / ind(:,j) 501 502 ! crown area (m**2) depends on stem diameter (pipe model) 503 dia(:) = ( woodmass(:) / ( pipe_density * pi/4. * pipe_tune2 ) ) & 504 ** ( 1. / ( 2. + pipe_tune3 ) ) 505 506 b1(:) = pipe_k1 / ( sla(j) * pipe_density*pipe_tune2 * dia(:)**pipe_tune3 ) * & 507 ind(:,j) 508 sm2(:) = lm_lastyearmax(:,j) / b1(:) 509 510 ENDWHERE 511 512 WHERE ( ( d_ind(:,j) .GT. 0.0 ) .AND. & 782 !!$ sm2(:) = 0.0 783 !!$ WHERE ( d_ind(:,j) .GT. 0.0 ) 784 !!$ 785 !!$ ! ratio of above / total sap parts 786 !!$ sm_at(:) = biomass(:,j,isapabove) / & 787 !!$ ( biomass(:,j,isapabove) + biomass(:,j,isapbelow) ) 788 !!$ 789 !!$ ! woodmass of an individual 790 !!$ 791 !!$ woodmass(:) = & 792 !!$ ( biomass(:,j,isapabove) + biomass(:,j,isapbelow) + & 793 !!$ biomass(:,j,iheartabove) + biomass(:,j,iheartbelow) ) / ind(:,j) 794 !!$ 795 !!$ ! crown area (m**2) depends on stem diameter (pipe model) 796 !!$ dia(:) = ( woodmass(:) / ( pipe_density * pi/4. * pipe_tune2 ) ) & 797 !!$ ** ( 1. / ( 2. + pipe_tune3 ) ) 798 !!$ 799 !!$ b1(:) = pipe_k1 / ( sla(j) * pipe_density*pipe_tune2 * dia(:)**pipe_tune3 ) * & 800 !!$ ind(:,j) 801 !!$ sm2(:) = lm_lastyearmax(:,j) / b1(:) 802 !!$ 803 !!$ ENDWHERE 804 805 sm2(:)=biomass(:,j,isapabove) + biomass(:,j,isapbelow) 806 807 WHERE ( ( d_ind(:,j) .GT. min_stomate ) .AND. & 513 808 ( biomass(:,j,isapabove) + biomass(:,j,isapbelow) ) .GT. sm2(:) ) 514 809 … … 518 813 519 814 biomass(:,j,iheartbelow) = biomass(:,j,iheartbelow) + & 520 ( biomass(:,j,isapbelow) - sm2(:) * ( 1.- sm_at) )521 biomass(:,j,isapbelow) = sm2(:) * ( 1.- sm_at(:))815 ( biomass(:,j,isapbelow) - sm2(:) * (un - sm_at) ) 816 biomass(:,j,isapbelow) = sm2(:) * (un - sm_at(:)) 522 817 523 818 ENDWHERE … … 536 831 537 832 CALL histwrite (hist_id_stomate, 'IND_ESTAB', itime, d_ind, npts*nvm, horipft_index) 833 CALL histwrite (hist_id_stomate, 'ESTABTREE', itime, estab_rate_max_tree, npts, hori_index) 834 CALL histwrite (hist_id_stomate, 'ESTABGRASS', itime, estab_rate_max_grass, npts, hori_index) 538 835 539 836 IF (bavard.GE.4) WRITE(numout,*) 'Leaving establish' -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/lpj_fire.f90
r136 r257 99 99 !MM Shilong ?? 100 100 !!$ REAL(r_std), PARAMETER :: tau_fire = 365. ! GKtest 101 102 101 ! fire perturbation 103 102 REAL(r_std), DIMENSION(npts) :: fire_disturb … … 273 272 IF(.NOT.disable_fire.AND.natural(j))THEN 274 273 WHERE ( aff(:) .GT. 0.1 ) 275 firefrac(:,j) = 1. - ( 1.- aff(:) ) ** (dt/one_year)274 firefrac(:,j) = un - ( un - aff(:) ) ** (dt/one_year) 276 275 ELSEWHERE 277 276 firefrac(:,j) = aff(:) * dt/one_year … … 315 314 ! 4.2.1 Trees: always disturbed 316 315 317 fire_disturb(:) = ( 1.- resist(j) ) * firefrac(:,j)316 fire_disturb(:) = ( un - resist(j) ) * firefrac(:,j) 318 317 319 318 ELSE … … 323 322 WHERE ( biomass(:,j,ileaf) .GT. min_stomate ) 324 323 325 fire_disturb(:) = ( 1.- resist(j) ) * firefrac(:,j)324 fire_disturb(:) = ( un - resist(j) ) * firefrac(:,j) 326 325 327 326 ELSEWHERE … … 353 352 ! 4.3.2 Determine the residue, in gC/m**2 of ground. 354 353 355 residue(:) = biomass(:,j,k) * fire_disturb(:) * ( 1.- co2frac(k) )356 !MM in SZ ??? residue(:) = fire_disturb(:) * ( 1.- co2frac(k) )354 residue(:) = biomass(:,j,k) * fire_disturb(:) * ( un - co2frac(k) ) 355 !MM in SZ ??? residue(:) = fire_disturb(:) * ( un - co2frac(k) ) 357 356 358 357 ! 4.3.2.1 determine fraction of black carbon. Only for plant parts above the … … 400 399 IF ( .NOT. ( ( .NOT. tree(j) ) .AND. ( ( k.EQ.iroot ) .OR. ( k.EQ.icarbres) ) ) ) THEN 401 400 402 biomass(:,j,k) = ( 1.- fire_disturb(:) ) * biomass(:,j,k)401 biomass(:,j,k) = ( un - fire_disturb(:) ) * biomass(:,j,k) 403 402 404 403 ENDIF … … 409 408 ! individuals. 410 409 411 IF ( control%ok_dgvm.AND. tree(j) ) THEN410 IF ( (control%ok_dgvm .OR. .NOT.lpj_gap_const_mort) .AND. tree(j) ) THEN 412 411 413 412 ! fraction of plants that dies each day. … … 415 414 firedeath(:,j) = fire_disturb(:) / dt 416 415 417 ind(:,j) = ( 1.- fire_disturb(:) ) * ind(:,j)416 ind(:,j) = ( un - fire_disturb(:) ) * ind(:,j) 418 417 419 418 ENDIF … … 440 439 441 440 litter(:,imetabolic,j,iabove) = litter(:,imetabolic,j,iabove) * & 442 ( 1.- firefrac(:,j) )441 ( un - firefrac(:,j) ) 443 442 444 443 ! … … 455 454 co2_fire(:,j) = co2_fire(:,j) + & 456 455 litter(:,istructural,j,iabove) * firefrac(:,j) * & 457 ( 1.- struc_residual(:) )/ dt456 ( un - struc_residual(:) )/ dt 458 457 459 458 ! 5.2.3 determine residue (litter that undergoes fire, but is not transformed 460 459 ! into CO2) 461 460 462 residue(:) = litter(:,istructural,j,iabove) * firefrac(:,j) * & 463 struc_residual(:) 461 !NV,MM : We add this test to keep coherence with CMIP5 computations without DGVM. 462 ! It has to be removed in trunk version after CMIP5. 463 IF (control%ok_dgvm .OR. .NOT.lpj_gap_const_mort) THEN 464 residue(:) = firefrac(:,j) * struc_residual(:) 465 ELSE 466 residue(:) = litter(:,istructural,j,iabove) * firefrac(:,j) * & 467 struc_residual(:) 468 ENDIF 469 470 ! residue(:) = litter(:,istructural,j,iabove) * firefrac(:,j) * & 471 ! struc_residual(:) 464 472 !MM in SZ residue(:) = firefrac(:,j) * struc_residual(:) 465 473 … … 482 490 483 491 litter(:,istructural,j,iabove) = & 484 litter(:,istructural,j,iabove) * ( 1.- firefrac(:,j) ) + &485 residue(:) * ( 1.- bcfrac(:) )486 !MM in SZ residue(:) * ( 1.- bcfrac(:) ) * litter(:,iwoody,j,iabove)492 litter(:,istructural,j,iabove) * ( un - firefrac(:,j) ) + & 493 residue(:) * ( un - bcfrac(:) ) 494 !MM in SZ residue(:) * ( un - bcfrac(:) ) * litter(:,iwoody,j,iabove) 487 495 488 496 ENDDO ! ground … … 496 504 497 505 DO k = 1, nlitt 498 dead_leaves(:,j,k) = dead_leaves(:,j,k) * ( 1.- firefrac(:,j) )506 dead_leaves(:,j,k) = dead_leaves(:,j,k) * ( un - firefrac(:,j) ) 499 507 ENDDO 500 508 … … 543 551 544 552 firefrac_result(:) = & 545 ! x(:) * EXP( xm1(:) / ( -.13*xm1(:)*xm1(:)*xm1(:) + .6*xm1(:)*xm1(:) + .8*xm1(:) + .45 ) )546 553 x(:) * EXP( xm1(:) / ( -firefrac_coeff(4)*xm1(:)*xm1(:)*xm1(:) + firefrac_coeff(3)*xm1(:)*xm1(:) + firefrac_coeff(2)*xm1(:) + firefrac_coeff(1) ) ) 547 554 548 549 555 END FUNCTION firefrac_func 550 556 -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/lpj_gap.f90
r64 r257 39 39 SUBROUTINE gap (npts, dt, & 40 40 npp_longterm, turnover_longterm, lm_lastyearmax, & 41 PFTpresent, biomass, ind, bm_to_litter )41 PFTpresent, biomass, ind, bm_to_litter, mortality) 42 42 43 43 ! … … 68 68 ! biomass taken away (gC/(m**2 of ground)) 69 69 REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout) :: bm_to_litter 70 ! mortality (fraction of trees that is dying per time step), per day in history file 71 REAL(r_std), DIMENSION(npts,nvm),INTENT(out) :: mortality 70 72 71 73 ! 0.3 local 72 74 73 ! which kind of mortality74 LOGICAL, SAVE :: constant_mortality75 75 ! biomass increase 76 76 REAL(r_std), DIMENSION(npts) :: delta_biomass 77 ! biomass increase 78 REAL(r_std), DIMENSION(npts) :: dmortality 77 79 ! vigour 78 80 REAL(r_std), DIMENSION(npts) :: vigour 79 81 ! natural availability, based on vigour 80 82 REAL(r_std), DIMENSION(npts) :: availability 81 ! mortality (fraction of trees that is dying per time step), per day in history file82 REAL(r_std), DIMENSION(npts,nvm) :: mortality83 83 ! indices 84 INTEGER(i_std) :: j,k 84 INTEGER(i_std) :: j,k,m 85 REAL(r_std) :: ref_greff 85 86 86 87 ! ========================================================================= … … 90 91 firstcall = .FALSE. 91 92 92 !Config Key = LPJ_GAP_CONST_MORT93 !Config Desc = constant tree mortality94 !Config Def = y95 !Config Help = If yes, then a constant mortality is applied to trees.96 !Config Otherwise, mortality is a function of the trees'97 !Config vigour (as in LPJ).98 99 constant_mortality = .TRUE.100 CALL getin_p('LPJ_GAP_CONST_MORT', constant_mortality)101 WRITE(numout,*) 'gap: constant mortality:', constant_mortality102 103 93 ENDIF 104 94 105 IF (bavard.GE.3) WRITE(numout,*) 'Entering gap' 95 IF (bavard.GE.3) WRITE(numout,*) 'Entering gap',lpj_gap_const_mort 106 96 107 97 mortality(:,:) = zero 108 98 99 ref_greff = 0.035 100 109 101 DO j = 2,nvm 110 102 … … 117 109 ! 118 110 119 IF ( .NOT. constant_mortality) THEN111 IF ( .NOT. lpj_gap_const_mort ) THEN 120 112 121 113 ! … … 125 117 WHERE ( PFTpresent(:,j) .AND. ( lm_lastyearmax(:,j) .GT. min_stomate ) ) 126 118 119 !SZ 080806, changed to LPJ formulation according to Smith et al., 2001 120 127 121 ! how much did the tree grow per year? 128 122 129 delta_biomass(:) = & 130 MAX( npp_longterm(:,j) - ( turnover_longterm(:,j,ileaf) + & 131 turnover_longterm(:,j,iroot) + turnover_longterm(:,j,ifruit) ), & 132 zero ) 123 !!$ delta_biomass(:) = & 124 !!$ MAX( npp_longterm(:,j) - ( turnover_longterm(:,j,ileaf) + & 125 !!$ turnover_longterm(:,j,iroot) + turnover_longterm(:,j,ifruit) ), & 126 !!$ 0._r_std ) 127 128 ! note that npp_longterm is now actually longterm growth efficiency (NPP/LAI) 129 ! to be fair to deciduous trees 130 delta_biomass(:) = MAX( npp_longterm(:,j) - ( turnover_longterm(:,j,ileaf) + & 131 turnover_longterm(:,j,iroot) + turnover_longterm(:,j,ifruit) + & 132 turnover_longterm(:,j,isapabove) + turnover_longterm(:,j,isapbelow) ) ,zero) 133 133 134 134 ! scale this to the leaf surface of the tree 135 136 vigour(:) = delta_biomass(:) / (lm_lastyearmax(:,j)*sla(j)) / vigour_coeff135 !!$ vigour(:) = delta_biomass(:) / (lm_lastyearmax(:,j)*sla(j)) / vigour_coeff 136 vigour(:) = delta_biomass(:) / (lm_lastyearmax(:,j)*sla(j)) 137 137 138 138 ELSEWHERE … … 147 147 ! low vigour. 148 148 149 availability(:) = availability_fact / ( 1.+vigour(:)/vigour_ref) 149 !SZ 080806, changed to LPJ formulation according to Smith et al., 2001 150 ! tuned maximal mortality to 0.05 to get realistic range of avergage age to get ~100 years at GREFF=100 151 ! for the range of modelled annual NPP 152 !!$ availability(:) = min_avail / ( 1.+vigour(:)/vigour_ref ) 153 availability(:) = 0.1 / ( 1.+ref_greff*vigour(:) ) 150 154 151 155 ! Mortality (fraction per time step). … … 158 162 ! approximation ok as availability < 0.02 << 1 159 163 160 mortality(:,j) = availability(:) * dt/one_year 164 mortality(:,j) = MAX(min_avail,availability(:)) * dt/one_year 165 !!$ mortality(:,j) = availability(:) * dt/one_year 161 166 162 167 ENDWHERE … … 199 204 WHERE ( PFTpresent(:,j) ) 200 205 201 bm_to_litter(:,j,k) = bm_to_litter(:,j,k) + mortality(:,j) * biomass(:,j,k) 202 203 biomass(:,j,k) = biomass(:,j,k) * ( 1. - mortality(:,j) ) 206 dmortality(:) = mortality(:,j) * biomass(:,j,k) 207 bm_to_litter(:,j,k) = bm_to_litter(:,j,k) + dmortality(:) 208 209 biomass(:,j,k) = biomass(:,j,k) - dmortality(:) 204 210 205 211 ENDWHERE … … 211 217 ! 212 218 213 IF ( control%ok_dgvm ) THEN 214 215 WHERE ( PFTpresent(:,j) ) 216 217 ind(:,j) = ind(:,j) * ( 1. - mortality(:,j) ) 218 219 ENDWHERE 220 219 !SZ 080806, allow changing density in static case when mortality is dynamic 220 IF ( control%ok_dgvm .OR. .NOT.lpj_gap_const_mort) THEN 221 222 WHERE ( PFTpresent(:,j) ) 223 224 ind(:,j) = ind(:,j) * ( un - mortality(:,j) ) 225 226 ENDWHERE 227 228 ENDIF 229 230 ELSE 231 232 IF ( .NOT.control%ok_dgvm .AND. .NOT.lpj_gap_const_mort) THEN 233 234 WHERE ( PFTpresent(:,j) .AND. ( npp_longterm(:,j) .LE. 10. ) ) 235 236 mortality(:,j) = 1. 237 238 ENDWHERE 239 DO k = 1, nparts 240 241 WHERE ( PFTpresent(:,j) ) 242 243 dmortality(:) = mortality(:,j) * biomass(:,j,k) 244 245 bm_to_litter(:,j,k) = bm_to_litter(:,j,k) + dmortality(:) 246 247 biomass(:,j,k) = biomass(:,j,k) - dmortality(:) 248 249 ENDWHERE 250 ENDDO 251 221 252 ENDIF 222 253 -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/lpj_kill.f90
r64 r257 25 25 SUBROUTINE kill (npts, whichroutine, lm_lastyearmax, & 26 26 ind, PFTpresent, cn_ind, biomass, senescence, RIP_time, & 27 lai, age, leaf_age, leaf_frac, &27 lai, age, leaf_age, leaf_frac, npp_longterm, & 28 28 when_growthinit, everywhere, veget, veget_max, bm_to_litter) 29 29 … … 37 37 INTEGER(i_std), INTENT(in) :: npts 38 38 ! message 39 CHARACTER *10, INTENT(in) :: whichroutine39 CHARACTER(LEN=10), INTENT(in) :: whichroutine 40 40 ! last year's maximum leaf mass, for each PFT (gC/(m**2 of ground)) 41 41 REAL(r_std), DIMENSION(npts,nvm), INTENT(in) :: lm_lastyearmax … … 72 72 ! "maximal" coverage fraction of a PFT (LAI -> infinity) on ground 73 73 REAL(r_std), DIMENSION(npts,nvm), INTENT(inout) :: veget_max 74 ! "long term" net primary productivity (gC/(m**2 of ground)/year) 75 REAL(r_std), DIMENSION(npts,nvm), INTENT(inout) :: npp_longterm 74 76 ! conversion of biomass to litter (gC/(m**2 of ground)) / day 75 77 REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout) :: bm_to_litter … … 98 100 ! the "was_killed" business is necessary for a more efficient code on the VPP 99 101 100 WHERE ( PFTpresent(:,j) .AND. & 101 ( ( ind(:,j) .LT. min_stomate ) .OR. & 102 ( lm_lastyearmax(:,j) .LT. min_stomate ) ) ) 103 102 IF ( control%ok_dgvm ) THEN 103 WHERE ( PFTpresent(:,j) .AND. & 104 ( ( ind(:,j) .LT. min_stomate ) .OR. & 105 ( lm_lastyearmax(:,j) .LT. min_stomate ) ) ) 106 104 107 was_killed(:) = .TRUE. 105 106 ENDWHERE 108 109 ENDWHERE 110 111 ELSE 112 WHERE ( PFTpresent(:,j) .AND. & 113 (biomass(:,j,icarbres) .LE.zero .OR. & 114 biomass(:,j,iroot).LT.-min_stomate .OR. biomass(:,j,ileaf).LT.-min_stomate ).AND. & 115 ind(:,j).GT. zero) 116 117 was_killed(:) = .TRUE. 118 119 ENDWHERE 120 121 IF(.NOT.tree(j).AND..NOT.lpj_gap_const_mort)THEN 122 WHERE ( was_killed(:) ) 123 124 npp_longterm(:,j)=500. 125 126 ENDWHERE 127 ENDIF 128 129 ENDIF 107 130 108 131 IF ( ANY( was_killed(:) ) ) THEN 109 132 110 133 WHERE ( was_killed(:) ) 111 112 ind(:,j) = 0.0113 134 114 135 bm_to_litter(:,j,ileaf) = bm_to_litter(:,j,ileaf) + biomass(:,j,ileaf) … … 123 144 bm_to_litter(:,j,icarbres) = bm_to_litter(:,j,icarbres) + biomass(:,j,icarbres) 124 145 125 biomass(:,j,ileaf) = 0.0 126 biomass(:,j,isapabove) = 0.0 127 biomass(:,j,isapbelow) = 0.0 128 biomass(:,j,iheartabove) = 0.0 129 biomass(:,j,iheartbelow) = 0.0 130 biomass(:,j,iroot) = 0.0 131 biomass(:,j,ifruit) = 0.0 132 biomass(:,j,icarbres) = 0.0 133 134 PFTpresent(:,j) = .FALSE. 135 136 cn_ind(:,j) = 0.0 146 biomass(:,j,ileaf) = zero 147 biomass(:,j,isapabove) = zero 148 biomass(:,j,isapbelow) = zero 149 biomass(:,j,iheartabove) = zero 150 biomass(:,j,iheartbelow) = zero 151 biomass(:,j,iroot) = zero 152 biomass(:,j,ifruit) = zero 153 biomass(:,j,icarbres) = zero 154 155 ENDWHERE ! number of individuals very low 156 157 IF (control%ok_dgvm) THEN 158 159 WHERE ( was_killed(:) ) 160 PFTpresent(:,j) = .FALSE. 161 162 veget_max(:,j) = zero 163 164 RIP_time(:,j) = zero 165 166 ENDWHERE ! number of individuals very low 167 168 ENDIF 169 170 WHERE ( was_killed(:) ) 171 172 ind(:,j) = zero 173 174 cn_ind(:,j) = zero 137 175 138 176 senescence(:,j) = .FALSE. 139 177 140 141 age(:,j) = 0.0 142 143 when_growthinit(:,j) = undef 144 145 everywhere(:,j) = 0.0 146 147 veget(:,j) = 0.0 148 149 veget_max(:,j) = 0.0 150 151 RIP_time(:,j) = 0.0 178 age(:,j) = zero 179 180 ! SZ: why undef ??? this causes a delay in reestablishment 181 !when_growthinit(:,j) = undef 182 when_growthinit(:,j) = large_value 183 184 everywhere(:,j) = zero 185 186 veget(:,j) = zero 152 187 153 188 ENDWHERE ! number of individuals very low … … 157 192 WHERE ( was_killed(:) ) 158 193 159 leaf_age(:,j,m) = 0.0160 leaf_frac(:,j,m) = 0.0194 leaf_age(:,j,m) = zero 195 leaf_frac(:,j,m) = zero 161 196 162 197 ENDWHERE -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/lpj_light.f90
r64 r257 14 14 ! Exclude agricultural pfts from competition 15 15 ! 16 ! SZ: added light competition for the static case if the mortality is not 17 ! assumed to be constant. 18 ! other modifs: 19 ! -1 FPC is now always calculated from lm_lastyearmax*sla, since the aim of this DGVM is 20 ! to represent community ecology effects; seasonal variations in establishment related to phenology 21 ! may be relevant, but beyond the scope of a 1st generation DGVM 22 ! -2 problem, if agriculture is present, fpc can never reach 1.0 since natural veget_max < 1.0. To 23 ! correct for this, ind must be recalculated to correspond to the natural density... 24 ! since ind is 1/m2 grid cell, this can be achived by dividing ind by the agricultural fraction 25 26 ! 16 27 ! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_stomate/lpj_light.f90,v 1.8 2009/01/06 15:01:25 ssipsl Exp $ 17 28 ! IPSL (2006) … … 43 54 44 55 SUBROUTINE light (npts, dt, & 45 PFTpresent, cn_ind, lai, maxfpc_lastyear, &46 ind, biomass, veget_lastlight, bm_to_litter)56 veget_max, fpc_max, PFTpresent, cn_ind, lai, maxfpc_lastyear, & 57 lm_lastyearmax, ind, biomass, veget_lastlight, bm_to_litter, mortality) 47 58 48 59 ! … … 64 75 ! last year's maximum fpc for each natural PFT, on ground 65 76 REAL(r_std), DIMENSION(npts,nvm), INTENT(in) :: maxfpc_lastyear 77 ! last year's maximum leafmass for each natural PFT, on ground 78 REAL(r_std), DIMENSION(npts,nvm), INTENT(in) :: lm_lastyearmax 79 ! last year's maximum fpc for each natural PFT, on ground 80 REAL(r_std), DIMENSION(npts,nvm), INTENT(in) :: veget_max 81 ! last year's maximum fpc for each natural PFT, on ground 82 REAL(r_std), DIMENSION(npts,nvm), INTENT(in) :: fpc_max 66 83 67 84 ! 0.2 modified fields … … 75 92 ! biomass taken away (gC/m**2) 76 93 REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout) :: bm_to_litter 94 ! fraction of individuals that died this time step 95 REAL(r_std), DIMENSION(npts,nvm), INTENT(inout) :: mortality 77 96 78 97 ! 0.3 local 79 98 80 99 ! index 81 INTEGER(i_std) :: i,j 100 INTEGER(i_std) :: i,j,k,m 82 101 ! total natural fpc 83 102 REAL(r_std), DIMENSION(npts) :: sumfpc 103 ! fraction of natural vegetation at grid cell level 104 REAL(r_std), DIMENSION(npts) :: fracnat 84 105 ! total natural woody fpc 85 106 REAL(r_std) :: sumfpc_wood … … 100 121 ! Fraction of plants that survive 101 122 REAL(r_std), DIMENSION(nvm) :: survive 123 ! FPC for static mode 124 REAL(r_std), DIMENSION(npts) :: fpc_real 125 ! FPC mortality for static mode 126 REAL(r_std), DIMENSION(npts) :: lai_ind 102 127 ! number of grass PFTs present in the grid box 103 INTEGER(i_std) :: num_grass128 ! INTEGER(i_std) :: num_grass 104 129 ! New total grass fpc 105 130 REAL(r_std) :: sumfpc_grass2 106 131 ! fraction of plants that dies each day (1/day) 107 132 REAL(r_std), DIMENSION(npts,nvm) :: light_death 133 ! Relative change of number of individuals for trees 134 REAL(r_std) :: fpc_dec 108 135 109 136 ! ========================================================================= … … 139 166 ENDIF 140 167 141 ! 142 ! 2 fpc characteristics 143 ! 144 145 ! 146 ! 2.1 calculate fpc on natural part of grid cell. 147 ! 148 149 DO j = 2, nvm 150 151 IF ( natural(j) ) THEN 152 153 ! 2.1.1 natural PFTs 154 155 IF ( tree(j) ) THEN 156 157 ! 2.1.1.1 trees: minimum cover due to stems, branches etc. 158 159 DO i = 1, npts 160 IF (lai(i,j) == val_exp) THEN 161 fpc_nat(i,j) = cn_ind(i,j) * ind(i,j) 162 ELSE 163 fpc_nat(i,j) = cn_ind(i,j) * ind(i,j) * & 164 MAX( ( un - exp( -lai(i,j) * ext_coeff(j) ) ), min_cover ) 165 ENDIF 166 ENDDO 168 IF (control%ok_dgvm) THEN 169 ! 170 ! 2 fpc characteristics 171 ! 172 173 ! 2.0 Only natural part of the grid cell: 174 ! calculate fraction of natural and agricultural (1-fracnat) surface 175 176 fracnat(:) = 1. 177 DO j = 2,nvm 178 IF ( .NOT. natural(j) ) THEN 179 fracnat(:) = fracnat(:) - veget_max(:,j) 180 ENDIF 181 ENDDO 182 ! 183 ! 2.1 calculate fpc on natural part of grid cell. 184 ! 185 fpc_nat(:,:)=zero 186 fpc_nat(:,ibare_sechiba)=un 187 188 DO j = 2, nvm 189 190 IF ( natural(j) ) THEN 191 192 ! 2.1.1 natural PFTs 193 194 IF ( tree(j) ) THEN 195 196 ! 2.1.1.1 trees: minimum cover due to stems, branches etc. 197 198 ! DO i = 1, npts 199 ! IF (lai(i,j) == val_exp) THEN 200 ! fpc_nat(i,j) = cn_ind(i,j) * ind(i,j) 201 ! ELSE 202 ! fpc_nat(i,j) = cn_ind(i,j) * ind(i,j) * & 203 ! MAX( ( 1._r_std - exp( -lai(i,j) * ext_coeff(j) ) ), min_cover ) 204 ! ENDIF 205 ! ENDDO 206 207 !NV : modif from SZ version : fpc is based on veget_max, not veget. 208 WHERE(fracnat(:).GE.min_stomate) 209 ! WHERE(LAI(:,j) == val_exp) 210 ! fpc_nat(:,j) = cn_ind(:,j) * ind(:,j) / fracnat(:) 211 ! ELSEWHERE 212 ! fpc_nat(:,j) = cn_ind(:,j) * ind(:,j) / fracnat(:) * & 213 ! MAX( ( 1._r_std - exp( - lm_lastyearmax(:,j) * sla(j) * ext_coeff(j) ) ), min_cover ) 214 ! ENDWHERE 215 fpc_nat(:,j) = cn_ind(:,j) * ind(:,j) / fracnat(:) 216 ENDWHERE 217 218 ELSE 219 220 !NV : modif from SZ version : fpc is based on veget_max, not veget. 221 WHERE(fracnat(:).GE.min_stomate) 222 ! WHERE(LAI(:,j) == val_exp) 223 ! fpc_nat(:,j) = cn_ind(:,j) * ind(:,j) / fracnat(:) 224 ! ELSEWHERE 225 ! fpc_nat(:,j) = cn_ind(:,j) * ind(:,j) / fracnat(:) * & 226 ! ( 1._r_std - exp( - lm_lastyearmax(:,j) * sla(j) * ext_coeff(j) ) ) 227 ! ENDWHERE 228 fpc_nat(:,j) = cn_ind(:,j) * ind(:,j) / fracnat(:) 229 ENDWHERE 230 231 !!$ ! 2.1.1.2 bare ground 232 !!$ IF (j == ibare_sechiba) THEN 233 !!$ fpc_nat(:,j) = cn_ind(:,j) * ind(:,j) 234 !!$ 235 !!$ ! 2.1.1.3 grasses 236 !!$ ELSE 237 !!$ DO i = 1, npts 238 !!$ IF (lai(i,j) == val_exp) THEN 239 !!$ fpc_nat(i,j) = cn_ind(i,j) * ind(i,j) 240 !!$ ELSE 241 !!$ fpc_nat(i,j) = cn_ind(i,j) * ind(i,j) * & 242 !!$ ( 1._r_std - exp( -lai(i,j) * ext_coeff(j) ) ) 243 !!$ ENDIF 244 !!$ ENDDO 245 !!$ ENDIF 246 247 ENDIF ! tree/grass 167 248 168 249 ELSE 169 250 170 ! 2.1.1.2 bare ground 171 IF (j == ibare_sechiba) THEN 172 fpc_nat(:,j) = cn_ind(:,j) * ind(:,j) 173 174 ! 2.1.1.3 grasses 251 ! 2.1.2 agricultural PFTs: not present on natural part 252 253 fpc_nat(:,j) = zero 254 255 ENDIF ! natural/agricultural 256 257 ENDDO 258 259 ! 260 ! 2.2 sum natural fpc for every grid point 261 ! 262 263 sumfpc(:) = zero 264 DO j = 2,nvm 265 !SZ bug correction MERGE: need to subtract agricultural area! 266 sumfpc(:) = sumfpc(:) + fpc_nat(:,j) 267 ENDDO 268 269 ! 270 ! 3 Light competition 271 ! 272 273 light_death(:,:) = zero 274 275 DO i = 1, npts ! SZ why this loop and not a vector statement ? 276 277 ! Only if vegetation cover is dense 278 279 IF ( sumfpc(i) .GT. fpc_crit ) THEN 280 281 ! fpc change for each pft 282 ! There are two possibilities: either we compare today's fpc with the fpc after the last 283 ! time step, or we compare it to last year's maximum fpc of that PFT. In the first case, 284 ! the fpc increase will be strong for seasonal PFTs at the beginning of the growing season. 285 ! As for trees, the cutback is proportional to this increase, this means that seasonal trees 286 ! will be disadvantaged compared to evergreen trees. In the original LPJ model, with its 287 ! annual time step, the second method was used (this corresponds to annual_increase=.TRUE.) 288 289 IF ( annual_increase ) THEN 290 deltafpc(:) = MAX( (fpc_nat(i,:)-maxfpc_lastyear(i,:)), zero ) 175 291 ELSE 176 DO i = 1, npts 177 IF (lai(i,j) == val_exp) THEN 178 fpc_nat(i,j) = cn_ind(i,j) * ind(i,j) 292 deltafpc(:) = MAX( (fpc_nat(i,:)-veget_lastlight(i,:)), zero ) 293 ENDIF 294 295 ! default: survive 296 297 survive(:) = 1.0 298 299 ! 300 ! 3.1 determine some characteristics of the fpc distribution 301 ! 302 303 sumfpc_wood = zero 304 sumdelta_fpc_wood = zero 305 maxfpc_wood = zero 306 optpft_wood = 0 307 sumfpc_grass = zero 308 ! num_grass = 0 309 310 DO j = 2,nvm 311 312 ! only natural pfts 313 314 IF ( natural(j) ) THEN 315 316 IF ( tree(j) ) THEN 317 318 ! trees 319 320 ! total woody fpc 321 322 sumfpc_wood = sumfpc_wood + fpc_nat(i,j) 323 324 ! how much did the woody fpc increase 325 326 sumdelta_fpc_wood = sumdelta_fpc_wood + deltafpc(j) 327 328 ! which woody pft is preponderant 329 330 IF ( fpc_nat(i,j) .GT. maxfpc_wood ) THEN 331 332 optpft_wood = j 333 334 maxfpc_wood = fpc_nat(i,j) 335 336 ENDIF 337 179 338 ELSE 180 fpc_nat(i,j) = cn_ind(i,j) * ind(i,j) * & 181 ( un - exp( -lai(i,j) * ext_coeff(j) ) ) 182 ENDIF 183 ENDDO 184 ENDIF 185 ENDIF ! tree/grass 186 187 ELSE 188 189 ! 2.1.2 agricultural PFTs: not present on natural part 190 191 fpc_nat(:,j) = 0.0 192 193 ENDIF ! natural/agricultural 194 195 ENDDO 196 197 ! 198 ! 2.2 sum natural fpc for every grid point 199 ! 200 201 sumfpc(:) = zero 202 DO j = 2,nvm 203 !SZ bug correction MERGE: need to subtract agricultural area! 204 sumfpc(:) = sumfpc(:) + fpc_nat(:,j) 205 ENDDO 206 207 ! 208 ! 3 Light competition 209 ! 210 211 light_death(:,:) = 0.0 212 213 DO i = 1, npts ! SZ why this loop and not a vector statement ? 214 215 ! Only if vegetation cover is dense 216 217 IF ( sumfpc(i) .GT. fpc_crit ) THEN 218 219 ! fpc change for each pft 220 ! There are two possibilities: either we compare today's fpc with the fpc after the last 221 ! time step, or we compare it to last year's maximum fpc of that PFT. In the first case, 222 ! the fpc increase will be strong for seasonal PFTs at the beginning of the growing season. 223 ! As for trees, the cutback is proportional to this increase, this means that seasonal trees 224 ! will be disadvantaged compared to evergreen trees. In the original LPJ model, with its 225 ! annual time step, the second method was used (this corresponds to annual_increase=.TRUE.) 226 227 IF ( annual_increase ) THEN 228 deltafpc(:) = MAX( (fpc_nat(i,:)-maxfpc_lastyear(i,:)), zero ) 229 ELSE 230 deltafpc(:) = MAX( (fpc_nat(i,:)-veget_lastlight(i,:)), zero ) 231 ENDIF 232 233 ! default: survive 234 235 survive(:) = 1.0 236 237 ! 238 ! 3.1 determine some characteristics of the fpc distribution 239 ! 240 241 sumfpc_wood = 0.0 242 sumdelta_fpc_wood = 0.0 243 maxfpc_wood = 0.0 244 optpft_wood = 0 245 sumfpc_grass = 0.0 246 num_grass = 0 247 248 DO j = 2,nvm 249 250 ! only natural pfts 251 252 IF ( natural(j) ) THEN 253 254 IF ( tree(j) ) THEN 255 256 ! trees 257 258 ! total woody fpc 259 260 sumfpc_wood = sumfpc_wood + fpc_nat(i,j) 261 262 ! how much did the woody fpc increase 263 264 sumdelta_fpc_wood = sumdelta_fpc_wood + deltafpc(j) 265 266 ! which woody pft is preponderant 267 268 IF ( fpc_nat(i,j) .GT. maxfpc_wood ) THEN 269 270 optpft_wood = j 271 272 maxfpc_wood = fpc_nat(i,j) 273 274 ENDIF 275 276 ELSE 277 339 278 340 ! grasses 279 341 280 342 ! total (natural) grass fpc 281 343 282 344 sumfpc_grass = sumfpc_grass + fpc_nat(i,j) 283 345 284 346 ! number of grass PFTs present in the grid box 285 286 IF ( PFTpresent(i,j) ) THEN287 num_grass = num_grass + 1288 ENDIF289 347 348 ! IF ( PFTpresent(i,j) ) THEN 349 ! num_grass = num_grass + 1 350 ! ENDIF 351 290 352 ENDIF ! tree or grass 291 353 292 354 ENDIF ! natural 293 355 294 356 ENDDO ! loop over pfts 295 357 296 358 ! 297 359 ! 3.2 light competition: assume wood outcompetes grass 298 360 ! 299 300 IF (sumfpc_wood .GE. fpc_crit ) THEN 301 302 ! 303 ! 3.2.1 all allowed natural space is covered by wood: 304 ! cut back trees to fpc_crit. 305 ! Original DGVM: kill grasses. Modified: we let a very 306 ! small fraction of grasses survive. 307 ! 308 361 !SZ 362 !!$ IF (sumfpc_wood .GE. fpc_crit ) THEN 363 364 ! 365 ! 3.2.1 all allowed natural space is covered by wood: 366 ! cut back trees to fpc_crit. 367 ! Original DGVM: kill grasses. Modified: we let a very 368 ! small fraction of grasses survive. 369 ! 370 371 DO j = 2,nvm 372 373 ! only present and natural pfts compete 374 375 IF ( PFTpresent(i,j) .AND. natural(j) ) THEN 376 377 IF ( tree(j) ) THEN 378 379 ! 380 ! 3.2.1.1 tree 381 ! 382 383 ! no single woody pft is overwhelming 384 ! (original DGVM: tree_mercy = 0.0 ) 385 ! The reduction rate is proportional to the ratio deltafpc/fpc. 386 387 IF (sumfpc_wood .GE. fpc_crit .AND. fpc_nat(i,j) .GT. min_stomate .AND. & 388 sumdelta_fpc_wood .GT. min_stomate) THEN 389 390 ! reduct = MIN( ( ( deltafpc(j)/sumdelta_fpc_wood * & 391 ! (sumfpc_wood-fpc_crit) ) / fpc_nat(i,j) ), & 392 ! ( 1._r_std - tree_mercy ) ) 393 reduct = un - MIN((fpc_nat(i,j)-(sumfpc_wood-fpc_crit) & 394 * deltafpc(j)/sumdelta_fpc_wood)/fpc_nat(i,j), un ) 395 396 ELSE 397 398 ! tree fpc didn't icrease or it started from nothing 399 400 reduct = zero 401 402 ENDIF 403 404 survive(j) = un - reduct 405 406 ELSE 407 408 ! 409 ! 3.2.1.2 grass: let a very small fraction survive (the sum of all 410 ! grass individuals may make up a maximum cover of 411 ! grass_mercy [for lai -> infinity]). 412 ! In the original DGVM, grasses were killed in that case, 413 ! corresponding to grass_mercy = 0. 414 ! 415 416 ! survive(j) = ( grass_mercy / REAL( num_grass,r_std ) ) / ind(i,j) 417 418 ! survive(j) = MIN( 1._r_std, survive(j) 419 420 IF(sumfpc_grass .GE. 1.0-MIN(fpc_crit,sumfpc_wood).AND. & 421 sumfpc_grass.GE.min_stomate) THEN 422 423 fpc_dec=(sumfpc_grass-1.+MIN(fpc_crit,sumfpc_wood))*fpc_nat(i,j)/sumfpc_grass 424 425 reduct=fpc_dec 426 ELSE 427 reduct = zero 428 ENDIF 429 survive(j) = ( un - reduct ) 430 431 ENDIF ! tree or grass 432 433 ENDIF ! pft there and natural 434 435 ENDDO ! loop over pfts 436 437 !SZ 438 !!$ ELSE 439 !!$ 440 !!$ ! 441 !!$ ! 3.2.2 not too much wood so that grasses can subsist 442 !!$ ! 443 !!$ 444 !!$ ! new total grass fpc 445 !!$ sumfpc_grass2 = fpc_crit - sumfpc_wood 446 !!$ 447 !!$ DO j = 2,nvm 448 !!$ 449 !!$ ! only present and natural PFTs compete 450 !!$ 451 !!$ IF ( PFTpresent(i,j) .AND. natural(j) ) THEN 452 !!$ 453 !!$ IF ( tree(j) ) THEN 454 !!$ 455 !!$ ! no change for trees 456 !!$ 457 !!$ survive(j) = 1.0 458 !!$ 459 !!$ ELSE 460 !!$ 461 !!$ ! grass: fractional loss is the same for all grasses 462 !!$ 463 !!$ IF ( sumfpc_grass .GT. min_stomate ) THEN 464 !!$ survive(j) = sumfpc_grass2 / sumfpc_grass 465 !!$ ELSE 466 !!$ survive(j)= zero 467 !!$ ENDIF 468 !!$ 469 !!$ ENDIF 470 !!$ 471 !!$ ENDIF ! pft there and natural 472 !!$ 473 !!$ ENDDO ! loop over pfts 474 !!$ 475 !!$ ENDIF ! sumfpc_wood > fpc_crit 476 477 ! 478 ! 3.3 update output variables 479 ! 480 309 481 DO j = 2,nvm 310 311 ! only present and natural pfts compete 312 482 313 483 IF ( PFTpresent(i,j) .AND. natural(j) ) THEN 314 315 IF ( tree(j) ) THEN316 317 !318 ! 3.2.1.1 tree319 !320 321 IF ( maxfpc_wood .GE. fpc_crit ) THEN322 323 ! 3.2.1.1.1 one single woody pft is overwhelming324 325 IF ( j .eq. optpft_wood ) THEN326 327 ! reduction for this dominant pft328 329 reduct = 1. - fpc_crit / fpc_nat(i,j)330 331 ELSE332 333 ! strongly reduce all other woody pfts334 ! (original DGVM: tree_mercy = 0.0 )335 336 reduct = 1. - tree_mercy337 338 ENDIF ! pft = dominant woody pft339 340 ELSE341 342 ! 3.2.1.1.2 no single woody pft is overwhelming343 ! (original DGVM: tree_mercy = 0.0 )344 ! The reduction rate is proportional to the ratio deltafpc/fpc.345 346 IF ( fpc_nat(i,j) .GE. min_stomate ) THEN347 348 reduct = MIN( ( ( deltafpc(j)/sumdelta_fpc_wood * &349 (sumfpc_wood-fpc_crit) ) / fpc_nat(i,j) ), &350 ( un - tree_mercy ) )351 352 ELSE353 354 ! tree fpc didn't icrease or it started from nothing355 356 reduct = 0.357 358 ENDIF359 360 ENDIF ! maxfpc_wood > fpc_crit361 362 survive(j) = 1. - reduct363 484 485 bm_to_litter(i,j,:) = bm_to_litter(i,j,:) + & 486 biomass(i,j,:) * ( un - survive(j) ) 487 488 biomass(i,j,:) = biomass(i,j,:) * survive(j) 489 490 IF ( control%ok_dgvm ) THEN 491 ind(i,j) = ind(i,j) * survive(j) 492 ENDIF 493 494 ! fraction of plants that dies each day. 495 ! exact formulation: light_death(i,j) = 1. - survive(j) ** (1/dt) 496 light_death(i,j) = ( un - survive(j) ) / dt 497 498 ENDIF ! pft there and natural 499 500 ENDDO ! loop over pfts 501 502 ENDIF ! sumfpc > fpc_crit 503 504 ENDDO ! loop over grid points 505 506 ! 507 ! 4 recalculate fpc on natural part of grid cell (for next light competition) 508 ! 509 510 DO j = 2,nvm 511 512 IF ( natural(j) ) THEN 513 514 ! 515 ! 4.1 natural PFTs 516 ! 517 518 IF ( tree(j) ) THEN 519 520 ! 4.1.1 trees: minimum cover due to stems, branches etc. 521 522 DO i = 1, npts 523 !NVMODIF 524 ! IF (lai(i,j) == val_exp) THEN 525 ! veget_lastlight(i,j) = cn_ind(i,j) * ind(i,j) 526 ! ELSE 527 ! veget_lastlight(i,j) = & 528 ! cn_ind(i,j) * ind(i,j) * & 529 ! MAX( ( un - exp( -lai(i,j) * ext_coeff(j) ) ), min_cover ) 530 ! ENDIF 531 !! veget_lastlight(i,j) = cn_ind(i,j) * ind(i,j) 532 IF (lai(i,j) == val_exp) THEN 533 veget_lastlight(i,j) = cn_ind(i,j) * ind(i,j) 364 534 ELSE 365 366 ! 367 ! 3.2.1.2 grass: let a very small fraction survive (the sum of all 368 ! grass individuals may make up a maximum cover of 369 ! grass_mercy [for lai -> infinity]). 370 ! In the original DGVM, grasses were killed in that case, 371 ! corresponding to grass_mercy = 0. 372 ! 373 374 survive(j) = ( grass_mercy / REAL( num_grass,r_std ) ) / ind(i,j) 375 376 survive(j) = MIN( un, survive(j) ) 377 378 ENDIF ! tree or grass 379 380 ENDIF ! pft there and natural 381 382 ENDDO ! loop over pfts 383 535 veget_lastlight(i,j) = & 536 cn_ind(i,j) * ind(i,j) * & 537 MAX( ( un - EXP( - lm_lastyearmax(i,j) * sla(j) * ext_coeff(j) ) ), min_cover ) 538 ENDIF 539 ENDDO 540 541 ELSE 542 543 ! 4.1.2 grasses 544 DO i = 1, npts 545 !NVMODIF 546 ! IF (lai(i,j) == val_exp) THEN 547 ! veget_lastlight(i,j) = cn_ind(i,j) * ind(i,j) 548 ! ELSE 549 ! veget_lastlight(i,j) = cn_ind(i,j) * ind(i,j) * & 550 ! ( un - exp( -lai(i,j) * ext_coeff(j) ) ) 551 ! ENDIF 552 !!veget_lastlight(i,j) = cn_ind(i,j) * ind(i,j) 553 IF (lai(i,j) == val_exp) THEN 554 veget_lastlight(i,j) = cn_ind(i,j) * ind(i,j) 555 ELSE 556 veget_lastlight(i,j) = cn_ind(i,j) * ind(i,j) * & 557 ( un - exp( - lm_lastyearmax(i,j) * sla(j) * ext_coeff(j) ) ) 558 ENDIF 559 ENDDO 560 ENDIF ! tree/grass 561 384 562 ELSE 385 386 ! 387 ! 3.2.2 not too much wood so that grasses can subsist 388 ! 389 390 ! new total grass fpc 391 sumfpc_grass2 = fpc_crit - sumfpc_wood 392 393 DO j = 2,nvm 394 395 ! only present and natural PFTs compete 396 397 IF ( PFTpresent(i,j) .AND. natural(j) ) THEN 398 399 IF ( tree(j) ) THEN 400 401 ! no change for trees 402 403 survive(j) = 1.0 404 405 ELSE 406 407 ! grass: fractional loss is the same for all grasses 408 409 IF ( sumfpc_grass .GT. min_stomate ) THEN 410 survive(j) = sumfpc_grass2 / sumfpc_grass 411 ELSE 412 survive(j)= 0.0 413 ENDIF 414 415 ENDIF 416 417 ENDIF ! pft there and natural 418 419 ENDDO ! loop over pfts 420 421 ENDIF ! sumfpc_wood > fpc_crit 422 423 ! 424 ! 3.3 update output variables 425 ! 426 427 DO j = 2,nvm 428 429 IF ( PFTpresent(i,j) .AND. natural(j) ) THEN 430 431 bm_to_litter(i,j,:) = bm_to_litter(i,j,:) + & 432 biomass(i,j,:) * ( 1. - survive(j) ) 433 434 biomass(i,j,:) = biomass(i,j,:) * survive(j) 435 436 IF ( control%ok_dgvm ) THEN 437 ind(i,j) = ind(i,j) * survive(j) 438 ENDIF 439 440 ! fraction of plants that dies each day. 441 ! exact formulation: light_death(i,j) = 1. - survive(j) ** (1/dt) 442 light_death(i,j) = ( 1. - survive(j) ) / dt 443 444 ENDIF ! pft there and natural 445 446 ENDDO ! loop over pfts 447 448 ENDIF ! sumfpc > fpc_crit 449 450 ENDDO ! loop over grid points 451 452 ! 453 ! 4 recalculate fpc on natural part of grid cell (for next light competition) 454 ! 455 456 DO j = 2,nvm 457 458 IF ( natural(j) ) THEN 459 460 ! 461 ! 4.1 natural PFTs 462 ! 463 464 IF ( tree(j) ) THEN 465 466 ! 4.1.1 trees: minimum cover due to stems, branches etc. 467 468 DO i = 1, npts 469 IF (lai(i,j) == val_exp) THEN 470 veget_lastlight(i,j) = cn_ind(i,j) * ind(i,j) 471 ELSE 472 veget_lastlight(i,j) = & 473 cn_ind(i,j) * ind(i,j) * & 474 MAX( ( un - exp( -lai(i,j) * ext_coeff(j) ) ), min_cover ) 475 ENDIF 563 564 ! 565 ! 4.2 agricultural PFTs: not present on natural part 566 ! 567 568 veget_lastlight(:,j) = zero 569 570 ENDIF ! natural/agricultural 571 572 ENDDO 573 574 ELSE ! static 575 576 light_death(:,:) = zero 577 578 DO j = 2, nvm 579 580 IF ( natural(j) ) THEN 581 582 ! 2.1.1 natural PFTs, in the one PFT only case there needs to be no special case for grasses, 583 ! neither a redistribution of mortality (delta fpc) 584 585 WHERE( ind(:,j)*cn_ind(:,j) .GT. min_stomate ) 586 lai_ind(:)=sla(j) * lm_lastyearmax(:,j) / ( ind(:,j) * cn_ind(:,j) ) 587 ELSEWHERE 588 lai_ind(:)=zero 589 ENDWHERE 590 591 fpc_nat(:,j) = cn_ind(:,j) * ind(:,j) * & 592 MAX( ( 1._r_std - exp( - ext_coeff(j) * lai_ind(:) ) ), min_cover ) 593 594 WHERE(fpc_nat(:,j).GT.fpc_max(:,j)) 595 596 light_death(:,j)=MIN(un,un-fpc_max(:,j)/fpc_nat(:,j)) 597 598 ENDWHERE 599 600 DO k=1,nparts 601 602 bm_to_litter(:,j,k)=bm_to_litter(:,j,k)+light_death(:,j)*biomass(:,j,k) 603 biomass(:,j,k)=biomass(:,j,k)-light_death(:,j)*biomass(:,j,k) 604 476 605 ENDDO 477 478 ELSE 479 480 ! 4.1.2 grasses 481 DO i = 1, npts 482 IF (lai(i,j) == val_exp) THEN 483 veget_lastlight(i,j) = cn_ind(i,j) * ind(i,j) 484 ELSE 485 veget_lastlight(i,j) = cn_ind(i,j) * ind(i,j) * & 486 ( 1. - exp( -lai(i,j) * ext_coeff(j) ) ) 487 ENDIF 488 ENDDO 489 ENDIF ! tree/grass 490 491 ELSE 492 493 ! 494 ! 4.2 agricultural PFTs: not present on natural part 495 ! 496 497 veget_lastlight(:,j) = 0.0 498 499 ENDIF ! natural/agricultural 500 501 ENDDO 502 606 ind(:,j)=ind(:,j)-light_death(:,j)*ind(:,j) 607 ! if (j==10) print *,'ind10bis=',ind(:,j),light_death(:,j)*ind(:,j) 608 ENDIF 609 ENDDO 610 611 light_death(:,:)=light_death(:,:)/dt 612 613 ENDIF 614 503 615 ! 504 616 ! 5 history 505 617 ! 506 618 507 619 CALL histwrite (hist_id_stomate, 'LIGHT_DEATH', itime, & 508 620 light_death, npts*nvm, horipft_index) 509 621 510 622 IF (bavard.GE.4) WRITE(numout,*) 'Leaving light' 511 623 512 624 END SUBROUTINE light 513 625 514 626 END MODULE lpj_light -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/lpj_pftinout.f90
r64 r257 33 33 SUBROUTINE pftinout (npts, dt, adapted, regenerate, & 34 34 neighbours, veget, veget_max, & 35 biomass, ind, age, leaf_frac, npp_longterm, lm_lastyearmax, senescence, &35 biomass, ind, cn_ind, age, leaf_frac, npp_longterm, lm_lastyearmax, senescence, & 36 36 PFTpresent, everywhere, when_growthinit, need_adjacent, RIP_time, & 37 37 co2_to_bm, & … … 66 66 ! density of individuals 1/m**2 67 67 REAL(r_std), DIMENSION(npts,nvm), INTENT(inout) :: ind 68 ! crownarea of individuals m**2 69 REAL(r_std), DIMENSION(npts,nvm), INTENT(in) :: cn_ind 68 70 ! mean age (years) 69 71 REAL(r_std), DIMENSION(npts,nvm), INTENT(inout) :: age … … 104 106 REAL(r_std), DIMENSION(npts) :: avail 105 107 ! indices 106 INTEGER(i_std) :: i,j 108 INTEGER(i_std) :: i,j,m 107 109 ! total woody vegetation cover 108 110 REAL(r_std), DIMENSION(npts) :: sumfrac_wood … … 111 113 ! we can introduce this PFT 112 114 LOGICAL, DIMENSION(npts) :: can_introduce 115 ! no real need for dimension(ntps) except for vectorisation 116 REAL(r_std), DIMENSION(npts) :: fracnat 113 117 114 118 ! ========================================================================= … … 132 136 ! 133 137 134 ! need to know total woody vegetation fraction 135 138 ! 2.1 Only natural part of the grid cell 139 ! 140 !SZ bug correction MERGE: need to subtract agricultural area! 141 ! fraction of agricultural surface 142 fracnat(:) = 1. 143 do j = 2,nvm 144 IF ( .NOT. natural(j) ) THEN 145 fracnat(:) = fracnat(:) - veget_max(:,j) 146 ENDIF 147 ENDDO 148 149 ! 150 ! 2.2 total woody fpc on grid 151 ! 136 152 sumfrac_wood(:) = zero 137 153 138 154 DO j = 2,nvm 139 140 IF ( tree(j) ) THEN 141 142 sumfrac_wood(:) = sumfrac_wood(:) + veget(:,j) 143 155 !SZ problem here: agriculture, not convinced that this representation of LPJ is correct 156 !if agriculture is present, ind must be recalculated to correspond to the natural density... 157 ! since ind is per grid cell, can be achived by discounting for agricultura fraction 158 IF ( natural(j).AND.tree(j) ) THEN 159 WHERE(fracnat(:).GT.min_stomate) 160 sumfrac_wood(:) = sumfrac_wood(:) + cn_ind(:,j) * ind(:,j) / fracnat(:) & 161 * ( 1. - exp( - lm_lastyearmax(:,j) * sla(j) * ext_coeff(j) ) ) 162 !lai changed to lm_last 163 ENDWHERE 144 164 ENDIF 145 146 165 ENDDO 147 166 -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/stomate.f90
r64 r257 227 227 INTEGER(i_std),ALLOCATABLE,SAVE,DIMENSION(:) :: nforce 228 228 229 REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:) :: harvest_above_monthly, cflux_prod_monthly 230 231 ! "maximal" coverage fraction of a PFT (LAI -> infinity) on ground 232 REAL(r_std), ALLOCATABLE,SAVE,DIMENSION(:,:) :: fpc_max 233 229 234 ! Date and EndOfYear, intialize and update in slowproc 230 235 ! (Now managed in slowproc for land_use) 231 236 ! time step of STOMATE in days 232 REAL(r_std),SAVE :: dt_days= 0.! Time step in days for stomate237 REAL(r_std),SAVE :: dt_days=zero ! Time step in days for stomate 233 238 ! to check 234 REAL(r_std),SAVE :: day_counter= 0.! count each sechiba (dtradia) time step each day239 REAL(r_std),SAVE :: day_counter=zero ! count each sechiba (dtradia) time step each day 235 240 ! date (d) 236 241 INTEGER(i_std),SAVE :: date=0 … … 242 247 ! Land cover change flag 243 248 LOGICAL,SAVE :: lcchange=.FALSE. 249 ! Do update of monthly variables ? 250 ! This variable must be .TRUE. once a month 251 LOGICAL, SAVE :: EndOfMonth=.FALSE. 244 252 PUBLIC dt_days, day_counter, date, do_slow, EndOfYear, lcchange 245 253 … … 554 562 555 563 REAL(r_std), DIMENSION(kjpindex) :: vartmp 564 REAL(r_std) :: net_cflux_prod_monthly_sum , net_cflux_prod_monthly_tot 565 REAL(r_std) :: net_harvest_above_monthly_sum, net_harvest_above_monthly_tot 566 REAL(r_std) :: net_biosp_prod_monthly_sum , net_biosp_prod_monthly_tot 556 567 !--------------------------------------------------------------------- 557 568 ! first of all: store time step in common value 558 569 itime = kjit 559 570 560 z_soil(0) = 0.571 z_soil(0) = zero 561 572 z_soil(1:nbdl) = diaglev(1:nbdl) 562 573 DO j=1,nvm … … 877 888 ENDIF 878 889 879 dt_forcesoil = 0.890 dt_forcesoil = zero 880 891 nparan = nparan+1 881 892 DO WHILE (dt_forcesoil < dt_slow/one_day) … … 951 962 l_first_stomate = .FALSE. 952 963 ! 953 ! 1.11 retu 964 ! 1.11 return 954 965 ! 955 966 RETURN … … 1158 1169 ENDDO 1159 1170 1171 IF ( day == 1 .AND. sec .LT. dtradia ) THEN 1172 EndOfMonth=.TRUE. 1173 ELSE 1174 EndOfMonth=.FALSE. 1175 ENDIF 1160 1176 ! 1161 1177 ! 5 "daily" variables … … 1293 1309 1294 1310 CALL StomateLpj & 1295 & (kjpindex, dt_days, EndOfYear, &1311 & (kjpindex, dt_days, EndOfYear, EndOfMonth, & 1296 1312 & neighbours, resolution, & 1297 1313 & clay, herbivores, & … … 1318 1334 & t_photo_min, t_photo_opt, t_photo_max,bm_to_litter,& 1319 1335 & prod10, prod100, flux10, flux100, veget_cov_max_new,& 1320 & convflux, cflux_prod10, cflux_prod100, harvest_above, lcchange) 1336 & convflux, cflux_prod10, cflux_prod100, harvest_above, lcchange,& 1337 & fpc_max) 1321 1338 1322 1339 ! … … 1534 1551 ! 1535 1552 co2_flux_monthly(:,:) = co2_flux_monthly(:,:) + co2_flux_daily(:,:) 1536 IF ( day == 1 .AND. sec .LT. dtradia ) THEN 1553 ! Monthly Cumulative fluxes of fluc and harvest 1554 harvest_above_monthly(:) = harvest_above_monthly(:) + harvest_above(:) 1555 cflux_prod_monthly(:) = cflux_prod_monthly(:) + convflux(:) + cflux_prod10(:) + cflux_prod100(:) 1556 IF ( EndOfMonth ) THEN 1537 1557 IF ( control%ok_stomate ) THEN 1538 CALL histwrite (hist_id_stomate, 'CO2FLUX _MONTHLY', itime, &1558 CALL histwrite (hist_id_stomate, 'CO2FLUX', itime, & 1539 1559 co2_flux_monthly, kjpindex*nvm, horipft_index) 1540 1560 ENDIF 1541 1561 !MM 1542 1562 ! Si on supprimer le cumul par mois, 1543 ! il ne faut pas oubli écette modif resolution(:,1)*resolution(:,2)*contfrac(:)1563 ! il ne faut pas oublier cette modif resolution(:,1)*resolution(:,2)*contfrac(:) 1544 1564 DO j=2, nvm 1545 1565 co2_flux_monthly(:,j) = co2_flux_monthly(:,j)* & … … 1551 1571 DO j=2,nvm 1552 1572 net_co2_flux_monthly = net_co2_flux_monthly + & 1553 & co2_flux_monthly(ji,j)*veget_ max(ji,j)1573 & co2_flux_monthly(ji,j)*veget_cov_max(ji,j) 1554 1574 ENDDO 1555 1575 ENDDO 1576 ! Total ( land) Cumulative fluxes of fluc and harvest 1577 net_cflux_prod_monthly_sum=& 1578 & SUM(cflux_prod_monthly(:)*resolution(:,1)*resolution(:,2)*contfrac(:))*1e-15 1579 CALL reduce_sum(net_cflux_prod_monthly_sum,net_cflux_prod_monthly_tot) 1580 CALL bcast(net_cflux_prod_monthly_tot) 1581 1582 net_harvest_above_monthly_sum=& 1583 & SUM(harvest_above_monthly(:)*resolution(:,1)*resolution(:,2)*contfrac(:))*1e-15 1584 CALL reduce_sum(net_harvest_above_monthly_sum,net_harvest_above_monthly_tot) 1585 CALL bcast(net_harvest_above_monthly_tot) 1586 1556 1587 net_co2_flux_monthly = net_co2_flux_monthly*1e-15 1557 WRITE(numout,*) 'net_co2_flux_monthly (Peta gC/month) = ',net_co2_flux_monthly1558 1559 1588 CALL reduce_sum(net_co2_flux_monthly,net_co2_flux_monthly_sum) 1560 IF ( control%ok_stomate ) THEN 1561 CALL histwrite (hist_id_stomate, 'CO2FLUX_MONTHLY_SUM', itime, & 1562 (/ net_co2_flux_monthly /), 1, (/ 1 /) ) 1563 ENDIF 1589 CALL bcast(net_co2_flux_monthly_sum) 1590 1591 WRITE(numout,9010) 'GLOBAL net_cflux_prod_monthly (Peta gC/month) = ',net_cflux_prod_monthly_tot 1592 WRITE(numout,9010) 'GLOBAL net_harvest_above_monthly (Peta gC/month) = ',net_harvest_above_monthly_tot 1593 WRITE(numout,9010) 'GLOBAL net_co2_flux_monthly (Peta gC/month) = ',net_co2_flux_monthly_sum 1594 1595 ! Calculation of net biospheric production 1596 net_biosp_prod_monthly_tot = & 1597 & ( net_co2_flux_monthly_sum + net_cflux_prod_monthly_tot + net_harvest_above_monthly_tot ) 1598 WRITE(numout,9010) 'GLOBAL net_biosp_prod_monthly (Peta gC/month) = ',net_biosp_prod_monthly_tot 1599 1600 9010 FORMAT(A52,F17.14) 1601 !!$ IF ( control%ok_stomate ) THEN 1602 !!$ vartmp(:)=net_co2_flux_monthly_sum 1603 !!$ CALL histwrite (hist_id_stomate, 'CO2FLUX_MONTHLY_SUM', itime, & 1604 !!$ vartmp, kjpindex, hori_index ) 1605 !!$ ENDIF 1564 1606 !!$ IF (is_root_prc) THEN 1565 1607 !!$ OPEN( unit=39, & … … 1579 1621 !!$ ENDIF 1580 1622 co2_flux_monthly(:,:) = zero 1623 harvest_above_monthly(:) = zero 1624 cflux_prod_monthly(:) = zero 1581 1625 ENDIF 1582 1626 ! … … 1599 1643 1600 1644 ENDIF ! daily processes? 1601 ! CO2FLUX Daily values are saved each dtradia,1602 ! then the value is wrong for the first day without restart.1603 IF ( hist_id > 0 ) THEN1604 CALL histwrite (hist_id, 'CO2FLUX', itime, &1605 co2_flux_daily, kjpindex*nvm, horipft_index)1606 ENDIF1607 IF ( hist2_id > 0 ) THEN1608 CALL histwrite (hist2_id, 'CO2FLUX', itime, &1609 co2_flux_daily, kjpindex*nvm, horipft_index)1610 ENDIF1611 1612 1645 ! 1613 1646 ! 7 Outputs from Stomate … … 1907 1940 ALLOCATE(co2_flux_monthly(kjpindex,nvm),stat=ier) 1908 1941 l_error = l_error .OR. (ier /= 0) 1942 ALLOCATE (cflux_prod_monthly(kjpindex), stat=ier) 1943 l_error = l_error .OR. (ier.NE.0) 1944 ALLOCATE (harvest_above_monthly(kjpindex), stat=ier) 1945 l_error = l_error .OR. (ier.NE.0) 1909 1946 ALLOCATE(bm_to_litter(kjpindex,nvm,nparts),stat=ier) 1910 1947 l_error = l_error .OR. (ier /= 0) … … 1955 1992 l_error = l_error .OR. (ier.NE.0) 1956 1993 ! 1994 ALLOCATE (fpc_max(kjpindex,nvm), stat=ier) 1995 l_error = l_error .OR. (ier.NE.0) 1996 ! 1957 1997 IF (l_error) THEN 1958 1998 STOP 'stomate_init: error in memory allocation' … … 2028 2068 WRITE(numout,*) & 2029 2069 & 'expansion across a grid cell is treated: ',treat_expansion 2070 2071 !Config Key = LPJ_GAP_CONST_MORT 2072 !Config Desc = prescribe mortality if not using DGVM? 2073 !Config Def = y 2074 !Config Help = set to TRUE if constant mortality is to be activated 2075 ! ignored if DGVM=true! 2076 ! 2077 lpj_gap_const_mort=.TRUE. 2078 CALL getin('LPJ_GAP_CONST_MORT', lpj_gap_const_mort) 2079 WRITE(numout,*) 'LPJ GAP: constant mortality:', lpj_gap_const_mort 2030 2080 2031 2081 !Config Key = HARVEST_AGRI … … 2046 2096 co2_flux_daily(:,:) = zero 2047 2097 co2_flux_monthly(:,:) = zero 2048 2098 cflux_prod_monthly(:) = zero 2099 harvest_above_monthly(:) = zero 2100 control_moist_daily(:,:) = zero 2101 control_temp_daily(:,:) = zero 2102 soilcarbon_input_daily(:,:,:) = zero 2049 2103 2050 2104 ! initialisation of land cover change variables … … 2056 2110 cflux_prod10(:) = zero 2057 2111 cflux_prod100(:)= zero 2112 2113 fpc_max(:,:)=zero 2058 2114 !-------------------------- 2059 2115 END SUBROUTINE stomate_init … … 2141 2197 IF (ALLOCATED(co2_flux_daily)) DEALLOCATE(co2_flux_daily) 2142 2198 IF (ALLOCATED(co2_flux_monthly)) DEALLOCATE(co2_flux_monthly) 2199 IF (ALLOCATED(harvest_above_monthly)) DEALLOCATE (harvest_above_monthly) 2200 IF (ALLOCATED(cflux_prod_monthly)) DEALLOCATE (cflux_prod_monthly) 2143 2201 IF (ALLOCATED(bm_to_litter)) DEALLOCATE(bm_to_litter) 2144 2202 IF (ALLOCATED(bm_to_littercalc)) DEALLOCATE(bm_to_littercalc) … … 2203 2261 IF ( ALLOCATED (control_temp_daily)) DEALLOCATE (control_temp_daily) 2204 2262 IF ( ALLOCATED (control_moist_daily)) DEALLOCATE (control_moist_daily) 2263 2264 IF ( ALLOCATED (fpc_max)) DEALLOCATE (fpc_max) 2205 2265 2206 2266 ! 2. reset l_first … … 2265 2325 !- 2266 2326 ! dummy time step, must be zero 2267 REAL(r_std),PARAMETER :: dt_0 = 0.2327 REAL(r_std),PARAMETER :: dt_0 = zero 2268 2328 REAL(r_std),DIMENSION(kjpindex,nvm) :: vcmax 2269 2329 REAL(r_std),DIMENSION(kjpindex,nvm) :: vjmax -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/stomate_alloc.f90
r64 r257 162 162 ! 1.1.1 soil levels 163 163 164 z_soil(0) = 0.164 z_soil(0) = zero 165 165 z_soil(1:nbdl) = diaglev(1:nbdl) 166 166 … … 202 202 ! 203 203 204 f_alloc(:,:,:) = 0.0205 f_alloc(:,:,icarbres) = 1.0204 f_alloc(:,:,:) = zero 205 f_alloc(:,:,icarbres) = un 206 206 ! 207 207 ! 1.3 Convolution of the temperature and humidity profiles with some kind of profile … … 212 212 213 213 ! 1.3.1.1 rpc is an integration constant such that the integral of the root profile is 1. 214 rpc(:) = 1. / ( 1.- EXP( -z_soil(nbdl) / z_nitrogen ) )214 rpc(:) = un / ( un - EXP( -z_soil(nbdl) / z_nitrogen ) ) 215 215 216 216 ! 1.3.1.2 integrate over the nbdl levels … … 229 229 230 230 ! 1.3.2.1 rpc is an integration constant such that the integral of the root profile is 1. 231 rpc(:) = 1. / ( 1.- EXP( -z_soil(nbdl) / z_nitrogen ) )231 rpc(:) = un / ( un - EXP( -z_soil(nbdl) / z_nitrogen ) ) 232 232 233 233 ! 1.3.2.2 integrate over the nbdl levels 234 234 235 h_nitrogen(:) = 0.0235 h_nitrogen(:) = zero 236 236 237 237 DO l = 1, nbdl … … 251 251 ! mean LAI on natural part 252 252 253 natveg_tot(:) = 0.0254 lai_nat(:) = 0.0253 natveg_tot(:) = zero 254 lai_nat(:) = zero 255 255 256 256 DO j = 2, nvm … … 259 259 veget_max_nat(:,j) = veget_max(:,j) 260 260 ELSE 261 veget_max_nat(:,j) = 0.0261 veget_max_nat(:,j) = zero 262 262 ENDIF 263 263 … … 314 314 ! 3/ must be at the beginning of the growing season 315 315 316 WHERE ( ( biomass(:,j,ileaf) .GT. 0.0) .AND. &316 WHERE ( ( biomass(:,j,ileaf) .GT. zero ) .AND. & 317 317 ( .NOT. senescence(:,j) ) .AND. & 318 318 ( lai(:,j) .LT. lai_happy(j) ) .AND. & … … 337 337 ELSEWHERE 338 338 339 transloc_leaf(:) = 0.0339 transloc_leaf(:) = zero 340 340 341 341 ENDWHERE … … 468 468 ! leaf allocation 469 469 470 LtoLSR(:) = 1.- RtoLSR(:) - StoLSR(:)470 LtoLSR(:) = un - RtoLSR(:) - StoLSR(:) 471 471 LtoLSR(:) = MAX( min_LtoLSR, MIN( max_LtoLSR, LtoLSR(:) ) ) 472 472 473 473 ! roots: the rest 474 474 475 RtoLSR(:) = 1.- LtoLSR(:) - StoLSR(:)475 RtoLSR(:) = un - LtoLSR(:) - StoLSR(:) 476 476 477 477 ENDWHERE … … 483 483 StoLSR(:) = StoLSR(:) + LtoLSR(:) 484 484 485 LtoLSR(:) = 0.0485 LtoLSR(:) = zero 486 486 487 487 ENDWHERE … … 514 514 515 515 IF ( ( biomass(i,j,icarbres)*sla(j) ) .LT. 2*lai_max(j) ) THEN 516 carb_rescale(i) = 1. / ( 1.+ ecureuil(j) * ( LtoLSR(i) + RtoLSR(i) ) )516 carb_rescale(i) = un / ( un + ecureuil(j) * ( LtoLSR(i) + RtoLSR(i) ) ) 517 517 ELSE 518 carb_rescale(i) = 1.518 carb_rescale(i) = un 519 519 ENDIF 520 520 … … 522 522 523 523 f_alloc(i,j,isapabove) = StoLSR(i) * alloc_sap_above(i) * & 524 ( 1.- f_alloc(i,j,ifruit) ) * carb_rescale(i)525 f_alloc(i,j,isapbelow) = StoLSR(i) * ( 1.- alloc_sap_above(i) ) * &526 ( 1.- f_alloc(i,j,ifruit) ) * carb_rescale(i)524 ( un - f_alloc(i,j,ifruit) ) * carb_rescale(i) 525 f_alloc(i,j,isapbelow) = StoLSR(i) * ( un - alloc_sap_above(i) ) * & 526 ( un - f_alloc(i,j,ifruit) ) * carb_rescale(i) 527 527 528 528 f_alloc(i,j,iroot) = RtoLSR(i) * ( 1.-f_alloc(i,j,ifruit) ) * carb_rescale(i) … … 530 530 ! this is equivalent to: 531 531 ! reserve alloc = ecureuil*(LtoLSR+StoLSR)*(1-fruit_alloc)*carb_rescale 532 f_alloc(i,j,icarbres) = ( 1.- carb_rescale(i) ) * ( 1.-f_alloc(i,j,ifruit) )532 f_alloc(i,j,icarbres) = ( un - carb_rescale(i) ) * ( 1.-f_alloc(i,j,ifruit) ) 533 533 534 534 ENDIF ! senescent? -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/stomate_data.f90
r252 r257 156 156 ! Oct 2010 : replaced by values given by N.Viovy 157 157 158 IF ( bavard .GE. 1 ) WRITE(numout,*) ' specific leaf area (m**2/gC):', sla(j) !, 12./leaflife(j) 158 ! includes conversion from 159 !! sla(j) = 2. * 1e-4 * EXP(5.615 - 0.46 * log(12./leaflife_tab(j))) 160 161 IF ( leaf_tab(j) .EQ. 2 ) THEN 162 163 ! needle leaved tree 164 sla(j) = 2. * ( 10. ** ( 2.29 - 0.4 * LOG10(12./leaflife_tab(j)) ) ) *1e-4 165 166 ELSE 167 168 ! broad leaved tree or grass (Reich et al 1992) 169 sla(j) = 2. * ( 10. ** ( 2.41 - 0.38 * LOG10(12./leaflife_tab(j)) ) ) *1e-4 170 171 ENDIF 172 173 !!$ IF ( leaf_tab(j) .EQ. 1 ) THEN 174 !!$ 175 !!$ ! broad leaved tree 176 !!$ 177 !!$ sla(j) = 2. * ( 10. ** ( 2.41 - 0.38 * LOG10(12./leaflife_tab(j)) ) ) *1e-4 178 !!$ 179 !!$ ELSE 180 !!$ 181 !!$ ! needle leaved or grass (Reich et al 1992) 182 !!$ 183 !!$ sla(j) = 2. * ( 10. ** ( 2.29 - 0.4 * LOG10(12./leaflife_tab(j)) ) ) *1e-4 184 !!$ 185 !!$ ENDIF 186 !!$ 187 !!$ IF ( ( leaf_tab(j) .EQ. 2 ) .AND. ( pheno_type_tab(j) .EQ. 2 ) ) THEN 188 !!$ 189 !!$ ! summergreen needle leaf 190 !!$ 191 !!$ sla(j) = 1.25 * sla(j) 192 !!$ 193 !!$ ENDIF 194 195 IF ( bavard .GE. 1 ) WRITE(numout,*) ' specific leaf area (m**2/gC):', sla(j), 12./leaflife_tab(j) 159 196 160 197 ! … … 175 212 bm_sapl(j,icarbres) = bm_sapl_carbres * bm_sapl(j,ileaf) 176 213 ELSE 177 bm_sapl(j,icarbres) = 0.0214 bm_sapl(j,icarbres) = zero 178 215 ENDIF 179 216 … … 203 240 bm_sapl(j,icarbres) = init_sapl_mass_carbres *bm_sapl(j,ileaf) 204 241 205 bm_sapl(j,isapabove) = 0.206 bm_sapl(j,isapbelow) = 0.207 208 bm_sapl(j,iheartabove) = 0.209 bm_sapl(j,iheartbelow) = 0.242 bm_sapl(j,isapabove) = zero 243 bm_sapl(j,isapbelow) = zero 244 245 bm_sapl(j,iheartabove) = zero 246 bm_sapl(j,iheartbelow) = zero 210 247 211 248 ENDIF -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/stomate_io.f90
r64 r257 1730 1730 REAL(r_std),DIMENSION(nbvmax) :: area 1731 1731 REAL(r_std),DIMENSION(nbvmax) :: tt 1732 1733 1732 REAL(r_std) :: resx, resy 1734 1733 LOGICAL :: do_again -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/stomate_lcchange.f90
r64 r257 139 139 140 140 ! Turnover rates (gC/(m**2 of ground)/day) 141 REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT( out) :: turnover_daily141 REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout) :: turnover_daily 142 142 143 143 ! 0.4 local … … 207 207 cn_ind(i,j) = cn_sapl(j) 208 208 ELSE 209 cn_ind(i,j) =1.0209 cn_ind(i,j) = un 210 210 ENDIF 211 211 ind(i,j)= delta_veg(j) / cn_ind(i,j) 212 212 PFTpresent(i,j) = .TRUE. 213 everywhere(i,j) = 1.213 everywhere(i,j) = un 214 214 senescence(i,j) = .FALSE. 215 215 age(i,j) = 0. 216 216 217 217 when_growthinit(i,j) = large_value 218 leaf_frac(i,j,1) = 1.0218 leaf_frac(i,j,1) = un 219 219 npp_longterm(i,j) = 10. 220 220 lm_lastyearmax(i,j) = bm_sapl(j,ileaf) * ind(i,j) … … 321 321 flux100(i,1) = 0.01 * prod100(i,0) 322 322 prod100(i,1) = prod100(i,0) 323 !MM=> IF (prod100(i,1).LT.1.0) prod100(i,1) = 0.0323 !MM=> IF (prod100(i,1).LT.1.0) prod100(i,1) = zero 324 324 !MM=>stomate_lpj.f90 prod100_total(i) = prod100_total(i) + prod100(i,1) 325 prod10(i,0) = 0.0326 prod100(i,0) = 0.0325 prod10(i,0) = zero 326 prod100(i,0) = zero 327 327 328 328 ENDDO ! End loop on npts -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/stomate_litter.f90
r64 r257 185 185 ! 186 186 187 z_soil(0) = 0.187 z_soil(0) = zero 188 188 z_soil(1:nbdl) = diaglev(1:nbdl) 189 189 … … 441 441 442 442 ! 4.2.1 rpc is an integration constant such that the integral of the root profile is 1. 443 rpc(:) = 1. / ( 1.- EXP( -z_soil(nbdl) / z_decomp ) )443 rpc(:) = un / ( un - EXP( -z_soil(nbdl) / z_decomp ) ) 444 444 445 445 ! 4.2.2 integrate over the nbdl levels … … 473 473 474 474 ! 5.2.1 rpc is an integration constant such that the integral of the root profile is 1. 475 rpc(:) = 1. / ( 1.- EXP( -z_soil(nbdl) / z_decomp ) )475 rpc(:) = un / ( un - EXP( -z_soil(nbdl) / z_decomp ) ) 476 476 477 477 ! 5.2.2 integrate over the nbdl levels … … 514 514 ! to avoid a multiple (for ibelow and iabove) modification of dead_leaves, 515 515 ! we do this test to do this calcul only ones in 1,nlev loop 516 if (l == iabove) dead_leaves(:,m,istructural) = dead_leaves(:,m,istructural) * ( 1.- fd(:) )516 if (l == iabove) dead_leaves(:,m,istructural) = dead_leaves(:,m,istructural) * ( un - fd(:) ) 517 517 518 518 ! 6.1.3 non-lignin fraction of structural litter goes into -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/stomate_lpj.f90
r136 r257 39 39 USE stomate_assimtemp 40 40 USE stomate_lcchange 41 42 41 ! USE Write_Field_p 43 42 … … 70 69 END SUBROUTINE StomateLpj_clear 71 70 72 SUBROUTINE StomateLpj (npts, dt_days, EndOfYear, &71 SUBROUTINE StomateLpj (npts, dt_days, EndOfYear, EndOfMonth, & 73 72 neighbours, resolution, & 74 73 clay, herbivores, & … … 94 93 t_photo_min, t_photo_opt, t_photo_max,bm_to_litter, & 95 94 prod10,prod100,flux10, flux100, veget_max_new, & 96 convflux,cflux_prod10,cflux_prod100, harvest_above, lcchange) 95 convflux,cflux_prod10,cflux_prod100, harvest_above, lcchange, & 96 fpc_max) 97 97 98 98 ! … … 168 168 ! maintenance respiration of different plant parts (gC/day/m**2 of ground) 169 169 REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(in) :: resp_maint_part 170 ! "maximal" coverage fraction of a PFT (LAI -> infinity) on ground 171 REAL(r_std), DIMENSION(npts,nvm), INTENT(in) :: fpc_max 170 172 171 173 ! 0.2 modified fields … … 264 266 REAL(r_std), DIMENSION(npts,nvm), INTENT(inout) :: height 265 267 ! fraction of soil covered by dead leaves 266 REAL(r_std), DIMENSION(npts), INTENT( out) :: deadleaf_cover268 REAL(r_std), DIMENSION(npts), INTENT(inout) :: deadleaf_cover 267 269 ! Maximum rate of carboxylation 268 270 REAL(r_std), DIMENSION(npts,nvm), INTENT(out) :: vcmax … … 301 303 ! Do update of yearly variables? This variable must be .TRUE. once a year 302 304 LOGICAL, INTENT(in) :: EndOfYear 303 305 ! Do update of monthly variables ? This variable must be .TRUE. once a month 306 LOGICAL, INTENT(in) :: EndOfMonth 304 307 305 308 ! 0.4 local … … 321 324 ! crown area of individuals (m**2) 322 325 REAL(r_std), DIMENSION(npts,nvm) :: cn_ind 326 ! woodmass of individuals (gC) 327 REAL(r_std), DIMENSION(npts,nvm) :: woodmass_ind 323 328 ! fraction that goes into plant part 324 329 REAL(r_std), DIMENSION(npts,nvm,nparts) :: f_alloc … … 337 342 ! "maximal" coverage fraction of a PFT (LAI -> infinity) on ground 338 343 REAL(r_std),DIMENSION(npts,nvm) :: veget_max_old 344 345 ! fraction of individual dying this time step 346 REAL(r_std), DIMENSION(npts,nvm) :: mortality 339 347 340 348 REAL(r_std), DIMENSION(npts) :: vartmp … … 367 375 bm_to_litter(:,:,:) = zero 368 376 cn_ind(:,:) = zero 377 woodmass_ind(:,:) = zero 369 378 veget_max_old(:,:) = veget_max(:,:) 370 379 371 ! 372 ! 1.3 Prescribe some vegetation characteristics if the vegetation is not dynamic 380 ! 1.3 Calculate some vegetation characteristics 381 382 ! 383 ! 1.3.1 Calculate some vegetation characteristics (cn_ind and height) from 384 ! state variables if running DGVM or dynamic mortality in static cover mode 385 ! 386 IF ( control%ok_dgvm .OR. .NOT.lpj_gap_const_mort) THEN 387 IF(control%ok_dgvm) THEN 388 WHERE (ind(:,:).GT.min_stomate) 389 woodmass_ind(:,:) = & 390 ((biomass(:,:,isapabove)+biomass(:,:,isapbelow) & 391 +biomass(:,:,iheartabove)+biomass(:,:,iheartbelow)) & 392 *veget_max(:,:))/ind(:,:) 393 ENDWHERE 394 ELSE 395 WHERE (ind(:,:).GT.min_stomate) 396 woodmass_ind(:,:) = & 397 (biomass(:,:,isapabove)+biomass(:,:,isapbelow) & 398 +biomass(:,:,iheartabove)+biomass(:,:,iheartbelow))/ind(:,:) 399 ENDWHERE 400 ENDIF 401 402 CALL crown (npts, PFTpresent, & 403 ind, biomass, woodmass_ind, & 404 veget_max, cn_ind, height) 405 ENDIF 406 407 ! 408 ! 1.3.2 Prescribe some vegetation characteristics if the vegetation is not dynamic 373 409 ! IF the DGVM is not activated, the density of individuals and their crown 374 410 ! areas don't matter, but they should be defined for the case we switch on … … 389 425 390 426 CALL constraints (npts, dt_days, & 391 t2m_month, t2m_min_daily, 427 t2m_month, t2m_min_daily,when_growthinit, & 392 428 adapted, regenerate) 393 429 … … 404 440 CALL pftinout (npts, dt_days, adapted, regenerate, & 405 441 neighbours, veget, veget_max, & 406 biomass, ind, age, leaf_frac, npp_longterm, lm_lastyearmax, senescence, &442 biomass, ind, cn_ind, age, leaf_frac, npp_longterm, lm_lastyearmax, senescence, & 407 443 PFTpresent, everywhere, when_growthinit, need_adjacent, RIP_time, & 408 444 co2_to_bm, & … … 417 453 CALL kill (npts, 'pftinout ', lm_lastyearmax, & 418 454 ind, PFTpresent, cn_ind, biomass, senescence, RIP_time, & 419 lai, age, leaf_age, leaf_frac, &455 lai, age, leaf_age, leaf_frac, npp_longterm, & 420 456 when_growthinit, everywhere, veget, veget_max, bm_to_litter) 421 457 … … 423 459 ! 3.3 calculate new crown area and maximum vegetation cover 424 460 ! 461 ! 462 ! unsure whether this is really required 463 ! - in theory this could ONLY be done at the END of stomate_lpj 464 ! 465 466 ! calculate woodmass of individual tree 467 WHERE ((ind(:,:).GT.min_stomate)) 468 WHERE ( veget_max(:,:) .GT. min_stomate) 469 woodmass_ind(:,:) = & 470 ((biomass(:,:,isapabove)+biomass(:,:,isapbelow) & 471 +biomass(:,:,iheartabove)+biomass(:,:,iheartbelow))*veget_max(:,:))/ind(:,:) 472 ELSEWHERE 473 woodmass_ind(:,:) =(biomass(:,:,isapabove)+biomass(:,:,isapbelow) & 474 +biomass(:,:,iheartabove)+biomass(:,:,iheartbelow))/ind(:,:) 475 ENDWHERE 476 477 ENDWHERE 425 478 426 479 CALL crown (npts, PFTpresent, & 427 ind, biomass, &480 ind, biomass, woodmass_ind, & 428 481 veget_max, cn_ind, height) 429 482 … … 487 540 resp_maint, resp_growth, npp_daily) 488 541 489 IF ( control%ok_dgvm ) THEN 542 IF ( control%ok_dgvm .OR. .NOT.lpj_gap_const_mort) THEN 543 CALL kill (npts, 'npp ', lm_lastyearmax, & 544 ind, PFTpresent, cn_ind, biomass, senescence, RIP_time, & 545 lai, age, leaf_age, leaf_frac, npp_longterm, & 546 when_growthinit, everywhere, veget, veget_max, bm_to_litter) 490 547 491 548 ! new provisional crown area and maximum vegetation cover after growth 549 IF(control%ok_dgvm) THEN 550 WHERE (ind(:,:).GT.min_stomate) 551 woodmass_ind(:,:) = & 552 ((biomass(:,:,isapabove)+biomass(:,:,isapbelow) & 553 +biomass(:,:,iheartabove)+biomass(:,:,iheartbelow)) & 554 *veget_max(:,:))/ind(:,:) 555 ENDWHERE 556 ELSE 557 WHERE (ind(:,:).GT.min_stomate) 558 woodmass_ind(:,:) = & 559 (biomass(:,:,isapabove)+biomass(:,:,isapbelow) & 560 +biomass(:,:,iheartabove)+biomass(:,:,iheartbelow))/ind(:,:) 561 ENDWHERE 562 ENDIF 492 563 493 564 CALL crown (npts, PFTpresent, & 494 ind, biomass, &565 ind, biomass, woodmass_ind,& 495 566 veget_max, cn_ind, height) 496 567 … … 513 584 CALL kill (npts, 'fire ', lm_lastyearmax, & 514 585 ind, PFTpresent, cn_ind, biomass, senescence, RIP_time, & 515 lai, age, leaf_age, leaf_frac, &586 lai, age, leaf_age, leaf_frac, npp_longterm, & 516 587 when_growthinit, everywhere, veget, veget_max, bm_to_litter) 517 588 … … 524 595 CALL gap (npts, dt_days, & 525 596 npp_longterm, turnover_longterm, lm_lastyearmax, & 526 PFTpresent, biomass, ind, bm_to_litter )597 PFTpresent, biomass, ind, bm_to_litter, mortality) 527 598 528 599 IF ( control%ok_dgvm ) THEN … … 532 603 CALL kill (npts, 'gap ', lm_lastyearmax, & 533 604 ind, PFTpresent, cn_ind, biomass, senescence, RIP_time, & 534 lai, age, leaf_age, leaf_frac, &605 lai, age, leaf_age, leaf_frac, npp_longterm, & 535 606 when_growthinit, everywhere, veget, veget_max, bm_to_litter) 536 607 … … 570 641 571 642 CALL light (npts, dt_days, & 572 PFTpresent, cn_ind, lai, maxfpc_lastyear, &573 ind, biomass, veget_lastlight, bm_to_litter)643 veget_max, fpc_max, PFTpresent, cn_ind, lai, maxfpc_lastyear, & 644 lm_lastyearmax, ind, biomass, veget_lastlight, bm_to_litter, mortality) 574 645 575 646 ! … … 579 650 CALL kill (npts, 'light ', lm_lastyearmax, & 580 651 ind, PFTpresent, cn_ind, biomass, senescence, RIP_time, & 581 lai, age, leaf_age, leaf_frac, &652 lai, age, leaf_age, leaf_frac, npp_longterm, & 582 653 when_growthinit, everywhere, veget, veget_max, bm_to_litter) 583 654 … … 588 659 ! 589 660 590 IF ( control%ok_dgvm ) THEN661 IF ( control%ok_dgvm .OR. .NOT.lpj_gap_const_mort ) THEN 591 662 592 663 ! … … 597 668 neighbours, resolution, need_adjacent, herbivores, & 598 669 precip_lastyear, gdd0_lastyear, lm_lastyearmax, & 599 cn_ind, lai, avail_tree, avail_grass, &670 cn_ind, lai, avail_tree, avail_grass, npp_longterm, & 600 671 leaf_age, leaf_frac, & 601 ind, biomass, age, everywhere, co2_to_bm, veget_max )672 ind, biomass, age, everywhere, co2_to_bm, veget_max, woodmass_ind) 602 673 603 674 ! … … 606 677 607 678 CALL crown (npts, PFTpresent, & 608 ind, biomass, &679 ind, biomass, woodmass_ind, & 609 680 veget_max, cn_ind, height) 610 681 … … 617 688 CALL cover (npts, cn_ind, ind, biomass, & 618 689 veget_max, veget_max_old, veget, & 619 lai, litter, carbon )690 lai, litter, carbon, turnover_daily, bm_to_litter) 620 691 621 692 ! … … 645 716 prod10,prod100,convflux,cflux_prod10,cflux_prod100,leaf_frac,& 646 717 npp_longterm, lm_lastyearmax, litter, carbon) 647 648 718 ENDIF 649 719 ENDIF 650 !MM déplacement pour initialisation correcte des grandeurs cumulées :720 !MM déplacement pour initialisation correcte des grandeurs cumulées : 651 721 cflux_prod_total(:) = convflux(:) + cflux_prod10(:) + cflux_prod100(:) 652 722 prod10_total(:)=SUM(prod10,dim=2) … … 736 806 CALL histwrite (hist_id_stomate, 'CO2_TAKEN', itime, & 737 807 co2_to_bm, npts*nvm, horipft_index) 808 !MM : histdef à construire ! 809 !!$ CALL histwrite (hist_id_stomate, 'CN_IND', itime, & 810 !!$ cn_ind, npts*nvm, horipft_index) 811 !!$ CALL histwrite (hist_id_stomate, 'WOODMASS_IND', itime, & 812 !!$ woodmass_ind, npts*nvm, horipft_index) 738 813 ! land cover change 739 814 CALL histwrite (hist_id_stomate, 'CONVFLUX', itime, & … … 833 908 vartmp(:)=SUM(tot_live_biomass*veget_max,dim=2)/1e3*contfrac 834 909 CALL histwrite (hist_id_stomate_IPCC, "cVeg", itime, & 835 vartmp, npts, hori_index)910 vartmp, npts, hori_index) 836 911 vartmp(:)=SUM(tot_litter_carb*veget_max,dim=2)/1e3*contfrac 837 912 CALL histwrite (hist_id_stomate_IPCC, "cLitter", itime, & 838 vartmp, npts, hori_index)913 vartmp, npts, hori_index) 839 914 vartmp(:)=SUM(tot_soil_carb*veget_max,dim=2)/1e3*contfrac 840 915 CALL histwrite (hist_id_stomate_IPCC, "cSoil", itime, & 841 vartmp, npts, hori_index)916 vartmp, npts, hori_index) 842 917 vartmp(:)=(prod10_total + prod100_total)/1e3 843 918 CALL histwrite (hist_id_stomate_IPCC, "cProduct", itime, & 844 vartmp, npts, hori_index)919 vartmp, npts, hori_index) 845 920 vartmp(:)=SUM(lai*veget_max,dim=2)*contfrac 846 921 CALL histwrite (hist_id_stomate_IPCC, "lai", itime, & 847 vartmp, npts, hori_index)922 vartmp, npts, hori_index) 848 923 vartmp(:)=SUM(gpp_daily*veget_max,dim=2)/1e3/one_day*contfrac 849 924 CALL histwrite (hist_id_stomate_IPCC, "gpp", itime, & 850 vartmp, npts, hori_index)925 vartmp, npts, hori_index) 851 926 vartmp(:)=SUM((resp_maint+resp_growth)*veget_max,dim=2)/1e3/one_day*contfrac 852 927 CALL histwrite (hist_id_stomate_IPCC, "ra", itime, & 853 vartmp, npts, hori_index)928 vartmp, npts, hori_index) 854 929 vartmp(:)=SUM(npp_daily*veget_max,dim=2)/1e3/one_day*contfrac 855 930 CALL histwrite (hist_id_stomate_IPCC, "npp", itime, & 856 vartmp, npts, hori_index)931 vartmp, npts, hori_index) 857 932 vartmp(:)=SUM(resp_hetero*veget_max,dim=2)/1e3/one_day*contfrac 858 933 CALL histwrite (hist_id_stomate_IPCC, "rh", itime, & 859 vartmp, npts, hori_index)934 vartmp, npts, hori_index) 860 935 vartmp(:)=SUM(co2_fire*veget_max,dim=2)/1e3/one_day*contfrac 861 936 CALL histwrite (hist_id_stomate_IPCC, "fFire", itime, & 862 vartmp, npts, hori_index)937 vartmp, npts, hori_index) 863 938 vartmp(:)=harvest_above/1e3/one_day*contfrac 864 939 CALL histwrite (hist_id_stomate_IPCC, "fHarvest", itime, & 865 vartmp, npts, hori_index)940 vartmp, npts, hori_index) 866 941 vartmp(:)=cflux_prod_total/1e3/one_day*contfrac 867 942 CALL histwrite (hist_id_stomate_IPCC, "fLuc", itime, & 868 vartmp, npts, hori_index)943 vartmp, npts, hori_index) 869 944 vartmp(:)=(SUM((gpp_daily-(resp_maint+resp_growth+resp_hetero)-co2_fire) & 870 945 & *veget_max,dim=2)-cflux_prod_total-harvest_above)/1e3/one_day*contfrac 871 946 CALL histwrite (hist_id_stomate_IPCC, "nbp", itime, & 872 vartmp, npts, hori_index)947 vartmp, npts, hori_index) 873 948 vartmp(:)=SUM(tot_bm_to_litter*veget_max,dim=2)/1e3/one_day*contfrac 874 949 CALL histwrite (hist_id_stomate_IPCC, "fVegLitter", itime, & 875 vartmp, npts, hori_index)950 vartmp, npts, hori_index) 876 951 vartmp(:)=SUM(SUM(soilcarbon_input,dim=2)*veget_max,dim=2)/1e3/one_day*contfrac 877 952 CALL histwrite (hist_id_stomate_IPCC, "fLitterSoil", itime, & 878 vartmp, npts, hori_index)953 vartmp, npts, hori_index) 879 954 vartmp(:)=SUM(biomass(:,:,ileaf)*veget_max,dim=2)/1e3*contfrac 880 955 CALL histwrite (hist_id_stomate_IPCC, "cLeaf", itime, & 881 vartmp, npts, hori_index)956 vartmp, npts, hori_index) 882 957 vartmp(:)=SUM((biomass(:,:,isapabove)+biomass(:,:,iheartabove))*veget_max,dim=2)/1e3*contfrac 883 958 CALL histwrite (hist_id_stomate_IPCC, "cWood", itime, & 884 vartmp, npts, hori_index)959 vartmp, npts, hori_index) 885 960 vartmp(:)=SUM(( biomass(:,:,iroot) + biomass(:,:,isapbelow) + biomass(:,:,iheartbelow) ) & 886 961 & *veget_max,dim=2)/1e3*contfrac 887 962 CALL histwrite (hist_id_stomate_IPCC, "cRoot", itime, & 888 vartmp, npts, hori_index)963 vartmp, npts, hori_index) 889 964 vartmp(:)=SUM(( biomass(:,:,icarbres) + biomass(:,:,ifruit))*veget_max,dim=2)/1e3*contfrac 890 965 CALL histwrite (hist_id_stomate_IPCC, "cMisc", itime, & 891 vartmp, npts, hori_index)966 vartmp, npts, hori_index) 892 967 vartmp(:)=SUM((litter(:,istructural,:,iabove)+litter(:,imetabolic,:,iabove))*veget_max,dim=2)/1e3*contfrac 893 968 CALL histwrite (hist_id_stomate_IPCC, "cLitterAbove", itime, & 894 vartmp, npts, hori_index)969 vartmp, npts, hori_index) 895 970 vartmp(:)=SUM((litter(:,istructural,:,ibelow)+litter(:,imetabolic,:,ibelow))*veget_max,dim=2)/1e3*contfrac 896 971 CALL histwrite (hist_id_stomate_IPCC, "cLitterBelow", itime, & 897 vartmp, npts, hori_index)972 vartmp, npts, hori_index) 898 973 vartmp(:)=SUM(carbon(:,iactive,:)*veget_max,dim=2)/1e3*contfrac 899 974 CALL histwrite (hist_id_stomate_IPCC, "cSoilFast", itime, & 900 vartmp, npts, hori_index)975 vartmp, npts, hori_index) 901 976 vartmp(:)=SUM(carbon(:,islow,:)*veget_max,dim=2)/1e3*contfrac 902 977 CALL histwrite (hist_id_stomate_IPCC, "cSoilMedium", itime, & 903 vartmp, npts, hori_index)978 vartmp, npts, hori_index) 904 979 vartmp(:)=SUM(carbon(:,ipassive,:)*veget_max,dim=2)/1e3*contfrac 905 980 CALL histwrite (hist_id_stomate_IPCC, "cSoilSlow", itime, & 906 vartmp, npts, hori_index)981 vartmp, npts, hori_index) 907 982 DO j=1,nvm 908 983 histvar(:,j)=veget_max(:,j)*contfrac(:)*100 909 984 ENDDO 910 985 CALL histwrite (hist_id_stomate_IPCC, "landCoverFrac", itime, & 911 histvar, npts*nvm, horipft_index) 912 vartmp(:)=(veget_max(:,3)+veget_max(:,6)+veget_max(:,8)+veget_max(:,9))*contfrac*100 986 histvar, npts*nvm, horipft_index) 987 988 ! >> DS to be modified for the externalisation 989 ! vartmp(:)=(veget_max(:,3)+veget_max(:,6)+veget_max(:,8)+veget_max(:,9))*contfrac*100 990 vartmp(:)=zero 991 DO j=2,nvm 992 IF(is_deciduous(j)) THEN 993 vartmp(:) = vartmp(:) + veget_max(:,j)*contfrac*100 994 ENDIF 995 ENDDO 913 996 CALL histwrite (hist_id_stomate_IPCC, "treeFracPrimDec", itime, & 914 vartmp, npts, hori_index) 915 vartmp(:)=(veget_max(:,2)+veget_max(:,4)+veget_max(:,5)+veget_max(:,7))*contfrac*100 997 vartmp, npts, hori_index) 998 !- 999 ! vartmp(:)=(veget_max(:,2)+veget_max(:,4)+veget_max(:,5)+veget_max(:,7))*contfrac*100 1000 vartmp(:)=zero 1001 DO j=2,nvm 1002 IF(is_evergreen(j)) THEN 1003 vartmp(:) = vartmp(:) + veget_max(:,j)*contfrac*100 1004 ENDIF 1005 ENDDO 916 1006 CALL histwrite (hist_id_stomate_IPCC, "treeFracPrimEver", itime, & 917 vartmp, npts, hori_index) 918 vartmp(:)=(veget_max(:,10)+veget_max(:,12))*contfrac*100 1007 vartmp, npts, hori_index) 1008 !- 1009 ! vartmp(:)=(veget_max(:,10)+veget_max(:,12))*contfrac*100 1010 vartmp(:)=zero 1011 DO j=2,nvm 1012 IF(is_c3(j)) THEN 1013 vartmp(:) = vartmp(:) + veget_max(:,j)*contfrac*100 1014 ENDIF 1015 ENDDO 919 1016 CALL histwrite (hist_id_stomate_IPCC, "c3PftFrac", itime, & 920 vartmp, npts, hori_index) 921 vartmp(:)=(veget_max(:,11)+veget_max(:,13))*contfrac*100 1017 vartmp, npts, hori_index) 1018 !- 1019 ! vartmp(:)=(veget_max(:,11)+veget_max(:,13))*contfrac*100 1020 vartmp(:)=zero 1021 DO j=2,nvm 1022 IF(is_c4(j)) THEN 1023 vartmp(:) = vartmp(:) + veget_max(:,j)*contfrac*100 1024 ENDIF 1025 ENDDO 922 1026 CALL histwrite (hist_id_stomate_IPCC, "c4PftFrac", itime, & 923 vartmp, npts, hori_index) 1027 vartmp, npts, hori_index) 1028 !>> End modif 1029 1030 924 1031 vartmp(:)=SUM(resp_growth*veget_max,dim=2)/1e3/one_day*contfrac 925 1032 CALL histwrite (hist_id_stomate_IPCC, "rGrowth", itime, & 926 vartmp, npts, hori_index)1033 vartmp, npts, hori_index) 927 1034 vartmp(:)=SUM(resp_maint*veget_max,dim=2)/1e3/one_day*contfrac 928 1035 CALL histwrite (hist_id_stomate_IPCC, "rMaint", itime, & 929 vartmp, npts, hori_index)1036 vartmp, npts, hori_index) 930 1037 vartmp(:)=SUM(bm_alloc(:,:,ileaf)*veget_max,dim=2)/1e3/one_day*contfrac 931 1038 CALL histwrite (hist_id_stomate_IPCC, "nppLeaf", itime, & 932 vartmp, npts, hori_index)1039 vartmp, npts, hori_index) 933 1040 vartmp(:)=SUM(bm_alloc(:,:,isapabove)*veget_max,dim=2)/1e3/one_day*contfrac 934 1041 CALL histwrite (hist_id_stomate_IPCC, "nppWood", itime, & 935 vartmp, npts, hori_index)1042 vartmp, npts, hori_index) 936 1043 vartmp(:)=SUM(( bm_alloc(:,:,isapbelow) + bm_alloc(:,:,iroot) )*veget_max,dim=2)/1e3/one_day*contfrac 937 1044 CALL histwrite (hist_id_stomate_IPCC, "nppRoot", itime, & 938 vartmp, npts, hori_index)1045 vartmp, npts, hori_index) 939 1046 940 1047 CALL histwrite (hist_id_stomate_IPCC, 'RESOLUTION_X', itime, & -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/stomate_npp.f90
r64 r257 144 144 ! 1.1.1 soil levels 145 145 146 z_soil(0) = 0.146 z_soil(0) = zero 147 147 z_soil(1:nbdl) = diaglev(1:nbdl) 148 148 … … 175 175 176 176 ! 1.3.1 rpc is an integration constant such that the integral of the root profile is 1. 177 rpc(:) = 1. / ( 1. - EXP( -z_soil(nbdl) / rprof(:,j) ) ) 177 178 rpc(:) = un / ( un - EXP( -z_soil(nbdl) / rprof(:,j) ) ) 178 179 179 180 ! 1.3.2 integrate over the nbdl levels … … 243 244 coeff_maint(:,j,k) = & 244 245 MAX( coeff_maint_zero(j,k) * & 245 ( 1.+ slope(:) * (t_maint(:,k)-ZeroCelsius) ), zero )246 ( un + slope(:) * (t_maint(:,k)-ZeroCelsius) ), zero ) 246 247 247 248 ENDDO … … 336 337 resp_growth_part(:,:) = frac_growthresp * bm_alloc(:,j,:) / dt 337 338 338 bm_alloc(:,j,:) = ( 1.- frac_growthresp ) * bm_alloc(:,j,:)339 bm_alloc(:,j,:) = ( un - frac_growthresp ) * bm_alloc(:,j,:) 339 340 340 341 ! -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/stomate_phenology.f90
r109 r257 163 163 ! 164 164 165 allow_initpheno(:, 1) = .FALSE. ! Add 02/02/2011 correctio of MM for the 1.9.5-1 version165 allow_initpheno(:,ibare_sechiba) = .FALSE. 166 166 DO j = 2,nvm 167 167 … … 348 348 349 349 WHERE ( age_reset(:) ) 350 leaf_frac(:,j,1) = 1.0350 leaf_frac(:,j,1) = un 351 351 ENDWHERE 352 352 DO m = 2, nleafages 353 353 WHERE ( age_reset(:) ) 354 leaf_frac(:,j,m) = 0.0354 leaf_frac(:,j,m) = zero 355 355 ENDWHERE 356 356 ENDDO … … 360 360 DO m = 1, nleafages 361 361 WHERE ( age_reset(:) ) 362 leaf_age(:,j,m) = 0.0362 leaf_age(:,j,m) = zero 363 363 ENDWHERE 364 364 ENDDO … … 409 409 410 410 ! signal to start putting leaves on 411 LOGICAL, DIMENSION(npts,nvm), INTENT( out) :: begin_leaves411 LOGICAL, DIMENSION(npts,nvm), INTENT(inout) :: begin_leaves 412 412 413 413 ! 0.3 local 414 415 ! moisture availability above which moisture tendency doesn't matter416 ! REAL(r_std), PARAMETER :: moiavail_always_tree = 1.0417 ! REAL(r_std), PARAMETER :: moiavail_always_grass = 0.6418 414 419 415 REAL(r_std) :: moiavail_always … … 543 539 544 540 ! signal to start putting leaves on 545 LOGICAL, DIMENSION(npts,nvm), INTENT( out) :: begin_leaves541 LOGICAL, DIMENSION(npts,nvm), INTENT(inout) :: begin_leaves 546 542 547 543 ! 0.3 local … … 679 675 680 676 ! signal to start putting leaves on 681 LOGICAL, DIMENSION(npts,nvm), INTENT( out) :: begin_leaves677 LOGICAL, DIMENSION(npts,nvm), INTENT(inout) :: begin_leaves 682 678 683 679 ! 0.3 local … … 775 771 gdd_crit(i) = pheno_gdd_crit(j,1) + tl(i)*pheno_gdd_crit(j,2) + & 776 772 tl(i)*tl(i)*pheno_gdd_crit(j,3) 777 778 773 779 774 IF ( ( gdd(i,j) .GE. gdd_crit(i) ) .AND. & … … 839 834 840 835 ! signal to start putting leaves on 841 LOGICAL, DIMENSION(npts,nvm), INTENT( out) :: begin_leaves836 LOGICAL, DIMENSION(npts,nvm), INTENT(inout) :: begin_leaves 842 837 843 838 ! 0.3 local … … 986 981 987 982 ! signal to start putting leaves on 988 LOGICAL, DIMENSION(npts,nvm), INTENT( out) :: begin_leaves983 LOGICAL, DIMENSION(npts,nvm), INTENT(inout) :: begin_leaves 989 984 990 985 ! 0.3 local … … 1084 1079 1085 1080 ! signal to start putting leaves on 1086 LOGICAL, DIMENSION(npts,nvm), INTENT( out) :: begin_leaves1081 LOGICAL, DIMENSION(npts,nvm), INTENT(inout) :: begin_leaves 1087 1082 1088 1083 ! 0.3 local -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/stomate_prescribe.f90
r64 r257 19 19 USE pft_parameters 20 20 USE constantes 21 22 21 23 22 IMPLICIT NONE … … 89 88 ! only when the DGVM is not activated or agricultural PFT. 90 89 91 IF ( ( .NOT. control%ok_dgvm ) .OR. ( .NOT. natural(j) ) ) THEN90 IF ( ( .NOT. control%ok_dgvm .AND. lpj_gap_const_mort ) .OR. ( .NOT. natural(j) ) ) THEN 92 91 93 92 ! … … 95 94 ! 96 95 97 cn_ind(:,j) = 0.096 cn_ind(:,j) = zero 98 97 99 98 IF ( tree(j) ) THEN … … 103 102 ! 104 103 105 dia(:) = 0.0104 dia(:) = zero 106 105 107 106 DO i = 1, npts 108 107 109 IF ( veget_max(i,j) .GT. 0.0) THEN108 IF ( veget_max(i,j) .GT. zero ) THEN 110 109 111 110 ! 1.1.1 calculate total wood mass … … 128 127 129 128 dia(i) = ( woodmass_ind(i) / ( pipe_density * pi/4. * pipe_tune2 ) ) ** & 130 ( 1./ ( 2. + pipe_tune3 ) )129 ( un / ( 2. + pipe_tune3 ) ) 131 130 132 131 ! 1.1.5 crown area, provisional … … 149 148 150 149 dia(i) = ( woodmass_ind(i) / ( pipe_density * pi/4. * pipe_tune2 ) ) ** & 151 ( 1./ ( 2. + pipe_tune3 ) )150 ( un / ( 2. + pipe_tune3 ) ) 152 151 153 152 ! final crown area … … 176 175 ! 177 176 178 WHERE ( veget_max(:,j) .GT. 0.0)179 cn_ind(:,j) = 1.0177 WHERE ( veget_max(:,j) .GT. zero ) 178 cn_ind(:,j) = un 180 179 ENDWHERE 181 180 … … 186 185 ! 187 186 188 WHERE ( veget_max(:,j) .GT. 0.0)187 WHERE ( veget_max(:,j) .GT. zero ) 189 188 190 189 ind(:,j) = veget_max(:,j) / cn_ind(:,j) … … 192 191 ELSEWHERE 193 192 194 ind(:,j) = 0.0193 ind(:,j) = zero 195 194 196 195 ENDWHERE … … 247 246 IF ( pheno_model(j) .NE. 'none' ) THEN 248 247 249 biomass(i,j,ileaf) = 0.0250 leaf_frac(i,j,1) = 0.0248 biomass(i,j,ileaf) = zero 249 leaf_frac(i,j,1) = zero 251 250 252 251 ENDIF … … 265 264 266 265 ! set leaf age classes 267 leaf_frac(i,j,:) = 0.0268 leaf_frac(i,j,1) = 1.0266 leaf_frac(i,j,:) = zero 267 leaf_frac(i,j,1) = un 269 268 270 269 ! set time since last beginning of growing season … … 279 278 IF ( veget_max(i,j) .GT. min_stomate ) THEN 280 279 PFTpresent(i,j) = .TRUE. 281 everywhere(i,j) = 1.280 everywhere(i,j) = un 282 281 ENDIF 283 282 -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/stomate_resp.f90
r64 r257 95 95 ! 1.1.1 soil levels 96 96 97 z_soil(0) = 0.97 z_soil(0) = zero 98 98 z_soil(1:nbdl) = diaglev(1:nbdl) 99 99 … … 116 116 117 117 ! 1.3.1 rpc is an integration constant such that the integral of the root profile is 1. 118 rpc(:) = 1. / ( 1. - EXP( -z_soil(nbdl) / rprof(:,j) ) ) 118 119 rpc(:) = un / ( un - EXP( -z_soil(nbdl) / rprof(:,j) ) ) 119 120 120 121 ! 1.3.2 integrate over the nbdl levels … … 174 175 coeff_maint(:,j,k) = & 175 176 MAX( (coeff_maint_zero(j,k)*dt/one_day) * & 176 ( 1.+ slope(:) * (t_maint_radia(:,k)-ZeroCelsius) ), zero )177 ( un + slope(:) * (t_maint_radia(:,k)-ZeroCelsius) ), zero ) 177 178 178 179 ENDDO … … 214 215 !!$ ( .3*lai(i,j) + 1.4 ) / lai(i,j) 215 216 !!$ ENDIF 216 !!$ resp_maint_part_radia(i,j,k) = coeff_maint(i,j,k) * biomass(i,j,k) * &217 !!$ ( .3*lai(i,j) + 1.4*(1.-exp(-.5*lai(i,j))) ) / lai(i,j)218 219 217 resp_maint_part_radia(i,j,k) = coeff_maint(i,j,k) * biomass(i,j,k) * & 220 218 ( maint_resp_min_vmax*lai(i,j) + maint_resp_coeff*(1.-exp(-ext_coeff(j)*lai(i,j))) ) / lai(i,j) -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/stomate_season.f90
r135 r257 174 174 ! residence time of green tissue (years) 175 175 REAL(r_std), DIMENSION(npts,nvm) :: green_age 176 177 ! ds 04/03 Old formulation for herbivores178 !!$ ! weights179 !!$ REAL(r_std), DIMENSION(npts) :: weighttot180 !!$ ! natural long-term leaf NPP ( gC/m**2/year)181 !!$ REAL(r_std), DIMENSION(npts) :: nlflong_nat182 !!$ ! residence time of green tissue (years)183 !!$ REAL(r_std), DIMENSION(npts) :: green_age184 185 176 ! herbivore consumption (gC/m**2/day) 186 177 REAL(r_std), DIMENSION(npts) :: consumption 178 ! fraction of each gridcell occupied by natural vegetation 179 REAL(r_std), DIMENSION(npts) :: fracnat 187 180 188 181 ! ========================================================================= … … 225 218 226 219 ! 1.2.1.1 "monthly" 227 !MM PAS PARALLELISE!!220 !MM PAS PARALLELISE!! 228 221 IF ( ABS( SUM( moiavail_month(:,2:nvm) ) ) .LT. min_stomate ) THEN 229 222 … … 277 270 278 271 ! 1.2.3 "monthly" soil temperatures 279 !MM PAS PARALLELISE!!272 !MM PAS PARALLELISE!! 280 273 IF ( ABS( SUM( tsoil_month(:,:) ) ) .LT. min_stomate ) THEN 281 274 … … 464 457 ! detect a beginning of the growing season by declaring it dormant 465 458 ! 466 !NVMODIF459 !NVMODIF 467 460 DO j = 2,nvm 468 461 WHERE ( ( gpp_week(:,j) .LT. min_gpp_allowed ) .OR. & … … 470 463 ( ( when_growthinit(:,j) .GT. 2.*one_year ) .AND. & 471 464 ( biomass(:,j,icarbres) .GT. biomass(:,j,ileaf)*4. ) ) ) 472 ! WHERE ( ( gpp_week(:,j) .EQ. zero ) .OR. &473 ! ( gpp_week(:,j) .LT. gppfrac_dormance * maxgppweek_lastyear(:,j) ) .OR. &474 ! ( ( when_growthinit(:,j) .GT. 2.*one_year ) .AND. &475 ! ( biomass(:,j,icarbres) .GT. biomass(:,j,ileaf)*4. ) ) )476 465 ! WHERE ( ( gpp_week(:,j) .EQ. zero ) .OR. & 466 ! ( gpp_week(:,j) .LT. gppfrac_dormance * maxgppweek_lastyear(:,j) ) .OR. & 467 ! ( ( when_growthinit(:,j) .GT. 2.*one_year ) .AND. & 468 ! ( biomass(:,j,icarbres) .GT. biomass(:,j,ileaf)*4. ) ) ) 469 477 470 time_lowgpp(:,j) = time_lowgpp(:,j) + dt 478 471 … … 816 809 ! 817 810 811 IF(control%ok_dgvm ) THEN 812 813 fracnat(:) = un 814 DO j = 2,nvm 815 IF ( .NOT. natural(j) ) THEN 816 fracnat(:) = fracnat(:) - veget_max(:,j) 817 ENDIF 818 ENDDO 819 820 ENDIF 821 818 822 IF ( control%ok_stomate ) THEN 819 820 DO j = 2,nvm 821 WHERE ( biomass(:,j,ileaf) .GT. lm_thisyearmax(:,j) ) 822 lm_thisyearmax(:,j) = biomass(:,j,ileaf) 823 ENDWHERE 824 ENDDO 825 823 IF(control%ok_dgvm ) THEN 824 DO j=2,nvm 825 826 IF ( natural(j) .AND. control%ok_dgvm ) THEN 827 828 WHERE ( fracnat(:) .GT. min_stomate .AND. biomass(:,j,ileaf).GT. lm_lastyearmax(:,j)*0.75 ) 829 maxfpc_lastyear(:,j) = ( maxfpc_lastyear(:,j) * ( one_year/leaflife_tab(j)- dt ) + & 830 veget(:,j) / fracnat(:) * dt ) / (one_year/leaflife_tab(j)) 831 ENDWHERE 832 maxfpc_thisyear(:,j) = maxfpc_lastyear(:,j) ! just to initialise value 833 834 ENDIF 835 836 !NV : correct initialization 837 !!$ WHERE(biomass(:,j,ileaf).GT. lm_lastyearmax(:,j)*0.75) 838 !!$ lm_lastyearmax(:,j) = ( lm_lastyearmax(:,j) * ( one_year/leaflife_tab(j)- dt ) + & 839 !!$ biomass(:,j,ileaf) * dt ) / (one_year/leaflife_tab(j)) 840 !!$ ENDWHERE 841 !!$ lm_thisyearmax(:,j)=lm_lastyearmax(:,j) ! just to initialise value 842 WHERE (lm_thisyearmax(:,j) .GT. min_stomate) 843 WHERE(biomass(:,j,ileaf).GT. lm_thisyearmax(:,j)*0.75) 844 lm_thisyearmax(:,j) = ( lm_thisyearmax(:,j) * ( one_year/leaflife_tab(j)- dt ) + & 845 biomass(:,j,ileaf) * dt ) / (one_year/leaflife_tab(j)) 846 ENDWHERE 847 ELSEWHERE 848 lm_thisyearmax(:,j) =biomass(:,j,ileaf) 849 ENDWHERE 850 851 ENDDO 852 853 ELSE 854 855 DO j = 2,nvm 856 WHERE ( biomass(:,j,ileaf) .GT. lm_thisyearmax(:,j) ) 857 lm_thisyearmax(:,j) = biomass(:,j,ileaf) 858 ENDWHERE 859 ENDDO 860 861 ENDIF 826 862 ELSE 827 863 … … 851 887 ! 21.1 replace old values 852 888 ! 853 !NVMODIF854 maxmoiavail_lastyear(:,:) = (maxmoiavail_lastyear(:,:)*(tau_climatology-1)+ maxmoiavail_thisyear(:,:))/tau_climatology855 minmoiavail_lastyear(:,:) = (minmoiavail_lastyear(:,:)*(tau_climatology-1)+ minmoiavail_thisyear(:,:))/tau_climatology856 maxgppweek_lastyear(:,:) =( maxgppweek_lastyear(:,:)*(tau_climatology-1)+ maxgppweek_thisyear(:,:))/tau_climatology857 ! maxmoiavail_lastyear(:,:) = maxmoiavail_thisyear(:,:)858 ! minmoiavail_lastyear(:,:) = minmoiavail_thisyear(:,:)859 ! maxgppweek_lastyear(:,:) = maxgppweek_thisyear(:,:)860 889 !NVMODIF 890 maxmoiavail_lastyear(:,:) = (maxmoiavail_lastyear(:,:)*(tau_climatology-1)+ maxmoiavail_thisyear(:,:))/tau_climatology 891 minmoiavail_lastyear(:,:) = (minmoiavail_lastyear(:,:)*(tau_climatology-1)+ minmoiavail_thisyear(:,:))/tau_climatology 892 maxgppweek_lastyear(:,:) =( maxgppweek_lastyear(:,:)*(tau_climatology-1)+ maxgppweek_thisyear(:,:))/tau_climatology 893 ! maxmoiavail_lastyear(:,:) = maxmoiavail_thisyear(:,:) 894 ! minmoiavail_lastyear(:,:) = minmoiavail_thisyear(:,:) 895 ! maxgppweek_lastyear(:,:) = maxgppweek_thisyear(:,:) 896 861 897 gdd0_lastyear(:) = gdd0_thisyear(:) 862 898 … … 909 945 ! fpc_crit. 910 946 911 ! calculate the sum of maxfpc_lastyear912 sumfpc_nat(:) = zero913 DO j = 2,nvm914 sumfpc_nat(:) = sumfpc_nat(:) + maxfpc_lastyear(:,j)915 ENDDO916 917 ! scale so that the new sum is fpc_crit918 DO j = 2,nvm919 WHERE ( sumfpc_nat(:) .GT. fpc_crit )920 maxfpc_lastyear(:,j) = maxfpc_lastyear(:,j) * (fpc_crit/sumfpc_nat(:))921 ENDWHERE922 ENDDO947 !!$ ! calculate the sum of maxfpc_lastyear 948 !!$ sumfpc_nat(:) = zero 949 !!$ DO j = 2,nvm 950 !!$ sumfpc_nat(:) = sumfpc_nat(:) + maxfpc_lastyear(:,j) 951 !!$ ENDDO 952 !!$ 953 !!$ ! scale so that the new sum is fpc_crit 954 !!$ DO j = 2,nvm 955 !!$ WHERE ( sumfpc_nat(:) .GT. fpc_crit ) 956 !!$ maxfpc_lastyear(:,j) = maxfpc_lastyear(:,j) * (fpc_crit/sumfpc_nat(:)) 957 !!$ ENDWHERE 958 !!$ ENDDO 923 959 924 960 ENDIF ! EndOfYear … … 941 977 !!$ nlflong_nat, green_age are pft-dependants 942 978 943 !!$ nlflong_nat(:) = zero944 !!$ weighttot(:) = zero945 !!$ green_age(:) = zero946 !!$ !947 !!$ DO j = 2,nvm948 !!$ !949 !!$ IF ( natural(j) ) THEN950 !!$ !951 !!$ weighttot(:) = weighttot(:) + lm_lastyearmax(:,j)952 !!$ nlflong_nat(:) = nlflong_nat(:) + npp_longterm(:,j) * leaf_frac_hvc953 !!$ !954 !!$ IF ( pheno_model(j) .EQ. 'none' ) THEN955 !!$ green_age(:) = green_age(:) + green_age_ever * lm_lastyearmax(:,j)956 !!$ ELSE957 !!$ green_age(:) = green_age(:) + green_age_dec * lm_lastyearmax(:,j)958 !!$ ENDIF959 !!$ !960 !!$ ENDIF961 !!$ !962 !!$ ENDDO963 !!$ !964 !!$ WHERE ( weighttot(:) .GT. zero )965 !!$ green_age(:) = green_age(:) / weighttot(:)966 !!$ ELSEWHERE967 !!$ green_age(:) = 1.968 !!$ ENDWHERE969 !!$970 !!$ !971 !!$ ! 22.2 McNaughton et al. give herbivore consumption as a function of annual leaf NPP.972 !!$ ! The annual leaf NPP can give us an idea about the edible biomass:973 !!$ !974 !!$975 !!$ DO j = 2,nvm976 !!$ !977 !!$ IF ( natural(j) ) THEN978 !!$ !979 !!$ WHERE ( nlflong_nat(:) .GT. zero )980 !!$ consumption(:) = hvc1 * nlflong_nat(:) ** hvc2981 !!$ herbivores(:,j) = one_year * green_age(:) * nlflong_nat(:) / consumption(:)982 !!$ ELSEWHERE983 !!$ herbivores(:,j) = 100000.984 !!$ ENDWHERE985 !!$ !986 !!$ ELSE987 !!$ !988 !!$ herbivores(:,j) = 100000.989 !!$ !990 !!$ ENDIF991 !!$ !992 !!$ ENDDO993 !!$ herbivores(:,ibare_sechiba) = zero994 995 979 nlflong_nat(:,:) = zero 996 980 weighttot(:,:) = zero -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/stomate_soilcarbon.f90
r108 r257 112 112 frac_carb(:,islow,ipassive) = frac_carb_sp 113 113 114 115 114 ! 1.1.1.3 from passive pool 116 115 … … 118 117 frac_carb(:,ipassive,iactive) = frac_carb_pa 119 118 frac_carb(:,ipassive,islow) = frac_carb_ps 120 121 119 122 120 … … 154 152 ! 155 153 156 resp_hetero_soil(:,:) = 0.0154 resp_hetero_soil(:,:) = zero 157 155 158 156 ! … … 173 171 ! 174 172 175 frac_resp(:,:) = 1.- frac_carb(:,:,iactive) - frac_carb(:,:,islow) - &173 frac_resp(:,:) = un - frac_carb(:,:,iactive) - frac_carb(:,:,islow) - & 176 174 frac_carb(:,:,ipassive) 177 175 … … 191 189 fluxtot(:,k) = dt/carbon_tau(k) * carbon(:,k,m) * & 192 190 control_moist(:,ibelow) * control_temp(:,ibelow) 193 !!$ DS ELSEIF ( PFT_name(m)==' C3 agriculture' ) THEN194 191 ELSEIF ( (.NOT. natural(m)) .AND. (.NOT. is_c4(m)) ) THEN 195 192 fluxtot(:,k) = dt/carbon_tau(k) * carbon(:,k,m) * & 196 193 control_moist(:,ibelow) * control_temp(:,ibelow) * flux_tot_coeff(1) 197 !!$ DS ELSEIF ( PFT_name(m)==' C4 agriculture' ) THEN198 194 ELSEIF ( (.NOT. natural(m)) .AND. is_c4(m) ) THEN 199 195 fluxtot(:,k) = dt/carbon_tau(k) * carbon(:,k,m) * & -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/stomate_turnover.f90
r64 r257 196 196 tl(:)*tl(:) * senescence_temp(j,3) 197 197 198 WHERE ( ( biomass(:,j,ileaf) .GT. 0.0) .AND. &198 WHERE ( ( biomass(:,j,ileaf) .GT. zero ) .AND. & 199 199 ( leaf_meanage(:,j) .GT. min_leaf_age_for_senescence(j) ) .AND. & 200 200 ( t2m_month(:) .LT. t_crit(:) ) .AND. ( t2m_week(:) .LT. t2m_month(:) ) ) … … 215 215 nosenescence_hum(j) ) 216 216 217 WHERE ( ( biomass(:,j,ileaf) .GT. 0.0) .AND. &217 WHERE ( ( biomass(:,j,ileaf) .GT. zero ) .AND. & 218 218 ( leaf_meanage(:,j) .GT. min_leaf_age_for_senescence(j) ) .AND. & 219 219 ( moiavail_week(:,j) .LT. moiavail_crit(:) ) ) … … 240 240 241 241 ! critical temperature for senescence may depend on long term annual mean temperature 242 WHERE ( ( biomass(:,j,ileaf) .GT. 0.0) .AND. &242 WHERE ( ( biomass(:,j,ileaf) .GT. zero ) .AND. & 243 243 ( leaf_meanage(:,j) .GT. min_leaf_age_for_senescence(j) ) .AND. & 244 244 ( ( moiavail_week(:,j) .LT. moiavail_crit(:) ) .OR. & … … 319 319 turnover(:,j,ifruit) = biomass(:,j,ifruit) * dt / turnover_time(:,j) 320 320 ELSEWHERE 321 turnover(:,j,ileaf)= 0.0322 turnover(:,j,isapabove) = 0.0323 turnover(:,j,iroot) = 0.0324 turnover(:,j,ifruit) = 0.0321 turnover(:,j,ileaf)= zero 322 turnover(:,j,isapabove) = zero 323 turnover(:,j,iroot) = zero 324 turnover(:,j,ifruit) = zero 325 325 ENDWHERE 326 326 biomass(:,j,ileaf) = biomass(:,j,ileaf) - turnover(:,j,ileaf) … … 364 364 365 365 DO m = 1, nleafages 366 turnover_rate(:) = 0366 turnover_rate(:) = zero 367 367 WHERE ( leaf_age(:,j,m) .GT. leaf_age_crit(:,j)/2. ) 368 368 … … 454 454 leaf_frac(:,j,m) = ( leaf_frac(:,j,m)*lm_old(:) + delta_lm(:,m) ) / biomass(:,j,ileaf) 455 455 ELSEWHERE 456 leaf_frac(:,j,m) = 0.0456 leaf_frac(:,j,m) = zero 457 457 ENDWHERE 458 458 … … 489 489 ! check whether we shed the remaining leaves 490 490 491 WHERE ( ( biomass(:,j,ileaf) .GT. 0.0) .AND. senescence(:,j) .AND. &491 WHERE ( ( biomass(:,j,ileaf) .GT. zero ) .AND. senescence(:,j) .AND. & 492 492 ( biomass(:,j,ileaf) .LT. (lai_initmin(j) / 2.)/sla(j) ) ) 493 493 … … 498 498 turnover(:,j,ifruit) = turnover(:,j,ifruit) + biomass(:,j,ifruit) 499 499 500 biomass(:,j,ileaf) = 0.0501 biomass(:,j,iroot) = 0.0502 biomass(:,j,ifruit) = 0.0500 biomass(:,j,ileaf) = zero 501 biomass(:,j,iroot) = zero 502 biomass(:,j,ifruit) = zero 503 503 504 504 505 505 506 506 ! reset leaf age 507 leaf_meanage(:,j) = 0.0507 leaf_meanage(:,j) = zero 508 508 509 509 ENDWHERE … … 519 519 ! Shed the remaining leaves if LAI very low. 520 520 521 WHERE ( ( biomass(:,j,ileaf) .GT. 0.0) .AND. senescence(:,j) .AND. &521 WHERE ( ( biomass(:,j,ileaf) .GT. zero ) .AND. senescence(:,j) .AND. & 522 522 ( biomass(:,j,ileaf) .LT. (lai_initmin(j) / 2.)/sla(j) )) 523 523 … … 529 529 turnover(:,j,ifruit) = turnover(:,j,ifruit) + biomass(:,j,ifruit) 530 530 531 biomass(:,j,ileaf) = 0.0532 biomass(:,j,isapabove) = 0.0533 biomass(:,j,iroot) = 0.0534 biomass(:,j,ifruit) = 0.0531 biomass(:,j,ileaf) = zero 532 biomass(:,j,isapabove) = zero 533 biomass(:,j,iroot) = zero 534 biomass(:,j,ifruit) = zero 535 535 536 536 537 537 538 538 ! reset leaf age 539 leaf_meanage(:,j) = 0.0539 leaf_meanage(:,j) = zero 540 540 541 541 ENDWHERE … … 551 551 WHERE ( shed_rest(:) ) 552 552 553 leaf_age(:,j,m) = 0.0554 leaf_frac(:,j,m) = 0.0553 leaf_age(:,j,m) = zero 554 leaf_frac(:,j,m) = zero 555 555 556 556 ENDWHERE … … 679 679 hw_new(:) = biomass(:,j,iheartabove) + biomass(:,j,iheartbelow) 680 680 681 WHERE ( hw_new(:) .GT. 0.0)681 WHERE ( hw_new(:) .GT. zero ) 682 682 683 683 age(:,j) = age(:,j) * hw_old(:)/hw_new(:)
Note: See TracChangeset
for help on using the changeset viewer.