Author : stefan.liersch@pik-potsdam.de Date : 2009-11-25 modified: 2009-12-08
PURPOSE : THIS SUBROUTINE READS CROP MANAGEMENT DATA FROM FILE: landman.csv
subroutine crop_read_management_input
!-------------------------------------------------------------------------------
! Author : stefan.liersch@pik-potsdam.de
! Date : 2009-11-25
! modified: 2009-12-08
!
! PURPOSE : THIS SUBROUTINE READS CROP MANAGEMENT DATA FROM FILE: landman.csv
!
! CALLED : from program main
!-------------------------------------------------------------------------------
use input, only : read_integer_column, read_real_column
character(len=80) :: colno
integer :: j = 0
call read_integer_column(crop_management_input_file_id, "manag_id", mgt_id, 0)
call read_integer_column(crop_management_input_file_id, "nop", mgt_nop, 0)
call read_integer_column(crop_management_input_file_id, "year", mgt_yr, 0)
call read_integer_column(crop_management_input_file_id, "lu_id", mgt_lu_id, 0)
do j = 1, mgt_nop(1)
write(colno, '(I5)') j
colno = trim(adjustl(colno))
! call read_integer_column(1818, "idop"//colno, temp(1, j), 0)
call read_integer_column(crop_management_input_file_id, "idop"//colno, mgt_idop(:, j), 0)
call read_integer_column(crop_management_input_file_id, "iopc"//colno, mgt_iopc(:, j), 0)
call read_integer_column(crop_management_input_file_id, "ncrp"//colno, mgt_ncrp(:, j), 0)
call read_integer_column(crop_management_input_file_id, "idfe"//colno, mgt_idfe(:, j), 0)
call read_real_column(crop_management_input_file_id, "fen"//colno, mgt_fen(:, j), 0.0_dp)
call read_real_column(crop_management_input_file_id, "feno"//colno, mgt_feno(:, j), 0.0_dp)
call read_real_column(crop_management_input_file_id, "fep"//colno, mgt_fep(:, j), 0.0_dp)
end do
close(crop_management_input_file_id)
end subroutine crop_read_management_input