added README_changes.txt
[wrffire.git] / wrfv2_fire / chem / KPP / kpp / kpp-2.1 / util / WRF_conform / WRFUserRateLaws.f90
blob3c1b18bef7d6b037d79382420b50dc6f3a693cc2
1 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 ! User-defined Rate Law functions
3 ! Note: the default argument type for rate laws, as read from the equations file, is single precision
4 ! but all the internal calculations are performed in double precision
5 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 !~~~> Simplified Arrhenius, with two arguments
8 KPP_REAL FUNCTION ARR2( A0,B0, TEMP )
9 REAL(KIND=dp) :: TEMP
10 REAL A0,B0
11 ARR2 = A0 * EXP( REAL(-B0, KIND=dp)/TEMP )
12 END FUNCTION ARR2
15 !------------------------------------
16 ! Troe reactions (as in Stockwell et al, 1997)
18 KPP_REAL FUNCTION TROE(k0_300K,n,kinf_300K,m,temp,cair)
20 INTRINSIC LOG10
22 REAL(KIND=dp), INTENT(IN) :: temp ! temperature [K]
23 REAL(KIND=dp), INTENT(IN) :: cair ! air concentration [molecules/cm3]
24 REAL, INTENT(IN) :: k0_300K ! low pressure limit at 300 K
25 REAL, INTENT(IN) :: n ! exponent for low pressure limit
26 REAL, INTENT(IN) :: kinf_300K ! high pressure limit at 300 K
27 REAL, INTENT(IN) :: m ! exponent for high pressure limit
28 REAL(KIND=dp) :: zt_help, k0_T, kinf_T, k_ratio
30 zt_help = 300._dp/temp
31 k0_T = k0_300K * zt_help**(n) * cair ! k_0 at current T
32 kinf_T = kinf_300K * zt_help**(m) ! k_inf at current T
33 k_ratio = k0_T/kinf_T
34 TROE = k0_T/(1._dp+k_ratio)*0.6_dp**(1._dp/(1._dp+LOG10(k_ratio)**2))
36 END FUNCTION TROE
40 !-------------------------------------------
41 ! Troe equilibrium reactions (as in Stockwell et al, 1997)
43 KPP_REAL FUNCTION TROEE(A, B, k0_300K,n,kinf_300K,m,temp,cair)
45 INTRINSIC LOG10
47 REAL(dp), INTENT(IN) :: temp ! temperature [K]
48 REAL(dp), INTENT(IN) :: cair ! air concentration [molecules/cm3]
49 REAL, INTENT(IN) :: k0_300K ! low pressure limit at 300 K
50 REAL, INTENT(IN) :: n ! exponent for low pressure limit
51 REAL, INTENT(IN) :: kinf_300K ! high pressure limit at 300 K
52 REAL, INTENT(IN) :: m ! exponent for high pressure limit
53 REAL, INTENT(IN) :: A, B
54 REAL(dp) :: zt_help, k0_T, kinf_T, k_ratio, troe
57 zt_help = 300._dp/temp
58 k0_T = k0_300K * zt_help**(n) * cair ! k_0 at current T
59 kinf_T = kinf_300K * zt_help**(m) ! k_inf at current T
60 k_ratio = k0_T/kinf_T
61 troe = k0_T/(1._dp+k_ratio)*0.6_dp**(1._dp/(1._dp+LOG10(k_ratio)**2))
63 TROEE = A * EXP( -REAL(B, KIND=dp) / temp) * troe
67 END FUNCTION TROEE
69 !------------------------
70 ! k=T^2 C exp (-D/T) reactions
72 KPP_REAL FUNCTION THERMAL_T2(c, d ,temp)
73 REAL(dp), INTENT(IN) :: temp ! temperature [K]
74 REAL, INTENT(IN) :: c, d
77 THERMAL_T2= temp**2._dp * c * EXP(-REAL(d, KIND=dp)/temp)
79 END FUNCTION THERMAL_T2
81 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82 ! End of User-defined Rate Law functions
83 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~