Conversation
Just imported old code and made sure it compiles! Introduces one new function: dragCoeff, which calculates the dynamic and thermodynamic drag coefficients over ice, taking atmospheric stability into account.
They can then be output. Several design changes were necessary to make this work.
Help convergence in the drag coefficient calculations by making the drag a prognostic variable. This means it's carried in memory and advected.
We're still in the CICE spirit, but this includes some important fixes.
This way, we don't have to calculate the specific humidity too often. It also fits better within the code.
A correct calculation of the Obukov length this time! Some minor additional adjustments.
I multiplied the flux with cp + cpv. Not sure why, it should just be cp.
But the default is to do it. This is really only useful for debugging!
The new drag was not given correctly to the dynamics because I forgot to multiply with wind speed and atmospheric density(!)
This moves the calculation of some of the more complex constants out of the element loop to save time. Also adds the limiting length scale as an option, to put a sensible limit on the Obukov length (Richard says 100 m is good).
I missed a factor two when transcribing the equations. Fixing this actually improves the results!
I managed to introduce a bug in the ocean drag calculation in a misguided attempt for minor optimisation. Remember Knuth!
I went through the constants yet again, and everything looks fine. Also changed the default Linv limit to something that makes more sense (and what I've used for my tests the whole time).
Member
Author
|
@docguibou This is what you tried using, right? We should still merge it, even if you don't really like it :) |
docguibou
approved these changes
Oct 31, 2024
Contributor
docguibou
left a comment
There was a problem hiding this comment.
I have been using it, compiling and running and it does work. It's not that I dont' like it, but I have been raised with games where the point is to do high scores, and with this one does not score as high as expected ;)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds computation of drag coefficients based on atmospheric stability.