metric_dict_add Function

private elemental function metric_dict_add(a, b) result(output)

Operation to add two metric_dict_type together

Type Bound

metric_dict_type

Arguments

Type IntentOptional Attributes Name
class(metric_dict_type), intent(in) :: a

Instances of metric data

class(metric_dict_type), intent(in) :: b

Instances of metric data

Return Value type(metric_dict_type)

Sum of the metric data


Source Code

  elemental function metric_dict_add(a, b) result(output)
    !! Operation to add two metric_dict_type together
    implicit none

    ! Arguments
    class(metric_dict_type), intent(in) :: a,b
    !! Instances of metric data
    type(metric_dict_type) :: output
    !! Sum of the metric data

    output%key = a%key
    output%val = a%val + b%val
    output%threshold = a%threshold
    output%active = a%active
    if(allocated(a%history)) output%history = a%history
    output%num_entries = a%num_entries

  end function metric_dict_add