Ignore:
Timestamp:
2022-07-20T11:30:43+02:00 (2 years ago)
Author:
josefine.ghattas
Message:

Integrated new irrigation scheme developed by Pedro Arboleda. See ticket #857
This corresponds to revsion 7708 of version pedro.arboleda/ORCHIDEE. Following differences were made but were not made on the pedro.arboleda/ORCHIDEE :

  • argumet place in call to routing_wrapper_intialize changed order
  • lines with only change in space were not taken
  • some indentation changed
  • set irrigation output as enalbled false if not do_irrigation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba/hydrol.f90

    r7476 r7709  
    2424!!                    We can also impose kfact_root=1 in all soil layers to cancel the effect of 
    2525!!                    roots on ks profile (keyword KFACT_ROOT_CONST). 
     26!!                    July 2022: New irrigation scheme. Here new irrigation demand based in 
     27!!                    soil moisture deficit, and irrigation application. 
    2628!!                  
    2729!! REFERENCE(S) : 
     
    366368                                                                         !!  @tex $(m^{3} m^{-3})$ @endtex 
    367369!$OMP THREADPRIVATE(mc) 
     370  REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:)    :: root_mc_fc         !! Max Field Capacity moisture content, for layers with roots, in soil tile of irrig_st 
     371                                                                         !!  @tex $(kg m^{-2})$ @endtex 
     372!$OMP THREADPRIVATE(root_mc_fc) 
     373  INTEGER(i_std), ALLOCATABLE, SAVE, DIMENSION (:) :: nslm_root          !! max. layers defining the root zone 
     374                                                                         !!  @tex $(layer)$ @endtex 
     375!$OMP THREADPRIVATE(nslm_root) 
    368376 
    369377   REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:,:) :: mc_read_prev       !! Soil moisture from file at previous timestep in the file 
     
    565573       & humrel, vegstress, drysoil_frac, evapot, evapot_penm, evap_bare_lim, evap_bare_lim_ns, & 
    566574       & flood_frac, flood_res, & 
    567        & shumdiag,shumdiag_perma, k_litt, litterhumdiag, soilcap, soiltile, fraclut, reinf_slope, rest_id, hist_id, hist2_id,& 
     575       & shumdiag,shumdiag_perma, k_litt, litterhumdiag, soilcap, soiltile, fraclut, reinf_slope_soil, rest_id, hist_id, hist2_id,& 
    568576       & contfrac, stempdiag, & 
    569577       & temp_air, pb, u, v, tq_cdrag, swnet, pgflux, & 
     
    571579       & grndflux,gtemp,tot_bare_soil, & 
    572580       & lambda_snow,cgrnd_snow,dgrnd_snow,frac_snow_veg,temp_sol_add, & 
    573        & mc_layh, mcl_layh, soilmoist_out ) 
     581       & mc_layh, mcl_layh, soilmoist_out, root_deficit ) 
    574582 
    575583    !! 0. Variable and parameter declaration 
     
    607615    REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (in)  :: qsintmax         !! Maximum water on vegetation for interception 
    608616    REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (in)  :: transpir         !! Transpiration 
    609     REAL(r_std),DIMENSION (kjpindex), INTENT (in)      :: reinf_slope      !! Slope coef 
     617    REAL(r_std),DIMENSION (kjpindex,nstm), INTENT (in) :: reinf_slope_soil !! Slope coef per soil tile 
    610618 
    611619    REAL(r_std),DIMENSION (kjpindex), INTENT (in)      :: ks               !! Hydraulic conductivity at saturation (mm {-1}) 
     
    647655    REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: tot_melt         !! Total melt     
    648656    REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: floodout         !! Flux out of floodplains 
    649      
     657    REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: root_deficit     !! water deficit to reach field capacity of soil 
     658 
    650659    !! 0.3 Modified variables 
    651660 
     
    794803    !! 3.5 computes soil hydrology ==>hydrol_soil 
    795804 
    796     CALL hydrol_soil(ks, nvan, avan, mcr, mcs, mcfc, mcw, kjpindex, veget_max, soiltile, njsc, reinf_slope,  & 
     805    CALL hydrol_soil(ks, nvan, avan, mcr, mcs, mcfc, mcw, kjpindex, veget_max, soiltile, njsc, reinf_slope_soil,  & 
    797806         transpir, vevapnu, evapot, evapot_penm, runoff, drainage, &  
    798807         returnflow, reinfiltration, irrigation, & 
     
    800809         k_litt, litterhumdiag, humrel, vegstress, drysoil_frac,& 
    801810         stempdiag,snow,snowdz, tot_bare_soil,  u, v, tq_cdrag, & 
    802          mc_layh, mcl_layh) 
     811         mc_layh, mcl_layh, root_deficit, veget) 
    803812 
    804813    ! The update fluxes come from hydrol_vegupd 
    805814    drainage(:) =  drainage(:) +  drain_upd(:) 
    806815    runoff(:) =  runoff(:) +  runoff_upd(:) 
     816 
     817   ! Output irrigation related variables 
     818    CALL xios_orchidee_send_field("root_deficit", root_deficit) 
     819    CALL xios_orchidee_send_field("root_mc_fc", root_mc_fc) 
    807820 
    808821 
     
    16911704    ALLOCATE (mc(kjpindex,nslm,nstm),stat=ier) 
    16921705    IF (ier /= 0) CALL ipslerr_p(3,'hydrol_init','Problem in allocate of variable mc','','') 
     1706 
     1707    ALLOCATE (root_mc_fc(kjpindex),stat=ier) ! 
     1708    IF (ier /= 0) CALL ipslerr_p(3,'hydrol_init','Problem in allocate of variable root_mc_fc','','') ! 
     1709 
     1710    ALLOCATE (nslm_root(kjpindex),stat=ier) ! 
     1711    IF (ier /= 0) CALL ipslerr_p(3,'hydrol_init','Problem in allocate of variable nslm_root','','') ! 
    16931712 
    16941713 
     
    23652384    IF (ALLOCATED  (vegetmax_soil)) DEALLOCATE (vegetmax_soil) 
    23662385    IF (ALLOCATED  (mc)) DEALLOCATE (mc) 
     2386    IF (ALLOCATED  (root_mc_fc)) DEALLOCATE (root_mc_fc) 
     2387    IF (ALLOCATED  (nslm_root)) DEALLOCATE (nslm_root) 
    23672388    IF (ALLOCATED  (soilmoist)) DEALLOCATE (soilmoist) 
    23682389    IF (ALLOCATED  (soilmoist_liquid)) DEALLOCATE (soilmoist_liquid) 
     
    27282749    INTEGER(i_std)                                      :: iiref           !! To identify the mc_lins where k_lin and d_lin 
    27292750                                                                           !! need special treatment 
     2751    REAL(r_std), DIMENSION (kjpindex,nvm)               :: cum_nroot       !! local variable to acummulate nroot 
     2752    INTEGER(i_std), DIMENSION (kjpindex,nvm)            :: nslm_pft_root   !! Deeper layer with cum_nroot > cum_nroot_thr per PFT, 
     2753    REAL(r_std), DIMENSION (kjpindex,nslm)              :: smf             !! Soil moisture of each layer at field capacity 
     2754                                                                           !!  @tex $(kg m^{-2})$ @endtex 
    27302755 
    27312756!_ ================================================================================================================================ 
     
    28802905    !! 2 Compute the root density profile if not ok_dynroot 
    28812906    !!   For the case with ok_dynroot, the calculations are done at each time step in hydrol_soil 
     2907    cum_nroot(:,:) = zero 
     2908    nslm_pft_root(:,:) = nslm 
     2909    nslm_root(:) =  nslm 
    28822910    IF (.NOT. ok_dynroot) THEN 
    2883        DO ji=1, kjpindex 
    2884           !- 
    2885           !! The three following equations concerning nroot computation are derived from the integrals  
    2886           !! of equations C9 to C11 of De Rosnay's (1999) PhD thesis (page 158). 
    2887           !! The occasional absence of minus sign before humcste parameter is correct. 
     2911       !! Calculation of nroot and of new nslm_root for irrigation  
     2912       !! The three following equations concerning nroot computation are derived from the integrals 
     2913       !! of equations C9 to C11 of De Rosnay's (1999) PhD thesis (page 158). 
     2914       !! The occasional absence of minus sign before humcste parameter is correct. 
     2915       ! First layer 
     2916       nroot(:,:,1) = zero 
     2917       !From 2 to nslm-1 layers 
     2918       DO jsl = 2, nslm-1 
    28882919          DO jv = 1,nvm 
    2889              DO jsl = 2, nslm-1 
     2920             DO ji=1, kjpindex 
     2921                 
     2922                 
    28902923                nroot(ji,jv,jsl) = (EXP(-humcste(jv)*zz(jsl)/mille)) * & 
    28912924                     & (EXP(humcste(jv)*dz(jsl)/mille/deux) - & 
     
    28932926                     & (EXP(-humcste(jv)*dz(2)/mille/deux) & 
    28942927                     & -EXP(-humcste(jv)*zz(nslm)/mille)) 
     2928                !We acum. nroot, and change nslm_pft_root if necessary 
     2929                cum_nroot(ji,jv) = cum_nroot(ji,jv) + nroot(ji,jv,jsl) ! 
     2930                 
     2931                IF(cum_nroot(ji,jv) > cum_nroot_thr .AND. nslm_pft_root(ji,jv) .GE. jsl ) THEN 
     2932                   nslm_pft_root(ji,jv) =  jsl 
     2933                ENDIF 
    28952934             ENDDO 
    2896              nroot(ji,jv,1) = zero 
    2897  
     2935              
     2936          ENDDO 
     2937           
     2938       ENDDO 
     2939       !Last layer 
     2940       !No need to put and IF here, if it is the case, nslm_pft_root is already 
     2941       ! equal to nslm, 
     2942       DO jv = 1,nvm 
     2943          DO ji=1, kjpindex 
    28982944             nroot(ji,jv,nslm) = (EXP(humcste(jv)*dz(nslm)/mille/deux) -un) * & 
    28992945                  & EXP(-humcste(jv)*zz(nslm)/mille) / & 
     
    29022948          ENDDO 
    29032949       ENDDO 
     2950       !New loop to compute min. soil layer per cell, using just PFT that 
     2951       !are not natural and exist inside the cell 
     2952       DO jv=1, nvm 
     2953          IF(.NOT. natural(jv)) THEN 
     2954             DO ji=1,kjpindex 
     2955                IF(veget_max(ji, jv) > min_sechiba) THEN 
     2956                   nslm_root(ji) = MIN(nslm_root(ji), nslm_pft_root(ji,jv)) 
     2957                ENDIF 
     2958             ENDDO 
     2959          ENDIF 
     2960       ENDDO 
     2961        
    29042962    END IF 
    29052963 
    2906   
    2907  
     2964    ! Calculates field capacity soil moisture per soil layers 
     2965    ! then calculate field capacity soil moisture over root zone 
     2966    smf(:,:) = zero 
     2967    root_mc_fc(:) = zero 
     2968    smf(:,1) = dz(2) * (quatre*mcfc(:))/huit 
     2969     
     2970    DO jsl = 2,nslm-1 
     2971       smf(:,jsl) = dz(jsl) * ( quatre*mcfc(:) )/huit & 
     2972            + dz(jsl+1) * ( quatre*mcfc(:) )/huit 
     2973    ENDDO 
     2974     
     2975    smf(:,nslm) = dz(nslm) * (quatre*mcfc(:))/huit 
     2976    DO ji = 1,kjpindex 
     2977       root_mc_fc(ji) = SUM(smf(ji,1:nslm_root(ji) )) 
     2978    ENDDO 
     2979     
    29082980    !- 
    29092981    !! 3 Compute the profile for a and n 
     
    35923664!_ hydrol_soil 
    35933665  SUBROUTINE hydrol_soil (ks, nvan, avan, mcr, mcs, mcfc, mcw, & 
    3594        kjpindex, veget_max, soiltile, njsc, reinf_slope, & 
     3666       kjpindex, veget_max, soiltile, njsc, reinf_slope_soil, & 
    35953667       & transpir, vevapnu, evapot, evapot_penm, runoff, drainage, & 
    35963668       & returnflow, reinfiltration, irrigation, & 
     
    35983670       & k_litt, litterhumdiag, humrel,vegstress, drysoil_frac, & 
    35993671       & stempdiag,snow, & 
    3600        & snowdz, tot_bare_soil, u, v, tq_cdrag, mc_layh, mcl_layh) 
     3672       & snowdz, tot_bare_soil, u, v, tq_cdrag, mc_layh, mcl_layh, root_deficit, veget) 
    36013673    !  
    36023674    ! interface description 
     
    36083680    INTEGER(i_std), INTENT(in)                               :: kjpindex  
    36093681    REAL(r_std), DIMENSION (kjpindex,nvm), INTENT (in)       :: veget_max        !! Map of max vegetation types [-] 
     3682    REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (in)        :: veget            !! Fraction of vegetation type 
    36103683    INTEGER(i_std),DIMENSION (kjpindex), INTENT (in)         :: njsc             !! Index of the dominant soil textural class  
    36113684                                                                                 !!   in the grid cell (1-nscm, unitless) 
     
    36223695    REAL(r_std), DIMENSION (kjpindex,nvm), INTENT(in)        :: transpir         !! Transpiration   
    36233696                                                                                 !!  @tex $(kg m^{-2} dt\_sechiba^{-1})$ @endtex 
    3624     REAL(r_std), DIMENSION (kjpindex), INTENT (in)           :: reinf_slope      !! Fraction of surface runoff that reinfiltrates 
     3697    REAL(r_std), DIMENSION (kjpindex,nstm), INTENT (in)      :: reinf_slope_soil !! Fraction of surface runoff that reinfiltrates per soil tile 
    36253698                                                                                 !!  (unitless, [0-1]) 
    36263699    REAL(r_std), DIMENSION (kjpindex), INTENT(in)            :: returnflow       !! Water returning to the soil from the bottom 
     
    36723745    REAL(r_std), DIMENSION (kjpindex,nslm), INTENT (out)     :: mcl_layh         !! Volumetric liquid water content for each soil layer  
    36733746                                                                                 !! averaged over the mesh (for thermosoil) 
    3674                                                                                  !!  @tex $(m^{3} m^{-3})$ @endtex  
     3747                                                                                 !!  @tex $(m^{3} m^{-3})$ @endtex      
     3748    REAL(r_std),DIMENSION (kjpindex), INTENT(out)            :: root_deficit     !! water deficit to reach SM target of soil column, for irrigation demand 
     3749     
    36753750    !! 0.3 Modified variables 
    36763751 
     
    36983773    REAL(r_std), DIMENSION(kjpindex)               :: reinfiltration_soil        !! Water from the routing back to the top of the  
    36993774                                                                                 !! soil @tex $(kg m^{-2} dt\_sechiba^{-1})$ @endtex 
    3700     REAL(r_std), DIMENSION(kjpindex)               :: irrigation_soil            !! Water from irrigation returning to soil moisture  
     3775    REAL(r_std), DIMENSION(kjpindex,nstm)          :: irrigation_soil            !! Water from irrigation returning to soil moisture per soil tile 
    37013776                                                                                 !!  @tex $(kg m^{-2} dt\_sechiba^{-1})$ @endtex 
    37023777    REAL(r_std), DIMENSION(kjpindex)               :: flux_infilt                !! Water to infiltrate 
     
    37663841    REAL(r_std), DIMENSION (kjpindex)              :: check_over                  !! Water conservation diagnostic at routine scale  
    37673842    REAL(r_std), DIMENSION (kjpindex)              :: check_under                 !! Water conservation diagnostic at routine scale 
    3768  
     3843    ! For irrigation triggering 
     3844    INTEGER(i_std), DIMENSION (kjpindex)           :: lai_irrig_trig              !! Number of PFT per cell with LAI> LAI_IRRIG_MIN - 
    37693845    ! Diagnostic of the vertical soil water fluxes   
    37703846    REAL(r_std), DIMENSION (kjpindex,nslm)         :: qflux                       !! Local upward flux into soil layer  
     
    37963872    returnflow_soil(:) = zero 
    37973873    reinfiltration_soil(:) = zero 
    3798     irrigation_soil(:) = zero 
     3874    irrigation_soil(:,:) = zero 
    37993875    qflux_ns(:,:,:) = zero 
    38003876    mc_layh(:,:) = zero ! for thermosoil 
     
    38383914    ! AD16*** The transformation in 0.2 and 0.3 is likely to induce conservation problems 
    38393915    !         when tot_frac_nobio NE 0, since sum(soiltile) NE vegtot in this case 
    3840      
    3841     DO ji=1,kjpindex 
    3842        IF(vegtot(ji).GT.min_sechiba) THEN 
    3843           ! returnflow_soil is assumed to enter from the bottom, but it is not possible with CWRR 
    3844           returnflow_soil(ji) = zero 
    3845           reinfiltration_soil(ji) = (returnflow(ji) + reinfiltration(ji))/vegtot(ji) 
    3846           irrigation_soil(ji) = irrigation(ji)/vegtot(ji) 
    3847        ELSE 
    3848           returnflow_soil(ji) = zero 
    3849           reinfiltration_soil(ji) = zero 
    3850           irrigation_soil(ji) = zero 
     3916    IF (.NOT. old_irrig_scheme) THEN ! 
     3917       IF (.NOT. irrigated_soiltile) THEN 
     3918          DO ji=1,kjpindex 
     3919             IF(vegtot(ji).GT.min_sechiba ) THEN 
     3920                returnflow_soil(ji) = zero 
     3921                reinfiltration_soil(ji) = (returnflow(ji) + reinfiltration(ji))/vegtot(ji) 
     3922                IF(soiltile(ji, irrig_st).GT.min_sechiba) THEN 
     3923                   !irrigation_soil(ji, 1:2) = 0, if irrig_st = 3. Not put because Values 
     3924                   !are already zero, due to initialization 
     3925                   irrigation_soil(ji, irrig_st) = irrigation(ji) / (soiltile(ji, irrig_st) * vegtot(ji) ) 
     3926                   !Irrigation is kg/m2 of grid cell. Here, all that water is put on 
     3927                   !irrig_st (irrigated soil tile), by default = 3, for the others 
     3928                   !soil tiles irrigation = zero 
     3929                ENDIF 
     3930             ENDIF 
     3931          ENDDO 
    38513932       ENDIF 
    3852     ENDDO        
     3933    ELSE  ! 
     3934       DO ji=1,kjpindex 
     3935          IF(vegtot(ji).GT.min_sechiba) THEN 
     3936             ! returnflow_soil is assumed to enter from the bottom, but it is not possible with CWRR 
     3937             returnflow_soil(ji) = zero 
     3938             reinfiltration_soil(ji) = (returnflow(ji) + reinfiltration(ji))/vegtot(ji) 
     3939             irrigation_soil(ji,:) = irrigation(ji)/vegtot(ji) 
     3940             ! irrigation_soil(ji) = irrigation(ji)/vegtot(ji) 
     3941             ! Computed for all the grid cell. New way is equivalent, and coherent 
     3942             ! with irrigation_soil new dimensions (cells, soil tiles) 
     3943             ! Irrigation is kg/m2 of grid cell. For the old irrig. scheme, 
     3944             ! irrigation soil is the same for every soil tile 
     3945             ! Next lines are in tag 2.0, deleted because values are already init to zero 
     3946             ! ELSE 
     3947             ! returnflow_soil(ji) = zero 
     3948             ! reinfiltration_soil(ji) = zero 
     3949             ! irrigation_soil(ji) = zero 
     3950             ! ENDIF 
     3951          ENDIF 
     3952       ENDDO 
     3953    ENDIF 
    38533954     
    38543955    !! -- START MAIN LOOP (prognostic loop to update mc and mcl) OVER SOILTILES 
     
    39014002       ! Here, temp is used as a temporary variable to store the min of water to infiltrate vs evaporate 
    39024003       DO ji = 1, kjpindex 
    3903           temp(ji) = MIN(water2infilt(ji,jst) + irrigation_soil(ji) + reinfiltration_soil(ji) & 
     4004          temp(ji) = MIN(water2infilt(ji,jst) + irrigation_soil(ji,jst) + reinfiltration_soil(ji) & 
    39044005                         - MIN(ae_ns(ji,jst),zero) - MIN(subsinksoil(ji),zero) + precisol_ns(ji,jst), & 
    39054006                           MAX(ae_ns(ji,jst),zero) + MAX(subsinksoil(ji),zero) ) 
     
    39124013       !   - eventually, water2infilt holds all fluxes to the soil surface except precisol (reduced by water2extract) 
    39134014       DO ji = 1, kjpindex 
    3914           water2infilt(ji,jst) = water2infilt(ji,jst) + irrigation_soil(ji) + reinfiltration_soil(ji) & 
     4015         !Note that in tag 2.0, irrigation_soil(ji), changed to be coherent with new variable dimension 
     4016          water2infilt(ji,jst) = water2infilt(ji,jst) + irrigation_soil(ji, jst) + reinfiltration_soil(ji) & 
    39154017                - MIN(ae_ns(ji,jst),zero) - MIN(subsinksoil(ji),zero) + precisol_ns(ji,jst) & 
    39164018                - temp(ji)  
     
    39554057       IF ( .NOT. doponds ) THEN ! this is the general case... 
    39564058          DO ji = 1, kjpindex 
    3957              water2infilt(ji,jst) = reinf_slope(ji) * ru_ns(ji,jst) 
     4059             water2infilt(ji,jst) = reinf_slope_soil(ji,jst) * ru_ns(ji,jst) 
    39584060          ENDDO 
    39594061       ELSE 
     
    43414443          tmcs_litter(:) = tmcs_litter(:) + sms(:,jsl) 
    43424444       END DO 
    4343               
     4445 
     4446       ! Here we compute root zone deficit, to have an estimate of water demand in irrigated soil column (i.e. crop and grass) 
     4447       IF(jst .EQ. irrig_st ) THEN 
     4448           !It computes water deficit only on the root zone, and only on the layers where 
     4449           !there is actually a deficit. If there is not deficit, it does not take into account that layer 
     4450            DO ji = 1,kjpindex 
     4451 
     4452                root_deficit(ji) = SUM( MAX(zero, beta_irrig*smf(ji,1:nslm_root(ji) ) & 
     4453                - sm(ji,1:nslm_root(ji)  ) )) - water2infilt(ji,jst) 
     4454 
     4455                root_deficit(ji) = MAX( root_deficit(ji) ,  zero) 
     4456 
     4457            ENDDO 
     4458            !It COUNTS the number of pft with LAI > lai_irrig_min, inside the soiltile 
     4459            !It compares veget, but it is the same as they are related by a function 
     4460            lai_irrig_trig(:) = 0 
     4461 
     4462            DO jv = 1, nvm 
     4463              IF( .NOT. natural(jv) ) THEN 
     4464                DO ji = 1,kjpindex 
     4465 
     4466                  IF(veget(ji, jv) > veget_max(ji, jv) * ( un - & 
     4467                  exp( - lai_irrig_min * ext_coeff_vegetfrac(jv) ) ) ) THEN 
     4468 
     4469                    lai_irrig_trig(ji) = lai_irrig_trig(ji) + 1 
     4470 
     4471                  ENDIF 
     4472 
     4473                ENDDO 
     4474              ENDIF 
     4475 
     4476            ENDDO 
     4477            !If any of the PFT inside the soil tile have LAI >  lai_irrig_min (I.E. lai_irrig_trig(ji) = 0 ) 
     4478            !The root deficit is set to zero, and irrigation is not triggered 
     4479            DO ji = 1,kjpindex 
     4480 
     4481              IF( lai_irrig_trig(ji) < 1 ) THEN 
     4482                root_deficit(ji) = zero 
     4483              ENDIF 
     4484 
     4485            ENDDO 
     4486       ENDIF 
     4487 
    43444488       ! Soil wetness profiles (W-Ww)/(Ws-Ww) 
    43454489       ! soil_wet_ns is the ratio of available soil moisture to max available soil moisture 
Note: See TracChangeset for help on using the changeset viewer.