program newt_main implicit none integer n,i,i_again parameter (n=2) real x(n) logical check 100 write(*,*) 'Type in the vector x(1:',n,') as initial guess :' read (*,*) (x(i),i=1,n) c "n" is used to declare x(n) in subroutine newt, we therefore need c to make "n" an parameter in the main program. call newt(x,n,check) write(*,*) 'The resulting root vector is :' write(*,*) (x(i),i=1,n) 102 write(*,*) 'Find root again ? (1=YES; 0=NO)' read(*,*) i_again if (i_again.eq.1) goto 100 if (i_again.ne.0) goto 102 end c subroutine funcv(n,x,f) c integer n c real x(n),f(n) c f(1) = x(1)**2 + x(2) - 1 c f(2) = x(2) c end c subroutine funcv(n,x,f) c integer n c real x(n),f(n) c f(1) = x(1) c f(2) = x(2) c end subroutine funcv(n,x,f) integer n real x(n),f(n) f(1) = x(1)**2 + x(2)**2 - 25 f(2) = x(2) end