c******************************************************* SUBROUTINE FIXPOINT (xstart,nmax,xnew,errfun) c******************************************************* c roots of a nonlinear function FF - Fixed point method c IMPLICIT REAL*8 (a-h, o-z) c open(1,file='conv') xold=xstart fold=FF(xold) write(1,*)0,xold,dabs(fold-xold) c c___ start iterating _______________ c DO niter=1,nmax xnew=fold fnew=FF(xnew) write(*,*) niter,xnew,dabs(xnew-fnew) write(1,*) niter,xnew,dabs(xnew-fnew) c-- Is XR a root? IF (dabs(xnew-fnew) .lt. errfun) THEN errfun=dabs(xnew-fnew) goto 10 ENDIF c-- update xold=xnew fold=fnew ENDDO stop 'Non-converged !!!! ' 10 close(1) RETURN END include 'testfun.for'