provide common physical constants to EKAT clients #220
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
A common set of physical constants is desirable; here's a first attempt at factoring such a thing out of scream and into ekat.
Closes #48
Once merged into EKAT client codes (haero/scream, e.g.,) could update their constants treatment to use the ekat values. Note that some unit conversions will be required; Scream tends to use SI units except for amount of substance, where it uses kilomoles instead of moles, for example. Not hard to do, just a note for future work.
Design choices
ekat/src/physics/constants.hpp
. From that file, a CMake parser (thanks, @jeff-cohere ) auto-generates a.cpp
and a.f90
file so that the values are defined in only one place. The tests include independent definitions of the constants..gitignore
file to exclude these auto-generated source files from the repo --- they will be autogenerated wheneverconstants.hpp
is updated.///
e3sm/share/util/shr_const_mod.F90
are included except the "special values" that could be replaced with some form ofnan
moving forwardTesting
2 tests are added, one for c++ and one for fortran.
Additional Information
This PR will be the first in a series that pull "common physics" from Scream into EKAT. Constants are simple enough that they seemed a decent starting point.