Research Article

High-Performance Design Patterns for Modern Fortran

Listing 9

function add_to_local(lhs, rhs) result(total)
  class(tensor), intent(in):: lhs
  type(local_tensor), intent(in):: rhs
  type(local_tensor):: total
  total = lhs%state() + rhs%global_f(:)
end function