I am getting an error message in my subroutine when I run my code.
This code is from an exercise in Kincaid & Cheney's book on Gauss Seidel methods to solve elliptic partial differential equations.
The error message is:
dummy argument 'u' with INTENT(IN) in variable definition context (assignment) at (1).
I refer to (1) in the code below. How can I fix the subroutine so the error message does not come up?
subroutine seidel(ax,ay,nx,ny,h,itmax,u)
real, dimension(0:nx,0:ny), intent(in) :: u
real, intent(in) :: ax,ay, h
integer, intent(in) :: nx, ny, itmax
integer:: i,j,k
do k = 1,itmax
do j = 1,ny-1
y = ay + real(j)*h
do i = 1,nx-1
x = ax + real(i)*h
v = u(i+1,j) + u(i-1,j) + u(i,j+1) + u(i,j-1)
u(i,j) = (v - h*h*g(x,y))/(4.0 - h*h*f(x,y)) (1)
end do
end do
end do
end subroutine seidel