pykpp.funcs package¶
Submodules¶
pykpp.funcs.am3 module¶
pykpp.funcs.camx module¶
pykpp.funcs.chimere module¶
- pykpp.funcs.chimere.CHIMERE_MTROE(A0, B0, C0, A1, B1, C1, N)[source]¶
- Mapping:
A0 = tabrate(1,nr) B0 = tabrate(2,nr) C0 = tabrate(3,nr) A1 = tabrate(4,nr) B1 = tabrate(5,nr) C1 = tabrate(6,nr) N = tabrate(7,nr) M = ai TEMP = te 1. = dun
- Original Code:
- c1 = tabrate(1,nr)*exp(-tabrate(2,nr)/te) &
*(300d0/te)**tabrate(3,nr)
- c2 = tabrate(4,nr)*exp(-tabrate(5,nr)/te) &
*(300d0/te)**tabrate(6,nr)
c3 = ai*c1 c4 = c3/c2 ex = dun/(dun + ((log10(c4) - 0.12d0)/1.2d0)**2) rate(nr,izo,ime,ivert) = c1*tabrate(7,nr)**ex/(dun + c4)
- pykpp.funcs.chimere.CHIMERE_SPECIAL_1(A1, C1, A2, C2)[source]¶
f1 = A1*exp(-C1/TEMP) f2 = A2*exp(-C2/TEMP) rate = f1 * f2/(1. + f2)
- pykpp.funcs.chimere.CHIMERE_SPECIAL_2(A1, C1, A2, C2)[source]¶
f1 = A1*exp(-C1/TEMP) f2 = A2*exp(-C2/TEMP) rate = f1/(1. + f2)
- pykpp.funcs.chimere.CHIMERE_SPECIAL_3(A1, C1, A2, C2, A3, C3, A4, C4)[source]¶
f1 = A1*exp(-C1/TEMP) f2 = A2*exp(-C2/TEMP) f3 = A3*exp(-C3/TEMP) f4 = A4*exp(-C4/TEMP) rate = 2.*(f1 * f2 * f3 * f4/((1.+f3)*(1.+f4)))**(0.5)
- pykpp.funcs.chimere.CHIMERE_SPECIAL_4(A1, C1, A2, C2, A3, C3, A4, C4)[source]¶
f1 = A1*exp(-C1/TEMP) f2 = A2*exp(-C2/TEMP) f3 = A3*exp(-C3/TEMP) f4 = A4*exp(-C4/TEMP) f3 = f3 / (1. + f3) f4 = f4 / (1. + f4) rate = 2.0*(f1*f2)**(0.5)*(1.-(f3*f4)**(0.5))*(1.-f4)/(2.-f3-f4)
- pykpp.funcs.chimere.CHIMERE_TROE(A0, B0, C0, A1, B1, C1, N)[source]¶
- Mapping:
A0 = tabrate(1,nr) B0 = tabrate(2,nr) C0 = tabrate(3,nr) A1 = tabrate(4,nr) B1 = tabrate(5,nr) C1 = tabrate(6,nr) N = tabrate(7,nr)
M = ai; M = third body concentration (molecules/cm3) and must be defined in the stdfuncs namespace
TEMP = te = bulk air temperature
= dun
- Original Code:
- c1 = tabrate(1,nr)*exp(-tabrate(2,nr)/te) &
*(300d0/te)**tabrate(3,nr)
- c2 = tabrate(4,nr)*exp(-tabrate(5,nr)/te) &
*(300d0/te)**tabrate(6,nr)
c3 = ai*c1 c4 = c3/c2 ex = dun/(dun + log10(c4)**2) rate(nr,izo,ime,ivert) = c1*tabrate(7,nr)**ex/(dun + c4)
pykpp.funcs.cmaq module¶
- pykpp.funcs.cmaq.CMAQ_10(A0, B0, C0, A1, B1, C1, CF, N)[source]¶
CMAQ reaction rate form 10
K0 = CMAQ_1to4(A0, B0, C0) K1 = CMAQ_1to4(A1, B1, C1) K0 = K0 * M K1 = K0 / K1
- M = third body concentration (molecules/cm3) and must be
defined in the stdfuncs namespace
Returns (K0 / (1.0 + K1))* (CF)**(1.0 / (1.0 / (N) + (log10(K1))**2))
- pykpp.funcs.cmaq.CMAQ_10D(A0, B0, C0, A1, B1, C1, CF, N)[source]¶
Same as reaction rate form 10, but implemented to provide compatibility for fortran code that need a DOUBLE form
- pykpp.funcs.cmaq.CMAQ_1to4(A0, B0, C0)[source]¶
CMAQ reaction rates form 1-4 have the form K = A * (T/300.0)**B * EXP(-C/T)
- pykpp.funcs.cmaq.CMAQ_5(A0, B0, C0, Kf)[source]¶
CMAQ reaction form 5
K1 = CMAQ_1to4(A0, B0, C0)
Returns Kf / K1
- pykpp.funcs.cmaq.CMAQ_6(A0, B0, C0, Kf)[source]¶
CMAQ reaction form 6
K1 = CMAQ_1to4(A0, B0, C0)
Returns Kf * K1
- pykpp.funcs.cmaq.CMAQ_7(A0, B0, C0)[source]¶
CMAQ reaction form 6
K0 = CMAQ_1to4(A0, B0, C0)
Returns K0 * (1 + .6 * PRESS / 101325.) # Pressure is in Pascals
- pykpp.funcs.cmaq.CMAQ_8(A0, C0, A2, C2, A3, C3)[source]¶
CMAQ reaction form 8
K0 = (A0) * exp(-(C0) / TEMP) K2 = (A2) * exp(-(C2) / TEMP) K3 = (A3) * exp(-(C3) / TEMP) K3 = K3 * M
Returns K0 + K3 / (1.0 + K3 / K2 )
- pykpp.funcs.cmaq.CMAQ_9(A1, C1, A2, C2)[source]¶
CMAQ reaction rate form 9
K1 = (A1) * exp(-(C1) / TEMP) K2 = (A2) * exp(-(C2) / TEMP)
- M = third body concentration (molecules/cm3) and must be
defined in the stdfuncs namespace
Returns K1 + K2 * M
- pykpp.funcs.cmaq.OH_CO(A0, B0, C0, A1, B1, C1, CF, N)[source]¶
OH + CO reaction rate
*Note: Mostly like CMAQ_10, but slight difference in K1
K0 = CMAQ_1to4(A0, B0, C0) K1 = CMAQ_1to4(A1, B1, C1) K0 = K0 K1 = K0 / (K1 / M)
- M = third body concentration (molecules/cm3) and must be
defined in the stdfuncs namespace
return (K0 / (1.0 + K1))* (CF)**(1.0 / (1.0 / (N) + (log10(K1))**2))
pykpp.funcs.geoschem module¶
- pykpp.funcs.geoschem.FYRNO3(CN)[source]¶
GEOS-Chem equation FYRNO3 implemented based on GEOS-Chem version 9
- pykpp.funcs.geoschem.GEOS_A(A0, B0, C0, A1, B1, C1)[source]¶
GEOS-Chem reaction form A
TMP_A0 = A0 * FYRNO3(A1)
Returns GEOS_STD(TMP_A0, B0, C0)
- pykpp.funcs.geoschem.GEOS_B(A0, B0, C0, A1, B1, C1)[source]¶
GEOS-Chem reaction form B
TMP_A0 = A0 * ( 1. - FYRNO3(A1) )
Returns GEOS_STD(TMP_A0, B0, C0)
- pykpp.funcs.geoschem.GEOS_C(A0, B0, C0)[source]¶
GEOS-Chem reaction form C
K1 = GEOS_STD(A0, B0, C0)
Returns K1 * (O2 + 3.5e18) / (2.0 * O2 + 3.5e18)
- pykpp.funcs.geoschem.GEOS_E(A0, B0, C0, Kf)[source]¶
GEOS-Chem reaction form E
K1 = GEOS_STD(A0, B0, C0)
Returns Kf / K1
- pykpp.funcs.geoschem.GEOS_G(A0, B0, C0, A1, B1, C1)[source]¶
GEOS-Chem reaction form A
K1 = GEOS_STD(A0, B0, C0) K2 = GEOS_STD(A1, B1, C1)
Returns K1 / ( 1.0 + K1 * O2 )
- pykpp.funcs.geoschem.GEOS_HR(A0, B0, C0, A1, B1, C1)[source]¶
GEOS-Chem reaction form HR
** Not implemented returns 0.
- pykpp.funcs.geoschem.GEOS_JO3(O3J)[source]¶
GEOS-Chem reaction form ozone photolysis
T3I = 1.0/TEMP Returs O3J * 1.45e-10 * exp( 89.0 * T3I) * H2O / ( 1.45e-10 * exp( 89.0 * T3I) * H2O + 2.14e-11 * exp(110.0 * T3I) * N2 + 3.20e-11 * exp( 70.0 * T3I) * O2 )
- pykpp.funcs.geoschem.GEOS_K(A0, B0, C0)[source]¶
GEOS-Chem reaction form K
** Not implemented returns 0.
- pykpp.funcs.geoschem.GEOS_N(A0, B0, C0)[source]¶
GEOS-Chem reaction form N
** Not implemented returns 0.
- pykpp.funcs.geoschem.GEOS_O(A0, B0, C0)[source]¶
GEOS-Chem reaction form O
** Not implemented returns 0.
- pykpp.funcs.geoschem.GEOS_P(A0, B0, C0, A1, B1, C1, FCV, FCT1, FCT2)[source]¶
GEOS-Chem pressure dependent TROE falloff equation
- if (FCT2 != 0.000000e+00):
CF = exp(-TEMP / FCT1) + exp(-FCT2 / TEMP)
- elif (FCT1 != 0.000000e+00):
CF = exp(-TEMP / FCT1)
- else:
CF = FCV
K0M = GEOS_STD(A0, B0, C0) * M
K1 = GEOS_STD(A1, B1, C1) K1 = K0M / K1
return (K0M / (1.0 + K1))* (CF)**(1.0 / (1.0 + (log10(K1))**2))
- pykpp.funcs.geoschem.GEOS_STD(A0, B0, C0)[source]¶
GEOS-Chem standard reaction rate with the form K = A * (300 / T)**B * EXP(C / T)
Returns A0 * (300. / TEMP)**B0 * exp(C0 / TEMP)
- pykpp.funcs.geoschem.GEOS_T(A0, B0, C0)[source]¶
GEOS-Chem reaction form T
** Not implemented returns 0.
- pykpp.funcs.geoschem.GEOS_V(A0, B0, C0, A1, B1, C1)[source]¶
GEOS-Chem reaction form V
K1 = GEOS_STD(A0, B0, C0) K2 = GEOS_STD(A1, B1, C1) return K1 / (1 + K2)
- pykpp.funcs.geoschem.GEOS_X(A0, B0, C0, A1, B1, C1, A2, B2, C2)[source]¶
GEOS-Chem reaction rate form Z
K0 = GEOS_STD(A0, B0, C0) K2 = GEOS_STD(A1, B1, C1) K3 = GEOS_STD(A2, B2, C2) K3 = K3 * M
Returns K0 + K3 / (1.0 + K3 / K2 )
- pykpp.funcs.geoschem.GEOS_Y(A0, B0, C0)[source]¶
GEOS-Chem reaction form Y
A0, B0, and C0 are numeric inputs that are ignored IGNORES INPUTS per v08-02-04 update
- pykpp.funcs.geoschem.GEOS_Z(A0, B0, C0, A1, B1, C1, A2, B2, C2)[source]¶
GEOS-Chem Z reaction rate form
K0 = GEOS_STD(A0, B0, C0) K1 = GEOS_STD(A1, B1, C1)*M K2 = GEOS_STD(A2, B2, C2)
Returns (K0 + K1) * (1 + H2O * K2)
pykpp.funcs.geoschemkpp module¶
pykpp.funcs.kpp module¶
- pykpp.funcs.kpp.ARR(A0, B0, C0)[source]¶
A0, B0 and C0 - numeric values used to calculate a reaction rate (1/s) based on the Arrhenius equation in the following form:
A0 * exp(-B0/TEMP) * (TEMP / 300.)**(C0)
Returns a rate in per time
- pykpp.funcs.kpp.ARR2(A0, B0)[source]¶
A0 and B0 - numeric values used to calculate a reaction rate (1/s) based on the Arrhenius equation in the following form:
A0 * exp(B0/TEMP)
Returns a rate in per time
Note: ARR2 sign of B0 is different than ARR
- pykpp.funcs.kpp.DP3(A1, C1, A2, C2)¶
A1, C1, A2, and C2 - numeric values used to calculate 3 rates (K0, K2, and K3), each of the form A * exp(-C / TEMP), to return a rate of the following form:
K1 + K2 * M * 1e6
Returns a rate in per time
- pykpp.funcs.kpp.EP2(A0, C0, A2, C2, A3, C3)[source]¶
A0, C0, A2, C2, A3, and C3 - numeric values used to calculate 3 rates (K0, K2, and K3), each of the form A * exp(-C / TEMP), to return a rate of the following form:
K0 + K3 * M * 1e6 / (1. + K3 * M * 1e6 / K2)
Returns a rate in per time
- pykpp.funcs.kpp.EP3(A1, C1, A2, C2)[source]¶
A1, C1, A2, and C2 - numeric values used to calculate 3 rates (K0, K2, and K3), each of the form A * exp(-C / TEMP), to return a rate of the following form:
K1 + K2 * M * 1e6
Returns a rate in per time
- pykpp.funcs.kpp.FALL(A0, B0, C0, A1, B1, C1, CF)[source]¶
Troe fall off equation
A0, B0, C0, A1, B1, C1 - numeric values to calculate 2 reaction rates (K0, K1) using ARR function; returns a rate in the following form
K0M = K0 * M * 1e6 KR = K0 / K1
Returns (K0M / (1.0 + KR))* CF**(1.0 / (1.0 + (log10(KR))**2))
pykpp.funcs.mcm module¶
pykpp.funcs.mozart4 module¶
- pykpp.funcs.mozart4.MZ4_TROE(A0, B0, A1, B1, factor)[source]¶
Troe fall off equation as calculated in MOZART4
- pykpp.funcs.mozart4.MZ4_USR1()[source]¶
USR1 reaction rate as defined in MOZART4
Returns 6.e-34 * (300.e0/TEMP)**2.4
- pykpp.funcs.mozart4.MZ4_USR10()[source]¶
USR10 reaction rate as defined in MOZART4
Returns MZ4_TROE(8.e-27, 3.5e0, 3.e-11, 0e0, .5e0)
- pykpp.funcs.mozart4.MZ4_USR11()[source]¶
USR11 reaction rate as defined in MOZART4
Returns MZ4_TROE(8.5e-29, 6.5e0, 1.1e-11, 1.0, .6e0)
- pykpp.funcs.mozart4.MZ4_USR12()[source]¶
USR12 reaction rate as defined in MOZART4
Return MZ4_USR11() * 1.111e28 * exp( -14000.0 / TEMP )
- pykpp.funcs.mozart4.MZ4_USR14()[source]¶
USR14 reaction rate as defined in MOZART4
Return 1.1e-11 * 300.e0/ TEMP / M
- pykpp.funcs.mozart4.MZ4_USR2()[source]¶
USR2 reaction rate as defined in MOZART4
Returns MZ4_TROE(8.5e-29, 6.5e0, 1.1e-11, 1.e0, .6e0)
- pykpp.funcs.mozart4.MZ4_USR21()[source]¶
USR21 reaction rate as defined in MOZART4
Returns TEMP**2 * 7.69e-17 * exp( 253.e0/TEMP )
- pykpp.funcs.mozart4.MZ4_USR22()[source]¶
USR22 reaction rate as defined in MOZART4
Returns 3.82e-11 * exp( -2000.0/TEMP ) + 1.33e-13
- pykpp.funcs.mozart4.MZ4_USR23()[source]¶
USR23 reaction rate as defined in MOZART4
fc = 3.0e-31 *(300.0/TEMP)**3.3e0 ko = fc * M / (1.0 + fc * M / 1.5e-12) Returns ko * .6e0**(1. + (log10(fc * M / 1.5e-12))**2.0)**(-1.0)
- pykpp.funcs.mozart4.MZ4_USR24()[source]¶
USR24 reaction rate as defined in MOZART4
#REAL(kind=dp) ko ko = 1.0 + 5.5e-31 * exp( 7460.0/TEMP ) * M * 0.21e0 return 1.7e-42 * exp( 7810.0/TEMP ) * M * 0.21e0 / ko
- pykpp.funcs.mozart4.MZ4_USR3()[source]¶
USR3 reaction rate as defined in MOZART4
Returns MZ4_USR2() * 3.333e26 * exp( -10990.e0/TEMP )
- pykpp.funcs.mozart4.MZ4_USR4()[source]¶
USR4 reaction rate as defined in MOZART4
Returns MZ4_TROE(2.0e-30, 3.0e0, 2.5e-11, 0.e0, .6e0)
- pykpp.funcs.mozart4.MZ4_USR5()[source]¶
USR5 reaction rate as defined in MOZART4
TINV = 1/TEMP ko = M * 6.5e-34 * exp( 1335.*tinv ) ko = ko / (1. + ko/(2.7e-17*exp( 2199.*tinv )))
Returns ko + 2.4e-14*exp( 460.*tinv )
- pykpp.funcs.mozart4.MZ4_USR6()[source]¶
USR6 reaction rate as defined in MOZART4
Returns MZ4_TROE(1.8e-31, 3.2e0, 4.7e-12, 1.4e0, .6e0)
- pykpp.funcs.mozart4.MZ4_USR7()[source]¶
USR7 reaction rate as defined in MOZART4
Returns MZ4_USR6() * exp( -10900./TEMP )/ 2.1e-27
pykpp.funcs.racm module¶
- pykpp.funcs.racm.RACM_THERMAL(A0, B0)[source]¶
RACM Thermal equation as defined in the RACM SBOX model
#REAL A0, B0 # RACM2 reaction rates have the form K = A * EXP(-B / T) # # Translation adds a 0 C return (A0 * exp(-B0 / TEMP))
- pykpp.funcs.racm.RACM_THERMAL_T2(A0, B0)[source]¶
RACM Thermal T2 equation as defined in the RACM SBOX model
# REAL A0, B0 # REAL, PARAMETER :: C0 = 0. # # Translation adds a 0 C return (A0)*TEMP**2*exp(-(B0)/TEMP)