function cross_2d_d(a,b) result(c) real(8),dimension(2) :: a,b real(8) :: c c = a(1)*b(2) - a(2)*b(1) end function cross_2d_d