MODULE const INTEGER, PARAMETER :: dp = KIND(1.0d0), sp = KIND(1.0e0) REAL(KIND=dp), PARAMETER :: dpi = 3.141592653589793d0 END MODULE const ! PROGRAM prog USE const IMPLICIT NONE INTEGER :: rvalue,flag,total ! ! Program to add up completely arbitrary set of integers ! total = 0 DO WRITE(*,*) 'Another number? 0 = no, any other = yes' READ(*,*) flag IF(flag == 0) THEN EXIT ENDIF WRITE(*,*) 'Input next value' READ(*,*) rvalue total = total + rvalue ENDDO WRITE(*,*) 'total = ',total END PROGRAM prog