1 / 18

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

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 “)

maegan
Télécharger la présentation

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. 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

  3. 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

  4. Design goalsof moz2kpp.py • Automatictranslationoffull gas-phase mechanismtoavoiderrors • Useconsistentnamingofspeciesandreaction tags wherepossible • Try todocumentspeciesandreactions (andpreservedocumentation) • Maketool easy touse

  5. Formats: mozpp

  6. 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)

  7. Formats: kpp (as in CAABA/MECCA) • Twofiles: • spc – definitionofspecies • eqn – definitionofreactions SPC

  8. Formats: kpp (as in CAABA/MECCA) (2) header … EQN

  9. 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“)

  10. moz2kpp.py • Modules required: • datetime (standard) • re (standard) • numpy (standard) • Main program: • (F5 in Windows shell, or „python moz2kpp.py“)

  11. 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

  12. 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

  13. species_map.csv Translatesspeciesnamesfrom/to KPP/MOZ andprovides „documentation“: Note: molecularcomposition (needed in KPP spcfile) isderivedfrom MOZPP „formula“ in specieslist. Couldbeincluded in csvfileinstead …

  14. moz2kpp.py – Programstructure

  15. moz2kpp.py – Programstructure (2)

  16. moz2kpp.py – Programstructure (3)

  17. moz2kpp.py – Programstructure (4)

  18. 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:

More Related