-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include reactions from the MCM #4
Comments
Was looking at the MCM. There are some reactions that need hand editing: {2.} O + O3 = : 8.0D-12*EXP(-2060/TEMP) ; # should be O + O3 = 2O2
{19.} OH + HO2 = : 4.8D-11*EXP(250/TEMP) ; # should be OH + HO2 = H2O + O2 |
Also there is this section where the MCM assumes that you are in-lining these species: #INLINE F90_GLOBAL
REAL(dp)::M, N2, O2, RO2, H2O
#ENDINLINE {above lines go into MODULE KPP_ROOT_Global} but wondering if we should add these to the #DEFVAR section (esp. O2 and H2O), because KPP won't parse it otherwise. |
Yes, these are two of the problems with the MCM-generated files. There
I currently have (MECCA-specific) awk and tcsh scripts that take care of |
Also adding Killian Murphy (@kilicomu) to this thread. He is the maintainer of the MCM at U. York, UK. He and I had a long talk about KPP at IGC10. The MCM group is updating the mechanism and we can feed them any updates about the |
Hello @kilicomu! When I downloaded reactions in KPP format from the MCM a few days ago, I There are a couple of other problems (listed above in my previous post), It would be great if we can have a look at this together and check how |
I'm not sure if @kilicomu is reading this discussion. Are the any other ways to contact him? |
I've pinged him on my Slack. |
@RolfSander I am indeed reading this discussion! I'm away from the office until 2022-07-18 minimum but will be getting to this soon after I'm back. |
@kilicomu: Thanks for letting us know. I look forward to our collaboration when you're back! |
@kilicomu: I'm back from vacation and ready to start working on the compatibility of KPP and the MCM! |
@RolfSander I haven't forgotten about this! I've got a lot of catch-up work on plate at the moment due to being away from the office for an extended period of time. I will get back round to this once I've finished up a few other things. |
@kilicomu: Sounds good, thanks! Let me know when you have time to work BTW: I'm currently working on the analysis and visualization of chemical |
Hello @kilicomu, Last year, we discussed a couple of changes that are necessary in the Something else: I have now submitted a manuscript about MEXPLORER, my https://doi.org/10.5194/egusphere-2023-1577 The manuscript contains some examples taken from the MCM mechanism. |
@RolfSander Hi - it's been a while. Firstly, MEXPLORER looks great, congratulations on completing the project. We are currently under quite a lot of time pressure to get a minimally viable replacement for the existing MCM application completed before the old applications get shut down. At the moment, FACSIMILE export is our primary export target, but KPP export is on our list of things to reimplement when we can make time (we are doing this work unfunded). So, I propose that when this new application goes live, we record a GitHub issue in the new application repository that describes the changes you would like to see, and we go from there. You would also be more than welcome to contribute to the application to get the KPP export back online and updated! We are looking at early - mid September for the new application to go online, just to give you an idea of timescale. |
Hello @kilicomu, I look forward to see your new MCM application, and I'll be happy to help you with the KPP export. What computer language and what database are you using for the new system?
Indeed, FACSIMILE has always been the main target language of the MCM.
KPP is free, open source, and generates fortran code that can directly |
Glad to hear it. The new application has been written in Ruby, with a SQLite database behind the scenes. I'm well aware of KPP's usefulness and increasing uptake! We just focused on FACSIMILE as it has been the primary export format from the MCM application for some time. We intend to provide first class support for KPP mechanisms as soon as is feasible - we don't expect an initial implementation of a KPP export to take too long, we're just thin on time and have to focus on replicating the core features of the current application. |
Thanks for the info! I have no experience with Ruby yet but this can of Regarding the database, I am familiar with postgreSQL. Using SQLite |
Thanks @RolfSander. I'll take a look at your MS when I get a chance. Very exciting stuff! |
Hello @kilicomu, I noticed that the new MCM web page with a fresh design |
Hi @RolfSander - we're working on getting the KPP export going, sorry for the delay. We'll let you know when there is something ready to test. |
OK, thanks. I look forward to seeing it... |
Hi @RolfSander and @yantosca 👋, I'm the developer who has been working on the MCM redesign. Thank you for your patience while we launched the new website. I'm now looking at getting the KPP export functionality up and running and would welcome your input in the PR thread in the MCM repo. I've got a basic version working and am now going through the modifications mentioned in this thread. |
Hello @stulacy, Great, thanks! I've posted a comment on your MCM repo page. |
Hello @yantosca, @jimmielin, @msl3v and @laestrada, As you may have seen already, an improved export in KPP syntax has https://mcm.york.ac.uk/MCM/export This solves most of the problems that we have discussed here. However,
I think I like the 2nd solution better. Especially when the external I'd like to hear your opinion as well. Also, let me know in case you |
@RolfSander: I also like the 2nd solution better. For GEOS-Chem this is how we inline all of the rate-law functions into KPP: #MINVERSION 3.0.0 { Need this version of KPP or later }
#INTEGRATOR rosenbrock_autoreduce { Use Rosenbrock integration method }
#AUTOREDUCE on { ...w/ autoreduce enabled but optional }
#LANGUAGE Fortran90 { Generate solver code in Fortran90 ... }
#UPPERCASEF90 on { ...w/ .F90 suffix (instead of .f90) }
#DRIVER none { Do not create gckpp_Main.F90 }
#HESSIAN off { Do not create the Hessian matrix }
#MEX off { MEX is for Matlab, so skip it }
#STOICMAT off { Do not create stoichiometric matrix }
#INCLUDE fullchem.eqn { Chemical reactions for fullchem mechanism }
#FAMILIES { Chemical families for prod/loss diagnostic }
POx : O3 + NO2 + 2NO3 + PAN + PPN + MPAN + HNO4 + 3N2O5 + HNO3 + BrO + HOBr + BrNO2 + 2BrNO3 + MPN + ETHLN + MVKN + MCRHN + MCRHNB + PROPNN + R4N2 + PRN1 + PRPN + R4N1 + HONIT + MONITS + MONITU + OLND + OLNN + IHN1 + IHN2 + IHN3 + IHN4 + INPB + INPD + ICN + 2IDN + ITCN + ITHN + ISOPNOO1 + ISOPNOO2 + INO2B + INO2D + INA + IDHNBOO + IDHNDOO1 + IDHNDOO2 + IHPNBOO + IHPNDOO + ICNOO + 2IDNOO + MACRNO2 + ClO + HOCl + ClNO2 + 2ClNO3 + 2Cl2O2 + 2OClO + O + O1D + IO + HOI + IONO + 2IONO2 + 2OIO + 2I2O2 + 3I2O3 + 4I2O4;
LOx : O3 + NO2 + 2NO3 + PAN + PPN + MPAN + HNO4 + 3N2O5 + HNO3 + BrO + HOBr + BrNO2 + 2BrNO3 + MPN + ETHLN + MVKN + MCRHN + MCRHNB + PROPNN + R4N2 + PRN1 + PRPN + R4N1 + HONIT + MONITS + MONITU + OLND + OLNN + IHN1 + IHN2 + IHN3 + IHN4 + INPB + INPD + ICN + 2IDN + ITCN + ITHN + ISOPNOO1 + ISOPNOO2 + INO2B + INO2D + INA + IDHNBOO + IDHNDOO1 + IDHNDOO2 + IHPNBOO + IHPNDOO + ICNOO + 2IDNOO + MACRNO2 + ClO + HOCl + ClNO2 + 2ClNO3 + 2Cl2O2 + 2OClO + O + O1D + IO + HOI + IONO + 2IONO2 + 2OIO + 2I2O2 + 3I2O3 + 4I2O4;
PCO : CO;
LCO : CO;
PSO4 : SO4;
LCH4 : CH4;
PH2O2 : H2O2;
#INLINE F90_RATES
! All rates are included in fullchem_RateLawFuncs.F90, which
! gets referenced directly from subroutine Update_Rconst.
#ENDINLINE
#INLINE F90_RCONST
! Inline an include file containing rate law definitions, which
! will be inserted directly into subroutine Update_Rconst().
! This is necessary as a workaround for KPP not being able to
! include very large files ( > 200000 chars) directly.
! -- Bob Yantosca (11 Jun 2021)
USE fullchem_RateLawFuncs
#ENDINLINE
#INLINE F90_GLOBAL
#include "commonIncludeVars.H"
#ENDINLINE For GEOS-Chem, we also use an include file via |
@RolfSander @jimmielin @mslv: Also note, I had to add comments in the F90_RATES section to avoid a KPP parsing error. #INLINE F90_RATES
! All rates are included in fullchem_RateLawFuncs.F90, which
! gets referenced directly from subroutine Update_Rconst.
#ENDINLINE |
Thanks for the explanations! If there are no objections, I will create a |
I have now created a small minimal working example based on the MCM https://github.com/KineticPreProcessor/KPP/tree/mcm/examples/mcm It should be easy to run the code as explained in the README file. A few notes on the code:
Please let me know what you think! If you agree, I will discuss with |
Thanks @RolfSander. I'll look at this when I get a chance. Happy to add the C-I test for the MCM example. |
Hello @yantosca, Thanks, I look forward to reading your comments! Also, thanks for your offer to add an MCM CI test! As we have an extra |
@RolfSander: I just pushed a PR #83 that develops a C-I test for the MCM plus also adds some Makefile updates. Let me know what you think. |
Thanks, @yantosca, for adding the CI test! If there are no objections, I will contact the MCM developer soon to ask |
Thanks @RolfSander. Let me know when the MCM stuff is complete, we can then release it as KPP 3.1.0. |
Yes, I will mention it here when everything is ready. If anyone is interested in the work in progress, you can find the details in this issue: |
Create a tool that facilitates the inclusion of a set of reactions from the MCM.
The text was updated successfully, but these errors were encountered: