Skip to content

Commit

Permalink
Added a test for the custom functions file, replacing KMT15
Browse files Browse the repository at this point in the history
  • Loading branch information
AlfredMayhew committed Jan 11, 2024
1 parent 17a3fb9 commit d2af359
Show file tree
Hide file tree
Showing 44 changed files with 4,374 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ mechanism.reac
mechanism.ro2
mechanism.species
mechanism.so
customRateFuncs.o
tests/*/output/reactionRates/*
model_tests/*/output/reactionRates/*

Expand Down
4 changes: 3 additions & 1 deletion tests/model_tests/INFO.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ starting at 6:30 am on 9/11/2008.

- `spec_model_kpp` is the same as the base case but the mechanism is in KPP format.

- `spec_model_stoich` is the same as the base case but the mechanism has been adjusted to include stoichometric coefficients (e.g. 'NO + NO = NO2 + NO2' becomes '2 NO = 2 NO2')
- `spec_model_stoich` is the same as the base case but the mechanism has been adjusted to include stoichometric coefficients (e.g. 'NO + NO = NO2 + NO2' becomes '2 NO = 2 NO2')

- `spec_model_func` is the same as the base case but the KMT15 rate definition has been moved to `customRateFuncs.f90` as opposed to being defined in the mechanism.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
! ******************************************************************** !
! ATCHEM2 -- MODULE customRateFunctions
!
! This module contains user-defined functions that can be referenced
! in the mechanism file
! ******************************************************************** !
module custom_functions_mod
implicit none

contains

! -----------------------------------------------------------------
! Calculates the rate of KMT15
pure function calcKMT15( t, m ) result ( KMT15 )
real*8, intent(in) :: t, m
real :: K150, K15I, KR15, FC15, NC15, F15
real :: KMT15

K150 = 8.6E-29 * m * (t / 300)**(-3.1)
K15I = 9.0E-12 * (t / 300)**(-0.85)
KR15 = K150 / K15I
FC15 = 0.48
NC15 = 0.75 - 1.27 * (LOG10(FC15))
F15 = 10**(LOG10(FC15) / (1 + (LOG10(KR15) / NC15)**2))
KMT15 = (K150*K15I)*F15/(K150+K15I)

return
end function calcKMT15

end module custom_functions_mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
1 TEMP 291.45
2 PRESS 950.2
3 RH 67.4
4 H2O CALC
5 DEC CALC
6 BLHEIGHT NOTUSED
7 DILUTE NOTUSED
8 JFAC NOTUSED
9 ROOF OPEN
10 ASA NOTUSED
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CO 4.8e+12
O3 6.11e11
NO 6.8e10
NO2 8.37e10
C2H4 2.76e+9
257 changes: 257 additions & 0 deletions tests/model_tests/spec_model_func/configuration/mechanism.prod.cmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
49 146 140 numberOfSpecies numberOfReactions numberOfGenericComplex
1 2
2 2
4 4
5 3
6 5
7 1
8 1
9 4
10 5
11 4
11 4
12 4
12 4
13 3
13 4
14 7
15 8
15 8
16 9
17 9
18 9
19 9
20 8
22 12
23 12
24 13
25 14
26 9
26 4
27 8
27 4
28 15
29 4
30 8
30 4
31 4
32 5
33 17
34 18
35 9
35 17
36 19
37 19
37 19
38 20
39 6
40 1
41 8
41 8
42 3
42 1
43 3
44 4
44 1
45 8
45 3
46 8
46 4
47 4
47 5
48 9
48 4
49 22
50 23
50 24
51 25
52 26
53 27
53 4
54 27
54 4
55 27
56 28
57 29
58 11
58 9
58 9
59 10
59 11
60 14
60 11
60 9
61 9
61 11
62 30
63 11
64 9
64 11
64 8
65 31
66 28
67 32
67 4
68 32
68 4
69 33
70 32
71 34
72 22
73 29
73 8
74 27
74 8
75 4
75 23
75 23
76 29
76 9
77 34
77 4
78 35
78 14
79 35
80 4
80 36
81 23
82 23
82 4
83 23
83 5
84 23
84 17
85 23
85 12
86 37
87 25
88 34
88 8
89 32
89 8
90 9
90 23
90 23
91 9
91 34
92 34
92 9
93 38
93 14
94 39
94 9
95 38
96 9
96 23
96 9
96 11
97 23
97 4
97 8
98 40
98 2
99 41
100 23
100 4
100 4
101 42
102 23
102 4
102 4
103 23
103 4
104 40
105 23
105 11
105 9
106 9
107 9
107 23
107 8
108 43
108 2
109 44
110 4
110 9
110 23
111 45
112 4
112 9
112 23
113 23
113 9
114 43
115 11
115 11
115 10
116 11
116 11
116 9
116 9
117 23
117 11
118 46
118 14
119 46
120 23
120 4
121 35
122 23
122 4
122 8
123 23
123 11
123 4
123 4
124 35
124 4
125 23
125 9
126 38
127 23
127 9
127 8
128 23
128 11
128 4
129 38
129 4
130 11
130 11
130 9
131 11
131 11
131 9
132 11
132 8
133 47
134 48
134 2
135 49
136 9
136 11
136 8
137 9
137 11
137 4
138 9
138 11
138 5
139 9
139 11
139 4
140 11
140 9
141 48
142 9
142 9
142 11
143 11
143 9
144 9
144 11
144 8
145 9
145 11
145 8
146 47
Loading

0 comments on commit d2af359

Please sign in to comment.