C
C
      SUBROUTINE CALC ( K, NL, N, MMAX, IV, C, ALF, T, ETA )
C
C
      PARAMETER ( MAXN1 = 11 )
C
      DIMENSION C(N), ALF(NL), T(MMAX,IV)
C
      COMMON /BLKPH/ PH(MAXN1)
C
C
      REAL MW
C
      TEMP = T(K,1) 
      MW   = T(K,2) 
C
      TMPINF = ALF(1)
      A      = ALF(2)
      B      = ALF(3)
      ALPHA  = ALF(4)
C
      PH(1) = 1.0 / ( TEMP - TMPINF )
      PH(2) = ALOG10 ( A*MW + B*MW**ALPHA )
C
      ETA = C(1)*PH(1) + PH(2)
C
      RETURN
      END 
C
C
C-----------------------------------------------------------------------
C
C
      SUBROUTINE DERIV ( K, T, MMAX, IV, ALF, NL, NP1 )
C
C
      PARAMETER ( MAXN1 = 11 , MAXKG = 8 )
C
      DIMENSION ALF(NL),T(MMAX,IV)
C
      COMMON /BLKDPH/ DPH(MAXN1,MAXKG)
C
C
      REAL MW, LOG10E
C
      TEMP = T(K,1) 
      MW   = T(K,2) 
C
      TMPINF = ALF(1)
      A      = ALF(2)
      B      = ALF(3)
      ALPHA  = ALF(4)
C
      LOG10E = ALOG10 ( EXP(1.0) )
C
      DO 10 J=1,NL
        DO 10 I=1,NP1
          DPH(I,J) = 0.0
   10 CONTINUE
C
C
C           DPH(I,J) SHOULD BE SET TO THE PARTIAL DERIVATIVE
C                    OF PH(I) WITH RESPECT TO ALF(J)
C
      DPH(1,1) = 1.0 / ( TEMP - TMPINF )**2
C
      DENOM = A*MW + B*MW**ALPHA
C
      DPH(2,2) = LOG10E*MW / DENOM
      DPH(2,3) = LOG10E*MW**ALPHA / DENOM
      DPH(2,4) = LOG10E*B*ALOG(MW)*MW**ALPHA / DENOM
C
      RETURN
      END 
C
C
C-----------------------------------------------------------------------
C
C
      SUBROUTINE WT ( M, WEIGHT, Y )
C
C
      DIMENSION Y(M),WEIGHT(M)
C
       DO 10 I=1,M
         WEIGHT(I) = 1.0/Y(I)**2
   10  CONTINUE
C
      RETURN
      END 
C
C-----------------------------------------------------------------------
C
C
      SUBROUTINE TRANS ( T, BT, Y, BY, IV, M, MMAX )
C
C
      DIMENSION T(MMAX,IV), BT(MMAX,IV), Y(M), BY(M)
C
      DO 20 I=1,M
C
          BY(I) = Y(I)
C
          DO 10 J=1,IV
C
              BT(I,J) = T(I,J)
C
   10     CONTINUE
C
          Y(I) = ALOG10 ( Y(I) )
C
   20 CONTINUE
C
      RETURN
      END 
C
C
C-----------------------------------------------------------------------
C
C
      SUBROUTINE BAKTRN ( ETA, BETA, M )
C
C
      DIMENSION ETA(M), BETA(M)
C
      DO 10 I=1,M
C
         BETA(I) = 10.0**ETA(I)
C
   10 CONTINUE
C
      RETURN
      END 
