⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 irr_res.f

📁 水文模型的原始代码
💻 F
字号:
      subroutine irr_res

!!    ~ ~ ~ PURPOSE ~ ~ ~
!!    this subroutine performs the irrigation operation when the water
!!    source is a reservoir

!!    ~ ~ ~ INCOMING VARIABLES ~ ~ ~
!!    name            |units         |definition
!!    ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!!    aird(:)         |mm H2O        |amount of water applied to HRU on current
!!                                   |day
!!    auto_wstr(:,:,:)|none or mm    |water stress factor which triggers auto
!!                                   |irrigation
!!    iida            |julian date   |day being simulated (current julian date)
!!    wstrs_id(:,:,:)  |none          |water stress identifier:
!!                                   |1 plant water demand
!!                                   |2 soil water deficit
!!    iir(:,:,:)      |julian date   |date of irrigation operation
!!    inum1           |none          |reservoir number
!!    ipot(:)         |none          |number of HRU (in subbasin) that is ponding
!!                                   |water--the HRU that the surface runoff from
!!                                   |current HRU drains into. This variable is
!!                                   |used only for rice paddys or closed
!!                                   |depressional areas
!!    irr_amt(:,:,:)  |mm H2O        |depth of irrigation water applied to
!!                                   |HRU
!!    irrno(:)        |none          |irrigation source location
!!                                   |if IRR=1, IRRNO is the number of the
!!                                   |          reach
!!                                   |if IRR=2, IRRNO is the number of the
!!                                   |          reservoir
!!                                   |if IRR=3, IRRNO is the number of the
!!                                   |          subbasin
!!                                   |if IRR=4, IRRNO is the number of the
!!                                   |          subbasin
!!                                   |if IRR=5, not used
!!    irrsc(:)        |none          |irrigation source code:
!!                                   |1 divert water from reach
!!                                   |2 divert water from reservoir
!!                                   |3 divert water from shallow aquifer
!!                                   |4 divert water from deep aquifer
!!                                   |5 divert water from source outside
!!                                   |  watershed
!!    nair(:)         |none          |sequence number of auto-irrigation
!!                                   |application within the year
!!    nhru            |none          |number of HRUs in watershed
!!    nirr(:)         |none          |sequence number of irrigation application
!!                                   |within the year
!!    nro(:)          |none          |sequence number of year in rotation
!!    phuacc(:)       |none          |fraction of plant heat units accumulated
!!    phuirr(:,:,:)   |none          |fraction of plant heat units at which
!!                                   |irrigation occurs
!!    pot_vol(:)      |m**3 H2O      |current volume of water stored in the
!!                                   |depression/impounded area
!!    res_vol(:)      |m**3          |reservoir volume
!!    sol_sumfc(:)    |mm H2O        |amount of water held in the soil profile
!!                                   |at field capacity
!!    sol_sw(:)       |mm H2O        |amount of water stored in soil profile on any
!!                                   |given day
!!    strsw(:)        |none          |fraction of potential plant growth achieved
!!                                   |on the day where the reduction is caused by
!!                                   |water stress
!!    ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

!!    ~ ~ ~ OUTGOING VARIABLES ~ ~ ~
!!    name        |units         |definition
!!    ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!!    nirr(:)     |none          |sequence number of irrigation application
!!                               |within the year
!!    pot_vol(:)  |m**3 H2O      |current volume of water stored in the
!!                               |depression/impounded area
!!    res_vol(:)  |m**3          |reservoir volume
!!    ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

!!    ~ ~ ~ LOCAL DEFINITIONS ~ ~ ~
!!    name        |units         |definition
!!    ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!!    cnv         |none          |conversion factor (mm => m^3)
!!    flag        |none          |irrigation flag:
!!                               |0 no irrigation operation on current day
!!                               |1 scheduled irrigation
!!                               |2 auto irrigation
!!    jres        |none          |reservoir number
!!    k           |none          |HRU number
!!    vmm         |mm H2O        |depth of irrigation water over HRU
!!    vmxi        |mm H2O        |amount of water specified in irrigation
!!                               |operation
!!    vol         |m^3 H2O       |volume of water applied in irrigation 
!!                               |operation
!!    ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

!!    ~ ~ ~ SUBROUTINES/FUNCTIONS CALLED ~ ~ ~
!!    Intrinsic: Abs, Min
!!    SWAT: irrigate

!!    ~ ~ ~ ~ ~ ~ END SPECIFICATIONS ~ ~ ~ ~ ~ ~

      use parm

      integer :: jres, k, flag
      real :: cnv, vmm, vol, vmxi

      jres = 0
      jres = inum1

      do k = 1, nhru
        if (irrsc(k) == 2 .and. irrno(k) == jres) then

          !! check for timing of irrigation operation
          flag = 0
          if (iida == iir(nro(k),nirr(k),k)) flag = 1
          if (phuacc(k) > phuirr(nro(k),nirr(k),k)) flag = 1
          if (auto_wstr(nro(k),nair(k),k) > 0.) then
            if (wstrs_id(nro(k),nair(k),k) == 1 .and.                   &
     &                  strsw(k) < auto_wstr(nro(k),nair(k),k)) flag = 2
            if (wstrs_id(nro(k),nair(k),k) == 2 .and.                   &
     &           sol_sumfc(k) - sol_sw(k) > auto_wstr(nro(k),nair(k),k))&
     &                                                         flag = 2
          end if

          if (flag > 0) then
            cnv = 0.
            cnv = hru_ha(k) * 10.

            !! compute maximum amount of water available for irrigation
            !! from reach
            vmm = 0.
            vmm = res_vol(jres) / cnv

            !! check available against set amount in scheduled operation
            if (flag == 1) then
              vmxi = 0.
              vmxi = irr_amt(nro(k),nirr(k),k)
              if (vmxi < 1.e-6) vmxi = sol_sumfc(k)
              if (vmm > vmxi) vmm = vmxi
            end if
            if (flag == 2) then
              vmxi = 0.
              vmxi = sol_sumfc(k)
              if (vmm > vmxi) vmm = vmxi
            end if

            if (vmm > 0.) then
              vol = 0.
              vol = vmm * cnv

              if (ipot(k) == k) then
                pot_vol(k) = pot_vol(k) + vol
              else
                call irrigate(k,vmm)
              end if

              !! subtract irrigation from reservoir volume
              if (ipot(k) /= k) then
                vol = 0.
                vol = aird(k) * cnv
              end if
              res_vol(jres) = res_vol(jres) - vol
              if (res_vol(jres) < 0.) res_vol(jres) = 0.

              !! advance irrigation operation number
              if (flag == 1) then
                nirr(k) = nirr(k) + 1
              end if
          
            end if
          end if
        end if
      end do

      return
      end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -