!================================================================
      PROGRAM BESSEL
!! Compares 3 (for Part(i), or 4 for Part(ii)) ways of computing J0(x)
!
!  ...  you describe ...
!
!
!-----------------------------------------------------
!! MAIN VARIABLES/SUBPROGRAMS
!----------------------------
! SERIES8   ...
! ...
! ... you describe
! ...
!-----------------------------------------------------

         REAL ...
         COMPLEX Z, ...

         !Statement function to degree 8
         ...

         !Headings 
         ...

         !Begin loop to form table
         DO  I ...
            X=...
            Z=...
            CALL ...    !NSWC
            ...
!! Note: one can't just
!!	PRINT 100, X,SERIES8(X),SERIES(X),...
!! because that causes a recursive use of the Fortran I/O library, since
!! SERIES itself PRINTs if no convergence obtained. This can be overcome 
!! in various ways, e.g. separate the function call and the PRINT:-
	    SX=SERIES(X)
            PRINT 100, ...,SX,...
100         FORMAT(...
         ENDDO
         
      END PROGRAM

!================================================================

      FUNCTION SERIES(X)        [for (i)]
      FUNCTION SERIES(X,M)      [for (ii)]
!! ...
!===================================
!! MAIN VARIABLES
!----------------
! ...
! ...
!===================================

         ! Partial sum loop
         DO  M=0,100   !allow for some large number of terms
            IF ...
               ... see earlier question on sin-squared
            ENDIF
            ! Test for convergence and RETURN if satisfied
	    IF(ABS(TERM)...) RETURN
         ENDDO 
         ! If no convergence after say 100 terms, then print warning and stop
         ...
         ...

      END FUNCTION

!================================================================
