output_initialise_storage Subroutine

public subroutine output_initialise_storage(hydrotope_input_fid, subbasin_input_fid)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: hydrotope_input_fid
integer, intent(in) :: subbasin_input_fid

Calls

proc~~output_initialise_storage~~CallsGraph proc~output_initialise_storage output_initialise_storage proc~output_open_files output_open_files proc~output_initialise_storage->proc~output_open_files proc~output_initialise_labelled output_initialise_labelled proc~output_initialise_storage->proc~output_initialise_labelled proc~output_initialise_storage_index output_initialise_storage_index proc~output_initialise_storage->proc~output_initialise_storage_index proc~output_check_requested_vars output_check_requested_vars proc~output_initialise_storage->proc~output_check_requested_vars proc~output_write_csv_header output_write_csv_header proc~output_open_files->proc~output_write_csv_header proc~output_open_file output_open_file proc~output_open_files->proc~output_open_file proc~log_error log_error proc~output_initialise_labelled->proc~log_error proc~read_string_column read_string_column proc~output_initialise_labelled->proc~read_string_column proc~has_column has_column proc~output_initialise_labelled->proc~has_column proc~indeces_in_array indeces_in_array proc~output_initialise_storage_index->proc~indeces_in_array proc~output_check_requested_vars->proc~log_error proc~string_index string_index proc~output_check_requested_vars->proc~string_index proc~log_message log_message proc~log_error->proc~log_message proc~read_string_column->proc~log_error proc~move_lines move_lines proc~read_string_column->proc~move_lines proc~read_csv_item read_csv_item proc~read_string_column->proc~read_csv_item proc~header_column_index header_column_index proc~read_string_column->proc~header_column_index proc~input_error_column_not_found input_error_column_not_found proc~read_string_column->proc~input_error_column_not_found proc~indeces_in_array->proc~string_index proc~has_column->proc~header_column_index proc~open_file open_file proc~output_open_file->proc~open_file proc~header_column_index->proc~move_lines proc~header_column_index->proc~input_error_column_not_found proc~open_file->proc~log_error 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~colourise->proc~string_index

Called by

proc~~output_initialise_storage~~CalledByGraph proc~output_initialise_storage output_initialise_storage proc~output_initialise output_initialise proc~output_initialise->proc~output_initialise_storage proc~initialise initialise proc~initialise->proc~output_initialise program~swim swim program~swim->proc~initialise

Contents


Source Code

  subroutine output_initialise_storage(hydrotope_input_fid, subbasin_input_fid)
    ! Initialisation storage after all variables have been registered registration.
    integer, intent(in) :: hydrotope_input_fid, subbasin_input_fid
    integer :: nd, nm, ny
    integer :: nspacetime(3, 3)

    call output_initialise_labelled(hydrotope_input_fid, subbasin_input_fid)
    call output_check_requested_vars
    call output_open_files
    call output_initialise_storage_index

    nd = output_ndays
    nm = output_nmonths
    ny = output_nyears
    ! Raw daily stores
    allocate(output_storage_hydrotope(output_id_hydrotope_counter, output_nhydrotopes, nd))
    allocate(output_storage_subbasin(output_id_subbasin_counter, output_nsubbasins, nd))
    ! Total variables requested for (space, time), maxval because [csv, bin] = 1
    nspacetime = sum(output_is_requested, dim=1)
    allocate(output_agg_hydrotope_monthly(nspacetime(1, 2), output_nhydrotopes, nm))
    allocate(output_agg_hydrotope_annual(nspacetime(1, 3), output_nhydrotopes, ny))
    allocate(output_agg_subbasin_daily(nspacetime(2, 1), output_nsubbasins, nd))
    allocate(output_agg_subbasin_monthly(nspacetime(2, 2), output_nsubbasins, nm))
    allocate(output_agg_subbasin_annual(nspacetime(2, 3), output_nsubbasins, ny))
    allocate(output_agg_catchment_daily(nspacetime(3, 1), output_ncatchments, nd))
    allocate(output_agg_catchment_monthly(nspacetime(3, 2), output_ncatchments, nm))
    allocate(output_agg_catchment_annual(nspacetime(3, 3), output_ncatchments, ny))
    ! set all to 0
    output_storage_hydrotope = 0
    output_storage_subbasin = 0
    output_agg_hydrotope_monthly = 0
    output_agg_hydrotope_annual = 0
    output_agg_subbasin_daily = 0
    output_agg_subbasin_monthly = 0
    output_agg_subbasin_annual = 0
    output_agg_catchment_daily = 0
    output_agg_catchment_monthly = 0
    output_agg_catchment_annual = 0
  end subroutine output_initialise_storage