crop_initialise_hydrotope Subroutine

public subroutine crop_initialise_hydrotope(nsub, nhru, iy, mstruc)

Author : stefan.liersch@pik-potsdam.de Date : 2009-11-25 modified: 2009-12-08

PURPOSE : THIS SUBROUTINE INITIALIZES CROP MANAGEMENT DATA AT HRU LEVEL

CALLED : from subroutine hydrotop

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: nsub
integer, intent(in) :: nhru
integer, intent(in) :: iy
integer, intent(in), dimension(:, :, :):: mstruc

Called by

proc~~crop_initialise_hydrotope~~CalledByGraph proc~crop_initialise_hydrotope crop_initialise_hydrotope proc~hydrotope_process hydrotope_process proc~hydrotope_process->proc~crop_initialise_hydrotope proc~runsubbasin runsubbasin proc~runsubbasin->proc~hydrotope_process 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

  subroutine crop_initialise_hydrotope(nsub, nhru, iy, mstruc)
    !-------------------------------------------------------------------------------
    ! Author : stefan.liersch@pik-potsdam.de
    ! Date : 2009-11-25
    ! modified: 2009-12-08
    !
    ! PURPOSE : THIS SUBROUTINE INITIALIZES CROP MANAGEMENT DATA AT HRU LEVEL
    !
    ! CALLED : from subroutine hydrotop
    !-------------------------------------------------------------------------------

    !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    !     PARAMETERS & VARIABLES
    !
    !      >>>>> COMMON PARAMETERS & VARIABLES
    !      fen(if) = amount of min N fertilizers applied, kg N/ha
    !      feno(if) = amount of org N fertilizers applied, kg N/ha
    !      fep(if) = amount of P fertilizers applied, kg P/ha
    !      icc = index for cover crop corr. number in crop database
    !      idfe(if) = day of fertilization
    !      idop(io) = day of operation
    !      iopc(io) = operation code: 1 - planting, 2 - harvest & kill
    !                                 3 - harvest, 4 - kill


    integer, intent(in) :: iy
    integer, dimension(:, :, :), intent(in) :: mstruc
    integer, intent(in) :: nsub, nhru
    integer :: i = 0, j = 0
    ! number of years of rotation (3) + one initialization year (year 0)
    integer :: rotation
    integer :: management

    rotation = nrotyrs + 1

    ! find the correct index for cropland management
    ! this depends on the mgt_id and current rotation year
    management = mstruc(nsub, nhru, 4)
    i = management * rotation - rotation + 1
    if (iy > 1) i = i + iyrrot ! iyrrot is calculated in mainpro

    cur_nop = mgt_nop(i) ! hydrotop - specific number of mgt operations

    do j = 1, mgt_nop(i)
      idop(j) = mgt_idop(i, j)
      iopc(j) = mgt_iopc(i, j)
      ncrp(j) = mgt_ncrp(i, j)
      idfe(j) = mgt_idfe(i, j)
      fen(j) = mgt_fen(i, j)
      feno(j) = mgt_feno(i, j)
      fep(j) = mgt_fep(i, j)
    end do

  end subroutine crop_initialise_hydrotope