      PROGRAM SERIES
C...
C...  DOUBLE PRECISION CODING IS USED
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C...
C...  NUMBER OF TIMES, POSITIONS, TERMS IN THE SERIES
      PARAMETER(NT=4,NX=6,NS=5)
C...
C...  DECLARE ARRAYS
      DIMENSION X(NX), SUM(NX)
C...
C...  DEFINE OUTPUT FILE
      OPEN(1,FILE='output')
C...
C...  PI
      PI=4.0D0*DATAN(1.0D0)
C...
C...  HEADING FOR THE COMPUTED SERIES
      WRITE(1,5)
5     FORMAT(8X,'t ',3X,' x = 0 ',3X,'x = 0.2',3X,'x = 0.4',
     +               3X,'x = 0.6',3X,'x = 0.8',3X,' x = 1 ')
C...
C...  STEP THROUGH A SERIES OF TIMES
      DO 1 IT=1,NT
      T=0.5*DFLOAT(IT)
C...
C...  STEP THROUGH A SERIES OF POSITIONS
      DO 2 IX=1,NX
      X(IX)=0.2D0*DFLOAT(IX-1)
C...
C...  SUM THE SERIES
      SUM(IX)=0.0D0
      DO 3 N=1,NS
      EN=(DFLOAT(N)-0.5D0)*PI
      TERM=2.0D0*(-1.0D0)**(N+1)/EN*DEXP(-(EN**2)*T)*COS(EN*X(IX))
      SUM(IX)=SUM(IX)+TERM
3     CONTINUE
C...
C...  NEXT X
2     CONTINUE
C...
C...  PRINT SERIES
      WRITE(1,4)T,(SUM(IX),IX=1,6)
4     FORMAT(F10.2,6F10.5)
C...
C...  NEXT T
1     CONTINUE
C...
C...  END OF CALCULATION
      STOP
      END
      DOUBLE PRECISION FUNCTION DFLOAT(I)
      DFLOAT=DBLE(FLOAT(I))
      RETURN
      END
