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
[DISCUSSION] C-preprocessor switches in GEOS-Chem #168
Comments
I think that is the best way forward, to use MODEL_CLASSIC, MODEL_GCHP, MODEL_GEOS, MODEL_WRF (and presumably soon MODEL_CESM2). That will let us get rid of the ESMF_ switch. I also agree we should try to replace cpp switches with runtime options where feasible. But for architecture reasons, we will probably always have to incur some CPP switches. |
Thanks Lizzie for opening this. I am a proponent of |
Here is a list of the CPP switches we currently have in the geos-chem repository: USE_TIMERS |
To further clarify, these #ifdefs are manually set by uncommenting lines of Fortran source code. They are typically intended to hardwire a default configuration, but to allow users to choose an alternate configuration if they need it for research:
The rest are set at compile time by setting a compiler variable. |
MESSY is used to pick the MESSY regridding in HEMCO. PILGRIM and SPMD are hardwired into the tpcore modules. They block out MPI-specific code that we don't need in GC Classic. DEVEL might be able to be removed. NC_HAS_COMPRESSION is needed to prevent us trying to use netCDF compression in GC-Classic if the user only has netcdf3. It is toggled by NC_NODEFLATE=y. I typically use this to keep the file sizes identical so we can diff them directly. The EXCHANGE* switches toggle the two-way nesting. This option is currently broken in GC12. Jintai Lin's group is the only one who uses this. GISS and MODELE might have been added by Lee Murray for compatibility with the ICECAP code, but that is a separate repository. |
As part of the conversion from F77 to F90, I've been replacing |
We can add MODEL_CLASSIC and MODEL_GCHP to 12.8.0. I'll add a separate issue. |
I'd also like to add that One should take care of not to confuse There probably needs to be a run through old flags like |
@jimmielin: I was thinking that a |
I would suggest |
I still have the preference of using MODEL_XXX and just stringing together & logic if multiple are used. The benefits I see for this are:
If the cpp logic eventually got cumbersome from the string of MODEL_XXX then they could be simplified at a later stage. As for MODEL_XXX or INTERFACE_XXX, MODEL_XXX is fewer characters. But I'm not super invested in the prefix as long as it's consistent. What I am invested in is minimizing switches and keeping the names logical, intuitive, and easily searchable. |
I tend to agree with @lizziel. MODEL_XXX is more intuitive. |
I agree with @lizziel. The number of highly "generic" model interfaces is not many. The following come to mind and I think it's acceptable to keep
|
Yes, they are already live in the dev/12.7.1 branch. |
Several CPP switches have been removed as part of the update to .F90 and general cleanup (#92), including:
|
I am working on cleaning up some of the CPP switches for 13.0 to use MODEL_CLASSIC, MODEL_GCHPCTM, etc. @jimmielin, what is the full list that WRF-GC is compiled with? I'm looking specifically for if it uses MPI, EXTERNAL_FORCING, EXTERNAL_GRID, or MODEL_. @fritzt: same question for CESM. |
Hi @lizziel we use |
Hi @lizziel ! For CESM-GC, we define a number of GEOS-Chem relevant CPP flags: On top of that, CESM uses some additional CPP flags, which are (most likely): |
Excellent. Thanks! |
This thread is for discussion of cpp switches in GEOS-Chem. Some of the existing ones can be removed, consolidated, or renamed. There will be more switches added as we interface with more ESMs. Ideally we would have an agreed upon philosophy about using them, make that philosophy public, and aim to consistently apply it. I look forward to hearing everyone's thoughts!
Please also see comments on the following two relevant PRs: #5, #165
Here are some thoughts to get us started:
In PR5, I put forward this idea, which gives some backstory on why the MODEL_x switches are the way they are.
However, currently we do not have MODEL_CLASSIC or MODEL_GCHP. I am in favor of having both, and following the guidelines I outline above where we periodically consolidate if there is an obvious shared trait. I am also in favor of replacing cpp switches with run-time config options where possible.
The text was updated successfully, but these errors were encountered: