source: trunk/LMDZ.GENERIC/libf/aeronostd/pfunc.F90 @ 2613

Last change on this file since 2613 was 2542, checked in by aslmd, 3 years ago

Generic GCM:

Large update of the chemical modules

  • Read chemical network from input files
  • Init chemistry with ModernTrac?
  • Photolysis online calculation

YJ

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