-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add support for kpp format #497
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #497 +/- ##
=======================================
Coverage 66.66% 66.66%
=======================================
Files 17 17
Lines 2049 2049
=======================================
Hits 1366 1366
Misses 683 683
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
or re.match('^\s*select\s*', to_output, flags=re.IGNORECASE) \ | ||
or re.match('^\s*case\s*', to_output, flags=re.IGNORECASE) \ | ||
or re.match('^\s*type\s+', to_output, flags=re.IGNORECASE): | ||
if re.search(r'\s*if.+then', to_output, flags=re.IGNORECASE) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this because the fix_style.py
script changes IF-THEN-ELSE to lowercase, but it shouldn't make a difference given the IGNORECASE
flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense
# at the top of mechanism.f90 for each errant species. | ||
# | ||
# TODO: This will break the expected format when mechanism.f90 is | ||
# replaced by a parsable format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This TODO comment was added with PR #347. I think it refers to the implementation of the function parser which then was abandoned in favor of the shared .so
file (?)
If so, it's probably not something "to do" anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so - fine to delete.
25cd946
to
cf3e601
Compare
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #497 +/- ##
==========================================
+ Coverage 52.00% 52.05% +0.04%
==========================================
Files 17 17
Lines 2096 2096
Branches 166 166
==========================================
+ Hits 1090 1091 +1
+ Misses 934 933 -1
Partials 72 72
☔ View full report in Codecov by Sentry. |
The procedure involves a new script This only works for the KPP files created by the MCM website. There is a large variability in the possible format of kpp files so it is hard to do better without specific examples. Two new tests are also added to verify that the conversion is correct: a reference test with a normal fac mechanism and an identical (ie using same config) test using a kpp mechanism. They give the same results. |
or re.match('^\s*select\s*', to_output, flags=re.IGNORECASE) \ | ||
or re.match('^\s*case\s*', to_output, flags=re.IGNORECASE) \ | ||
or re.match('^\s*type\s+', to_output, flags=re.IGNORECASE): | ||
if re.search(r'\s*if.+then', to_output, flags=re.IGNORECASE) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense
# at the top of mechanism.f90 for each errant species. | ||
# | ||
# TODO: This will break the expected format when mechanism.f90 is | ||
# replaced by a parsable format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so - fine to delete.
I think this all makes sense. On formatting and style, I have thoughts we should use existing external tools rather than rolling our own if possible - will create a separate issue. |
@spco thanks a lot! |
This will let the model use chemical mechanisms in KPP format (issue #304).
Also includes minor and cosmetic changes to the Python scripts in
build/
andtools/
(checked using pylint) and to some bash scripts.This also changes the version number back to development towards the 1.3 release (
1.3-dev
).