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 ! ! Program to subdivide the inveral [a,b] into ! n equal parts. For this example, the interval ! is [0,1] ! ! Method 1: Add h to x each pass through the loop. ! INTEGER :: n,i REAL(KIND=dp) :: a,b,h,x a = 0 b = 1 ! Get n WRITE(*,*) 'Input n' READ(*,*) n ! Get step size h = (b-a)/n ! Generate points x = a WRITE(*,*) 'x = ',x DO i = 2,n+1 x = x + h WRITE(*,*) 'x = ',x ENDDO END PROGRAM prog