Changeset 8418 for branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba
- Timestamp:
- 2024-02-12T19:49:09+01:00 (5 months ago)
- Location:
- branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba/hydrol.f90
r8320 r8418 415 415 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:) :: soil_wet_litter !! Soil wetness aove mvw in the litter (0-1, unitless) 416 416 !$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) 417 420 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:,:) :: qflux_ns !! Diffusive water fluxes between soil layers 418 421 !! (at lower interface) … … 572 575 & tot_melt, transpir, precip_rain, precip_snow, returnflow, reinfiltration, irrigation, & 573 576 & humrel, vegstress, drysoil_frac, evapot, evapot_penm, evap_bare_lim, evap_bare_lim_ns, & 574 & flood_frac, flood_res, &577 & flood_frac, flood_res,shumdiagSAT,litterhumdiagSAT, & 575 578 & shumdiag,shumdiag_perma, k_litt, litterhumdiag, soilcap, soiltile, fraclut, reinf_slope_soil, rest_id, hist_id, hist2_id,& 576 579 & contfrac, stempdiag, & … … 650 653 !! with respect to (mcfc-mcw) 651 654 !! (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 652 659 REAL(r_std),DIMENSION (kjpindex,nslm), INTENT (out):: shumdiag_perma !! Percent of porosity filled with water (mc/mcs) used for the thermal computations 653 660 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: k_litt !! litter approximate conductivity 654 661 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) 655 664 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: tot_melt !! Total melt 656 665 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: floodout !! Flux out of floodplains … … 806 815 transpir, vevapnu, evapot, evapot_penm, runoff, drainage, & 807 816 returnflow, reinfiltration, irrigation, & 808 tot_melt,evap_bare_lim,evap_bare_lim_ns, shumdiag, shumdiag_perma, &809 k_litt, litterhumdiag, humrel, vegstress, drysoil_frac,&817 tot_melt,evap_bare_lim,evap_bare_lim_ns,shumdiagSAT, shumdiag, shumdiag_perma, & 818 k_litt,litterhumdiagSAT, litterhumdiag, humrel, vegstress, drysoil_frac,& 810 819 stempdiag,snow,snowdz, tot_bare_soil, u, v, tq_cdrag, & 811 820 mc_layh, mcl_layh, root_deficit, veget) … … 1772 1781 ALLOCATE (soil_wet_litter(kjpindex,nstm),stat=ier) 1773 1782 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','','') 1774 1786 1775 1787 ALLOCATE (qflux_ns(kjpindex,nslm,nstm),stat=ier) … … 2391 2403 IF (ALLOCATED (soil_wet_ns)) DEALLOCATE (soil_wet_ns) 2392 2404 IF (ALLOCATED (soil_wet_litter)) DEALLOCATE (soil_wet_litter) 2405 IF (ALLOCATED (soil_wet_litterSAT)) DEALLOCATE (soil_wet_litterSAT) 2393 2406 IF (ALLOCATED (qflux_ns)) DEALLOCATE (qflux_ns) 2394 2407 IF (ALLOCATED (tmat)) DEALLOCATE (tmat) … … 3661 3674 & transpir, vevapnu, evapot, evapot_penm, runoff, drainage, & 3662 3675 & returnflow, reinfiltration, irrigation, & 3663 & tot_melt, evap_bare_lim, evap_bare_lim_ns, shumdiag, shumdiag_perma,&3664 & k_litt, litterhumdiag, humrel,vegstress, drysoil_frac, &3676 & tot_melt, evap_bare_lim, evap_bare_lim_ns,shumdiagSAT, shumdiag, shumdiag_perma,& 3677 & k_litt,litterhumdiagSAT, litterhumdiag, humrel,vegstress, drysoil_frac, & 3665 3678 & stempdiag,snow, & 3666 3679 & snowdz, tot_bare_soil, u, v, tq_cdrag, mc_layh, mcl_layh, root_deficit, veget) … … 3724 3737 REAL(r_std), DIMENSION (kjpindex,nslm), INTENT (out) :: shumdiag !! Relative soil moisture in each diag soil layer 3725 3738 !! 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 3726 3742 REAL(r_std), DIMENSION (kjpindex,nslm), INTENT (out) :: shumdiag_perma !! Percent of porosity filled with water (mc/mcs) 3727 3743 !! in each diag soil layer (for the thermal computations) … … 3731 3747 REAL(r_std), DIMENSION (kjpindex), INTENT (out) :: litterhumdiag !! Mean of soil_wet_litter across soil tiles 3732 3748 !! (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) 3733 3752 REAL(r_std), DIMENSION (kjpindex, nvm), INTENT(out) :: vegstress !! Veg. moisture stress (only for vegetation 3734 3753 !! growth) (unitless, [0-1]) … … 4404 4423 END DO 4405 4424 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 4406 4434 ! Preliminary calculation of various soil moistures (for each layer, in kg/m2) 4407 4435 sm(:,1) = dz(2) * (trois*mcl(:,1,jst) + mcl(:,2,jst))/huit … … 4624 4652 4625 4653 ! For consistency in stomate, we also set moderwilt and soil_wet_ns to zero in this case. 4626 ! They are used later for shumdiag and shumdiag_perma4654 ! They are used later for shumdiag, shumdiagSAT and shumdiag_perma 4627 4655 DO jsl = 1,nslm 4628 4656 WHERE (is_under_mcr(:,jst)) … … 4671 4699 !! 7. Summing 3d variables into 2d variables 4672 4700 CALL hydrol_diag_soil (ks, nvan, avan, mcr, mcs, mcfc, mcw, kjpindex, veget_max, soiltile, njsc, runoff, drainage, & 4673 & evapot, vevapnu, returnflow, reinfiltration, irrigation, &4674 & shumdiag,shumdiag_perma, k_litt, litterhumdiag, humrel, vegstress, drysoil_frac,tot_melt)4701 & evapot, vevapnu, returnflow, reinfiltration, irrigation, shumdiagSAT,& 4702 & shumdiag,shumdiag_perma, k_litt,litterhumdiagSAT, litterhumdiag, humrel, vegstress, drysoil_frac,tot_melt) 4675 4703 4676 4704 ! Means of wtd, runoff and drainage corrections, across soiltiles … … 6415 6443 6416 6444 SUBROUTINE hydrol_diag_soil (ks, nvan, avan, mcr, mcs, mcfc, mcw, kjpindex, veget_max, soiltile, njsc, runoff, drainage, & 6417 & evapot, vevapnu, returnflow, reinfiltration, irrigation, &6418 & shumdiag,shumdiag_perma, k_litt, litterhumdiag, humrel, vegstress, drysoil_frac, tot_melt)6445 & evapot, vevapnu, returnflow, reinfiltration, irrigation,shumdiagSAT, & 6446 & shumdiag,shumdiag_perma, k_litt,litterhumdiagSAT, litterhumdiag, humrel, vegstress, drysoil_frac, tot_melt) 6419 6447 ! 6420 6448 ! interface description … … 6448 6476 REAL(r_std), DIMENSION (kjpindex), INTENT(out) :: drainage !! Drainage 6449 6477 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) 6450 6479 REAL(r_std),DIMENSION (kjpindex,nslm), INTENT (out) :: shumdiag_perma !! Percent of porosity filled with water (mc/mcs) used for the thermal computations 6451 6480 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: k_litt !! litter cond. 6452 6481 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) 6453 6484 REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out) :: humrel !! Relative humidity 6454 6485 REAL(r_std), DIMENSION (kjpindex, nvm), INTENT(out) :: vegstress !! Veg. moisture stress (only for vegetation growth) … … 6496 6527 humtot(:) = zero 6497 6528 shumdiag(:,:)= zero 6529 shumdiagSAT(:,:)= zero 6498 6530 shumdiag_perma(:,:)=zero 6499 6531 k_litt(:) = zero 6500 6532 litterhumdiag(:) = zero 6533 litterhumdiagSAT(:) = zero 6501 6534 tmc_litt_dry_mea(:) = zero 6502 6535 tmc_litt_wet_mea(:) = zero … … 6571 6604 ! BUT THIS IS NOT USED ANYMORE WITH THE NEW BACKGROUNG ALBEDO 6572 6605 !! k_litt is calculated here as a grid-cell average (for consistency with drainage) 6573 !! litterhumdiag, li ke shumdiag,is averaged over the soiltiles for transmission to stomate6606 !! litterhumdiag, litterhumdiagSAT, like shumdiag,shumdiagSAT is averaged over the soiltiles for transmission to stomate 6574 6607 DO jst=1,nstm 6575 6608 DO ji=1,kjpindex … … 6588 6621 litterhumdiag(ji) = litterhumdiag(ji) + & 6589 6622 & soil_wet_litter(ji,jst) * soiltile(ji,jst) 6623 6624 litterhumdiagSAT(ji) = litterhumdiagSAT(ji) + & 6625 & soil_wet_litterSAT(ji,jst) * soiltile(ji,jst) 6590 6626 6591 6627 tmc_litt_wet_mea(ji) = tmc_litt_wet_mea(ji) + & … … 6659 6695 ENDDO 6660 6696 ENDDO 6661 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 6662 6709 ! Shumdiag_perma is based on soilmoist / moisture at saturation in the layer 6663 6710 ! 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
r8221 r8418 140 140 !! by thermosoil.f90 (unitless, 0-1) 141 141 !$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) 142 145 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:) :: shumdiag_perma !! Saturation degree of the soil 143 146 !$OMP THREADPRIVATE(shumdiag_perma) … … 146 149 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: litterhumdiag !! Litter dryness factor (unitless, 0-1) 147 150 !$OMP THREADPRIVATE(litterhumdiag) 151 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: litterhumdiagSAT!! Litter dryness factor (unitless, 0-1) 152 !$OMP THREADPRIVATE(litterhumdiagSAT) 148 153 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:) :: stempdiag !! Temperature which controls canopy evolution (K) 149 154 !$OMP THREADPRIVATE(stempdiag) … … 765 770 & tot_melt, transpir, precip_rain, precip_snow, returnflow, reinfiltration, irrigation, & 766 771 & humrel, vegstress, drysoil_frac, evapot, evapot_corr, evap_bare_lim, evap_bare_lim_ns, flood_frac, flood_res, & 767 & shumdiag ,shumdiag_perma, k_litt, litterhumdiag, soilcap, soiltile, fraclut, reinf_slope_soil,&772 & shumdiagSAT,litterhumdiagSAT,shumdiag,shumdiag_perma, k_litt, litterhumdiag, soilcap, soiltile, fraclut, reinf_slope,& 768 773 & rest_id, hist_id, hist2_id,& 769 774 & contfrac, stempdiag, & … … 820 825 CALL slowproc_main (kjit, kjpij, kjpindex, & 821 826 index, indexveg, lalo, neighbours, resolution, contfrac, soiltile, fraclut, nwdFraclut, & 822 temp_air, temp_sol, stempdiag, &827 temp_air, temp_sol, stempdiag,shumdiagSAT,litterhumdiagSAT, & 823 828 vegstress, shumdiag, litterhumdiag, precip_rain, precip_snow, gpp, & 824 829 deadleaf_cover, & … … 1765 1770 ALLOCATE (shumdiag(kjpindex,nslm),stat=ier) 1766 1771 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','','') 1767 1775 1768 1776 ALLOCATE (shumdiag_perma(kjpindex,nslm),stat=ier) … … 1771 1779 ALLOCATE (litterhumdiag(kjpindex),stat=ier) 1772 1780 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','','') 1773 1784 1774 1785 ALLOCATE (ptnlev1(kjpindex),stat=ier) … … 2021 2032 IF ( ALLOCATED (co2_flux)) DEALLOCATE (co2_flux) 2022 2033 IF ( ALLOCATED (shumdiag)) DEALLOCATE (shumdiag) 2034 IF ( ALLOCATED (shumdiagSAT)) DEALLOCATE (shumdiagSAT) 2023 2035 IF ( ALLOCATED (shumdiag_perma)) DEALLOCATE (shumdiag_perma) 2024 2036 IF ( ALLOCATED (litterhumdiag)) DEALLOCATE (litterhumdiag) 2037 IF ( ALLOCATED (litterhumdiagSAT)) DEALLOCATE (litterhumdiagSAT) 2025 2038 IF ( ALLOCATED (ptnlev1)) DEALLOCATE (ptnlev1) 2026 2039 IF ( ALLOCATED (k_litt)) DEALLOCATE (k_litt) -
branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba/slowproc.f90
r7709 r8418 72 72 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: siltfraction !! Siltfraction (0-1, unitless) 73 73 !$OMP THREADPRIVATE(siltfraction) 74 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:) :: bulk !!Bulk density (kg/m**3) 75 !$OMP THREADPRIVATE(bulk) 74 76 REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:,:) :: laimap !! LAI map when the LAI is prescribed and not calculated by STOMATE 75 77 !$OMP THREADPRIVATE(laimap) … … 137 139 138 140 !! 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 139 181 filename = 'PFTmap.nc' 140 182 CALL getin_p('VEGETATION_FILE',filename) … … 377 419 rest_id_stom, hist_id_stom, hist_id_stom_IPCC, & 378 420 indexLand, lalo, neighbours, resolution, & 379 contfrac, totfrac_nobio, clayfraction, temp_air,&380 lai, veget, veget_max,&421 contfrac, totfrac_nobio, clayfraction, bulk, & 422 temp_air, lai, veget, veget_max, & 381 423 deadleaf_cover, assim_param, temp_growth ) 382 424 ENDIF … … 478 520 SUBROUTINE slowproc_main (kjit, kjpij, kjpindex, & 479 521 IndexLand, indexveg, lalo, neighbours, resolution, contfrac, soiltile, fraclut, nwdFraclut, & 480 temp_air, temp_sol, stempdiag, &522 temp_air, temp_sol, stempdiag, shumdiagSAT,litterhumdiagSAT, & 481 523 humrel, shumdiag, litterhumdiag, precip_rain, precip_snow, gpp, & 482 524 deadleaf_cover, & … … 511 553 REAL(r_std),DIMENSION (kjpindex,nslm), INTENT (in) :: stempdiag !! Soil temperature (K) 512 554 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) 513 557 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) 514 560 REAL(r_std),DIMENSION (kjpindex), INTENT (in) :: precip_rain !! Rain precipitation (mm dt_stomate^{-1}) 515 561 REAL(r_std),DIMENSION (kjpindex), INTENT (in) :: precip_snow !! Snow precipitation (mm dt_stomate^{-1}) … … 627 673 628 674 !! 4.1 Call stomate main routine that will call all c-cycle routines ! 675 629 676 CALL stomate_main (kjit, kjpij, kjpindex, & 630 677 IndexLand, lalo, neighbours, resolution, contfrac, totfrac_nobio, clayfraction, & 631 temp_air, temp_sol, stempdiag, &632 humrel, shumdiag, litterhumdiag, precip_rain, precip_snow, gpp, &678 bulk, temp_air, temp_sol, stempdiag, humrel, shumdiag, shumdiagSAT, litterhumdiag, & 679 litterhumdiagSAT, precip_rain, precip_snow, gpp, & 633 680 deadleaf_cover, & 634 681 assim_param, & … … 638 685 co2_flux, fco2_lu, fco2_wh, fco2_ha, & 639 686 resp_maint, resp_hetero, resp_growth, temp_growth) 640 641 687 642 688 !! 4.2 Output the respiration terms and the net primary … … 865 911 ! counter, vegetation fraction, max vegetation fraction, LAI 866 912 ! variable from stomate, fraction of bare soil, soiltype 867 ! fraction, clay fraction, height of vegetation, map of LAI913 ! fraction, clay fraction,bulk density, height of vegetation, map of LAI 868 914 869 915 CALL restput_p (rest_id, 'veget', nbp_glo, nvm, 1, kjit, veget, 'scatter', nbp_glo, index_g) … … 904 950 CALL restput_p (rest_id, 'clay_frac', nbp_glo, 1, 1, kjit, clayfraction, 'scatter', nbp_glo, index_g) 905 951 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) 906 953 !salma: added the following lines for restput of the soil parameters 907 954 CALL restput_p (rest_id, 'ks', nbp_glo, 1, 1, kjit, ks, 'scatter', nbp_glo, index_g) … … 929 976 ! 2.2 Write restart variables managed by STOMATE 930 977 IF ( ok_stomate ) THEN 931 CALL stomate_finalize (kjit, kjpindex, indexLand, clayfraction, assim_param)978 CALL stomate_finalize (kjit, kjpindex, indexLand, clayfraction, bulk, assim_param) 932 979 ENDIF 933 980 … … 1057 1104 siltfraction(:)=undef_sechiba 1058 1105 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 1059 1110 ! Allocation of last year vegetation fraction in case of land use change 1060 1111 ALLOCATE(veget_max_new(kjpindex, nvm), STAT=ier) … … 1357 1408 CALL slowproc_soilt(njsc, ks, nvan, avan, mcr, mcs, mcfc, mcw, kjpindex, & 1358 1409 lalo, neighbours, resolution, contfrac, soilclass, & 1359 clayfraction, sandfraction, siltfraction )1410 clayfraction, sandfraction, siltfraction, bulk) 1360 1411 1361 1412 call_slowproc_soilt=.FALSE. … … 1536 1587 ENDIF 1537 1588 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 1538 1594 var_name= 'lai' 1539 1595 CALL ioconf_setatt_p('UNITS', '-') … … 1611 1667 !Config Units = [-] 1612 1668 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) 1613 1678 1614 1679 !Config Key = SLOWPROC_HEIGHT … … 1723 1788 ENDIF 1724 1789 1725 1726 1790 !! 4.3 Dynamic irrigation map 1727 1791 ! If do_irrigation, it will look to the dynamical irrig. map in restart … … 1843 1907 IF (ALLOCATED (sandfraction)) DEALLOCATE (sandfraction) 1844 1908 IF (ALLOCATED (siltfraction)) DEALLOCATE (siltfraction) 1909 IF (ALLOCATED (bulk)) DEALLOCATE (bulk) 1845 1910 IF (ALLOCATED (laimap)) DEALLOCATE (laimap) 1846 1911 IF (ALLOCATED (veget_max_new)) DEALLOCATE (veget_max_new) … … 2531 2596 END IF 2532 2597 2533 ! Assig ning the right values and giving a value where information was not found2598 ! Assiggning the right values and giving a value where information was not found 2534 2599 DO ib=1,nbpt 2535 2600 IF (alaimap(ib) < min_sechiba) THEN … … 2931 2996 !>\BRIEF looks for nearest grid point on the fine map 2932 2997 !! 2933 !! DESCRIPTION : (definitions, functional, design, flags): 2934 !! 2998 !! DESCRIPTION : (definitions, functional, design, flags): 2999 !! 2935 3000 !! RECENT CHANGE(S): None 2936 3001 !! … … 3003 3068 !! 3004 3069 !>\BRIEF Interpolate the Zobler or Reynolds/USDA soil type map 3070 !! Read and interpolate soil bulk from file. 3005 3071 !! 3006 3072 !! DESCRIPTION : (definitions, functional, design, flags): … … 3010 3076 !! and everything needed to read all maps and assign parameter values. 3011 3077 !! 3012 !! MAIN OUTPUT VARIABLE(S): ::soiltype, ::clayfraction, sandfraction, siltfraction 3078 !! MAIN OUTPUT VARIABLE(S): ::soiltype, ::clayfraction, sandfraction, siltfraction, bulk 3013 3079 !! 3014 3080 !! REFERENCE(S) : Reynold, Jackson, and Rawls (2000). Estimating soil water-holding capacities … … 3019 3085 !! \n 3020 3086 !_ ================================================================================================================================ 3021 SUBROUTINE slowproc_soilt(njsc, ks, nvan, avan, mcr, mcs, mcfc, mcw, nbpt, lalo, neighbours, resolution, contfrac, soilclass, clayfraction, sandfraction, siltfraction )3087 SUBROUTINE slowproc_soilt(njsc, ks, nvan, avan, mcr, mcs, mcfc, mcw, nbpt, lalo, neighbours, resolution, contfrac, soilclass, clayfraction, sandfraction, siltfraction, bulk) 3022 3088 3023 3089 USE interpweight … … 3061 3127 REAL(r_std), INTENT(out) :: sandfraction(nbpt) !! The fraction of sand (for SP-MIP) 3062 3128 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 3063 3130 ! 3064 3131 ! … … 3088 3155 CHARACTER(LEN=80) :: spmipexp !! designing the number of sp-mip experiment 3089 3156 CHARACTER(LEN=80) :: unif_case !! designing the model of experiment 4 (sp_mip) 3090 3157 REAL(r_std), DIMENSION(nbpt) :: abulkph !!Availability of the bulk and ph interpolation 3091 3158 REAL(r_std) :: vmin, vmax !! min/max values to use for the 3092 3159 … … 3113 3180 !! `maskingtype') 3114 3181 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 3115 3183 INTEGER(i_std), DIMENSION(:), ALLOCATABLE :: vecpos 3116 3184 REAL(r_std) :: sgn !! sum of fractions excluding glaciers and ocean … … 3637 3705 IF ( (solt(ilf) .LE. nscm) .AND. (solt(ilf) .GT. 0) ) THEN 3638 3706 soilclass(ib,solt(ilf)) = textrefrac(ib,solt(ilf)) 3639 clayfraction(ib) = clayfraction(ib) + textfrac_table(solt(ilf),3) * 3707 clayfraction(ib) = clayfraction(ib) + textfrac_table(solt(ilf),3) * & 3640 3708 textrefrac(ib,solt(ilf)) 3641 3709 sandfraction(ib) = sandfraction(ib) + textfrac_table(solt(ilf),2) * & … … 3688 3756 3689 3757 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 3690 3829 3691 3830 ! End of soil texture reading, for 'maps' and classical behavior … … 3818 3957 CALL xios_orchidee_send_field("interp_diag_njsc",REAL(njsc, r_std)) 3819 3958 CALL xios_orchidee_send_field("interp_diag_clayfraction",clayfraction) 3959 CALL xios_orchidee_send_field("interp_diag_bulk",bulk) 3820 3960 CALL xios_orchidee_send_field("interp_diag_sandfraction",sandfraction) 3821 3961 CALL xios_orchidee_send_field("interp_diag_siltfraction",siltfraction)
Note: See TracChangeset
for help on using the changeset viewer.