subroutine timeStep4(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) = (4.0d0*(u(i-1,j) + u(i+1,j) + & u(i,j-1) + u(i,j+1)) & + u(i-1,j-1) + u(i+1,j+1) + & u(i+1,j-1) + u(i-1,j+1))/20.0d0 diff = u(i,j) - tmp error = error + diff*diff end do end do error = sqrt(error) end subroutine timeStep4