reservoir_read_storage_file Subroutine

public subroutine reservoir_read_storage_file()

Uses

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

Arguments

None

Calls

proc~~reservoir_read_storage_file~~CallsGraph proc~reservoir_read_storage_file reservoir_read_storage_file proc~input_open_file input_open_file proc~reservoir_read_storage_file->proc~input_open_file proc~read_real_column read_real_column proc~reservoir_read_storage_file->proc~read_real_column 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~log_error log_error 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~input_type_conversion_error->proc~log_error proc~log_message log_message proc~log_error->proc~log_message proc~check_range->proc~log_error proc~log_warn log_warn proc~check_range->proc~log_warn proc~out_of_range_error out_of_range_error 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~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~~reservoir_read_storage_file~~CalledByGraph proc~reservoir_read_storage_file reservoir_read_storage_file proc~reservoir_initialise reservoir_initialise proc~reservoir_initialise->proc~reservoir_read_storage_file proc~initialise initialise proc~initialise->proc~reservoir_initialise program~swim swim program~swim->proc~initialise

Contents


Source Code

  subroutine reservoir_read_storage_file() ! reservoir_storage_conf.csv
    use input, only : read_real_column, input_open_file

    integer :: fid
    real(dp), dimension(:), allocatable :: temp
    integer size

    fid = input_open_file(trim(reservoir_storage_input_file))

    size = rsv_nReservoirs * 20
    allocate(temp(size))

    call read_real_column(fid, "pol_l", temp, 0.0_dp)
    rsv_pol_L(1, 1:20) = temp(1:20)
    rsv_pol_L(2, 1:20) = temp(21:40)
    call read_real_column(fid, "pol_l2", temp, 0.0_dp)
    rsv_pol_L2(1, 1:20) = temp(1:20)
    rsv_pol_L2(2, 1:20) = temp(21:40)
    call read_real_column(fid, "pol_a", temp, 0.0_dp)
    rsv_pol_A(1, 1:20) = temp(1:20)
    rsv_pol_A(2, 1:20) = temp(21:40)
    call read_real_column(fid, "pol_v", temp, 0.0_dp)
    rsv_pol_V(1, 1:20) = temp(1:20)
    rsv_pol_V(2, 1:20) = temp(21:40)
    call read_real_column(fid, "pol_hp", temp, 0.0_dp)
    rsv_pol_HP(1, 1:20) = temp(1:20)
    rsv_pol_HP(2, 1:20) = temp(21:40)

    ! convert million m^3 to m^3
    rsv_pol_V = rsv_pol_V * 10 ** 6 ! convert [million m^3] into [m^3]

    close(fid)

  end subroutine reservoir_read_storage_file