Changeset 8423


Ignore:
Timestamp:
2024-02-13T13:45:31+01:00 (5 months ago)
Author:
josefine.ghattas
Message:

Revert commit [8418] because it has problems with restartability.

Location:
branches/ORCHIDEE_2_2/ORCHIDEE
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/ORCHIDEE_2_2/ORCHIDEE/src_parameters/constantes.f90

    r8418 r8423  
    143143       !Config Units = BOOLEAN     
    144144       CALL getin_p('SPINUP_ANALYTIC',spinup_analytic) 
    145        ! 
    146        !Config Key   = OK_MOYANO_SOILHUMSAT 
    147        !Config Desc  = Activation of Moyano equation for control_moist in stomate_litter. 
    148        !Config If    = OK_STOMATE 
    149        !Config Def   = n 
    150        !Config Help  = Activate this option if you want to use Moyano equation 
    151        !to define control_moist in stomate_litter. 
    152        !Config Units = [FLAG]     
    153        CALL getin_p('OK_MOYANO_SOILHUMSAT',ok_moyano_soilhumsat) 
    154        ! 
    155        !Config Key   = OK_ORGA 
    156        !Config Desc  = Activation of Moyano equation for control_moist in 
    157        !stomate_litter. 
    158        !Config If    = OK_STOMATE and OK_MOYANO_SOILHUMSAT 
    159        !Config Def   = n 
    160        !Config Help  = Activate this option if you want to use the organic part 
    161        !of the Moyano equation for soil rich in C. 
    162        !to define control_moist in stomate_litter. 
    163        !Config Units = [FLAG]     
    164        CALL getin_p('OK_ORGA',ok_orga) 
     145 
    165146    ENDIF 
    166147 
     
    18811862    !Config Units = [-] 
    18821863    CALL getin_p('MOISTCONT_MIN',moistcont_min) 
    1883     ! 
    1884     !Config Key   = BETA1 
    1885     !Config Desc  = Parameter for Moyano et al 2012 PRSR model(2) 
    1886     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT  
    1887     !Config Def   = -0.26 
    1888     !Config Help  =  
    1889     !Config Units = [-] 
    1890     CALL getin_p('BETA1',beta1) 
    1891     ! 
    1892     !Config Key   = BETA1_ORGA 
    1893     !Config Desc  = Parameter for Moyano et al 2012 PRSR model(3) 
    1894     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT 
    1895     !Config Def   = -0.67 
    1896     !Config Help  = 
    1897     !Config Units = [-] 
    1898     CALL getin_p('BETA1_ORGA',beta1_orga) 
    1899     ! 
    1900     !Config Key   = BETA2 
    1901     !Config Desc  = Parameter for Moyano et al 2012 PRSR model(2) 
    1902     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT  
    1903     !Config Def   = 0.32 
    1904     !Config Help  =  
    1905     !Config Units = [-] 
    1906     CALL getin_p('BETA2',beta2) 
    1907     ! 
    1908     !Config Key   = BETA2_ORGA 
    1909     !Config Desc  = Parameter for Moyano et al 2012 PRSR model(3) 
    1910     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT 
    1911     !Config Def   = 1.08 
    1912     !Config Help  = 
    1913     !Config Units = [-] 
    1914     CALL getin_p('BETA2_ORGA',beta2_orga)     
    1915     ! 
    1916     !Config Key   = BETA3 
    1917     !Config Desc  = Parameter for Moyano et al 2012 PRSR model(2) 
    1918     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT  
    1919     !Config Def   = -0.15 
    1920     !Config Help  =  
    1921     !Config Units = [-] 
    1922     CALL getin_p('BETA3',beta3) 
    1923     ! 
    1924     !Config Key   = BETA3_ORGA 
    1925     !Config Desc  = Parameter for Moyano et al 2012 PRSR model(3) 
    1926     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT 
    1927     !Config Def   = -0.57 
    1928     !Config Help  = 
    1929     !Config Units = [-] 
    1930     CALL getin_p('BETA3_ORGA',beta3_orga)     
    1931     ! 
    1932     !Config Key   = BETA4 
    1933     !Config Desc  = Parameter for Moyano et al 2012 PRSR model(2) 
    1934     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT  
    1935     !Config Def   = 0.08 
    1936     !Config Help  =  
    1937     !Config Units = [-] 
    1938     CALL getin_p('BETA4',beta4) 
    1939     ! 
    1940     !Config Key   = BETA5 
    1941     !Config Desc  = Parameter for Moyano et al 2012 PRSR model(2) 
    1942     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT  
    1943     !Config Def   = -0.09 
    1944     !Config Help  =  
    1945     !Config Units = [-] 
    1946     CALL getin_p('BETA5',beta5) 
    1947     ! 
    1948     !Config Key   = BETA6 
    1949     !Config Desc  = Prameter for Moyano et al 2012 PRSR model(2) 
    1950     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT  
    1951     !Config Def   = 0.57 
    1952     !Config Help  =  
    1953     !Config Units = [-] 
    1954     CALL getin_p('BETA6',beta6) 
    1955     ! 
    1956     !Config Key   = INTERCEPT 
    1957     !Config Desc  = Prameter for Moyano et al 2012 PRSR model(2) 
    1958     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT  
    1959     !Config Def   = 1.059 
    1960     !Config Help  =  
    1961     !Config Units = [-] 
    1962     CALL getin_p('INTERCEPT',intercept) 
    1963     ! 
    1964     !Config Key   = INTERCEPT_ORGA 
    1965     !Config Desc  = Prameter for Moyano et al 2012 PRSR model(3) 
    1966     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT  
    1967     !Config Def   = 1.134 
    1968     !Config Help  =  
    1969     !Config Units = [-] 
    1970     CALL getin_p('INTERCEPT_ORGA',intercept_orga)     
    1971     ! 
    1972     !Config Key   = SRO 
    1973     !Config Desc  = Initial respiration value (SR0) arbitrary defined at 1.0  
    1974     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT  
    1975     !Config Def   = 1.0 
    1976     !Config Help  =  
    1977     !Config Units = [-] 
    1978     CALL getin_p('SRO',SRo) 
    1979     ! 
    1980     !Config Key   = MOISTCONSTSAT_MIN 
    1981     !Config Desc  = minimum soil wetness to limit the heterotrophic respiration  
    1982     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT  
    1983     !Config Def   = 0.0 
    1984     !Config Help  =  
    1985     !Config Units = [-] 
    1986     CALL getin_p('MOISTCONSTSAT_MIN',moistcontSAT_min) 
    1987     !     
    1988     !Config Key   = SOILHEIGHT 
    1989     !Config Desc  = soilheight to converte gC/m2soil to gC/gsoil  
    1990     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT  
    1991     !Config Def   = 0.1 
    1992     !Config Help  =  
    1993     !Config Units = [-] 
    1994     CALL getin_p('SOILHEIGHT',soilheight) 
    1995     !     
    1996     !Config Key   = CINI_MOYANO 
    1997     !Config Desc  = Carbon content to initialize Moyano equation  
    1998     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT  
    1999     !Config Def   = 1000.0 
    2000     !Config Help  =  
    2001     !Config Units = [gC/m3] 
    2002     CALL getin_p('CINI_MOYANO',Cini_Moyano) 
    2003     !     
    2004     !Config Key   = LITTERINI_MOYANO 
    2005     !Config Desc  = Carbon litter content to initialize Moyano equation  
    2006     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT  
    2007     !Config Def   = 1000.0 
    2008     !Config Help  =  
    2009     !Config Units = [gC/m3] 
    2010     CALL getin_p('LITTERINI_MOYANO',Litterini_Moyano) 
    2011     !     
    2012     !Config Key   = MAX_CARBON_MOYANO 
    2013     !Config Desc  = Maximum carbon concentration in the database used by Moyano et al 
    2014     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT  
    2015     !Config Def   = 0.35 
    2016     !Config Help  =  
    2017     !Config Units = [gC/g soil] 
    2018     CALL getin_p('MAX_CARBON_MOYANO',max_carbon_moyano) 
    2019     !     
    2020     !Config Key   = MIN_CARBON_MOYANO 
    2021     !Config Desc  = Minimum carbon concentration in the database used by Moyano et al 
    2022     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT  
    2023     !Config Def   = 0.01 
    2024     !Config Help  =  
    2025     !Config Units = [gC/g soil] 
    2026     CALL getin_p('MIN_CARBON_MOYANO',min_carbon_moyano) 
    2027     !     
    2028     !Config Key   = LIMIT_CARBON_ORGA 
    2029     !Config Desc  = Minimum carbon concentration in the database for organic soil used by Moyano et al 
    2030     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT  
    2031     !Config Def   = 0.06 
    2032     !Config Help  =  
    2033     !Config Units = [gC/g soil] 
    2034     CALL getin_p('LIMIT_CARBON_ORGA',limit_carbon_orga)     
    2035     !     
    2036     !Config Key   = MAX_CLAY_MOYANO 
    2037     !Config Desc  = Maximum clay fraction in the database used by Moyano et al 
    2038     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT  
    2039     !Config Def   = 0.58 
    2040     !Config Help  =  
    2041     !Config Units = [-] 
    2042     CALL getin_p('MAX_CLAY_MOYANO',max_clay_moyano) 
    2043     !     
    2044     !Config Key   = MIN_CLAY_MOYANO 
    2045     !Config Desc  = Minimum clay fraction in the database used by Moyano et al 
    2046     !Config If    = OK_STOMATE, OK_MOYANO_SOILHUMSAT  
    2047     !Config Def   = 0.03 
    2048     !Config Help  =  
    2049     !Config Units = [-] 
    2050     CALL getin_p('MIN_CLAY_MOYANO',min_clay_moyano) 
     1864 
    20511865    !- 
    20521866    ! lpj parameters 
  • branches/ORCHIDEE_2_2/ORCHIDEE/src_parameters/constantes_var.f90

    r8418 r8423  
    702702!$OMP THREADPRIVATE(veget_year_orig) 
    703703   
    704  REAL(r_std), SAVE :: bulk_default = 1000.0           !! Default value for bulk density of soil (kg/m3) 
    705 !$OMP THREADPRIVATE(bulk_default) 
    706704  REAL(r_std), SAVE :: min_vegfrac = 0.001           !! Minimal fraction of mesh a vegetation type can occupy (0-1, unitless) 
    707705!$OMP THREADPRIVATE(min_vegfrac) 
     
    10241022!$OMP THREADPRIVATE(moistcont_min) 
    10251023 
    1026   ! 4. Moyano et la. 2012 Biogeosciences 
    1027  
    1028   LOGICAL, SAVE :: ok_moyano_soilhumsat = .FALSE.  !! Use soilhumSAT and Moyano formulation for control_moist 
    1029 !$OMP THREADPRIVATE(ok_moyano_soilhumsat) 
    1030   LOGICAL, SAVE :: ok_orga = .TRUE.                !! Do we use also the equation designed for organic soils by Moyano et al. 
    1031                                                    !! for control_moist 
    1032 !$OMP THREADPRIVATE(ok_orga) 
    1033   REAL(r_std), SAVE :: beta1 = -0.26               !! 1st(Beta1*M) term of Moyano' PRSR model 2 
    1034                                                    !! for fraction of saturation Beta1= [-0.28,-0.24] 
    1035 !$OMP THREADPRIVATE(beta1) 
    1036   REAL(r_std), SAVE :: beta2 = 0.32                !! 2nd(Beta2*M^2) term of Moyano' PRSR model 2 
    1037                                                    !! for fraction of saturation Beta2= [0.28,0.36] 
    1038 !$OMP THREADPRIVATE(beta2) 
    1039   REAL(r_std), SAVE :: beta3 = -0.15               !! 3rd(Beta3*M^3) term of Moyano' PRSR model 2 
    1040                                                    !! for fraction of saturation Beta3= [-0.18,-0.12] 
    1041 !$OMP THREADPRIVATE(beta3) 
    1042   REAL(r_std), SAVE :: beta1_orga = -0.67          !! 1st(Beta1*M) term of Moyano' PRSR model 3 
    1043                                                    !! for fraction of saturation Beta1= [-0.65,-0.69] 
    1044 !$OMP THREADPRIVATE(beta1_orga) 
    1045   REAL(r_std), SAVE :: beta2_orga = 1.08           !! 2nd(Beta2*M^2) term of Moyano' PRSR model 3 
    1046                                                    !! for fraction of saturation Beta2= [1.03,1.13] 
    1047 !$OMP THREADPRIVATE(beta2_orga) 
    1048   REAL(r_std), SAVE :: beta3_orga = -0.57          !! 3rd(Beta3*M^3) term of Moyano' PRSR model 3 
    1049                                                    !! for fraction of saturation Beta3= [-0.54,-0.60] 
    1050 !$OMP THREADPRIVATE(beta3_orga) 
    1051   REAL(r_std), SAVE :: beta4 = 0.08                !! 4th(Beta4*clay) term of Moyano' PRSR model 2 
    1052                                                    !! for fraction of saturation Beta4= [0.07,0.09] 
    1053 !$OMP THREADPRIVATE(beta4) 
    1054   REAL(r_std), SAVE :: beta5 = -0.09               !! 5th(Beta5*M*clay) term of Moyano' PRSR model 2 
    1055                                                    !! for fraction of saturation Beta5= [-0.10,-0.08] 
    1056 !$OMP THREADPRIVATE(beta5) 
    1057   REAL(r_std), SAVE :: beta6 = 0.57                !! 6th(Beta6*SOC) term of Moyano' PRSR model 2 
    1058                                                    !! for fraction of saturation Beta6= [0.53,0.61] 
    1059 !$OMP THREADPRIVATE(beta6) 
    1060   REAL(r_std), SAVE :: intercept = 1.059           !! intercept term of Moyano' PRSR model 2 
    1061                                                    !! for fraction of saturation intercept= [1.056,1.062] 
    1062 !$OMP THREADPRIVATE(intercept) 
    1063   REAL(r_std), SAVE :: intercept_orga = 1.134      !! intercept term of Moyano' PRSR model 3 
    1064                                                    !! for fraction of saturation intercept= [1.131,1.137] 
    1065 !$OMP THREADPRIVATE(intercept_orga) 
    1066   REAL(r_std), SAVE :: SRo = 1.0                   !! Initial respiration value (SR0) arbitrary defined at 1.0  
    1067 !$OMP THREADPRIVATE(SRo) 
    1068   REAL(r_std), SAVE :: moistcontSAT_min = 0.0      !! minimum soil wetness to limit the heterotrophic respiration 
    1069 !$OMP THREADPRIVATE(moistcontSAT_min) 
    1070   REAL(r_std), SAVE :: soilheight = 0.10           !! soil height in meter to converte totalSOC  
    1071                                                    !! from gC/m2soil to gC/gsoil [0.10, 0.20, 0.30, 0.50, 1m]  
    1072 !$OMP THREADPRIVATE(soilheight) 
    1073   REAL(r_std), SAVE :: Cini_Moyano = 1000_r_std !!Initial carbon content for Moyano equation  (kgC/m3) 
    1074 !$OMP THREADPRIVATE(Cini_Moyano) 
    1075   REAL(r_std), SAVE :: Litterini_Moyano = 1000_r_std !!Initial litter carbon content for Moyano equation  (kgC/m3) 
    1076 !$OMP THREADPRIVATE(Litterini_Moyano) 
    1077   REAL(r_std), SAVE :: min_carbon_moyano = 0.01   !! Minimum carbon concentration in the database  
    1078                                                   !! used by Moyano et al (gC/gSoil) 
    1079 !$OMP THREADPRIVATE(min_carbon_moyano) 
    1080   REAL(r_std), SAVE :: max_carbon_moyano = 0.35   !! Maximum carbon concentration in the database  
    1081                                                   !! used by Moyano et al (gC/gSoil) 
    1082 !$OMP THREADPRIVATE(max_carbon_moyano) 
    1083   REAL(r_std), SAVE :: limit_carbon_orga = 0.06   !! Minimum carbon concentration in the database  
    1084                                                   !! for organic soil used by Moyano et al (gC/gSoil) 
    1085 !$OMP THREADPRIVATE(limit_carbon_orga) 
    1086   REAL(r_std), SAVE :: min_clay_moyano = 0.03     !! Minimum clay fraction in the database used by Moyano et al (unitless) 
    1087 !$OMP THREADPRIVATE(min_clay_moyano) 
    1088   REAL(r_std), SAVE :: max_clay_moyano = 0.58     !! Maximum clay fraction in the database used by Moyano et al (unitless) 
    1089 !$OMP THREADPRIVATE(max_clay_moyano) 
     1024 
    10901025  ! 
    10911026  ! stomate_lpj.f90 
  • branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba/hydrol.f90

    r8418 r8423  
    415415  REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:)    :: soil_wet_litter  !! Soil wetness aove mvw in the litter (0-1, unitless) 
    416416!$OMP THREADPRIVATE(soil_wet_litter) 
    417   REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:)    :: soil_wet_litterSAT!!Soil wetness above mvw in the litter (0-1, unitless) 
    418                                                                           !! with respect to(tmc_litter_sat-tmc_litter_wilt) 
    419 !$OMP THREADPRIVATE(soil_wet_litterSAT) 
    420417  REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:,:)  :: qflux_ns         !! Diffusive water fluxes between soil layers 
    421418                                                                         !! (at lower interface) 
     
    575572       & tot_melt, transpir, precip_rain, precip_snow, returnflow, reinfiltration, irrigation, & 
    576573       & humrel, vegstress, drysoil_frac, evapot, evapot_penm, evap_bare_lim, evap_bare_lim_ns, & 
    577        & flood_frac, flood_res,shumdiagSAT,litterhumdiagSAT, & 
     574       & flood_frac, flood_res, & 
    578575       & shumdiag,shumdiag_perma, k_litt, litterhumdiag, soilcap, soiltile, fraclut, reinf_slope_soil, rest_id, hist_id, hist2_id,& 
    579576       & contfrac, stempdiag, & 
     
    653650                                                                           !! with respect to (mcfc-mcw) 
    654651                                                                           !! (unitless; can be out of 0-1) 
    655     REAL(r_std),DIMENSION (kjpindex,nslm), INTENT (out):: shumdiagSAT      !! Relative soil moisture in each soil layer  
    656                                                                            !! with respect to (mcs-mcw) 
    657                                                                            !! (unitless; can be out of 0-1) 
    658                                                                            !! used in Stomate, for Moyano et al 2012 equation 
    659652    REAL(r_std),DIMENSION (kjpindex,nslm), INTENT (out):: shumdiag_perma   !! Percent of porosity filled with water (mc/mcs) used for the thermal computations  
    660653    REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: k_litt           !! litter approximate conductivity 
    661654    REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: litterhumdiag    !! litter humidity 
    662     REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: litterhumdiagSAT !!litter humidity  
    663                                                                            !! with respect to(tmc_litter_sat-tmc_litter_wilt)  
    664655    REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: tot_melt         !! Total melt     
    665656    REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: floodout         !! Flux out of floodplains 
     
    815806         transpir, vevapnu, evapot, evapot_penm, runoff, drainage, &  
    816807         returnflow, reinfiltration, irrigation, & 
    817          tot_melt,evap_bare_lim,evap_bare_lim_ns,shumdiagSAT, shumdiag, shumdiag_perma, & 
    818          k_litt,litterhumdiagSAT, litterhumdiag, humrel, vegstress, drysoil_frac,& 
     808         tot_melt,evap_bare_lim,evap_bare_lim_ns, shumdiag, shumdiag_perma, & 
     809         k_litt, litterhumdiag, humrel, vegstress, drysoil_frac,& 
    819810         stempdiag,snow,snowdz, tot_bare_soil,  u, v, tq_cdrag, & 
    820811         mc_layh, mcl_layh, root_deficit, veget) 
     
    17811772    ALLOCATE (soil_wet_litter(kjpindex,nstm),stat=ier) 
    17821773    IF (ier /= 0) CALL ipslerr_p(3,'hydrol_init','Problem in allocate of variable soil_wet_litter','','') 
    1783  
    1784     ALLOCATE (soil_wet_litterSAT(kjpindex,nstm),stat=ier) 
    1785     IF (ier /= 0) CALL ipslerr_p(3,'hydrol_init','Problem in allocate of variable soil_wet_litterSAT','','')  
    17861774 
    17871775    ALLOCATE (qflux_ns(kjpindex,nslm,nstm),stat=ier)  
     
    24032391    IF (ALLOCATED  (soil_wet_ns)) DEALLOCATE (soil_wet_ns) 
    24042392    IF (ALLOCATED  (soil_wet_litter)) DEALLOCATE (soil_wet_litter) 
    2405     IF (ALLOCATED  (soil_wet_litterSAT)) DEALLOCATE (soil_wet_litterSAT) 
    24062393    IF (ALLOCATED  (qflux_ns)) DEALLOCATE (qflux_ns) 
    24072394    IF (ALLOCATED  (tmat)) DEALLOCATE (tmat) 
     
    36743661       & transpir, vevapnu, evapot, evapot_penm, runoff, drainage, & 
    36753662       & returnflow, reinfiltration, irrigation, & 
    3676        & tot_melt, evap_bare_lim, evap_bare_lim_ns,shumdiagSAT, shumdiag, shumdiag_perma,& 
    3677        & k_litt,litterhumdiagSAT, litterhumdiag, humrel,vegstress, drysoil_frac, & 
     3663       & tot_melt, evap_bare_lim, evap_bare_lim_ns, shumdiag, shumdiag_perma,& 
     3664       & k_litt, litterhumdiag, humrel,vegstress, drysoil_frac, & 
    36783665       & stempdiag,snow, & 
    36793666       & snowdz, tot_bare_soil, u, v, tq_cdrag, mc_layh, mcl_layh, root_deficit, veget) 
     
    37373724    REAL(r_std), DIMENSION (kjpindex,nslm), INTENT (out)     :: shumdiag         !! Relative soil moisture in each diag soil layer  
    37383725                                                                                 !! with respect to (mcfc-mcw) (unitless, [0-1]) 
    3739     REAL(r_std), DIMENSION (kjpindex,nslm), INTENT (out)     :: shumdiagSAT      !! Relative soil moisture in each diag soil layer  
    3740                                                                                  !! with respect to(mcs-mcw)(unitless,[0-1])  
    3741                                                                                  !! used in stomate for Moyano et al 2012 equation 
    37423726    REAL(r_std), DIMENSION (kjpindex,nslm), INTENT (out)     :: shumdiag_perma   !! Percent of porosity filled with water (mc/mcs) 
    37433727                                                                                 !! in each diag soil layer (for the thermal computations) 
     
    37473731    REAL(r_std), DIMENSION (kjpindex), INTENT (out)          :: litterhumdiag    !! Mean of soil_wet_litter across soil tiles 
    37483732                                                                                 !! (unitless, [0-1]) 
    3749     REAL(r_std), DIMENSION (kjpindex), INTENT (out)          ::litterhumdiagSAT  !! Mean of soil_wet_litterSAT across soil tiles 
    3750                                                                                  !!(unitless, [0-1]) 
    3751                                                                                  !! with respect to(tmc_litter_sat-tmc_litter_wilt)  
    37523733    REAL(r_std), DIMENSION (kjpindex, nvm), INTENT(out)      :: vegstress        !! Veg. moisture stress (only for vegetation  
    37533734                                                                                 !! growth) (unitless, [0-1]) 
     
    44234404       END DO 
    44244405 
    4425        ! Subsequent calculation of soil_wet_litterSAT (tmc-tmcw)/(tmcs-tmcw) 
    4426        ! Based on liquid water content 
    4427        DO ji=1,kjpindex 
    4428           soil_wet_litterSAT(ji,jst) = MIN(un, MAX(zero,& 
    4429                & (tmc_litter(ji,jst)-tmc_litter_wilt(ji,jst)) / & 
    4430                & (tmc_litter_sat(ji,jst)-tmc_litter_wilt(ji,jst)) )) 
    4431        END DO 
    4432  
    4433  
    44344406       ! Preliminary calculation of various soil moistures (for each layer, in kg/m2) 
    44354407       sm(:,1)  = dz(2) * (trois*mcl(:,1,jst) + mcl(:,2,jst))/huit 
     
    46524624        
    46534625       ! For consistency in stomate, we also set moderwilt and soil_wet_ns to zero in this case.  
    4654        ! They are used later for shumdiag, shumdiagSAT and shumdiag_perma 
     4626       ! They are used later for shumdiag and shumdiag_perma 
    46554627       DO jsl = 1,nslm 
    46564628          WHERE (is_under_mcr(:,jst)) 
     
    46994671    !! 7. Summing 3d variables into 2d variables  
    47004672    CALL hydrol_diag_soil (ks, nvan, avan, mcr, mcs, mcfc, mcw, kjpindex, veget_max, soiltile, njsc, runoff, drainage, & 
    4701          & evapot, vevapnu, returnflow, reinfiltration, irrigation, shumdiagSAT,& 
    4702          & shumdiag,shumdiag_perma, k_litt,litterhumdiagSAT, litterhumdiag, humrel, vegstress, drysoil_frac,tot_melt) 
     4673         & evapot, vevapnu, returnflow, reinfiltration, irrigation, & 
     4674         & shumdiag,shumdiag_perma, k_litt, litterhumdiag, humrel, vegstress, drysoil_frac,tot_melt) 
    47034675 
    47044676    ! Means of wtd, runoff and drainage corrections, across soiltiles     
     
    64436415 
    64446416  SUBROUTINE hydrol_diag_soil (ks, nvan, avan, mcr, mcs, mcfc, mcw, kjpindex, veget_max, soiltile, njsc, runoff, drainage, & 
    6445        & evapot, vevapnu, returnflow, reinfiltration, irrigation,shumdiagSAT, & 
    6446        & shumdiag,shumdiag_perma, k_litt,litterhumdiagSAT, litterhumdiag, humrel, vegstress, drysoil_frac, tot_melt) 
     6417       & evapot, vevapnu, returnflow, reinfiltration, irrigation, & 
     6418       & shumdiag,shumdiag_perma, k_litt, litterhumdiag, humrel, vegstress, drysoil_frac, tot_melt) 
    64476419    !  
    64486420    ! interface description 
     
    64766448    REAL(r_std), DIMENSION (kjpindex), INTENT(out)           :: drainage        !! Drainage 
    64776449    REAL(r_std),DIMENSION (kjpindex,nslm), INTENT (out)      :: shumdiag        !! relative soil moisture 
    6478     REAL(r_std),DIMENSION (kjpindex,nslm), INTENT (out)      :: shumdiagSAT     !! relative soil moisture with respect to (mcs-mcw) 
    64796450    REAL(r_std),DIMENSION (kjpindex,nslm), INTENT (out)      :: shumdiag_perma  !! Percent of porosity filled with water (mc/mcs) used for the thermal computations 
    64806451    REAL(r_std),DIMENSION (kjpindex), INTENT (out)           :: k_litt          !! litter cond. 
    64816452    REAL(r_std),DIMENSION (kjpindex), INTENT (out)           :: litterhumdiag   !! litter humidity 
    6482     REAL(r_std),DIMENSION (kjpindex), INTENT (out)           :: litterhumdiagSAT!! litter humidity 
    6483                                                                                 !! with respect to(tmc_litter_sat-tmc_litter_wilt) 
    64846453    REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out)       :: humrel          !! Relative humidity 
    64856454    REAL(r_std), DIMENSION (kjpindex, nvm), INTENT(out)      :: vegstress       !! Veg. moisture stress (only for vegetation growth) 
     
    65276496    humtot(:) = zero 
    65286497    shumdiag(:,:)= zero 
    6529     shumdiagSAT(:,:)= zero 
    65306498    shumdiag_perma(:,:)=zero 
    65316499    k_litt(:) = zero 
    65326500    litterhumdiag(:) = zero 
    6533     litterhumdiagSAT(:) = zero 
    65346501    tmc_litt_dry_mea(:) = zero 
    65356502    tmc_litt_wet_mea(:) = zero 
     
    66046571    ! BUT THIS IS NOT USED ANYMORE WITH THE NEW BACKGROUNG ALBEDO 
    66056572    !! k_litt is calculated here as a grid-cell average (for consistency with drainage)    
    6606     !! litterhumdiag, litterhumdiagSAT, like shumdiag,shumdiagSAT is averaged over the soiltiles for transmission to stomate 
     6573    !! litterhumdiag, like shumdiag, is averaged over the soiltiles for transmission to stomate 
    66076574    DO jst=1,nstm        
    66086575       DO ji=1,kjpindex 
     
    66216588          litterhumdiag(ji) = litterhumdiag(ji) + & 
    66226589               & soil_wet_litter(ji,jst) * soiltile(ji,jst) 
    6623  
    6624           litterhumdiagSAT(ji) = litterhumdiagSAT(ji) + & 
    6625                & soil_wet_litterSAT(ji,jst) * soiltile(ji,jst) 
    66266590 
    66276591          tmc_litt_wet_mea(ji) =  tmc_litt_wet_mea(ji) + &  
     
    66956659       ENDDO 
    66966660    ENDDO 
    6697  
    6698     ! ShumdiagSAT: we start from soil_wet_ns, 
    6699     !  do a spatial average, excluding the nobio fraction on which stomate doesn't act 
    6700     DO jst=1,nstm 
    6701        DO jsl=1,nslm 
    6702           DO ji=1,kjpindex 
    6703              shumdiagSAT(ji,jsl) = shumdiagSAT(ji,jsl) + soil_wet_ns(ji,jsl,jst) * soiltile(ji,jst)  
    6704              shumdiagSAT(ji,jsl) = MAX(MIN(shumdiagSAT(ji,jsl), un), zero) 
    6705           ENDDO 
    6706        ENDDO 
    6707     ENDDO 
    6708  
     6661     
    67096662    ! Shumdiag_perma is based on soilmoist / moisture at saturation in the layer 
    67106663    ! Her we start from grid averages by hydrol soil layer and transform it to the diag levels 
  • branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba/sechiba.f90

    r8418 r8423  
    140140                                                                     !! by thermosoil.f90 (unitless, 0-1) 
    141141!$OMP THREADPRIVATE(shumdiag) 
    142   REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:)  :: shumdiagSAT    !! Mean relative soil moisture (0-1, unitless)  
    143                                                                      !! with respect to(mcs-mcw) 
    144 !$OMP THREADPRIVATE(shumdiagSAT)  
    145142  REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:)  :: shumdiag_perma !! Saturation degree of the soil  
    146143!$OMP THREADPRIVATE(shumdiag_perma) 
     
    149146  REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:)    :: litterhumdiag  !! Litter dryness factor (unitless, 0-1) 
    150147!$OMP THREADPRIVATE(litterhumdiag) 
    151   REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:)    :: litterhumdiagSAT!! Litter dryness factor (unitless, 0-1) 
    152 !$OMP THREADPRIVATE(litterhumdiagSAT) 
    153148  REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:)  :: stempdiag      !! Temperature which controls canopy evolution (K) 
    154149!$OMP THREADPRIVATE(stempdiag) 
     
    770765         & tot_melt, transpir, precip_rain, precip_snow, returnflow, reinfiltration, irrigation, & 
    771766         & humrel, vegstress, drysoil_frac, evapot, evapot_corr, evap_bare_lim, evap_bare_lim_ns, flood_frac, flood_res, & 
    772          & shumdiagSAT,litterhumdiagSAT,shumdiag,shumdiag_perma, k_litt, litterhumdiag, soilcap, soiltile, fraclut, reinf_slope,& 
     767         & shumdiag,shumdiag_perma, k_litt, litterhumdiag, soilcap, soiltile, fraclut, reinf_slope_soil,& 
    773768         & rest_id, hist_id, hist2_id,& 
    774769         & contfrac, stempdiag, & 
     
    825820    CALL slowproc_main (kjit, kjpij, kjpindex, & 
    826821         index, indexveg, lalo, neighbours, resolution, contfrac, soiltile, fraclut, nwdFraclut, & 
    827          temp_air, temp_sol, stempdiag,shumdiagSAT,litterhumdiagSAT, & 
     822         temp_air, temp_sol, stempdiag, & 
    828823         vegstress, shumdiag, litterhumdiag, precip_rain, precip_snow, gpp, & 
    829824         deadleaf_cover, & 
     
    17701765    ALLOCATE (shumdiag(kjpindex,nslm),stat=ier) 
    17711766    IF (ier /= 0) CALL ipslerr_p(3,'sechiba_init','Pb in alloc for shumdiag','','') 
    1772  
    1773     ALLOCATE (shumdiagSAT(kjpindex,nslm),stat=ier) 
    1774     IF (ier /= 0) CALL ipslerr_p(3,'sechiba_init','Pb in alloc for shumdiagSAT','','') 
    17751767     
    17761768    ALLOCATE (shumdiag_perma(kjpindex,nslm),stat=ier) 
     
    17791771    ALLOCATE (litterhumdiag(kjpindex),stat=ier) 
    17801772    IF (ier /= 0) CALL ipslerr_p(3,'sechiba_init','Pb in alloc for litterhumdiag','','') 
    1781  
    1782     ALLOCATE (litterhumdiagSAT(kjpindex),stat=ier) 
    1783     IF (ier /= 0) CALL ipslerr_p(3,'sechiba_init','Pb in alloc for litterhumdiagSAT','','') 
    17841773 
    17851774    ALLOCATE (ptnlev1(kjpindex),stat=ier) 
     
    20322021    IF ( ALLOCATED (co2_flux)) DEALLOCATE (co2_flux) 
    20332022    IF ( ALLOCATED (shumdiag)) DEALLOCATE (shumdiag) 
    2034     IF ( ALLOCATED (shumdiagSAT)) DEALLOCATE (shumdiagSAT) 
    20352023    IF ( ALLOCATED (shumdiag_perma)) DEALLOCATE (shumdiag_perma) 
    20362024    IF ( ALLOCATED (litterhumdiag)) DEALLOCATE (litterhumdiag) 
    2037     IF ( ALLOCATED (litterhumdiagSAT)) DEALLOCATE (litterhumdiagSAT) 
    20382025    IF ( ALLOCATED (ptnlev1)) DEALLOCATE (ptnlev1) 
    20392026    IF ( ALLOCATED (k_litt)) DEALLOCATE (k_litt) 
  • branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba/slowproc.f90

    r8418 r8423  
    7272  REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:)      :: siltfraction        !! Siltfraction (0-1, unitless) 
    7373!$OMP THREADPRIVATE(siltfraction)   
    74   REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:)      :: bulk                !!Bulk density (kg/m**3)  
    75 !$OMP THREADPRIVATE(bulk)    
    7674  REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:,:)  :: laimap              !! LAI map when the LAI is prescribed and not calculated by STOMATE 
    7775!$OMP THREADPRIVATE(laimap) 
     
    139137     
    140138    !! 2. Prepare for reading of PFTmap file 
    141          !!  
    142          !! 2.1 Prepare for reading of bulk variable  
    143          !!  
    144      IF (ok_moyano_soilhumsat) THEN  
    145          ! Get the file name from run.def file and set file attributes accordingly  
    146          filename = 'soil_bulk_and_ph.nc'   
    147          CALL getin_p('SOIL_BULK_FILE',filename)   
    148          name = filename(1:LEN_TRIM(FILENAME)-3)  
    149          CALL xios_orchidee_set_file_attr("soilbulk_file",name=name)  
    150        
    151          ! Set variables that can be used in the xml files  
    152          lerr=xios_orchidee_setvar('bulk_default',bulk_default)  
    153            
    154          ! Determine if the file will be read by XIOS. If not,deactivate reading of the file.      
    155          IF (xios_interpolation .AND. restname_in=='NONE' .AND. .NOT. impsoilt) THEN  
    156             ! Reading will be done with XIOS later  
    157             IF (printlev>=2) WRITE(numout,*) 'Reading of soilbulk file will be done later using XIOS. The filename is ', filename  
    158         ELSE  
    159             ! No reading by XIOS, deactivate soilbulk file and related variables declared in context_input_orchidee.xml.  
    160             ! If this is not done, the model will crash if the file is not available in the run directory.  
    161             IF (printlev>=2) WRITE(numout,*) 'Reading of soil_bulk file will not be done with XIOS.'  
    162             CALL xios_orchidee_set_file_attr("soilbulk_file",enabled=.FALSE.)  
    163             CALL xios_orchidee_set_field_attr("soilbulk",enabled=.FALSE.)  
    164             CALL xios_orchidee_set_field_attr("soilbulk_mask",enabled=.FALSE.)  
    165          END IF  
    166      ELSE 
    167          ! Not needed if the flag is not activated, deactivate soilbulk file and related variables 
    168          ! declared in context_input_orchidee.xml.  
    169          ! If this is not done, the model will crash if the file is not 
    170          ! available in the run directory.  
    171          IF (printlev>=2) WRITE(numout,*) 'Reading of soil_bulk file will not be done with XIOS.' 
    172          CALL xios_orchidee_set_file_attr("soilbulk_file",enabled=.FALSE.) 
    173          CALL xios_orchidee_set_field_attr("soilbulk",enabled=.FALSE.) 
    174          CALL xios_orchidee_set_field_attr("soilbulk_mask",enabled=.FALSE.) 
    175       END IF 
    176            
    177     !!  
    178     !! 2.2 Prepare for reading of PFTmap file  
    179     !!  
    180  
    181139    filename = 'PFTmap.nc' 
    182140    CALL getin_p('VEGETATION_FILE',filename) 
     
    419377             rest_id_stom,   hist_id_stom,           hist_id_stom_IPCC,               & 
    420378             indexLand,      lalo,                   neighbours,   resolution,        & 
    421              contfrac,       totfrac_nobio,          clayfraction, bulk,              & 
    422              temp_air,       lai,                    veget,        veget_max,         & 
     379             contfrac,       totfrac_nobio,          clayfraction, temp_air,          & 
     380             lai,            veget,                  veget_max,                       & 
    423381             deadleaf_cover,         assim_param,  temp_growth ) 
    424382    ENDIF 
     
    520478  SUBROUTINE slowproc_main (kjit, kjpij, kjpindex, & 
    521479       IndexLand, indexveg, lalo, neighbours, resolution, contfrac, soiltile, fraclut, nwdFraclut, & 
    522        temp_air, temp_sol, stempdiag, shumdiagSAT,litterhumdiagSAT, & 
     480       temp_air, temp_sol, stempdiag, & 
    523481       humrel, shumdiag, litterhumdiag, precip_rain, precip_snow, gpp, & 
    524482       deadleaf_cover, & 
     
    553511    REAL(r_std),DIMENSION (kjpindex,nslm), INTENT (in)  :: stempdiag           !! Soil temperature (K) 
    554512    REAL(r_std),DIMENSION (kjpindex,nslm), INTENT (in)  :: shumdiag            !! Relative soil moisture (0-1, unitless) 
    555     REAL(r_std),DIMENSION (kjpindex,nslm), INTENT (in)  :: shumdiagSAT         !! Relative soil moisture (0-1, unitless) 
    556                                                                                !! with respect to(mcs-mcw) 
    557513    REAL(r_std),DIMENSION (kjpindex), INTENT (in)       :: litterhumdiag       !! Litter humidity  (0-1, unitless) 
    558     REAL(r_std),DIMENSION (kjpindex), INTENT (in)       :: litterhumdiagSAT    !! Litter humidity  (0-1, unitless)  
    559                                                                                !!with respect to(tmc_litter_sat-tmc_litter_wilt) 
    560514    REAL(r_std),DIMENSION (kjpindex), INTENT (in)       :: precip_rain         !! Rain precipitation (mm dt_stomate^{-1}) 
    561515    REAL(r_std),DIMENSION (kjpindex), INTENT (in)       :: precip_snow         !! Snow precipitation (mm dt_stomate^{-1}) 
     
    673627 
    674628       !! 4.1 Call stomate main routine that will call all c-cycle routines       ! 
    675  
    676629       CALL stomate_main (kjit, kjpij, kjpindex, & 
    677630            IndexLand, lalo, neighbours, resolution, contfrac, totfrac_nobio, clayfraction, & 
    678             bulk, temp_air, temp_sol, stempdiag, humrel, shumdiag, shumdiagSAT, litterhumdiag, & 
    679             litterhumdiagSAT, precip_rain, precip_snow, gpp, & 
     631            temp_air, temp_sol, stempdiag, & 
     632            humrel, shumdiag, litterhumdiag, precip_rain, precip_snow, gpp, & 
    680633            deadleaf_cover, & 
    681634            assim_param, & 
     
    685638            co2_flux, fco2_lu, fco2_wh, fco2_ha, & 
    686639            resp_maint, resp_hetero, resp_growth, temp_growth) 
     640 
    687641 
    688642       !! 4.2 Output the respiration terms and the net primary 
     
    911865    ! counter, vegetation fraction, max vegetation fraction, LAI 
    912866    ! variable from stomate, fraction of bare soil, soiltype 
    913     ! fraction, clay fraction,bulk density, height of vegetation, map of LAI 
     867    ! fraction, clay fraction, height of vegetation, map of LAI 
    914868     
    915869    CALL restput_p (rest_id, 'veget', nbp_glo, nvm, 1, kjit, veget, 'scatter',  nbp_glo, index_g) 
     
    950904    CALL restput_p (rest_id, 'clay_frac', nbp_glo, 1, 1, kjit, clayfraction, 'scatter',  nbp_glo, index_g) 
    951905    CALL restput_p (rest_id, 'sand_frac', nbp_glo, 1, 1, kjit, sandfraction, 'scatter',  nbp_glo, index_g) 
    952     CALL restput_p (rest_id, 'bulk', nbp_glo, 1, 1, kjit, bulk, 'scatter',  nbp_glo,index_g)  
    953906    !salma: added the following lines for restput of the soil parameters 
    954907    CALL restput_p (rest_id, 'ks', nbp_glo, 1, 1, kjit, ks, 'scatter',  nbp_glo, index_g) 
     
    976929    ! 2.2 Write restart variables managed by STOMATE 
    977930    IF ( ok_stomate ) THEN 
    978        CALL stomate_finalize (kjit, kjpindex, indexLand, clayfraction, bulk, assim_param)  
     931       CALL stomate_finalize (kjit, kjpindex, indexLand, clayfraction, assim_param)  
    979932    ENDIF 
    980933     
     
    11041057    siltfraction(:)=undef_sechiba 
    11051058 
    1106     ALLOCATE (bulk(kjpindex),stat=ier) 
    1107     IF (ier /= 0) CALL ipslerr_p(3,'slowproc_init','Problem in allocation of variable bulk','','') 
    1108     bulk(:)=undef_sechiba 
    1109  
    11101059    ! Allocation of last year vegetation fraction in case of land use change 
    11111060    ALLOCATE(veget_max_new(kjpindex, nvm), STAT=ier) 
     
    14081357          CALL slowproc_soilt(njsc, ks, nvan, avan, mcr, mcs, mcfc, mcw, kjpindex, & 
    14091358               lalo, neighbours, resolution, contfrac, soilclass, & 
    1410                clayfraction, sandfraction, siltfraction, bulk) 
     1359               clayfraction, sandfraction, siltfraction) 
    14111360           
    14121361          call_slowproc_soilt=.FALSE. 
     
    15871536    ENDIF 
    15881537 
    1589     var_name= 'bulk'  
    1590     CALL ioconf_setatt_p('UNITS', '-') 
    1591     CALL ioconf_setatt_p('LONG_NAME','Bulk density in each mesh') 
    1592     CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., bulk, "gather", nbp_glo, index_g)  
    1593  
    15941538    var_name= 'lai' 
    15951539    CALL ioconf_setatt_p('UNITS', '-') 
     
    16671611       !Config Units = [-] 
    16681612       CALL setvar_p (lai, val_exp, 'SECHIBA_LAI', llaimax) 
    1669  
    1670        !Config Key   = BULK   
    1671        !Config Desc  = Bulk density (0-dim mode)  
    1672        !Config Def   = XXX  
    1673        !Config If    = IMPOSE_VEG and IMPOSE_SOIL  
    1674        !Config Help  = Determines the bulk density in the grid box.  The bulk density  
    1675        !Config         is the weight of soil in a given volume.  
    1676        !Config Units = [-]   
    1677        CALL setvar_p (bulk, val_exp, 'BULK', bulk_default)  
    16781613 
    16791614       !Config Key   = SLOWPROC_HEIGHT 
     
    17881723    ENDIF 
    17891724     
     1725 
    17901726    !! 4.3 Dynamic irrigation map 
    17911727    !  If do_irrigation, it will look to the dynamical irrig. map in restart 
     
    19071843    IF (ALLOCATED (sandfraction)) DEALLOCATE (sandfraction) 
    19081844    IF (ALLOCATED (siltfraction)) DEALLOCATE (siltfraction) 
    1909     IF (ALLOCATED (bulk)) DEALLOCATE (bulk)  
    19101845    IF (ALLOCATED (laimap)) DEALLOCATE (laimap) 
    19111846    IF (ALLOCATED (veget_max_new)) DEALLOCATE (veget_max_new) 
     
    25962531    END IF  
    25972532 
    2598     ! Assiggning the right values and giving a value where information was not found 
     2533    ! Assigning the right values and giving a value where information was not found 
    25992534    DO ib=1,nbpt 
    26002535      IF (alaimap(ib) < min_sechiba) THEN 
     
    29962931!>\BRIEF         looks for nearest grid point on the fine map 
    29972932!! 
    2998 !! DESCRIPTION  : (definitions, functional, design, flags): 
    2999 !!            
     2933!! DESCRIPTION  : (definitions, functional, design, flags):  
     2934!! 
    30002935!! RECENT CHANGE(S): None 
    30012936!! 
     
    30683003!! 
    30693004!>\BRIEF         Interpolate the Zobler or Reynolds/USDA soil type map 
    3070 !!               Read and interpolate soil bulk from file.  
    30713005!! 
    30723006!! DESCRIPTION  : (definitions, functional, design, flags):  
     
    30763010!!                             and everything needed to read all maps and assign parameter values.   
    30773011!! 
    3078 !! MAIN OUTPUT VARIABLE(S): ::soiltype, ::clayfraction, sandfraction, siltfraction, bulk 
     3012!! MAIN OUTPUT VARIABLE(S): ::soiltype, ::clayfraction, sandfraction, siltfraction 
    30793013!! 
    30803014!! REFERENCE(S) : Reynold, Jackson, and Rawls (2000). Estimating soil water-holding capacities  
     
    30853019!! \n 
    30863020!_ ================================================================================================================================ 
    3087   SUBROUTINE slowproc_soilt(njsc,  ks,  nvan, avan, mcr, mcs, mcfc, mcw, nbpt, lalo, neighbours, resolution, contfrac, soilclass, clayfraction, sandfraction, siltfraction, bulk) 
     3021  SUBROUTINE slowproc_soilt(njsc,  ks,  nvan, avan, mcr, mcs, mcfc, mcw, nbpt, lalo, neighbours, resolution, contfrac, soilclass, clayfraction, sandfraction, siltfraction) 
    30883022 
    30893023    USE interpweight 
     
    31273061    REAL(r_std), INTENT(out)      :: sandfraction(nbpt)     !! The fraction of sand (for SP-MIP) 
    31283062    REAL(r_std), INTENT(out)      :: siltfraction(nbpt)     !! The fraction of silt (for SP-MIP) 
    3129     REAL(r_std), INTENT(out)      :: bulk(nbpt)             !! Bulk density  as used by STOMATE  
    31303063    ! 
    31313064    ! 
     
    31553088    CHARACTER(LEN=80)                                    :: spmipexp          !! designing the number of sp-mip experiment 
    31563089    CHARACTER(LEN=80)                                    :: unif_case               !! designing the model of experiment 4 (sp_mip) 
    3157     REAL(r_std), DIMENSION(nbpt)                         :: abulkph          !!Availability of the bulk and ph interpolation  
     3090 
    31583091    REAL(r_std)                                          :: vmin, vmax       !! min/max values to use for the  
    31593092 
     
    31803113                                                                             !!   `maskingtype')  
    31813114    CHARACTER(LEN=250)                                   :: namemaskvar      !! name of the variable to use to mask  
    3182     CHARACTER(LEN=80)                                    :: fieldname        !!name of the field read for the bulk density map 
    31833115    INTEGER(i_std), DIMENSION(:), ALLOCATABLE            :: vecpos 
    31843116    REAL(r_std)                                          :: sgn              !! sum of fractions excluding glaciers and ocean 
     
    37053637                      IF ( (solt(ilf) .LE. nscm) .AND. (solt(ilf) .GT. 0) ) THEN 
    37063638                         soilclass(ib,solt(ilf)) = textrefrac(ib,solt(ilf)) 
    3707                          clayfraction(ib) = clayfraction(ib) + textfrac_table(solt(ilf),3) * & 
     3639                         clayfraction(ib) = clayfraction(ib) + textfrac_table(solt(ilf),3) *                & 
    37083640                              textrefrac(ib,solt(ilf)) 
    37093641                         sandfraction(ib) = sandfraction(ib) + textfrac_table(solt(ilf),2) * & 
     
    37563688 
    37573689       ENDIF        !      xios_interpolation 
    3758  
    3759     !!  
    3760     !! Read and interpolate soil bulk and soil ph using IOIPSL or XIOS  
    3761     !! 
    3762     IF (ok_moyano_soilhumsat) THEN 
    3763        IF (xios_interpolation) THEN  
    3764          ! Read and interpolate using XIOS  
    3765      
    3766            ! Check if the restart file for sechiba is read.  
    3767            ! Reading of soilbulk and soilph with XIOS is only activated if restname==NONE.  
    3768            IF (restname_in /= 'NONE') THEN  
    3769               CALL ipslerr_p(3,'slowproc_soilt','soilbulk and soilph can not be read with XIOS if sechiba restart file exist', & 
    3770               'Remove sechiba restart file and start again','')  
    3771            END IF  
    3772       
    3773            IF (printlev_loc>=3) WRITE (numout,*) 'slowproc_soilt:Read soilbulk and soilph with XIOS'  
    3774            CALL xios_orchidee_recv_field('soilbulk', bulk)  
    3775        ELSE  
    3776        ! Read using IOIPSL and interpolate using aggregate tool in ORCHIDEE  
    3777            IF (printlev_loc>=3) WRITE (numout,*) 'slowproc_soilt:Read soilbulk and soilph with IOIPSL'       
    3778            !! Read soilbulk  
    3779       
    3780            !Config Key   = SOIL_BULK_FILE  
    3781            !Config Desc  = Name of file from which soil bulk should be read  
    3782            !Config Def   = soil_bulk_and_ph.nc  
    3783            !Config If    =   
    3784            !Config Help  =   
    3785            !Config Units = [FILE]  
    3786  
    3787        ! By default, bulk and ph is stored in the same file but they could be 
    3788        ! separated if needed.  
    3789            filename = 'soil_bulk_and_ph.nc'  
    3790            CALL getin_p('SOIL_BULK_FILE',filename)  
    3791       
    3792            variablename = 'soilbulk'  
    3793            ! Name of the longitude and latitude in the input file  
    3794            lonname = 'nav_lon'  
    3795            latname = 'nav_lat'  
    3796            vmin=0  ! not used in interpweight_2Dcont  
    3797            vmax=0  ! not used in interpweight_2Dcont  
    3798       
    3799            ! Should negative values be set to zero from input file?  
    3800            nonegative = .FALSE.  
    3801            ! Type of mask to apply to the input data (see header for more 
    3802            ! details)  
    3803            maskingtype = 'mabove'  
    3804            ! Values to use for the masking  
    3805            maskvals = (/ min_sechiba, undef_sechiba, undef_sechiba/)  
    3806            ! Name of the variable with the values for the mask in the input file 
    3807            ! (only if maskkingtype='var') ( not used)  
    3808            namemaskvar = ''  
    3809            ! Type of calculation of cell fractions  
    3810            fractype = 'default'  
    3811  
    3812               IF (printlev_loc >= 1) WRITE(numout,*) "slowproc_soilt: Read and interpolate " & 
    3813                    // TRIM(filename) // " for variable " // TRIM(variablename) 
    3814  
    3815  
    3816            CALL interpweight_2Dcont(nbpt, 0, 0, lalo, resolution,neighbours,                           &     
    3817                 contfrac, filename, variablename, lonname, latname,vmin, vmax,nonegative, maskingtype,    &     
    3818                 maskvals, namemaskvar, -1, fractype, bulk_default,undef_sechiba,                       & 
    3819                 bulk, abulkph)  
    3820            WRITE(numout,*) 'bulk density map is read _______' 
    3821  
    3822  
    3823        ENDIF        !      xios_interpolation 
    3824     ENDIF 
    3825  
    3826        DO ib = 1, nbpt 
    3827           njsc(ib) = MAXLOC(soilclass(ib,:),1) 
    3828        ENDDO 
    38293690 
    38303691       ! End of soil texture reading, for 'maps' and classical behavior 
     
    39573818    CALL xios_orchidee_send_field("interp_diag_njsc",REAL(njsc, r_std)) 
    39583819    CALL xios_orchidee_send_field("interp_diag_clayfraction",clayfraction) 
    3959     CALL xios_orchidee_send_field("interp_diag_bulk",bulk) 
    39603820    CALL xios_orchidee_send_field("interp_diag_sandfraction",sandfraction) 
    39613821    CALL xios_orchidee_send_field("interp_diag_siltfraction",siltfraction) 
  • branches/ORCHIDEE_2_2/ORCHIDEE/src_stomate/stomate.f90

    r8418 r8423  
    644644         rest_id_stom,   hist_id_stom,      hist_id_stom_IPCC,               & 
    645645         index,          lalo,              neighbours,   resolution,        & 
    646          contfrac,       totfrac_nobio,     clay,         bulk,              & 
    647          temp_air,       lai,               veget,        veget_max,         & 
     646         contfrac,       totfrac_nobio,     clay,         temp_air,          & 
     647         lai,            veget,             veget_max,                       & 
    648648         deadleaf_cover,    assim_param,  temp_growth ) 
    649649 
     
    665665    REAL(r_std),DIMENSION(kjpindex),INTENT(in)      :: totfrac_nobio     !! Fraction of grid cell covered by lakes, land ice, cities, ... (unitless)  
    666666    REAL(r_std),DIMENSION(kjpindex),INTENT(in)      :: clay              !! Clay fraction of soil (0-1, unitless) 
    667     REAL(r_std),DIMENSION(kjpindex),INTENT(in)      :: bulk              !! Bulk density (kg/m**3)   
    668667    REAL(r_std),DIMENSION(kjpindex),INTENT(in)      :: temp_air          !! Air temperature at first atmospheric model layer (K) 
    669668    REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in)  :: lai               !! Leaf area inex @tex $(m^2 m^{-2})$ @endtex 
     
    11891188       & (kjit, kjpij, kjpindex, & 
    11901189       &  index, lalo, neighbours, resolution, contfrac, totfrac_nobio, clay, & 
    1191        &  bulk, temp_air, temp_sol, stempdiag, & 
    1192        &  humrel, shumdiag,shumdiagSAT, litterhumdiag,litterhumdiagSAT, precip_rain, precip_snow, & 
     1190       &  temp_air, temp_sol, stempdiag, & 
     1191       &  humrel, shumdiag, litterhumdiag, precip_rain, precip_snow, & 
    11931192       &  gpp, deadleaf_cover, assim_param, & 
    11941193       &  lai, frac_age, height, veget, veget_max, & 
     
    12261225                                                                         !! ice, cities, ... (unitless)  
    12271226    REAL(r_std),DIMENSION(kjpindex),INTENT(in)      :: clay              !! Clay fraction of soil (0-1, unitless) 
    1228     REAL(r_std),DIMENSION(kjpindex),INTENT(in)      :: bulk              !! Bulk density (kg/m**3)   
    12291227    REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in)  :: humrel            !! Relative humidity ("moisture availability")  
    12301228                                                                         !! (0-1, unitless)  
     
    12331231    REAL(r_std),DIMENSION(kjpindex,nslm),INTENT(in) :: stempdiag         !! Soil temperature (K) 
    12341232    REAL(r_std),DIMENSION(kjpindex,nslm),INTENT(in) :: shumdiag          !! Relative soil moisture (0-1, unitless) 
    1235     REAL(r_std),DIMENSION(kjpindex,nslm),INTENT(in) :: shumdiagSAT       !! Relative soil moisture (0-1, unitless) 
    1236                                                                          !! with respect to(mcs-mcw) 
    12371233    REAL(r_std),DIMENSION(kjpindex),INTENT(in)      :: litterhumdiag     !! Litter humidity (0-1, unitless) 
    1238     REAL(r_std),DIMENSION(kjpindex),INTENT(in)      :: litterhumdiagSAT  !! Litter humidity (0-1, unitless) 
    1239                                                                          !! with respect to(tmc_litter_sat-tmc_litter_wilt) 
    12401234    REAL(r_std),DIMENSION(kjpindex),INTENT(in)      :: precip_rain       !! Rain precipitation   
    12411235                                                                         !! @tex $(mm dt_stomate^{-1})$ @endtex  
     
    13751369 
    13761370!_ ================================================================================================================================ 
    1377     
    1378   
     1371     
    13791372  !! 1. Initialize variables 
    13801373 
     
    14941487    CALL littercalc (kjpindex, & 
    14951488         turnover_littercalc, bm_to_littercalc, & 
    1496          veget_cov_max, temp_sol, stempdiag, shumdiag, litterhumdiag,shumdiagSAT,litterhumdiagSAT, & 
     1489         veget_cov_max, temp_sol, stempdiag, shumdiag, litterhumdiag, & 
    14971490         litterpart, litter, dead_leaves, lignin_struc, & 
    14981491         deadleaf_cover, resp_hetero_litter, & 
    14991492         soilcarbon_input_inst, control_temp_inst, control_moist_inst, & 
    1500          matrixA, vectorB, bulk, clay, carbon) 
     1493         matrixA, vectorB) 
    15011494     
    15021495    ! Heterothropic litter respiration during time step ::dt_sechiba @tex $(gC m^{-2})$ @endtex 
     
    15581551            &          (kjpindex, dt_days, & 
    15591552            &           veget_cov, veget_cov_max, & 
    1560             &           humrel_daily, t2m_daily, tsoil_daily, & 
    1561             &           soilhum_daily, lalo, & 
     1553            &           humrel_daily, t2m_daily, tsoil_daily, soilhum_daily, lalo, & 
    15621554            &           precip_daily, npp_daily, biomass, & 
    15631555            &           turnover_daily, gpp_daily, when_growthinit, & 
     
    15701562            &           maxfpc_lastyear, maxfpc_thisyear, & 
    15711563            &           humrel_month, humrel_week, t2m_longterm, tau_longterm, & 
    1572             &           t2m_month, t2m_week, tsoil_month,soilhum_month, & 
     1564            &           t2m_month, t2m_week, tsoil_month, soilhum_month, & 
    15731565            &           npp_longterm, turnover_longterm, gpp_week, & 
    15741566            &           gdd_m5_dormance, gdd_midwinter, ncd_dormance, ngd_minus5, & 
     
    15921584            &             clay, herbivores, & 
    15931585            &             tsurf_daily, tsoil_daily, t2m_daily, t2m_min_daily, & 
    1594             &             litterhum_daily, soilhum_daily,  & 
     1586            &             litterhum_daily, soilhum_daily, & 
    15951587            &             maxhumrel_lastyear, minhumrel_lastyear, & 
    15961588            &             gdd0_lastyear, precip_lastyear, & 
     
    20212013!_ ================================================================================================================================ 
    20222014 
    2023   SUBROUTINE stomate_finalize (kjit, kjpindex, index, clay, bulk, assim_param)  
     2015  SUBROUTINE stomate_finalize (kjit, kjpindex, index, clay, assim_param)  
    20242016     
    20252017    IMPLICIT NONE 
     
    20312023    INTEGER(i_std),DIMENSION(kjpindex),INTENT(in)   :: index             !! Indices of the terrestrial pixels only (unitless) 
    20322024    REAL(r_std),DIMENSION(kjpindex),INTENT(in)      :: clay              !! Clay fraction of soil (0-1, unitless) 
    2033     REAL(r_std),DIMENSION(kjpindex),INTENT(in)      :: bulk              !! Bulk density (kg/m**3) 
    20342025    REAL(r_std),DIMENSION(kjpindex,nvm,npco2),INTENT(in) :: assim_param  !! min+max+opt temperatures (K) & vmax for photosynthesis   
    20352026 
     
    21182109         dt_days, days_since_beg, & 
    21192110         ind, adapted, regenerate, & 
    2120          humrel_daily, gdd_init_date, litterhum_daily,& 
     2111         humrel_daily, gdd_init_date, litterhum_daily, & 
    21212112         t2m_daily, t2m_min_daily, tsurf_daily, tsoil_daily, & 
    21222113         soilhum_daily, precip_daily, & 
  • branches/ORCHIDEE_2_2/ORCHIDEE/src_stomate/stomate_io.f90

    r8418 r8423  
    440440         &              .TRUE., litterhum_daily, 'gather', nbp_glo, index_g) 
    441441    IF (ALL(litterhum_daily(:) == val_exp)) litterhum_daily(:) = zero 
    442  
    443442    !- 
    444443    t2m_daily(:) = val_exp 
     
    472471         &                .TRUE., soilhum_daily, 'gather', nbp_glo, index_g) 
    473472    IF (ALL(soilhum_daily(:,:) == val_exp)) soilhum_daily(:,:) = zero 
    474  
    475473    !- 
    476474    precip_daily(:) = val_exp 
     
    606604         &              .TRUE., soilhum_month, 'gather', nbp_glo, index_g) 
    607605    IF (ALL(soilhum_month(:,:) == val_exp)) soilhum_month(:,:) = zero 
    608  
    609  
    610606    !- 
    611607    ! 6 fire probability 
     
    997993             CALL restget_p (rest_id_stomate, var_name, nbp_glo, nlitt , 1, itime, & 
    998994                  &                     .TRUE., litter(:,:,m,l,k), 'gather', nbp_glo, index_g) 
    999              IF (ok_moyano_soilhumsat)THEN 
    1000                IF (ALL(litter(:,:,m,l,k) == val_exp)) litter(:,:,m,l,k) = Litterini_Moyano 
    1001              ELSE 
    1002                IF (ALL(litter(:,:,m,l,k) == val_exp)) litter(:,:,m,l,k) = zero 
    1003              ENDIF 
     995             IF (ALL(litter(:,:,m,l,k) == val_exp)) litter(:,:,m,l,k) = zero 
    1004996          ENDDO 
    1005997       ENDDO 
     
    10211013       CALL restget_p (rest_id_stomate, var_name, nbp_glo, ncarb , 1, itime, & 
    10221014            &                   .TRUE., carbon(:,:,m), 'gather', nbp_glo, index_g) 
    1023        IF (ok_moyano_soilhumsat)THEN  
    1024           IF (ALL(carbon(:,:,m) == val_exp)) carbon(:,:,m) = Cini_Moyano 
    1025        ELSE 
    1026           IF (ALL(carbon(:,:,m) == val_exp)) carbon(:,:,m) = zero 
    1027        ENDIF 
     1015       IF (ALL(carbon(:,:,m) == val_exp)) carbon(:,:,m) = zero 
    10281016    ENDDO 
    10291017    !- 
     
    17011689    var_name = 't2m_daily' 
    17021690    CALL restput_p (rest_id_stomate, var_name, nbp_glo,    1, 1, itime, & 
    1703                     &                t2m_daily, 'scatter', nbp_glo, index_g) 
     1691         &                t2m_daily, 'scatter', nbp_glo, index_g) 
    17041692    !- 
    17051693    var_name = 't2m_min_daily' 
    17061694    CALL restput_p (rest_id_stomate, var_name, nbp_glo,    1, 1, itime, & 
    1707                     &                t2m_min_daily, 'scatter', nbp_glo, index_g) 
     1695         &                t2m_min_daily, 'scatter', nbp_glo, index_g) 
    17081696    !- 
    17091697    var_name = 'tsurf_daily' 
    17101698    CALL restput_p (rest_id_stomate, var_name, nbp_glo,    1, 1, itime, & 
    1711                     &                tsurf_daily, 'scatter', nbp_glo, index_g) 
     1699         &                tsurf_daily, 'scatter', nbp_glo, index_g) 
    17121700    !- 
    17131701    var_name = 'tsoil_daily' 
    17141702    CALL restput_p (rest_id_stomate, var_name, nbp_glo, nslm, 1, itime, & 
    1715                     &                tsoil_daily, 'scatter', nbp_glo, index_g) 
     1703         &                tsoil_daily, 'scatter', nbp_glo, index_g) 
    17161704    !- 
    17171705    var_name = 'soilhum_daily' 
  • branches/ORCHIDEE_2_2/ORCHIDEE/src_stomate/stomate_litter.f90

    r8418 r8423  
    2626 
    2727  ! modules used: 
    28   USE xios_orchidee 
     28 
    2929  USE ioipsl_para 
    3030  USE stomate_data 
     
    180180       turnover, bm_to_litter, & 
    181181       veget_cov_max, tsurf, tsoil, soilhum, litterhum, & 
    182        soilhumSAT, litterhumSAT, & 
    183182       litterpart, litter, dead_leaves, lignin_struc, & 
    184183       deadleaf_cover, resp_hetero_litter, & 
    185184       soilcarbon_input, control_temp, control_moist, & 
    186        MatrixA, VectorB, bulk, clay, carbon) 
     185       MatrixA, VectorB) 
    187186 
    188187    !! 0. Variable and parameter declaration 
     
    202201    REAL(r_std), DIMENSION(npts,nslm), INTENT(in)               :: soilhum            !! Daily soil humidity of each soil layer  
    203202                                                                                      !! (unitless) 
    204     REAL(r_std), DIMENSION(npts,nslm), INTENT(in)               :: soilhumSAT         !! Daily soil humidity of each soil layer  
    205                                                                                       !! (unitless) 
    206203    REAL(r_std), DIMENSION(npts), INTENT(in)                    :: litterhum          !! Daily litter humidity (unitless) 
    207     REAL(r_std), DIMENSION(npts), INTENT(in)                    :: litterhumSAT       !! Daily litter humidity (unitless) 
    208     REAL(r_std), DIMENSION(npts), INTENT(in)                    :: clay               !! Clay fraction (unitless, 0-1)  
    209     REAL(r_std), DIMENSION(npts),INTENT(in)                     :: bulk               !! Bulk density (kg/m**3)   
    210     REAL(r_std), DIMENSION(npts,ncarb,nvm), INTENT(in)          :: carbon             !! Soil carbon pools: active, slow, or passive, \f$(gC m^{2})$\f 
    211204 
    212205    !! 0.2 Output variables 
     
    268261    REAL(r_std), DIMENSION(npts)                                :: soilhum_decomp     !! Humidity used for decompostition in soil 
    269262                                                                                      !! (unitless) 
    270     REAL(r_std), DIMENSION(npts)                                :: soilhumSAT_decomp  !! Humidity used for decompostition in soil 
    271                                                                                       !! (unitless) for Moyano et al 2012  
    272263    REAL(r_std), DIMENSION(npts)                                :: fd                 !! Fraction of structural or metabolic litter 
    273264                                                                                      !! decomposed (unitless) 
     
    594585     
    595586    !! 4.1 above the ground: litter humidity 
    596  
    597     IF (ok_moyano_soilhumsat)THEN !!ok_moyano_soilhumsat is true 
    598        control_moist(:,iabove) = control_moist_func (npts,clay,bulk,carbon, litter ,litterhumSAT, veget_cov_max) 
    599     ELSE !ok_moyano_soilhumsat is false by default 
    600        control_moist(:,iabove) = control_moist_func (npts,clay,bulk,carbon, litter, litterhum, veget_cov_max) 
    601     ENDIF 
    602  
    603         CALL xios_orchidee_send_field("ControlMoistLitter",control_moist(:,iabove)) 
    604         CALL xios_orchidee_send_field("litterhumSAT",litterhumSAT(:)) 
     587    control_moist(:,iabove) = control_moist_func (npts, litterhum) 
     588 
    605589    ! 
    606590    !! 4.2 below: convolution of humidity and decomposer profiles 
     
    612596    !! 4.2.2 integrate over the nslm levels 
    613597    soilhum_decomp(:) = zero 
    614     soilhumSAT_decomp(:) = zero 
    615  
    616     IF (ok_moyano_soilhumsat)THEN !!ok_moyano_soilhumsat is true 
    617       DO l = 1, nslm !Loop over soil levels 
    618          soilhumSAT_decomp(:) = & 
    619               soilhumSAT_decomp(:) + soilhumSAT(:,l) * rpc(:) * & 
    620               ( EXP( -z_soil(l-1)/z_decomp ) - EXP( -z_soil(l)/z_decomp ) ) 
    621       ENDDO 
    622       control_moist(:,ibelow) = control_moist_func (npts,clay,bulk,carbon, litter, soilhumSAT_decomp,veget_cov_max) 
    623  
    624      ELSE !ok_moyano_soilhumsat is false by default 
    625       DO l = 1, nslm !Loop over soil levels 
    626  
    627          soilhum_decomp(:) = & 
    628               soilhum_decomp(:) + soilhum(:,l) * rpc(:) * & 
    629               ( EXP( -z_soil(l-1)/z_decomp ) - EXP( -z_soil(l)/z_decomp ) ) 
    630       ENDDO 
    631       control_moist(:,ibelow) = control_moist_func (npts,clay,bulk,carbon, litter, soilhum_decomp,veget_cov_max) 
    632     ENDIF 
    633  
    634         CALL xios_orchidee_send_field("ControlMoistSoil",control_moist(:,ibelow)) 
    635         CALL xios_orchidee_send_field("soilhumSAT",soilhumSAT_decomp(:)) 
     598 
     599    DO l = 1, nslm !Loop over soil levels 
     600 
     601       soilhum_decomp(:) = & 
     602            soilhum_decomp(:) + soilhum(:,l) * rpc(:) * & 
     603            ( EXP( -z_soil(l-1)/z_decomp ) - EXP( -z_soil(l)/z_decomp ) ) 
     604 
     605    ENDDO 
     606 
     607    control_moist(:,ibelow) = control_moist_func (npts, soilhum_decomp) 
    636608 
    637609  !! 5. fluxes from litter to carbon pools and respiration 
     
    906878!_ ================================================================================================================================ 
    907879   
    908   FUNCTION control_moist_func (npts,clay,bulk,carbon,litter,moist_in,veget_cov_max) RESULT (moistfunc_result) 
     880  FUNCTION control_moist_func (npts, moist_in) RESULT (moistfunc_result) 
    909881 
    910882  !! 0. Variable and parameter declaration 
    911883     
    912884    !! 0.1 Input variables 
    913     INTEGER(i_std)                           :: k,m,n,i,l,e         !!indices               
     885           
    914886    INTEGER(i_std), INTENT(in)               :: npts                !! Domain size - number of grid pixel (unitless) 
    915887    REAL(r_std), DIMENSION(npts), INTENT(in) :: moist_in            !! relative humidity (unitless) 
    916     REAL(r_std), DIMENSION(npts), INTENT(in) :: clay                !! Clay fraction (unitless, 0-1)  
    917     REAL(r_std), DIMENSION(npts), INTENT(in) :: bulk                !! Bulk density (kg/m**3)   
    918     REAL(r_std), DIMENSION(npts,ncarb,nvm), INTENT(in) :: carbon    !! Soil carbon pools: active, s     low, or passive, \f$(gC m^{2})$\f 
    919     REAL(r_std), DIMENSION(npts,nlitt,nvm,nlevs,nelements), INTENT(inout) ::litter   !! Metabolic and structural litter,above and 
    920                                                                     !! below ground. The unit is given by m^2 of ground 
    921                                                                     !! @tex $(gC m^{-2})$ @endtex 
    922     REAL(r_std),DIMENSION(npts,nvm),INTENT(in):: veget_cov_max      !! PFT "Maximal" coverage fraction of a PFT  
    923   
     888 
    924889    !! 0.2 Output variables 
    925890    
     
    929894 
    930895    !! 0.4 Local variables 
    931     REAL(r_std), DIMENSION(101)              :: Mint                !! range [0,0.01,1] to compute PRSRmax 
    932     REAL(r_std), DIMENSION(npts,101)         :: PRSR                !! Proportional Response of Soil Respiration   
    933     REAL(r_std), DIMENSION(npts,101)         :: SR                  !! Soil respiration compute using Moyano et al 2012 procedure   
    934     REAL(r_std)                              :: SRmax               !! maximum value of SR 
    935     REAL(r_std), DIMENSION(npts,101)         :: SRnorm              !! SR normalized by the SRmax  
    936     REAL(r_std)                              :: ind                 !! i index of maximum SRnorm value 
    937     REAL(r_std)                              :: SRmin               !! minimum value of SRnorm 
    938     REAL(r_std), DIMENSION(npts,101)         :: SRsc                !! Soil respiration rescale between 0 and 1 following Moyano et al 2012 procedure   
    939     REAL(r_std)                              :: SRscmax             !! maximum value of SRsc 
    940     REAL(r_std)                              :: indmc               !! i index of maximum mois_round values  
    941     REAL(r_std)                              :: moist_round         !! moist_in round to 2decimal points 
    942     REAL(r_std), DIMENSION(npts)             :: carbon_gCgs         !! total Soil carbon pools: active +slow+ passive, (gC/gsoil) 
    943     REAL(r_std), DIMENSION(npts)             :: carbon_gCm2s        !! total Soil carbon pools: active +slow+ passive     , (gC/gsoil) 
    944     REAL(r_std), DIMENSION(npts)             :: clay_Moyano         !! Clay fraction borned within the values used by Moyano et al., (unitless, 0-1) 
    945  
    946 !_ =============================================================================================================================== 
    947  
    948      IF (ok_moyano_soilhumsat)THEN !!ok_moyano_soilhumsat is true 
    949  
    950      !! In ok_moyano_soilhumsat total soil carbon per grid cells need to be computed and 
    951      !!  converted from gC/m2soil to gC/gsoil 
    952      carbon_gCm2s(:)=zero 
    953      carbon_gCgs(:)=zero 
    954      DO n = 1, npts ! loop over grids 
    955       DO m = 1, nvm ! Loop over # PFTs 
    956        DO k = 1, ncarb ! Loop over carbon pools  
    957         carbon_gCm2s(n)=carbon_gCm2s(n)+carbon(n,k,m)*veget_cov_max(n,m) 
    958        ENDDO 
    959       ENDDO 
    960      ENDDO 
    961  
    962      IF (ok_orga) THEN 
    963         DO n = 1, npts ! loop over grids 
    964            carbon_gCgs(n)=carbon_gCm2s(n) / (bulk(n) * 1E3 * soilheight) 
    965           carbon_gCgs(n)= MAX(min_carbon_moyano,MIN(max_carbon_moyano,carbon_gCgs(n)))  
    966           clay_Moyano(n) = MAX(min_clay_moyano,MIN(max_clay_moyano,clay(n))) 
    967       ENDDO 
    968  
    969         !!1. compute Max(Prsr(M[0,0.01,1])); Prsr:Proportional Response of Soil 
    970         !!Respiration (PRSR) and Soil respiration(SR): SR(M)=SRo x Prsr(M)/Max(Prsr(M[0,0.01,1])) 
    971         !! M:soilhumSAT, SRo=1 (arbitrary) 
    972         DO n = 1,npts 
    973           Mint(:)= zero 
    974           SRmax = zero 
    975           DO i = 1,101 
    976              Mint(i)=0.01*(i-1) 
    977              IF (carbon_gCgs(n) .LT. limit_carbon_orga) THEN 
    978                  PRSR(n,i) = beta1 * Mint(i)  + beta2 * Mint(i)**2.0 + beta3 * Mint(i)**3.0 & 
    979                             & + beta4 * clay_Moyano(n) + beta5 * clay_Moyano(n) * Mint(i) & 
    980                             & + beta6 * carbon_gCgs(n) + intercept 
    981              ELSE  
    982                  PRSR(n,i) = beta1_orga * Mint(i)  + beta2_orga * Mint(i)**2.0 + & 
    983                             & beta3_orga * Mint(i)**3.0 + intercept_orga 
    984              ENDIF 
    985  
    986              IF (i.LT.2) THEN 
    987                SR(n,i) = PRSR(n,i) 
    988                SRmax = MAX(SR(n,i),SRmax) 
    989              ELSE 
    990                SR(n,i) = PRSR(n,i) * SR(n,i-1) 
    991                SRmax = MAX(SR(n,i),SRmax) 
    992              ENDIF 
    993           ENDDO 
    994           SRnorm(n,:)= SRo * SR(n,:)/SRmax 
    995         ENDDO 
    996      ELSE 
    997         DO n = 1, npts ! loop over grids 
    998            carbon_gCgs(n)=carbon_gCm2s(n) / (bulk(n) * 1E3 * soilheight) 
    999           carbon_gCgs(n)= MAX(min_carbon_moyano,MIN(limit_carbon_orga,carbon_gCgs(n))) 
    1000           clay_Moyano(n) = MAX(min_clay_moyano,MIN(max_clay_moyano,clay(n))) 
    1001       ENDDO 
    1002  
    1003         !!1. compute Max(Prsr(M[0,0.01,1])); Prsr:Proportional Response of Soil 
    1004         !!Respiration (PRSR) and Soil respiration(SR): SR(M)=SRo x 
    1005         !Prsr(M)/Max(Prsr(M[0,0.01,1])) 
    1006         !! M:soilhumSAT, SRo=1 (arbitrary) 
    1007         DO n = 1,npts 
    1008           Mint(:)= zero 
    1009           SRmax = zero 
    1010           DO i = 1,101 
    1011              Mint(i)=0.01*(i-1) 
    1012               PRSR(n,i) = beta1 * Mint(i)  + beta2 * Mint(i)**2.0 + beta3 * Mint(i)**3.0 & 
    1013                          & + beta4 * clay_Moyano(n) + beta5 * clay_Moyano(n) * Mint(i) & 
    1014                          & + beta6 * carbon_gCgs(n) + intercept 
    1015  
    1016              IF (i.LT.2) THEN 
    1017                SR(n,i) = PRSR(n,i) 
    1018                SRmax = MAX(SR(n,i),SRmax) 
    1019              ELSE 
    1020                SR(n,i) = PRSR(n,i) * SR(n,i-1) 
    1021                SRmax = MAX(SR(n,i),SRmax) 
    1022              ENDIF 
    1023           ENDDO 
    1024           SRnorm(n,:)= SRo * SR(n,:)/SRmax 
    1025         ENDDO 
    1026      ENDIF    
    1027  
    1028      !!2. Rescale SR values between 0 and 1 and defined SR for moist_in 
    1029        DO n = 1,npts 
    1030          ind = 1.0 
    1031          indmc = zero 
    1032          moist_round = zero 
    1033          SRscmax = zero 
    1034          SRsc(n,:) = zero 
    1035          SRmin = 1.0 
    1036           
    1037          ind = MAXLOC(SRnorm(n,:),1) 
    1038          DO i = 1,ind 
    1039            SRmin = MIN(SRnorm(n,i),SRmin) 
    1040          ENDDO 
    1041          DO i = 1,101 
    1042            SRsc(n,i) = SRnorm(n,i)- SRmin 
    1043            IF (i.LE.ind)THEN 
    1044              SRscmax = MAX(SRsc(n,i),SRscmax) 
    1045            ENDIF 
    1046          ENDDO 
    1047          SRsc(n,:)=SRsc(n,:)/SRscmax 
    1048           
    1049          moist_round=(NINT(moist_in(n)*100.))/100. 
    1050          indmc=INT(moist_round/0.01) + un 
    1051          
    1052         moistfunc_result(n) = SRsc(n,indmc) 
    1053         moistfunc_result(n) = MAX( moistcontSAT_min, MIN( un, moistfunc_result(n) )) 
    1054        ENDDO 
    1055  
    1056      ELSE !ok_moyano_soilhumsat is false by default 
    1057        moistfunc_result(:) = -moist_coeff(1) * moist_in(:) * moist_in(:) & 
    1058                              & + moist_coeff(2)* moist_in(:) - moist_coeff(3) 
    1059        moistfunc_result(:) = MAX( moistcont_min, MIN( un, moistfunc_result(:) )) 
    1060      ENDIF 
     896 
     897!_ ================================================================================================================================ 
     898 
     899    moistfunc_result(:) = -moist_coeff(1) * moist_in(:) * moist_in(:) + moist_coeff(2)* moist_in(:) - moist_coeff(3) 
     900    moistfunc_result(:) = MAX( moistcont_min, MIN( un, moistfunc_result(:) ) ) 
    1061901 
    1062902  END FUNCTION control_moist_func 
  • branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/context_input_orchidee.xml

    r8418 r8423  
    3030      <field id="soilcolor" name="soilcolor" domain_ref="dom_file_soil" operation="instant" freq_offset="1ts" enabled="false"/> 
    3131      <field id="soiltext" name="soiltext" domain_ref="dom_file_soil" operation="instant" freq_offset="1ts"/> 
    32     </file> 
    33  
    34     <!-- Default file name: soil_bulk_and_ph.nc for both soilbulk and soilph. The variables can be read from different files, specified in run.def 
    35                   This file is read in the initialization phase only if there is no restart file. 
    36          For soilbulk and soilph, set values lower than min_sechiba as masked values because missing values are zero in the file. 
    37         Renormalization will be done later using the interpolated mask.  --> 
    38     <file id="soilbulk_file" mode="read" output_freq="1y" enabled="true"> 
    39       <field id="soilbulk_mask_read" name="soilbulk" domain_ref="dom_file_soilbulk" operation="instant" freq_offset="1ts" > this &gt; $min_sechiba ? 1 : 0 </field> 
    40       <field id="soilbulk_read" name="soilbulk" domain_ref="dom_file_soilbulk" operation="instant" freq_offset="1ts" > this &gt; $min_sechiba ? this : 0 </field> 
    4132    </file> 
    4233 
     
    143134        <field id="soiltext13" > soiltext == 13 </field> 
    144135      </field_group> 
    145  
    146       <!-- If soilbulk_mask .gt. min_sechiba, then renormalize by dividing with soilbulk_mask else set bulk_default. 
    147       soilbulk_mask interpolated to the model grid corresponds to the fraction of the grid cell covered by non-masked 
    148       values in the input file. Where soilbulk_mask=0, no data where found on the source grid. --> 
    149       <field id="soilbulk_tmp"  field_ref="soilbulk_read" domain_ref="dom_from_soilbulk" /> 
    150       <field id="soilbulk_mask" field_ref="soilbulk_mask_read" domain_ref="dom_from_soilbulk" read_access="true" enabled="true" /> 
    151       <field id="soilbulk"      field_ref="soilbulk_tmp"  domain_ref="dom_from_soilbulk" read_access="true" enabled="true"  > soilbulk_mask &gt; $min_sechiba ? soilbulk_tmp/(soilbulk_mask+1e-100) : $bulk_default </field> 
    152136       
    153137      <field id="frac_veget"      field_ref="maxvegetfrac_read" domain_ref="dom_from_pft" read_access="true" enabled="true" /> 
     
    236220    </domain> 
    237221 
    238     <domain id="dom_from_soilbulk" domain_ref="domain_landpoints"> 
    239     <interpolate_domain order="1" renormalize="false" /> 
    240     </domain> 
    241  
    242222    <domain id="dom_from_pft" domain_ref="domain_landpoints"> 
    243223      <interpolate_domain order="1" renormalize="false" /> 
     
    278258      <!-- generate_rectilinear_domain bounds_lon_start="-180" bounds_lon_end="180" bounds_lat_start="-90" bounds_lat_end="90"/--> 
    279259      <generate_rectilinear_domain bounds_lon_start="-180" bounds_lon_end="180" bounds_lat_start="90" bounds_lat_end="-90"/> 
    280     </domain> 
    281  
    282     <domain id="dom_file_soilbulk" type="rectilinear"> 
    283     <generate_rectilinear_domain bounds_lon_start="-180" bounds_lon_end="180" bounds_lat_start="90" bounds_lat_end="-90"/>/> 
    284260    </domain> 
    285261     
     
    370346    <variable id="albbg_vis_default" type="double">xxx</variable> 
    371347    <variable id="albbg_nir_default" type="double">xxx</variable> 
    372     <variable id="bulk_default" type="double">xxx</variable> 
    373348     
    374349  </variable_definition> 
  • branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/field_def_orchidee.xml

    r8418 r8423  
    358358    <field id="gpplut" name="gppLut" long_name="Gross primary productivity on Landuse tiles" unit="kgC m-2 s-1" grid_ref="grid_nlut" /> 
    359359 
     360 
    360361    <!-- Varaibles interp_diag_xxx and interp_avail_xxx are written just after reading and interpolating from file and are used for validation --> 
    361362    <field id="interp_avail_aveget" name="interp_avail_aveget" long_name="Availability of data for the vegetation fraction interpolation (negative values if no data found)" unit="1" operation="once" freq_offset="0ts"/> 
     
    365366    <field id="interp_diag_soilclass" name="interp_diag_soilclass"     grid_ref="grid_nscm" long_name="soilclass read from soils_param file" operation="once" freq_offset="0ts"/> 
    366367    <field id="interp_diag_njsc" name="interp_diag_njsc" long_name="njsc after reading of soilclass from soils_param file" operation="once" freq_offset="0ts"/> 
    367     <field id="interp_diag_bulk" name="interp_diag_bulk" long_name="Soil bulk density read from file" unit="kg/m**3" operation="once" freq_offset="0ts"/> 
    368368    <field id="interp_diag_clayfraction" name="interp_diag_clayfraction" long_name="clayfraction read from soils_param file" operation="once" freq_offset="0ts" /> 
    369369    <field id="interp_diag_sandfraction" name="interp_diag_sandfraction" long_name="sandfraction read from soils_param file" operation="once" freq_offset="0ts" /> 
     
    636636  <field id="vegetmax_soil" name="vegetsoil" long_name="PFT fraction for soil tiles" unit="1" grid_ref="grid_nvm_nstm"/> 
    637637 
    638   <!-- Output variables for Moyano et al. 2012 control humidity function --> 
    639   <field id="ControlMoistLitter" name="ControlMoistLitter" long_name="Controle moist value for iabove" unit="1" grid_ref="grid_landpoints" /> 
    640   <field id="ControlMoistSoil" name="ControlMoistSoil" long_name="Controle moist value for ibelow" unit="1" grid_ref="grid_landpoints"/> 
    641   <field id="litterhumSAT" name="litterhumSAT" long_name="litter moisture for the controle moisture fonction" unit="1" grid_ref="grid_landpoints"/> 
    642   <field id="soilhumSAT" name="soilhumSAT" long_name="soil moisture for the control moisture fonction" unit="1" grid_ref="grid_landpoints"/> 
    643  
    644638</field_definition> 
    645639 
  • branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/file_def_orchidee.xml

    r8418 r8423  
    991991    <field field_ref="nppOther" level="1"/> 
    992992    <field field_ref="nep" level="0"/> 
    993    <!-- variables for Moyano control moisture --> 
    994     <field field_ref="ControlMoistLitter" level="1"/> 
    995     <field field_ref="ControlMoistSoil" level="1"/> 
    996     <field field_ref="litterhumSAT" level="1"/> 
    997     <field field_ref="soilhumSAT" level="1"/> 
    998  
    999993   </field_group> 
    1000994     
Note: See TracChangeset for help on using the changeset viewer.