output_subbasin_to_catchment Function

public function output_subbasin_to_catchment(subbasin_values) result(catchment_values)

Arguments

Type IntentOptional AttributesName
real, intent(in) :: subbasin_values(output_nsubbasins)

Return Value real (output_ncatchments)


Called by

proc~~output_subbasin_to_catchment~~CalledByGraph proc~output_subbasin_to_catchment output_subbasin_to_catchment proc~output_day output_day proc~output_day->proc~output_subbasin_to_catchment proc~time_process_day time_process_day proc~time_process_day->proc~output_day proc~time_process_month time_process_month proc~time_process_month->proc~time_process_day proc~time_process_years time_process_years proc~time_process_years->proc~time_process_month program~swim swim program~swim->proc~time_process_years

Contents


Source Code

  function output_subbasin_to_catchment(subbasin_values) result(catchment_values)
    ! Average subbasin values to catchment
    real, intent(in) :: subbasin_values(output_nsubbasins)
    real :: catchment_values(output_ncatchments)
    integer s, scix
    real share


    catchment_values = 0
    do s = 1, output_nsubbasins
      scix = output_subbasin_catchment_ix(s)
      share = subbasin_values(s) * output_subbasin_catchment_share(s)
      catchment_values(scix) = catchment_values(scix) + share
      catchment_values(1) = &
        catchment_values(1) + share * output_catchment_basin_share(scix)
    end do
  end function output_subbasin_to_catchment