$DEBUG
C     THIS IS THE EXAMPLE PROGRAM DESCRIBING HOW TO USE KDB ROUTINES.
      PROGRAM HC_SRF_E
      IMPLICIT DOUBLE PRECISION (A-H,O-Z) 
      INTEGER NCMP
      CHARACTER*50 CNAME
      CHARACTER*20 FORMULA 
      COMMON/HC_NAME/ICMP(50),CNAME(50),FORMULA(50),ICLASS(50) 
      COMMON/HC_PROP/WT(50),TB(50),TF(50),TC(50),PC(50),VC(50),ZC(50)
	1    ,ACCF(50),WSRK(50),VEST(50),ZRA(50),SOLP(50),VOLP(50)
     2    ,QI(50),RI(50),DM(50) 

	REAL*8 TEXP(3),SRFEXP1(3),SRFEXP2(3)
C	EXPERIMENTAL DATA FOR ETHANEOL AT LOW PRESSURE
	DATA (TEXP(J),J=1,3) /293.D0,313.D0,333.D0/
	DATA (SRFEXP1(J),J=1,3) /22.56D0,20.96D0,19.41D0/ ! FOR METHANOL
	DATA (SRFEXP2(J),J=1,3) /20.14D0,18.18D0,16.22D0/ ! FOR N-HEPTANE
	OPEN(UNIT=5,FILE="RESULT.TXT")
C     NUMBER OF COMPONENT = 1
      NCMP = 2

C     SPECIFY THE ID OF EACH COMPONENT 
      ICMP(1) = 817		! MEHTANOL
	CNAME(1) = "METHANOL"
	ICLASS(1) = 11	

      ICMP(2) = 7		! N-HEPTNAE
	CNAME(2) = "N-HETANE"
	ICLASS(2) = 1	

C	PURE PROPERTIES FOR METHANOL
	TC(1)=512.50D0
	TB(1)=337.70D0			 
	PC(1)=8084.0D0
	ACCF(1)=0.556D0

C	PURE PROPERTIES FOR N-HEPTANE
	TC(2)=540.2D0
	TB(2)=371.6D0			 
	PC(2)=2740.D0
	ACCF(2)=0.349D0


	WRITE(5,*) CNAME(1)
	WRITE(5,*) 'COMPARISON OF EXPERIMENTAL AND ESTIMATED VALUE ',
	1		'(% ERROR)'
	WRITE(5,*) '-----------------------------------------------------'
	1	   ,'----------------'
	WRITE(5,*) ' T(K)   SRF(EXP)    BROCK       ZUO         SR',
	1		'       IST1  IST2  IST3'
	WRITE(5,*) '-----------------------------------------------------'
	1	   ,'----------------'
	ICN = 1
	DO I = 1, 3
		CALL HC_SRFBROCK(ICN,TEXP(I),SRF1,IST1)
		CALL HC_SRFZUO(ICN,TEXP(I),SRF2,IST2)
		CALL HC_SRFSR(ICN,TEXP(I),SRF3,IST3)
		ERR1 = DABS( (SRF1-SRFEXP1(I))/SRFEXP1(I) )*100.D0
		ERR2 = DABS( (SRF2-SRFEXP1(I))/SRFEXP1(I) )*100.D0
		ERR3 = DABS( (SRF3-SRFEXP1(I))/SRFEXP1(I) )*100.D0

		WRITE(5,5) TEXP(I),SRFEXP1(I),ERR1,ERR2,ERR3,IST1,IST2,IST3
	ENDDO
5	FORMAT(1x,F6.2,1X,4(1X,G10.5),3I6) 
	WRITE(5,*) '-----------------------------------------------------'
	1	   ,'----------------'

	WRITE(5,*)
	WRITE(5,*)
	WRITE(5,*) CNAME(2)
	WRITE(5,*) 'COMPARISON OF EXPERIMENTAL AND ESTIMATED VALUE ',
	1		'(% ERROR)'
	WRITE(5,*) '-----------------------------------------------------'
	1	   ,'----------------'
	WRITE(5,*) ' T(K)   SRF(EXP)    BROCK       ZUO         SR',
	1		'       IST1  IST2  IST3'
	WRITE(5,*) '-----------------------------------------------------'
	1	   ,'----------------'
	ICN = 2
	DO I = 1, 3
		CALL HC_SRFBROCK(ICN,TEXP(I),SRF1,IST1)
		CALL HC_SRFZUO(ICN,TEXP(I),SRF2,IST2)
		CALL HC_SRFSR(ICN,TEXP(I),SRF3,IST3)
		ERR1 = DABS( (SRF1-SRFEXP2(I))/SRFEXP2(I) )*100.D0
		ERR2 = DABS( (SRF2-SRFEXP2(I))/SRFEXP2(I) )*100.D0
		ERR3 = DABS( (SRF3-SRFEXP2(I))/SRFEXP2(I) )*100.D0

		WRITE(5,15) TEXP(I),SRFEXP2(I),ERR1,ERR2,ERR3,IST1,IST2,IST3
	ENDDO
15	FORMAT(1x,F6.2,1X,4(1X,G10.5),3I6) 
	WRITE(5,*) '-----------------------------------------------------'
	1	   ,'----------------'

	CLOSE(5) 
      STOP 
      END 