C     THIS FILE WILL CREATE THE DATA FOR THE EMPIRICAL DISTRIBUTION FUNCTION
C     THE DATA ARE STORED IN 'rainfll.dat', and it is in the same directory.

         PARAMETER(N=500)
         REAL X(N)
   

        OPEN(UNIT=15,FILE='rainfall.dat')

         M = 28
         DO I = 1,M
          READ(15,*)X(I)
           X(I) = X(I)
         ENDDO


         CALL ORDER(M,X)

         AA = (M-1)/REAL(M)
         WRITE(43,*)'0    ', '    1'
         WRITE(43,*)X(1),'      1'
         WRITE(43,*) X(1), AA

         DO I = 2,M
            AA = (M-I+1)/REAL(M)
            BB = (M-I)/REAL(M)
            WRITE(43,*) X(I), AA
            WRITE(43,*) X(I), BB
         ENDDO

         STOP
         END

         

         SUBROUTINE ORDER(M,X)
         PARAMETER(K= 500)
         REAL X(K)

         DO I = M,2,-1
         DO J = 1,I
           IF(X(J-1).GT.X(J))THEN
              STORE = X(J)
              X(J) = X(J-1)
              X(J-1) = STORE
           ELSE
           ENDIF
         ENDDO
         ENDDO

         RETURN
         END



