16000 CONTINUE
SUBSUM=0.
DO 17000 J=NC1,NN-1
DO 17001 J1=J+1,NN
DO 17002 I=1,NCAT
SUBSUM=SUBSUM+PSI(J,J1,I)*XM(I)
17002
CONTINUE
SANON=SANON+(SUBSUM+PHIPHI(J,J1))*XM(J)*XM(J1)
SUMANF=SUMANF+PHIPRI(J,J1)*XM(J)*XM(J1)
SUBSUM=0.
17001
CONTINUE
17000 CONTINUE
SUMB=0.
SUMPHI=0.
DO 18000 J=1,NCAT
DO 18001 I=NC1,NN
SUMB=SUMB+XM(J)*XM(I)*BPRIME(J,I)
SUMPHI=SUMPHI+XM(J)*XM(I)*(BPHI(J,I)+ZZ*C(J,I))
18001
CONTINUE
18000 CONTINUE
F=-A0*(SQ/(1.+1.2*SQ)+2.*DLOG(1.+1.2*SQ)/1.2)+
$
SUMB+SUMCAF+SUMANF
PHI=1.+2./SMX*(-A0*UM**1.5/(1.+1.2*SQ)+SUMPHI+SCATON+SANON)
AH2O=-PHI*SMX/55.50837
C...... CALCULATION OF TERMS FOR ACTIVITY COEFFICIENTS(GAMMA).......
SUM=0.
DO 19000 J=1, NCAT-1
DO 19001 J1=J+1, NCAT
DO 19002 I=NC1,NN
PSI(J1,J,I)=PSI(J,J1,I)
19002
CONTINUE
PHIIJ(J1,J)=PHIIJ(J,J1)
19001
CONTINUE
19000 CONTINUE
DO 20000 I=NC1, NN-1
DO 20001 I1=I+1, NN
DO 20002 J=1, NCAT
PSI(I1,I,J)=PSI(I,I1,J)
24