Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / chem / KPP / mechanisms / cbmz_bb / cbmz_bb.def
blob77418d78879c52282859a5dd3f88fc3645989b61
1 #include atoms_red
2 #include ./cbmz_bb.spc
3 #include ./cbmz_bb.eqn
8 #INLINE F90_RATES
9 !__________________________________________________
11 REAL(KIND=dp) FUNCTION ARR3( A0,B0, TEMP )
12 REAL(KIND=dp),INTENT(IN) :: TEMP
13 REAL(KIND=dp),INTENT(IN):: A0,B0
14 ARR3 = A0 * EXP(- B0 /TEMP )
15 END FUNCTION ARR3
16 !__________________________________________________
18 REAL(KIND=dp) FUNCTION ARR3MS( A0,B0,TEMP,C_M )
19 REAL(KIND=dp), INTENT(IN) :: A0,B0
20 REAL(KIND=dp), INTENT(IN) :: TEMP,C_M
22 ARR3MS = C_M*A0 *(TEMP/300._dp)**(-B0)
23 END FUNCTION ARR3MS
24 !__________________________________________________
26 REAL(KIND=dp) FUNCTION TROEMS(k0_300K,n,kinf_300K,m,TEMP,C_M)
28 INTRINSIC LOG10
30 REAL(KIND=dp), INTENT(IN) :: TEMP ! TEMPerature [K]
31 REAL(KIND=dp), INTENT(IN) :: C_M ! air concentration [molecules/cm3]
32 REAL(KIND=dp), INTENT(IN) :: k0_300K ! low pressure limit at 300 K
33 REAL(KIND=dp), INTENT(IN) :: n ! exponent for low pressure limit
34 REAL(KIND=dp), INTENT(IN) :: kinf_300K ! high pressure limit at 300 K
35 REAL(KIND=dp), INTENT(IN) :: m ! exponent for high pressure limit
36 REAL(KIND=dp) :: zt_help, k0_T, kinf_T, k_ratio
38 zt_help = TEMP/300._dp
39 k0_T = k0_300K * zt_help**(n) * C_M ! k_0 at current T
40 kinf_T = kinf_300K * zt_help**(m) ! k_inf at current T
41 k_ratio = k0_T/kinf_T
42 TROEMS = k0_T/(1._dp+k_ratio)*0.6_dp**(1._dp/(1._dp+LOG10(k_ratio)**2))
44 END FUNCTION TROEMS
45 !__________________________________________________
47 REAL(KIND=dp) FUNCTION TROEEMS(A, B, k0_300K,n,kinf_300K,m,TEMP,C_M)
49 INTRINSIC LOG10
51 REAL(KIND=dp), INTENT(IN) :: TEMP ! TEMPerature [K]
52 REAL(KIND=dp), INTENT(IN) :: C_M ! air concentration [molecules/cm3]
53 REAL(KIND=dp), INTENT(IN) :: k0_300K ! low pressure limit at 300 K
54 REAL(KIND=dp), INTENT(IN) :: n ! exponent for low pressure limit
55 REAL(KIND=dp), INTENT(IN) :: kinf_300K ! high pressure limit at 300 K
56 REAL(KIND=dp), INTENT(IN) :: m ! exponent for high pressure limit
57 REAL(KIND=dp), INTENT(IN) :: A, B
58 REAL(KIND=dp) :: zt_help, k0_T, kinf_T, k_ratio, troe
61 zt_help = TEMP/300._dp
62 k0_T = k0_300K * zt_help**(n) * C_M ! k_0 at current T
63 kinf_T = kinf_300K * zt_help**(m) ! k_inf at current T
64 k_ratio = k0_T/kinf_T
65 troe = k0_T/(1._dp+k_ratio)*0.6_dp**(1._dp/(1._dp+LOG10(k_ratio)**2))
67 TROEEMS = A * EXP( - B / TEMP) * troe
68 END FUNCTION TROEEMS
70 !__________________________________________________
73 REAL(KIND=dp) FUNCTION k46( TEMP, C_M )
74 REAL(KIND=dp), INTENT(IN) :: TEMP, C_M
75 REAL(KIND=dp) :: k0, k2, k3
76 k0=7.2E-15_dp * EXP(785._dp/TEMP)
77 k2=4.1E-16_dp * EXP(1440._dp/TEMP)
78 k3=1.9E-33_dp * EXP(725._dp/TEMP)
79 k46=k0+k3/(1+k3/k2)
80 END FUNCTION k46
81 !__________________________________________________
82 REAL(KIND=dp) FUNCTION RK_HO_HNO3( TEMP, C_M )
83 REAL(KIND=dp), INTENT(IN) :: TEMP, C_M
84 REAL(KIND=dp) :: k1, k2, k3
85 k1=7.2E-15_dp * EXP(785._dp/TEMP)
86 k2=1.9E-33_dp * EXP(725._dp/TEMP)
87 k3=4.1E-16_dp * EXP(1440._dp/TEMP)
88 RK_HO_HNO3=k1+(C_M*k2)/(1+(C_M*k2)/k3)
89 END FUNCTION RK_HO_HNO3
90 !__________________________________________________
91 REAL(KIND=dp) FUNCTION RK_2HO2( TEMP, C_M )
92 REAL(KIND=dp), INTENT(IN) :: TEMP, C_M
93 REAL(KIND=dp) :: k1, k2, k3
94 k1=2.3E-13_dp * EXP(600._dp/TEMP)
95 k2=1.7E-33_dp * EXP(1000._dp/TEMP)
96 RK_2HO2=k1+(C_M*k2)
97 END FUNCTION RK_2HO2
98 !__________________________________________________
99 REAL(KIND=dp) FUNCTION RK_2HO2_H2O( TEMP, C_M )
100 REAL(KIND=dp), INTENT(IN) :: TEMP, C_M
101 REAL(KIND=dp) :: k1, k2, k3
102 k1=2.3E-13_dp * EXP(600._dp/TEMP)
103 k2=1.7E-33_dp * EXP(1000._dp/TEMP) * C_M
104 k3=1.4E-21_dp * EXP(2200._dp/TEMP)
105 RK_2HO2_H2O=(k1+k2)*k3
106 END FUNCTION RK_2HO2_H2O
107 !__________________________________________________
108 REAL(KIND=dp) FUNCTION RK_CO_HO( TEMP, C_M )
109 REAL(KIND=dp), INTENT(IN) :: TEMP, C_M
110 RK_CO_HO =1.5e-13 * (1.0 + 8.18e-23 * TEMP * C_M)
111 END FUNCTION RK_CO_HO
112 !__________________________________________________
113 REAL(KIND=dp) FUNCTION peroxy(K,X1,X2,X3,X4,X5,X6,X7,X8,X9,X10, &
114 TEMP,C_M)
115 REAL(KIND=dp), INTENT(IN) :: X1,X2,X3,X4,X5,X6,X7,X8,X9,X10
116 REAL(KIND=dp), INTENT(IN) :: TEMP,C_M
117 INTEGER :: nperox, I, J, K
118 PARAMETER(nperox=10)
119 REAL(KIND=dp) :: Aperox(nperox,nperox),Bperox(nperox,nperox)
120 REAL(KIND=dp) :: RK_PEROX(nperox,nperox)
121 REAL(KIND=dp) :: RK_PARAM(nperox),SPEROX(nperox)
123 SPEROX(1)=X1
124 SPEROX(2)=X2
125 SPEROX(3)=X3
126 SPEROX(4)=X4
127 SPEROX(5)=X5
128 SPEROX(6)=X6
129 SPEROX(7)=X7
130 SPEROX(8)=X8
131 SPEROX(9)=X9
132 SPEROX(10)=X10
134 Aperox(1,1)=2.5e-13
135 Aperox(2,2)=6.8e-14
136 Aperox(3,3)=2.9e-12
137 Aperox(4,4)=8.0e-12
138 Aperox(5,5)=1.0e-12
139 Aperox(6,6)=5.3e-16
140 Aperox(7,7)=3.1e-14
141 Aperox(8,8)=3.1e-14
142 Aperox(9,9)=3.1e-14
143 Aperox(10,10)=3.1e-14
144 Bperox(1,1)=190.
145 Bperox(2,2)=0.0
146 Bperox(3,3)=500.
147 Bperox(4,4)=0.0
148 Bperox(5,5)=0.0
149 Bperox(6,6)=1980.
150 Bperox(7,7)=1000.
151 Bperox(8,8)=1000.
152 Bperox(9,9)=1000.
153 Bperox(10,10)=1000.
154 DO I=1,nperox
155 DO J=1,nperox
156 IF(I.NE.J) THEN
157 Aperox(I,J)=2.0*SQRT(Aperox(I,I)*Aperox(J,J))
158 Bperox(I,J)=0.5*(Bperox(I,I)+Bperox(J,J))
159 ENDIF
160 ENDDO
161 ENDDO
162 Aperox(3,1)=1.3e-12
163 Aperox(1,3)=1.3e-12
164 Bperox(3,1)=640.0
165 Bperox(1,3)=640.0
167 DO I=1,nperox
168 RK_PARAM(I)=0.0
169 ENDDO
170 DO I=1,nperox
171 DO J=1,nperox
172 RK_PEROX(I,J)=ARR3(Aperox(I,J),-Bperox(I,J),TEMP)
173 RK_PARAM(I)=RK_PARAM(I)+RK_PEROX(I,J)*SPEROX(J)
174 ENDDO
175 ENDDO
176 peroxy=RK_PARAM(K)
178 END FUNCTION peroxy
179 !__________________________________________________
180 #ENDINLINE