kbarandphi.F [SRC] [CPP] [JOB] [SCAN]
SEQCODE / MODELSOURCES/MODEL [=]



   1 | include(dom.inc)
   2 | 
   3 |        SUBROUTINE KBARANDPHI(celldata,LICO,LICO2,LIH2O,ICO,ICO2,IH2O,   &
   4 |      &                      KCO,KC,KH,DCO,DC,DH,MIXDATA,ntbands)
   5 |   
   6 | 
   7 | !*******************************************************************!
   8 | !*******************************************************************!
   9 | !                                                                   !
  10 | !   SUBROUTINE FOR THE CALCULATION OF Kappa moy AND Phi FROM THE    !
  11 | !   CELLS' TEMPERATURE, PRESSURE AND SPECIES MASS CONCENTRATIONS    !
  12 | !                                                                   !
  13 | !   INPUT  : T en K                   --->   celldata(1)            !
  14 | !          : P en atm                 --->   celldata(2)            !
  15 | !          : X_H2O                    --->   celldata(3)            !
  16 | !          : X_CO2                    --->   celldata(4)            !
  17 | !          : X_CO                     --->   celldata(5)            !
  18 | !          : X_O2                     --->   celldata(6)            !
  19 | !          : X_N2                     --->   celldata(7)            !
  20 | !          : X_SOOT                   --->   celldata(8)            !
  21 | !                                                                   !
  22 | !   OUTPUT : Kappa_moy_Mix en m-1     --->   MIXDATA(1)             !
  23 | !            Phi_Mix sans unite       --->   MIXDATA(2)             !
  24 | !                                                                   !
  25 | !            Kappa_moy_H2O en m-1     --->   SNBDATA(1,...)         !
  26 | !            Kappa_moy_CO2 en m-1     --->   SNBDATA(...,3,...)     !
  27 | !            Kappa_moy_CO  en m-1     --->   SNBDATA(...,5,...)     !
  28 | !            Phi_H2O sans unite       --->   SNBDATA(...,2,...)     !
  29 | !            Phi_CO2 sans unite       --->   SNBDATA(...,4...)      !
  30 | !            Phi_CO sans unite        --->   SNBDATA(...,6)         !
  31 | !                                                                   !
  32 | !                                                                   !
  33 | !*******************************************************************!
  34 | !*******************************************************************!
  35 | 
  36 |        IMPLICIT NONE
  37 | 
  38 |        include 'dom_constants.h'
  39 | 
  40 |        DOM_INT  :: ICO, ICO2, IH2O, IT, ntbands
  41 | 
  42 |        DOM_REAL  :: RT, T296, T273, T900, XN2, GAM, XDCO
  43 |        DOM_REAL  :: XDCO2, RATT, XDH2O, SUMBIGB
  44 |        DOM_REAL, DIMENSION(14,ntbands)::KCO,DCO,KC,DC,KH,DH
  45 |        DOM_REAL, DIMENSION(8) :: celldata
  46 |        DOM_REAL, DIMENSION(6) :: SNBDATA
  47 |        DOM_REAL, DIMENSION(2) :: MIXDATA
  48 |        DOM_REAL, DIMENSION(3) :: BIGB
  49 | 
  50 |        LOGICAL LICO,LICO2,LIH2O
  51 | 
  52 |        SNBDATA = 0.
  53 |        BIGB    = 0.
  54 | 
  55 | !      -------------------------------------------------!
  56 | !      Test on the temperature value                    !
  57 | !      -------------------------------------------------!
  58 | 
  59 |        IF (celldata(1).lt.300. .OR. celldata(1).gt.2900) THEN
  60 |          WRITE(*,*) "FATAL ERROR: Temperature must belong to the "
  61 |          WRITE(*,*) "             interval 300K-2900K"
  62 |          WRITE(*,*) "             celldata =", celldata
  63 |          STOP   
  64 |        ENDIF
  65 | 
  66 | !      -------------------------------------------------!
  67 | !      Get the temperature interval IT and the distance !
  68 | !      to the inferior temperature in the tables RT     !
  69 | !      -------------------------------------------------!
  70 |        CALL TMNO(celldata(1),RT,IT)
  71 | 
  72 |        T296=296./celldata(1)
  73 |        T273=273./celldata(1)
  74 |        T900=900./celldata(1)
  75 |        XN2=1.-celldata(5)-celldata(4)-celldata(3)
  76 | 
  77 |        IF(LICO) THEN
  78 |           GAM=0.07*celldata(4)+0.06*(celldata(5)+XN2+celldata(3))
  79 |           GAM=celldata(2)*GAM*SQRT(T273)
  80 |           SNBDATA(5)=KCO(IT,ICO)+RT*(KCO(IT+1,ICO)-KCO(IT,ICO))
  81 |           SNBDATA(5)=100.*SNBDATA(5)*celldata(2)*celldata(5)
  82 |           XDCO=DCO(IT,ICO)+RT*(DCO(IT+1,ICO)-DCO(IT,ICO))
  83 |           SNBDATA(6)=2.*GAM*XDCO
  84 |           BIGB(3)=SNBDATA(5)**2/SNBDATA(6) 
  85 |           IF (SNBDATA(6).eq.0.) THEN
  86 |             BIGB(3)=0
  87 |           ENDIF
  88 |        ENDIF
  89 | 
  90 |        IF(LICO2) THEN
  91 |           GAM=0.07*celldata(4)+0.058*XN2+0.15*celldata(3)
  92 |           IF(celldata(1).LE.900.) THEN
  93 |              GAM=celldata(2)*GAM*(T296)**0.7
  94 |           ELSE
  95 |              GAM=celldata(2)*GAM*0.45913*SQRT(T900)
  96 |           ENDIF
  97 |           SNBDATA(3)=KC(IT,ICO2)+RT*(KC(IT+1,ICO2)-KC(IT,ICO2))
  98 |           SNBDATA(3)=100.*SNBDATA(3)*celldata(2)*celldata(4)
  99 |           XDCO2=DC(IT,ICO2)+RT*(DC(IT+1,ICO2)-DC(IT,ICO2))
 100 |           SNBDATA(4)=2.*GAM*XDCO2
 101 |           BIGB(2)=SNBDATA(3)**2/SNBDATA(4)
 102 |           IF (SNBDATA(4).eq.0.) THEN
 103 |             BIGB(2)=0
 104 |           ENDIF
 105 |        ENDIF
 106 |    
 107 |        IF(LIH2O) THEN
 108 |           RATT=SQRT(T296)
 109 |           GAM=0.066*(7.0*RATT*celldata(3)+1.2*(celldata(3)+XN2)         &
 110 |      &     +1.5*celldata(4))*RATT
 111 |           GAM=celldata(2)*GAM 
 112 |           SNBDATA(1)=KH(IT,IH2O)+RT*(KH(IT+1,IH2O)-KH(IT,IH2O))
 113 |           SNBDATA(1)=100.*SNBDATA(1)*celldata(2)*celldata(3)
 114 |           XDH2O=DH(IT,IH2O)+RT*(DH(IT+1,IH2O)-DH(IT,IH2O))
 115 |           SNBDATA(2)=2.*GAM*XDH2O
 116 |           BIGB(1)=SNBDATA(1)**2/SNBDATA(2)
 117 |           IF (SNBDATA(2).eq.0.) THEN
 118 |             BIGB(1)=0
 119 |           ENDIF
 120 |        ENDIF
 121 | 
 122 | !      ----------------------!
 123 | !      Gaz mixture modelling !
 124 | !      ----------------------!
 125 | 
 126 |        MIXDATA(1)=SNBDATA(1)+SNBDATA(3)+SNBDATA(5)
 127 |  
 128 |        SUMBIGB=BIGB(1)+BIGB(2)+BIGB(3)
 129 | 
 130 |        IF (SUMBIGB.ne.0.) THEN
 131 |          MIXDATA(2)=MIXDATA(1)**2/SUMBIGB
 132 |        ELSE
 133 |          MIXDATA(2)=0.
 134 |        ENDIF
 135 | 
 136 |        END SUBROUTINE KBARANDPHI