crop_read_management_input Subroutine

public subroutine crop_read_management_input()

Uses

  • proc~~crop_read_management_input~~UsesGraph proc~crop_read_management_input crop_read_management_input module~input input proc~crop_read_management_input->module~input module~utilities utilities module~input->module~utilities

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

Arguments

None

Calls

proc~~crop_read_management_input~~CallsGraph proc~crop_read_management_input crop_read_management_input proc~read_integer_column read_integer_column proc~crop_read_management_input->proc~read_integer_column proc~read_real_column read_real_column proc~crop_read_management_input->proc~read_real_column proc~input_type_conversion_error input_type_conversion_error proc~read_integer_column->proc~input_type_conversion_error proc~move_lines move_lines proc~read_integer_column->proc~move_lines proc~check_int_range check_int_range proc~read_integer_column->proc~check_int_range proc~log_error log_error proc~read_integer_column->proc~log_error proc~read_csv_item read_csv_item proc~read_integer_column->proc~read_csv_item proc~header_column_index header_column_index proc~read_integer_column->proc~header_column_index proc~input_error_column_not_found input_error_column_not_found proc~read_integer_column->proc~input_error_column_not_found proc~read_real_column->proc~input_type_conversion_error proc~read_real_column->proc~move_lines proc~read_real_column->proc~log_error proc~check_range check_range proc~read_real_column->proc~check_range proc~read_real_column->proc~read_csv_item proc~read_real_column->proc~header_column_index proc~read_real_column->proc~input_error_column_not_found proc~input_type_conversion_error->proc~log_error proc~check_int_range->proc~log_error proc~log_warn log_warn proc~check_int_range->proc~log_warn proc~out_of_range_error out_of_range_error proc~check_int_range->proc~out_of_range_error proc~log_message log_message proc~log_error->proc~log_message proc~check_range->proc~log_error proc~check_range->proc~log_warn proc~check_range->proc~out_of_range_error proc~header_column_index->proc~move_lines proc~header_column_index->proc~input_error_column_not_found proc~input_error_column_not_found->proc~log_error proc~log_warn->proc~log_message proc~out_of_range_error->proc~log_error proc~to_string to_string proc~out_of_range_error->proc~to_string proc~log_write log_write proc~log_message->proc~log_write proc~log_format_message log_format_message proc~log_message->proc~log_format_message proc~log_write->proc~to_string proc~date_time_str date_time_str proc~log_format_message->proc~date_time_str proc~colourise colourise proc~log_format_message->proc~colourise proc~string_index string_index proc~colourise->proc~string_index

Called by

proc~~crop_read_management_input~~CalledByGraph proc~crop_read_management_input crop_read_management_input proc~crop_initialise crop_initialise proc~crop_initialise->proc~crop_read_management_input proc~initialise initialise proc~initialise->proc~crop_initialise program~swim swim program~swim->proc~initialise

Contents


Source Code

  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