$DEBUG
C*******************************************************************
C
C KDB THEMOPHYSICAL PROPERTIES CALCULATION FORTRAN ROUTINE LIBRARY 
C
C [NAME   ]  RACKETT 
C
C [TYPE   ]  FORTRAN SUBROUTINE                              
C
C [PURPOSE]  SUBROUTINES TO CALCULATE LIQIUD SPECIFIC VOLUMES         
C            AT SATURATED CONDITION USING MODIFIED RACKETT METHOD  
C            
C
C [USAGE  ]  CALL RACKETT(N,T,X,VOL,IST)
C
C [ARGUMENTS]                                                                  
C     N          : NUMBER OF COMPONENTS IN THE MIXTURE (INTEGER, INPUT) 
C     T          : TEMPERATURE IN KELVIN (REAL*8, INPUT) 
C
C     X(50)	   : MOLE FRACTIONS OF EACH COMPONENTS(REAL*8, OUTPUT)
C	VOL		   : SATURATED VOLUME OF LIQUID (CM3/mol) 
C     IST        : STATUS OF CALCULATION (INTEGER, OUTPUT) 
C			0  : NORMAL OUTPUT OBTAINED             
C		  1011 : NOT AVALIBLE DATA(CIRTICAL PROPERTIES)	 
C		  1012 : NOT AVALIBLE RACKETT AND ACCENTRIC FACTOR	
C           1013 : SPECIFIED TEMPERATUER .GT. THAN TC 
C                         OUTPUT : CRITICAL VOLUME        
C
C [COMMENTS]
C     
C [REQUIRED COMMON BLOCKS]
C	COMMON /HC_PROP/
C                                                                   
C [REQUIRED SUBROUTINES OR FUNCTIONS] 
C	NONE 
C
C [REFERENCE]
C     Spencer,C.F. and R.P.Danner, J.Chem.Eng.Data,18,230 (1973)   
C	
C [REVISION INFORMATION]
C     1.PROGRMAMMED BY J.W.KANG, KOREA UNIVERSITY, 1996
C     4.REVISED BY Y.S.KIM, KOREA UNIVERSITY, 2002 
C*******************************************************************

       SUBROUTINE RACKETT(N,T,X,VOL,IST)
       IMPLICIT DOUBLE PRECISION (A-H,O-Z)
       INTEGER N,IST
       REAL*8  X(50),T,VOL
       REAL*8  SUMV,SUMR,ZRAM,TR,POW,BKIJ,TCM,TCC,SFI,SFJ
       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) 

       DATA R2/83.1439D0/
C------------- SCAN IF INSUFFICIENT DATA AVAILABLE -----------------C
	 VOL = 0.D0
       DO 5 I = 1,N
         IF (TC(I).LE.0.D0 .OR.PC(I).LE.0.D0.OR.VC(I).LE.0.D0) THEN
            IST = 1011
            RETURN
         ENDIF
         IF (ZRA(I).LE.0.D0.AND.ACCF(I).LE.0.D0)  THEN
            IST = 1012
            RETURN
         ENDIF
5      CONTINUE
C-------------------- INITIALIZATION -------------------------------C
       IST  = 0
       SUMV = 0.D0
       SUMR = 0.D0
       TCM  = 0.D0
       ZRAM = 0.D0
C------------------- APPLY MIXING RULES ----------------------------C
       DO 10 I=1,N
         IF(ZRA(I).LE.0.D0) ZRA(I) = 0.29056D0 -0.08775D0*ACCF(I)
         SUMV = SUMV+X(I)*VC(I)
         SUMR = SUMR+X(I)*TC(I)/(PC(I)*1.D-2)
         ZRAM = ZRAM + X(I)*ZRA(I)
10     CONTINUE
       DO 30 I=1,N
         SFI = X(I)*VC(I)/SUMV
         DO 20 J=1,N
         SFJ = X(J)*VC(J)/SUMV
         BKIJ = 8.D0*DSQRT(VC(I)*VC(J))/(VC(I)**(1.D0/3.D0)+
     +             VC(J)**(1.D0/3.D0))**3
         TCC = BKIJ*DSQRT(TC(I)*TC(J))
         TCM = TCM+SFI*SFJ*TCC
20       CONTINUE
30     CONTINUE
C--------------- CALCULATE SATURATED LIQUID VOLUME -----------------C
       TR = T/TCM
       IF(TR.GE.1.D0) THEN
         VOL = R2*SUMR*ZRAM
         IST =  1013
         RETURN
       ENDIF
       POW = 1.D0 + (1.D0 - TR)**(2.D0/7.D0)
       VOL = R2*SUMR*ZRAM**POW
       RETURN
       END
C------------------------- END OF FILE -----------------------------C
