Commit 62b842f2 authored by Loic Huder's avatar Loic Huder
Browse files

Added f2py snippets

parent 587f8912
subroutine sum_squares(A, res)
implicit none
real, dimension(:) :: A
real :: res
integer :: i, N
N = size(A)
res = 0.
do i=1, N
res = res + A(i)*A(i)
end do
end subroutine
\ No newline at end of file
subroutine sum_squares(A, res)
implicit none
real, dimension(:), intent(in) :: A
real, intent(out) :: res
integer :: i, N
N = size(A)
res = 0.
do i=1, N
res = res + A(i)*A(i)
end do
end subroutine
real function sum_squares_as_func(A)
implicit none
real, dimension(:), intent(in) :: A
integer :: i, N
N = size(A)
sum_squares_as_func = 0.
do i=1, N
sum_squares_as_func = sum_squares_as_func + A(i)*A(i)
end do
end function
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment