subroutine timeStep2(u,n,error) implicit none double precision u(n,n) double precision error double precision tmp, diff integer n,i,j !f2py intent(in, out) :: u !f2py intent(out) :: error !f2py intent(in) :: n error = 0d0 do j=2,n-1 do i=2,n-1 tmp = u(i,j) u(i,j) = (u(i-1,j) + u(i+1,j) + & u(i,j-1) + u(i,j+1))/4.0d0 diff = u(i,j) - tmp error = error + diff*diff end do end do error = sqrt(error) end subroutine timeStep2