      PROGRAM series_test
*     DO LOOP 文の使用例．
      IMPLICIT NONE
      REAL*8 newterm, relative_change, sum
      INTEGER n
      sum = 0                               ! 変数の初期化
      n = 0
      relative_change = 1                   ! 大きい値を選ぶ
      DO WHILE(relative_change .GT. 1.0D-4)
         n = n + 1
         newterm = 1.0D0/n/n
         sum = sum + newterm
         relative_change = newterm/sum
         WRITE(*,'(I13,2F13.6)') n, relative_change, sum
      END DO
      END
