Skip to content

Commit 766030a

Browse files
author
Peter Bräuer
committed
Set version to 0.1.0; README; minor updates
Set version to 0.1.0 in Poject.toml. New README including version history. Updated links to parameter files in params_header.md. Updated back-to-top links in wiki templates. New back-to-top link for parameter list at the bottom of the md file. Additional print command in function write_params in generate_wiki.jl.
1 parent 7280f5d commit 766030a

File tree

6 files changed

+185
-32
lines changed

6 files changed

+185
-32
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "TUVtools"
22
uuid = "345a537c-f292-11e8-1826-5db092d7553c"
33
authors = ["Peter Bräuer <pb866@york.ac.uk>"]
44
julia = "≥0.7"
5-
version = "0.1.0-DEV"
5+
version = "0.1.0"
66

77
[deps]
88
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"

README.md

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,151 @@
11
TUVtools
2+
========
3+
4+
TUV developer tools to auto-generate TUV input files, include files to link
5+
TUV to the boxmodel [DSMACC](https://github.com/pb866/DSMACC-testing.git) or
6+
generate markdown files for the TUV wiki.
7+
8+
9+
Installation
10+
------------
11+
12+
Go to the package manager and add first the unregistered package
13+
[filehandling](https://github.com/pb866/filehandling.git) and then TUVtools.
14+
You may want to `activate` an environment as optional second step, if you
15+
don't want the project installed in the main julia environment (where `.` can
16+
be replaced by any path to any existing Project.toml or to a new folder
17+
creating a new environment).
18+
19+
```julia
20+
julia> ]
21+
pkg> activate .
22+
pkg> add https://github.com/pb866/filehandling.git
23+
pkg> add https://github.com/pb866/TUVtools.git
24+
pkg> instantiate
25+
pkg> precompile
26+
```
27+
28+
29+
Usage
30+
-----
31+
32+
Import package with `using` or import `import`:
33+
34+
```julia
35+
using Pkg
36+
Pkg.activate("path/to/Project.toml") #if not in main julia environment
37+
using TUVtools
38+
```
39+
40+
**_Currently all functions work only for the MCM/GECKO-A TUV version 5.2.x., where source code has been moved to a separate source folder!_**
41+
Additional flags to use with the original TUV version will be introduced in the future.
42+
43+
44+
### Function setrxns
45+
46+
Auto-generates The reaction part of the TUV input files from the reaction labels
47+
defined in the rxn files/subroutines. Options exist to reset flags.
48+
49+
50+
51+
```julia
52+
setrxns(tuvdir::String; inputfiles::Union{String,Vector{String}}="", setflags::Int64=-1)
53+
```
54+
55+
Specify the location of the TUV main folder with `tuvdir`. TUV input files have to exist
56+
already and only the mechanisims section is overwritten. By default all files in the `INPUTS`
57+
folders are re-written. Use keyword argument `inputfiles` to select a subset.
58+
59+
Use kwarg `setflags` to reset flags for TUV output. By default the same flags are used as
60+
previously. If you add/delete reactions, you will have to insert/delete flags at the
61+
corresponding lines (you only need to provide the flag at the first character of the line,
62+
the remaining line will be auto-filled). Other options are:
63+
64+
- `0`: Set all flags to false (`F`)
65+
- `1`: Set all flags to true (`T`)
66+
- `2`: Set output to `T` for reactions in the MCM/GECKO-A mechanism, remaining flags to `F`
67+
- `3`: Set output to `T` for reactions in the MCMv3.3.1 (and older) mechanism, remaining flags to `F`
68+
69+
70+
### Function generate_incfiles
71+
72+
Auto-generates include files for the boxmodel
73+
[DSMACC](https://github.com/pb866/DSMACC-testing.git) to link TUV and DSMACC
74+
reaction numbers in the model.
75+
76+
```julia
77+
generate_incfiles(tuvdir::String)
78+
```
79+
80+
Specify the main folder of the TUV version you are using
81+
(needs to be the MCM/GECKO-A TUV version rather than original TUV), from
82+
which the function will derive the TUV reaction numbers.
83+
DSMACC reaction numbers are saved in `src/data/MCMv32.db`, `src/data/MCMv331.db`,
84+
and `src/data/MCM-GECKO-A.db` for the respective MCM versions.
85+
86+
If you use additonal photolysis reactions or altered the photolysis numbers
87+
in any way, you need to modify these number either by cloning this repository
88+
and making sure to load the cloned version into julia or you can `develop` the
89+
package with the help of the package manager.
90+
91+
Include files will be auto-generated for every MCM version and written to the
92+
main folder of the specified TUV version.
93+
94+
95+
### Function generate_wiki
96+
97+
This is a more advanced routine for developers of the MCM/GECKO-A TUV version
98+
to maintain the wiki pages of the repository.
99+
100+
Function `generate_wiki` can auto-generate wiki pages for the reaction numbers
101+
used in MCM/GECKO-A and TUV and the improved MCM photolysis parameterisations.
102+
103+
By default, no wiki files are generated unless you specify a template for the wiki page(s)
104+
or the `parameter.csv` from [MCMphotolysis](https://github.com/pb866/MCMphotolysis.git).
105+
106+
```julia
107+
generate_wiki(tuvdir::String; wikitemplates::Union{String, Vector{String}}="",
108+
wikioutput::Union{String, Vector{String}}="WIKI.md", MCMcollength::Union{Int64,Vector{Int64}}=10,
109+
MCMversion::Union{Int64,Vector{Int64}}=4, parinput::String="",
110+
paroutput::String="../MCM-Photolysis-Parameters.md")
111+
```
112+
113+
Specify the main folder of the TUV version used in `tuvdir` to get the TUV
114+
reaction numbers. If you want to generate wiki page(s) for the reaction numbers,
115+
make sure the DSMACC reaction numbers are correct in the database files
116+
(see [function `generate_incfiles`](#function-generate_incfiles)).
117+
118+
Create templates for all wiki pages using markdown code. Type any text you like
119+
in the page. Where you want tables with the reaction numbers, only provide the header.
120+
Put the reaction string starting at the first character of the line for every reaction
121+
you want in the tables at the correct positon in the template. The script will auto-fill-in
122+
the correct MCM/GECKO-A and TUV reaction numbers in the first two columns and the
123+
reaction label in the third. Reaction labels have to be the same as in TUV.
124+
Examples of templates can be found in `src/data`.
125+
126+
Specify the templates with the kwarg `wikitemplates` as `String` for single file
127+
or as `Vector{String}` for multiple files. Define as many output file names as
128+
templates with `wikioutput` in the same manor. Specify, which version of the MCM
129+
you are using for each wiki page as `Int64` or `Vector{Int64}` using `3` for
130+
MCMv3.3.1 or older and `4` for MCM/GECKO-A. Optionally you can specify the column
131+
length of the MCM/GECKO-A reaction number column for nicer formatting of the table
132+
in the md files. TUV columns will always be for 3-digit integers.
133+
134+
If you want to generate the parameter list for the improved MCM/GECKO-A
135+
photolysis parameterisations, specify the location and file name of the
136+
`parameters.csv` from [MCMphotolysis](https://github.com/pb866/MCMphotolysis.git)
137+
with kwarg `parinput`. To specify a location and file name for the
138+
auto-generated markdown file use kwarg `paroutput`.
139+
140+
141+
Version history
142+
===============
143+
144+
Version 0.1.0
145+
-------------
146+
- New function `setrxns` to auto-generate TUV input files
147+
- New function `generate_incfiles` to auto-generate DSMACC include files
148+
to link TUV to DSMACC
149+
- New function `generate_wiki` to auto-generate wiki files for the
150+
MCM/GECKO-A and TUV reaction numbers and for the improved MCM/GECKO-A
151+
photolysis parameterisations

src/data/WIKItemplate_MCM-GECKO-A.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ and in TUV 5.2.x for the following compound classes:
2424
- [Alkyl hydroperoxides](#alkyl-hydroperoxides)
2525
- [Criegee intermediates](#criegee-intermediates)
2626
- [Polyfunctionals](#polyfunctional-chromophores)
27-
- [Halogens](#edwards-et-al-mcm-halogen-extensions)
27+
- [Halogens](#halogen-extensions)
2828

2929
Please ensure that `vers` is set to `2` in the `params` file in TUV.
3030
This should set all cross section and quantum yield options correctly to
@@ -51,7 +51,7 @@ HNO3 -> OH + NO2
5151
HNO4 -> HO2 + NO2
5252
HNO4 -> OH + NO3
5353

54-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
54+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
5555

5656

5757
## Linear aldehydes
@@ -70,7 +70,7 @@ n-C5H11CHO -> C5H11 + CHO
7070
n-C6H13CHO -> C6H13 + CHO
7171
n-C7H15CHO -> C7H15 + CHO
7272

73-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
73+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
7474

7575

7676
## Branched aldehydes
@@ -87,7 +87,7 @@ C4H9CH(C2H5)CHO -> C7H15 + CHO
8787
tALD -> products
8888
neoC5H11CHO -> neoC5H11 + CHO
8989

90-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
90+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
9191

9292

9393
## Unsaturated aldehydes
@@ -119,7 +119,7 @@ luALD -> NI products
119119
luALD -> alkene + CO
120120
luALD -> acyl + H
121121

122-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
122+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
123123

124124

125125
## Substituted aldehydes
@@ -137,7 +137,7 @@ C8nALDOH -> NI products
137137
intAldOH -> R + CHO
138138
Glycidaldehyde -> oxyranyl radical + CHO
139139

140-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
140+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
141141

142142

143143
## Unbranched ketones
@@ -160,7 +160,7 @@ lKET5 -> products
160160
4-heptanone -> NI products
161161
4-octanone -> NI products
162162

163-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
163+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
164164

165165

166166
## Branched ketones
@@ -187,7 +187,7 @@ n-C3H7COCH(CH3)2 -> i-C3H7COCH3 + C2H4
187187
CH3COCH2C(CH3)3 -> NI products
188188
di-sec-butyl ketone -> sec-C4H9COCH2CH3 + C2H4
189189

190-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
190+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
191191

192192

193193
## Unsaturated ketones
@@ -197,7 +197,7 @@ MCM/GECKO-A | TUV | TUV reaction label
197197
CH3COCH=CH2 -> CH3 + C2H3CO
198198
CH3CH2COCH=CH2 -> C2H5 + C2H3CO
199199

200-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
200+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
201201

202202

203203
## Cyclic ketones
@@ -216,7 +216,7 @@ c-C6H10O -> 1-pentene + CO
216216
c-C7H12O -> 6-heptenal
217217
c-C7H12O -> 1-hexene + CO
218218

219-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
219+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
220220

221221

222222
## Substituted ketones
@@ -230,7 +230,7 @@ CH3COC(CH3)2OH -> CH3 + (CH3)2C(OH)CO
230230
CH3COCOOH -> CH3CHO + CO2
231231
CH3COCH2C(CH3)2OH -> CH3COCH2 + CH3C(OH)CH3
232232

233-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
233+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
234234

235235

236236
## Ketenes
@@ -240,7 +240,7 @@ MCM/GECKO-A | TUV | TUV reaction label
240240
CH2=C=O -> CO2 + CO + H2
241241
CH3CH=C=O -> C2H4 + CO
242242

243-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
243+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
244244

245245

246246
## Dicarbonyls
@@ -261,7 +261,7 @@ CHOCH=CHCH=CHCHO -> diformyl cyclobutene
261261
pinonaldehyde -> R + CO + HO2
262262
caronaldehyde -> R + CO + HO2
263263

264-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
264+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
265265

266266

267267
## Terminal linear alkyl nitrates
@@ -274,7 +274,7 @@ n-C3H7ONO2 -> C3H7O + NO2
274274
1-C4H9ONO2 -> 1-C4H9O + NO2
275275
n-C5H11ONO2 -> n-C5H11O + NO2
276276

277-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
277+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
278278

279279

280280
## Internal linear alkyl nitrates
@@ -287,7 +287,7 @@ CH3CHONO2CH3 -> CH3CHOCH3 + NO2
287287
3-C5H11ONO2 -> 3-C5H11O + NO2
288288
C5H11ONO2 -> C5H11O + NO2
289289

290-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
290+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
291291

292292

293293
## Branched alkyl nitrates
@@ -299,7 +299,7 @@ C(CH3)3(ONO2) -> C(CH3)3(O.) + NO2
299299
i-C5H11ONO2 -> i-C5H11O + NO2
300300
c-C5H11ONO2 -> c-C5H11O + NO2
301301

302-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
302+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
303303

304304

305305
## Substituted alkyl nitrates
@@ -312,7 +312,7 @@ R(OH)NO3 -> R(OH)O + NO2
312312
iR(OH)NO3 -> iR(OH)O + NO2
313313
tR(OH)NO3 -> tR(OH)O + NO2
314314

315-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
315+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
316316

317317

318318
## Further nitrogen compounds
@@ -331,7 +331,7 @@ CH3CH2CO(OONO2) -> CH3CH2CO(O) + NO3
331331
PAN -> RCO(OO) + NO2
332332
PAN -> RCO(O) + NO3
333333

334-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
334+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
335335

336336

337337
## Alkyl dinitrates
@@ -344,7 +344,7 @@ CH3CH(NO3)CH(NO3)CH3 -> RO. + NO2
344344
CH2(NO3)CH=CHCH2NO3 -> RO. + NO2
345345
CH2=CHCH(NO3)CH2NO3 -> CH2=CHCH(NO3)CH2O + NO2
346346

347-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
347+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
348348

349349

350350
## Alkyl hydroperoxides
@@ -356,7 +356,7 @@ CH3OOH -> CH3O + OH
356356
HOCH2OOH -> HOCH2O. + OH
357357
CH3CO(OOH) -> Products
358358

359-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
359+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
360360

361361

362362
## Criegee intermediates
@@ -373,7 +373,7 @@ antiCH3CHOO -> CH3CHO + O(3P)
373373
C2H5CHOO -> C2H5CHO + O(3P)
374374
(CH3)2COO -> CH3COCH3 + O(3P)
375375

376-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
376+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
377377

378378

379379
## Polyfunctional chromophores
@@ -417,10 +417,10 @@ Ald (poly)
417417
uDICARaa(poly)
418418
uDICARak(poly)
419419

420-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
420+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)
421421

422422

423-
## Edwards et al. MCM halogen extensions
423+
## Halogen extensions
424424

425425
MCM/GECKO-A | TUV | TUV reaction label
426426
-----------:|----:|:------------------
@@ -441,4 +441,4 @@ IO -> I + O
441441
HOI -> I + OH
442442
OIO -> I + O2
443443

444-
[Back to the top](#photolysis-reaction-numbers-in-different-model-frameworks)
444+
[Back to the top](#photolysis-reaction-numbers-in-mcmgecko-a-and-tuv-522)

0 commit comments

Comments
 (0)