-
Notifications
You must be signed in to change notification settings - Fork 151
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
cam6_4_006: fix CLUBB interface bug #1054
Merged
brian-eaton
merged 8 commits into
ESCOMP:cam_development
from
PeterHjortLauritzen:clubb_intr_bug_fix
Jul 3, 2024
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
98b5cfe
fix CLUBB interface bug
PeterHjortLauritzen 238c4e3
Merge remote-tracking branch 'ESCOMP/cam_development' into clubb_intr…
brian-eaton 952cb07
refactor set_wet_to_dry/set_dry_to_wet
brian-eaton 6ed85f9
update fv3 submodule
brian-eaton b2de02b
address review comments
brian-eaton 82547ea
update to cam6_4_002
brian-eaton 51ebdd3
update to cam6_4_005
brian-eaton 7a3a23c
update ChangeLog
brian-eaton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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'm curious why make this fix in place here instead of fixing
set_wet_to_dry
in physics_types.F90?The "broken"
set_wet_to_dry
is still called invertical_diffusion_tend
which is called intphysac
.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.
What the subroutine
set_wet_to_dry
does would be clearer if it was namedundo_set_dry_to_wet
orrevert_set_dry_to_wet
Explanation:
subroutine
set_dry_to_wet
does as the subroutine name suggests: it converts mixing ratios that are dry ((cnst_type(m).eq.'dry')
) to wet.subroutine
set_wet_to_dry
reverts this operation by converting the tracers that are supposed to be dry back to dry (from wet).set_wet_to_dry does NOT convert wet tracers to dry as the name seems to imply: here is the code from set_wet_to_dry
Hence the operation in
vertical_diffusion_tend
is correct as it converts dry tracers to wet and reverts the operation at the end.Converting all of CAM physics to a dry basis would highly likely make sure these kinds of bugs are avoided ... and vertical diffusion would not create spurious gradients for constant dry mixing ratios ...
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.
Ah, thanks. I keep forgetting about that subtlety (probably because of the broken name and also getting rusty in that part of the code). Also, there is no tag on a constituent's current state which has caused plenty of other problems in the past. I'm still hoping this can get fixed in CAM-SIMA but I don't know if that has been fully fleshed out yet.
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.
@PeterHjortLauritzen @gold2718 I have wondered this question for a while: why do we need to use dry basis and wet basis in different CAM parts?
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.
Traditionally, moist physics developers have always used moist mixing ratios for water species. For example, specific humidity (which equals the moist mixing ratio of water vapor) is a directly measurable and observable quantity, making it a logical choice for moist physics. However, chemists usually use dry mixing ratios; for them, a moist basis is problematic because it includes a water vapor signal embedded in the mixing ratio. Numerical schemes are generally designed to conserve a constant mixing ratio. Specifically, some chemical species remain constant (on a dry basis) in most of the atmosphere. If one uses a moist basis, the numerical schemes will likely introduce a water vapor signal into the mixing ratio that was supposed to remain constant.
We wrote a detailed argument for using a dry basis, which you can find here:
https://agupubs.onlinelibrary.wiley.com/doi/epdf/10.1029/2017MS001257
(see Introduction)
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.
Thanks @PeterHjortLauritzen so much for your detailed explanation and sharing of your paper. That is very helpful.