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