1 | module pfunc |
---|
2 | implicit none |
---|
3 | |
---|
4 | contains |
---|
5 | |
---|
6 | !======================================================================= |
---|
7 | ! Reaction rate function |
---|
8 | ! |
---|
9 | ! version: April 2019 - Yassin Jaziri |
---|
10 | !======================================================================= |
---|
11 | |
---|
12 | |
---|
13 | function pfunc1(nlayer,t,dens,param) |
---|
14 | |
---|
15 | use types_asis |
---|
16 | |
---|
17 | implicit none |
---|
18 | |
---|
19 | ! input/output |
---|
20 | |
---|
21 | integer :: nlayer ! number of atmospheric layers |
---|
22 | real, dimension(nlayer) :: pfunc1 ! output values |
---|
23 | type(rtype1) :: param ! parameters |
---|
24 | real, dimension(nlayer) :: t ! temperature (K) |
---|
25 | real, dimension(nlayer) :: dens ! total number density (molecule.cm-3) |
---|
26 | |
---|
27 | |
---|
28 | pfunc1(:) = param%a*exp(-param%b/t(:))*((t(:)/param%t0)**param%c)*(dens(:)**param%d) |
---|
29 | |
---|
30 | return |
---|
31 | end function pfunc1 |
---|
32 | |
---|
33 | |
---|
34 | function pfunc2(nlayer,t,dens,param) |
---|
35 | |
---|
36 | use types_asis |
---|
37 | |
---|
38 | implicit none |
---|
39 | |
---|
40 | ! input/output |
---|
41 | |
---|
42 | integer :: nlayer ! number of atmospheric layers |
---|
43 | real, dimension(nlayer) :: pfunc2 ! output values |
---|
44 | type(rtype2) :: param ! parameters |
---|
45 | real, dimension(nlayer) :: t ! temperature (K) |
---|
46 | real, dimension(nlayer) :: dens ! total number density (molecule.cm-3) |
---|
47 | |
---|
48 | ! local |
---|
49 | |
---|
50 | real, dimension(nlayer) :: ak0, ak1, ak2, rate, xpo |
---|
51 | |
---|
52 | ak0(:) = param%k0*exp(-param%a/t(:))*((t(:)/param%t0)**param%n) |
---|
53 | ak1(:) = param%kinf*exp(-param%b/t(:))*((t(:)/param%t0)**param%m) |
---|
54 | ak2(:) = param%g*exp(-param%h/t(:)) |
---|
55 | rate(:) = (ak0(:)*dens(:)**param%dup)/(1. + ak0(:)*(dens(:)**param%ddown)/ak1(:)) |
---|
56 | xpo(:) = 1./(1. + alog10((ak0(:)*dens(:))/ak1(:))**2) |
---|
57 | |
---|
58 | pfunc2(:) = ak2(:) + rate(:)*(param%fc**xpo(:)) |
---|
59 | |
---|
60 | return |
---|
61 | end function pfunc2 |
---|
62 | |
---|
63 | function pfunc3(nlayer,t,dens,param) |
---|
64 | |
---|
65 | use types_asis |
---|
66 | |
---|
67 | implicit none |
---|
68 | |
---|
69 | ! input/output |
---|
70 | |
---|
71 | integer :: nlayer ! number of atmospheric layers |
---|
72 | real, dimension(nlayer) :: pfunc3 ! output values |
---|
73 | type(rtype3) :: param ! parameters |
---|
74 | real, dimension(nlayer) :: t ! temperature (K) |
---|
75 | real, dimension(nlayer) :: dens ! total number density (molecule.cm-3) |
---|
76 | |
---|
77 | ! local |
---|
78 | |
---|
79 | real, dimension(nlayer) :: ak0, ak1, rate, fc, c, N, d, xpo |
---|
80 | |
---|
81 | ak0(:) = param%k0*exp(-param%a/t(:))*((t(:)/param%t0)**param%n) |
---|
82 | ak1(:) = param%kinf*exp(-param%b/t(:))*((t(:)/param%t0)**param%m) |
---|
83 | rate(:) = (ak0(:)*dens(:)**param%dup)/(1. + ak0(:)*(dens(:)**param%ddown)/ak1(:)) |
---|
84 | fc(:) = (1-param%atroe)*exp(-t(:)/param%btroe) + param%atroe*exp(-t(:)/param%ctroe) + exp(-param%dtroe/t(:)) |
---|
85 | c(:) = -0.4-0.67*alog10(fc(:)) |
---|
86 | N(:) = 0.75-1.27*alog10(fc(:)) |
---|
87 | d(:) = 0.14 |
---|
88 | xpo(:) = 1./(1. + ( (alog10((ak0(:)*dens(:))/ak1(:))+c(:))/(N(:)-d(:)*(alog10((ak0(:)*dens(:))/ak1(:))+c(:))) )**2) |
---|
89 | |
---|
90 | pfunc3(:) = rate(:)*(fc(:)**xpo(:)) |
---|
91 | |
---|
92 | return |
---|
93 | end function pfunc3 |
---|
94 | |
---|
95 | end module pfunc |
---|