crop_yield_output Subroutine

public subroutine crop_yield_output(j, jek, k, ieap, ms, ndgro, tsav, wsav, ylda, is_cropland)

Arguments

Type IntentOptional AttributesName
integer :: j
integer :: jek
integer :: k
integer, intent(inout) :: ieap
integer, intent(in) :: ms
integer, intent(in) :: ndgro
real(kind=dp), intent(inout), dimension(:, :):: tsav
real(kind=dp), intent(inout), dimension(:, :):: wsav
real(kind=dp), intent(in), dimension(:, :):: ylda
logical, intent(in) :: is_cropland

Called by

proc~~crop_yield_output~~CalledByGraph proc~crop_yield_output crop_yield_output proc~runsubbasin runsubbasin proc~runsubbasin->proc~crop_yield_output proc~time_process_day time_process_day proc~time_process_day->proc~runsubbasin proc~time_process_month time_process_month proc~time_process_month->proc~time_process_day proc~time_process_years time_process_years proc~time_process_years->proc~time_process_month program~swim swim program~swim->proc~time_process_years

Contents

Source Code


Source Code

  subroutine crop_yield_output(j, jek, k, ieap, ms, ndgro, tsav, wsav, ylda, is_cropland)
    !**** PURPOSE: Write crop yield for GRASS output
    !**** CALLED IN: SUBBASIN
    !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    !     PARAMETERS & VARIABLES
    !
    !      >>>>> COMMON PARAMETERS & VARIABLES
    !      ieap = counter
    !      ndgro = number days of growth - calc. in crop
    !      tsav(j, je) = temp stress, sum for the growth period
    !      wsav(j, je) = water stress, sum for the growth period
    !      ylda(j, k) = crop yield, kg/ha
    !      >>>>>

    !      >>>>> STATIC PARAMETERS
    !      mts = mean temp stress for the growth period, in %
    !      mws = mean water stress for the growth period, in %
    !      myld = ylda(j, k)/100 - yield in kg/dt, integer
    !      xyld = crop yield, dt/ha
    !      >>>>>
    !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    !**** Include common parameters

    integer, intent(inout) :: ieap
    integer, intent(in) :: ms
    integer, intent(in) :: ndgro
    real(dp), dimension(:, :), intent(inout) :: tsav
    real(dp), dimension(:, :), intent(inout) :: wsav
    real(dp), dimension(:, :), intent(in) :: ylda
    logical, intent(in) :: is_cropland

    integer :: j, jek, k, mts, mws, myld
    real(dp) :: xyld

    if (is_cropland .and. k .lt. ms .and. ndgro .gt. 0) then
      xyld = ylda(j, k) / 100. + 0.5
      myld = int(xyld)
      mws = int(wsav(j, jek) / ndgro * 100)
      mts = int(tsav(j, jek) / ndgro * 100)
    else
      myld = 0
      mws = 0
      mts = 0
    end if

    ieap = ieap + 1
    wsav(j, jek) = 0.
    tsav(j, jek) = 0.

  end subroutine crop_yield_output