Moz2kpp.py
This presentation is the property of its rightful owner.
Sponsored Links
1 / 18

moz2kpp.py ( includes also a rudimentary kpp2moz routine ) Martin Schultz PowerPoint PPT Presentation


  • 34 Views
  • Uploaded on
  • Presentation posted in: General

moz2kpp.py ( includes also a rudimentary kpp2moz routine ) Martin Schultz. Motivation. boxmodel intercomparison of chemical mechanisms focus on OH recycling ( isoprene chemistry ) use of standard scenarios („Poppe scenarios “)

Download Presentation

moz2kpp.py ( includes also a rudimentary kpp2moz routine ) Martin Schultz

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Moz2kpp py includes also a rudimentary kpp2moz routine martin schultz

moz2kpp.py

(includes also a rudimentary kpp2moz routine)

Martin Schultz


Motivation

Motivation

  • boxmodelintercomparisonofchemicalmechanisms

  • focus on OH recycling (isoprenechemistry)

  • useofstandardscenarios („Poppe scenarios“)

  • exploresensitivitiestochanges in NOxand VOC levels/emissions

Boxmodelusedis CAABA/MECCA (Sander et al., 2011)

CAABA/MECCA isbased on KPP


Selection of mechanisms

Selectionofmechanisms

  • Goal istorun ~4 different scenarios:

  • (middle) freetroposphere

  • clean marine environment

  • urbanbio (urban plumetransportedover a forest)

  • clean bio

  • Thenperformsensitivityvariations (~36 each)

  • ApplicationforandPEGASOS projects

  • So far KPP mechanismsavailablefor MOZ3.5, TM5, MECCA

  • In preparation: ECHAM6-HAMMOZ, MOCAGE


Design goals of moz2kpp py

Design goalsof moz2kpp.py

  • Automatictranslationoffull gas-phase mechanismtoavoiderrors

  • Useconsistentnamingofspeciesandreaction tags wherepossible

  • Try todocumentspeciesandreactions (andpreservedocumentation)

  • Maketool easy touse


Formats mozpp

Formats: mozpp


Formats mozpp 2

Formats: mozpp (2)

  • Things tobeawareof:

  • Reactionlabelsandspeciesnamesareused in themodelcode

  • User-definedreactionsindicatedbysimplyomitting a rate coefficientterm

  • Reactionproductscan span multiple lines: k-term on firstline(!)

  • NEW:

  • Documentationpossible (add „!“ or „#“ ascommentcharacter on anyline)


Formats kpp as in caaba mecca

Formats: kpp (as in CAABA/MECCA)

  • Twofiles:

  • spc – definitionofspecies

  • eqn – definitionofreactions

SPC


Formats kpp as in caaba mecca 2

Formats: kpp (as in CAABA/MECCA) (2)

header …

EQN


Formats kpp as in caaba mecca 3

Formats: kpp (as in CAABA/MECCA) (3)

  • Things tobeawareof:

  • CAABA/MECCA usescommentfeatures („{…}“) for 4 purposes:

    • additionof „M“

    • labelofreaction type orscope (St, Tr, Cl, …)

    • uncertaintyspecificationfor Monte-Carlo runs

    • literaturereference

  • All reactionsarelabeled in a schematicfashion

  • user-defined k terms must bedefined in thecode(example „k_HO2_HO2“)


Moz2kpp py

moz2kpp.py

  • Modules required:

  • datetime (standard)

  • re (standard)

  • numpy (standard)

  • Main program:

  • (F5 in Windows shell, or „python moz2kpp.py“)


Moz2kpp py 2

moz2kpp.py (2)

  • Arguments andkeywordsofmoz2kppfunction:

  • inputfile: name of the MOZPP formatted mechanism input file

  • kppspcfile: name of the KPP formatted output file with species definitions (*.spc)

  • kppeqnfile: name of the KPP formatted output file with equations (*.eqn)

  • kppreffile: name of an existing KPP file for equation labels

  • use_alias: if True, then MOZART species names will be replaced by KPP names

  • Note: you must have a valid species translation table in species_map.csv


Moz2kpp py 3

moz2kpp.py (3)

  • Arguments andkeywordsofkpp2mozfunction:

  • inputfile: name of the KPP formatted equations file

  • outputfile: name of the MOZPP formatted output file

  • use_alias: if True, then KPP species names will be replaced by MOZART names

  • Notes:

  • you must have a valid species translation table in species_map.csv

  • species names will be extracted automatically from reaction list


Species map csv

species_map.csv

Translatesspeciesnamesfrom/to KPP/MOZ andprovides „documentation“:

Note: molecularcomposition (needed in KPP spcfile) isderivedfrom MOZPP „formula“ in specieslist.

Couldbeincluded in csvfileinstead …


Moz2kpp py program structure

moz2kpp.py – Programstructure


Moz2kpp py program structure 2

moz2kpp.py – Programstructure (2)


Moz2kpp py program structure 3

moz2kpp.py – Programstructure (3)


Moz2kpp py program structure 4

moz2kpp.py – Programstructure (4)


Moz2kpp py data structure for reactions

moz2kpp.py – Data structureforreactions

reactions: listconsistingoftuples (educts, products, kterm, label [rtype], comment)

educts: listcontainingstringswithspecies (photohasonlyoneeduct)

products: listoftupleswith(yield, species)

kterm: string (formatvariesfor MOZ and KPP kterms)

label: string

rtype (only KPP): stringidentifyingreaction type („St“, „Tr“, …)

comment: string

Example: write a formattedreactionstring:


  • Login