output_register_var Subroutine

public subroutine output_register_var(name, state, counter, vars, id)

Uses

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

Arguments

Type IntentOptional AttributesName
character, intent(in) :: name
logical, intent(in) :: state
integer, intent(inout) :: counter
character, intent(out) :: vars(:)
integer, intent(out) :: id

Calls

proc~~output_register_var~~CallsGraph proc~output_register_var output_register_var proc~string_index string_index proc~output_register_var->proc~string_index proc~log_error log_error proc~output_register_var->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_register_var~~CalledByGraph proc~output_register_var output_register_var proc~output_register_subbasin_var output_register_subbasin_var proc~output_register_subbasin_var->proc~output_register_var proc~output_register_hydrotope_var output_register_hydrotope_var proc~output_register_hydrotope_var->proc~output_register_var proc~snow_initialise snow_initialise proc~snow_initialise->proc~output_register_subbasin_var proc~snow_initialise->proc~output_register_hydrotope_var proc~vegetation_initialise vegetation_initialise proc~vegetation_initialise->proc~output_register_hydrotope_var proc~crop_initialise crop_initialise proc~crop_initialise->proc~output_register_hydrotope_var proc~soil_initialise soil_initialise proc~soil_initialise->proc~output_register_hydrotope_var proc~evapotranspiration_initialise evapotranspiration_initialise proc~evapotranspiration_initialise->proc~output_register_hydrotope_var proc~groundwater_initialise groundwater_initialise proc~groundwater_initialise->proc~output_register_subbasin_var proc~groundwater_initialise->proc~output_register_hydrotope_var proc~river_initialise river_initialise proc~river_initialise->proc~output_register_subbasin_var proc~hydrotope_initialise hydrotope_initialise proc~hydrotope_initialise->proc~output_register_subbasin_var proc~hydrotope_initialise->proc~output_register_hydrotope_var proc~subbasin_initialise subbasin_initialise proc~subbasin_initialise->proc~output_register_subbasin_var proc~initialise initialise proc~initialise->proc~snow_initialise proc~initialise->proc~vegetation_initialise proc~initialise->proc~crop_initialise proc~initialise->proc~soil_initialise proc~initialise->proc~evapotranspiration_initialise proc~initialise->proc~groundwater_initialise proc~initialise->proc~river_initialise proc~initialise->proc~hydrotope_initialise proc~initialise->proc~subbasin_initialise program~swim swim program~swim->proc~initialise

Contents

Source Code


Source Code

  subroutine output_register_var(name, state, counter, vars, id)
    ! Abstract subroutine of register_hydrotope/subbasin_var functions.
    use utilities, only: string_index
    character(*), intent(in) :: name
    logical, intent(in) :: state
    integer, intent(inout) :: counter
    character(*), intent(out) :: vars(:)
    integer, intent(out) :: id
    integer vi

    ! make sure name hasnt been registered already
    if (string_index(name, vars) > 0) &
      call log_error("output_register_var", trim(name)//" has already been registered.")
    ! is variable requested?
    vi = string_index(name, output_requested_vars)
    output_registered_vars(string_index("", output_registered_vars)) = name
    ! increase counter if requested
    if (vi > 0) then
      counter = counter + 1
      vars(counter) = name
      id = counter
      output_var_state(vi) = state
    else
      id = 0
    end if
  end subroutine output_register_var