Scientific Programming / 2015 / Article / Lst 13

Research Article

High-Performance Design Patterns for Modern Fortran

Listing 13

pure function add(lhs, rhs) result(total)
class(local_tensor), intent(in):: lhs, rhs
type(local_tensor):: total
! Requires
if (lhs%user_defined() .and. &
  rhs%user_defined()) then
total%f = lhs%f + rhs%f
 ! Ensures
call total%mark_as_defined
 end if
end function

We are committed to sharing findings related to COVID-19 as quickly as possible. We will be providing unlimited waivers of publication charges for accepted research articles as well as case reports and case series related to COVID-19. Review articles are excluded from this waiver policy. Sign up here as a reviewer to help fast-track new submissions.