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 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 KPP_REAL
FUNCTION ARR( A0
,B0
,C0
)
10 ARR
= DBLE(A0
) * EXP(-DBLE(B0
)/TEMP
) * (TEMP
/300.0_dp
)**DBLE(C0
)
13 !~~~> Simplified Arrhenius, with two arguments
14 !~~~> Note: The argument B0 has a changed sign when compared to ARR
15 KPP_REAL
FUNCTION ARR2( A0
,B0
)
17 ARR2
= DBLE(A0
) * EXP( DBLE(B0
)/TEMP
)
20 KPP_REAL
FUNCTION EP2(A0
,C0
,A2
,C2
,A3
,C3
)
21 REAL A0
,C0
,A2
,C2
,A3
,C3
23 K0
= DBLE(A0
) * EXP(-DBLE(C0
)/TEMP
)
24 K2
= DBLE(A2
) * EXP(-DBLE(C2
)/TEMP
)
25 K3
= DBLE(A3
) * EXP(-DBLE(C3
)/TEMP
)
26 K3
= K3
*CFACTOR
*1.0E6_dp
27 EP2
= K0
+ K3
/(1.0_dp
+K3
/K2
)
30 KPP_REAL
FUNCTION EP3(A1
,C1
,A2
,C2
)
33 K1
= DBLE(A1
) * EXP(-DBLE(C1
)/TEMP
)
34 K2
= DBLE(A2
) * EXP(-DBLE(C2
)/TEMP
)
35 EP3
= K1
+ K2
*(1.0E6_dp
*CFACTOR
)
38 KPP_REAL
FUNCTION FALL ( A0
,B0
,C0
,A1
,B1
,C1
,CF
)
39 REAL A0
,B0
,C0
,A1
,B1
,C1
,CF
41 K0
= DBLE(A0
) * EXP(-DBLE(B0
)/TEMP
)* (TEMP
/300.0_dp
)**DBLE(C0
)
42 K1
= DBLE(A1
) * EXP(-DBLE(B1
)/TEMP
)* (TEMP
/300.0_dp
)**DBLE(C1
)
43 K0
= K0
*CFACTOR
*1.0E6_dp
45 FALL
= (K0
/(1.0_dp
+K1
))* &
46 DBLE(CF
)**(1.0_dp
/(1.0_dp
+(LOG10(K1
))**2))
49 !---------------------------------------------------------------------------
51 ELEMENTAL
REAL(dp
) FUNCTION k_3rd(temp
,cair
,k0_300K
,n
,kinf_300K
,m
,fc
)
55 REAL(dp
), INTENT(IN
) :: temp
! temperature [K]
56 REAL(dp
), INTENT(IN
) :: cair
! air concentration [molecules/cm3]
57 REAL, INTENT(IN
) :: k0_300K
! low pressure limit at 300 K
58 REAL, INTENT(IN
) :: n
! exponent for low pressure limit
59 REAL, INTENT(IN
) :: kinf_300K
! high pressure limit at 300 K
60 REAL, INTENT(IN
) :: m
! exponent for high pressure limit
61 REAL, INTENT(IN
) :: fc
! broadening factor (usually fc=0.6)
62 REAL :: zt_help
, k0_T
, kinf_T
, k_ratio
64 zt_help
= 300._dp
/temp
65 k0_T
= k0_300K
* zt_help
**(n
) * cair
! k_0 at current T
66 kinf_T
= kinf_300K
* zt_help
**(m
) ! k_inf at current T
68 k_3rd
= k0_T
/(1._dp
+k_ratio
)*fc
**(1._dp
/(1._dp
+LOG10(k_ratio
)**2))
72 !---------------------------------------------------------------------------
74 ELEMENTAL
REAL(dp
) FUNCTION k_arr (k_298
,tdep
,temp
)
77 REAL, INTENT(IN
) :: k_298
! k at T = 298.15K
78 REAL, INTENT(IN
) :: tdep
! temperature dependence
79 REAL(dp
), INTENT(IN
) :: temp
! temperature
83 k_arr
= k_298
* EXP(tdep
*(1._dp
/temp
-3.3540E-3_dp
)) ! 1/298.15=3.3540e-3
87 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88 ! End of User-defined Rate Law functions
89 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~