output_check_requested_vars Subroutine

public subroutine output_check_requested_vars()

Uses

  • proc~~output_check_requested_vars~~UsesGraph proc~output_check_requested_vars output_check_requested_vars module~utilities utilities proc~output_check_requested_vars->module~utilities

Arguments

None

Calls

proc~~output_check_requested_vars~~CallsGraph proc~output_check_requested_vars output_check_requested_vars proc~string_index string_index proc~output_check_requested_vars->proc~string_index proc~log_error log_error proc~output_check_requested_vars->proc~log_error proc~log_message log_message proc~log_error->proc~log_message 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~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_check_requested_vars~~CalledByGraph proc~output_check_requested_vars output_check_requested_vars proc~output_initialise_storage output_initialise_storage proc~output_initialise_storage->proc~output_check_requested_vars 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_check_requested_vars
    ! Make sure all requested variables have been registered.
    use utilities, only: string_index
    character(len=identifier_max_length) vs
    integer i, ih, is

    do i = 1, output_nvars
      vs = output_requested_vars(i)
      ih = string_index(vs, output_hydrotope_vars)
      is = string_index(vs, output_subbasin_vars)
      ! Is requested variable registered?
      if (ih + is == 0) call log_error("output_check_requested_vars", &
        "Requested output variable invalid: "//vs)
      ! Is subbasin variable requested at hydrotope level?
      if (ih == 0 .and. maxval(output_is_requested(i, 1, :)) > 0) then
        call log_error("output_check_requested_vars", &
          "Requested variable at hydrotope level is not a hydrotope variable: "//vs)
      end if
    end do
  end subroutine output_check_requested_vars