hydrotope_read_input Subroutine

public subroutine hydrotope_read_input()

Uses

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

Arguments

None

Calls

proc~~hydrotope_read_input~~CallsGraph proc~hydrotope_read_input hydrotope_read_input proc~log_info log_info proc~hydrotope_read_input->proc~log_info proc~input_count_rows input_count_rows proc~hydrotope_read_input->proc~input_count_rows proc~input_open_file input_open_file proc~hydrotope_read_input->proc~input_open_file proc~read_real_column read_real_column proc~hydrotope_read_input->proc~read_real_column proc~read_integer_column read_integer_column proc~hydrotope_read_input->proc~read_integer_column proc~log_message log_message proc~log_info->proc~log_message proc~log_error log_error proc~input_count_rows->proc~log_error proc~open_file open_file proc~input_open_file->proc~open_file proc~input_type_conversion_error input_type_conversion_error proc~read_real_column->proc~input_type_conversion_error proc~move_lines move_lines 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_csv_item read_csv_item proc~read_real_column->proc~read_csv_item proc~header_column_index header_column_index proc~read_real_column->proc~header_column_index proc~input_error_column_not_found input_error_column_not_found proc~read_real_column->proc~input_error_column_not_found proc~read_integer_column->proc~input_type_conversion_error proc~read_integer_column->proc~move_lines proc~check_int_range check_int_range proc~read_integer_column->proc~check_int_range proc~read_integer_column->proc~log_error proc~read_integer_column->proc~read_csv_item proc~read_integer_column->proc~header_column_index proc~read_integer_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_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~open_file->proc~log_error proc~header_column_index->proc~move_lines proc~header_column_index->proc~input_error_column_not_found 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~input_error_column_not_found->proc~log_error proc~to_string to_string 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~log_warn->proc~log_message proc~out_of_range_error->proc~log_error proc~out_of_range_error->proc~to_string proc~string_index string_index proc~colourise->proc~string_index

Called by

proc~~hydrotope_read_input~~CalledByGraph proc~hydrotope_read_input hydrotope_read_input proc~hydrotope_initialise hydrotope_initialise proc~hydrotope_initialise->proc~hydrotope_read_input proc~initialise initialise proc~initialise->proc~hydrotope_initialise program~swim swim program~swim->proc~initialise

Contents

Source Code


Source Code

  subroutine hydrotope_read_input
    use input, only : read_integer_column, read_real_column, input_open_file, input_count_rows

    hydrotope_input_file_id = input_open_file(hydrotope_input_file)
    hydrotope_csv_size = input_count_rows(hydrotope_input_file_id, .true.)
    call log_info('hydrotope_read_input', 'Number of hydrotopes:', &
      int=hydrotope_csv_size)

    allocate(hydrotope_ids(hydrotope_csv_size))
    allocate(hydrotope_subbasin_id(hydrotope_csv_size))
    allocate(landuse_ids(hydrotope_csv_size))
    allocate(soil_ids(hydrotope_csv_size))
    allocate(elevations(hydrotope_csv_size))
    allocate(glaciers(hydrotope_csv_size))
    allocate(hydrotope_area(hydrotope_csv_size))
    allocate(irrigations(hydrotope_csv_size))
    allocate(wetland(hydrotope_csv_size))
    allocate(crop_management_id(hydrotope_csv_size))

    call read_integer_column(hydrotope_input_file_id, "subbasin_id", hydrotope_subbasin_id)
    call read_integer_column(hydrotope_input_file_id, "hydrotope_id", hydrotope_ids)
    call read_integer_column(hydrotope_input_file_id, "landuse_id", landuse_ids)
    call read_integer_column(hydrotope_input_file_id, "soil_id", soil_ids)
    call read_integer_column(hydrotope_input_file_id, "elevation", elevations)
    call read_integer_column(hydrotope_input_file_id, "glacier_thickness", glaciers, 0)
    call read_real_column(hydrotope_input_file_id, "area", hydrotope_area)
    call read_integer_column(hydrotope_input_file_id, "irrigation_user_id", irrigations, 0)
    call read_integer_column(hydrotope_input_file_id, "wetland", wetland, 0)
    call read_integer_column(hydrotope_input_file_id, "crop_management_id", crop_management_id, 1)

  end subroutine hydrotope_read_input