GEOS-ESM / geos-chem

Source code repository for the GEOS-Chem model of atmospheric chemistry and composition.
Other
2 stars 3 forks source link

initial version of KPP Standalone in GEOS-Chem #19

Open obin1 opened 6 months ago

obin1 commented 6 months ago

Name and Institution (Required)

Name: Obin Sturm Institution: University of Southern California

Confirm you have reviewed the following documentation

Describe the update

The KPP Standalone replicates the chemistry operator when given the full chemical state of a grid cell. Documentation on how to set it up for any mechanism is in its home directory: https://github.com/KineticPreProcessor/KPP-Standalone/tree/kpp-standalone

It is used with the KPP Standalone Interface, a 3D-to-standalone interface used to obtain the full chemical state of specific grid cells during GEOS-Chem runs.

Currently, this code compiles with make but @christophkeller and I were discussing how it might be nice to have the option to compile the KPP Standalone when building GEOS-Chem.

Expected changes

This will be zero diff to the GEOS-Chem model. This feature contributes a few files to the KPP/fullchem directory, and the standalone automatically updates with the KPP mechanism.

Reference(s)

More documentation on this is in a manuscript in prep, with application to twilight chemistry in GEOS-CF.

The KPP Standalone builds off a more specific autoreduce box model detailed in Lin et al. (2023): Lin, H., Long, M. S., Sander, R., Sandu, A., Yantosca, R. M., Estrada, L. A., et al. (2023). An adaptive auto-reduction solver for speeding up integration of chemical kinetics in atmospheric chemistry models: Implementation and evaluation in the Kinetic Pre-Processor (KPP) version 3.0.0. Journal of Advances in Modeling Earth Systems, 15, e2022MS003293. https://doi.org/10.1029/2022MS003293

Related Github Issue(s)

Not an issue, but this is related to the KPP Standalone Interface, which sparsely samples grid cells during GEOS-Chem runs: the output from these 3D runs is fed as input to the KPP Standalone. The 3D to standalone interface pull request is here: https://github.com/GEOS-ESM/geos-chem/pull/9

msl3v commented 5 months ago

@viral211, good point. It would make sense for this to be generalized to any mechanism GC is running. Where would it go? Maybe GC wants an analysis/ folder or something. e.g. KPP/analysis wherein kpp_standaone and any other tools might live. Just for argument's sake, though, I'm generally wary of unnecessary complexity, and at this point kpp_standalone is meant for fullchem.

obin1 commented 5 months ago

I'm happy to restructure to a folder e.g. KPP/kpp_standalone. The use case that @christophkeller @msl3v and I were envisioning is that the KPP Standalone compiles at the same time as GEOS-Chem, with whichever mechanism is chosen. I'm not exactly sure how to do that and am hoping to check in with @lizziel and the GCST about the best way to structure this.

This would be in addition to the current option that is enabled, which is drop in a mechanism, preprocess with KPP, and then compile with make. For now, should I just copy the KPP/fullchem mechanism over to a new folder KPP/kpp_standalone?

lizziel commented 2 months ago

Sorry I missed seeing this until now. Tagging @yantosca on this since he will be using the box model and likely has some opinions on where it should go.

I would prefer this PR to be on the upstream GEOS-Chem, do the full review and discussion there, bring it into the standard model, and then merge that into geos/develop. Does anyone object to bringing it into GEOS-Chem in this way? Since it will not impact GEOS-Chem benchmarks we can bring it into a Z version which means not waiting a long time for a new release.

obin1 commented 2 months ago

Hi Lizzie, would you mind making this a PR to the upstream branch similarly to how you made the PR for the 3D-to-standalone interface https://github.com/geoschem/geos-chem/pull/2482? I don't have a code base for GEOS-Chem, so I probably shouldn't do it from my end.

lizziel commented 2 months ago

Yes, I just made the PR. See https://github.com/geoschem/geos-chem/pull/2483. As with the other PR, @yantosca will be reviewing and testing.

lizziel commented 2 months ago

@obin1, whatever updates you make to the branch in this PR I can bring into the PR going into the standard model.