-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add internal wave test #249
Conversation
from default to case directory
@xylar I broke something recently. I'll let you know when it's ready again. |
No worries, I saw that this was in draft mode, so wasn't going to test it out until you gave the okay. |
@xylar Actually, I think it's ready for review as-is. It failed earlier because I linked to wrong MPAS-O build. Feel free to give suggestions on the viz too. Right now it plots the initial and final states. |
# Ignore all PNGs | ||
*.png | ||
|
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.
Just noting that we discussed this. Ignoring PNG files causes trouble for the documentation so we don't want to include these in the `.gitignore.
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.
Truly superb work as always. All 3 test cases together ran perfectly on Ubuntu with gfortran in under 3 minutes.
My only major concern is that the viscosities for the RPE test case aren't the same as in the original test case or the paper. Maybe that's just a question of having copied the viscosities from the baroclinic channel and not having updated them?
@@ -23,6 +24,7 @@ def __init__(self): | |||
self.add_test_group(GlobalConvergence(mpas_core=self)) | |||
self.add_test_group(GlobalOcean(mpas_core=self)) | |||
self.add_test_group(Gotm(mpas_core=self)) | |||
self.add_test_group(InternalWave(mpas_core=self)) |
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.
Super pedantic but could we move this down one so test groups are alphabetical?
@@ -3,6 +3,7 @@ | |||
from compass.ocean.tests.global_convergence import GlobalConvergence | |||
from compass.ocean.tests.global_ocean import GlobalOcean | |||
from compass.ocean.tests.gotm import Gotm | |||
from compass.ocean.tests.internal_wave import InternalWave |
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 much less concerned about the imports but might as well keep them alphabetical, too.
compass/ocean/tests/internal_wave/ten_day_test/namelist.forward
Outdated
Show resolved
Hide resolved
name = 'rpe_test' | ||
super().__init__(test_group=test_group, name=name) | ||
|
||
nus = [1, 5, 10, 20, 200] |
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.
These are different from the viscosities in the legacy test case and in the original paper. I think these might be copied from the baroclinic channel?
Following, https://github.com/MPAS-Dev/compass/blob/legacy/ocean/internal_waves/5km/rpe_test/plot.py#L10
nus = [1, 5, 10, 20, 200] | |
nus = [0.01, 1, 15, 150] |
The formatting of the step names might get a little screwed up if 0.01
turns into something with 16 digits, so you might want to do some formatting magic there.
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.
@xylar I did notice that the viscosities were different in the legacy internal wave case and the latest baroclinic channel case. I went with the baroclinic channel choices because nu=1 seemed low enough to me. But since nu=0.01 is in the paper we should include that.
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 feel like I have a slight preference for sticking with the same set of nu values as in the paper, so the 4 values in my suggestion above. That would make for an easier comparison with the model results from the paper if anyone wanted to do that. Maybe no one will actually want to do that and it's a moot point.
@mark-petersen, do you have an opinion?
@@ -0,0 +1 @@ | |||
config_run_duration = '20_00:00:00' |
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.
Just a note to say that I agree with reducing the run duration from 100 days to 20 days. The analysis is performed at 20 days so no added advantage in running 80 more days by default. Also, the experiments in the paper were run for 200 days, so 100 days isn't consistent with the paper either.
@mark-petersen, since you wrote the legacy test case, could you give this a look as soon as possible? We'd ideally like to merge this one soon. |
Co-authored-by: Xylar Asay-Davis <[email protected]>
Co-authored-by: Xylar Asay-Davis <[email protected]>
Co-authored-by: Xylar Asay-Davis <[email protected]>
@cbegeman, when you get a chance, could you fix the PEP8 issues that the linter pointed out unless there's a good reason to keep the current formatting (e.g. long module names or URLs)? |
139d54f
to
9c2b4d6
Compare
9c2b4d6
to
a58f43d
Compare
@cbegeman, let me know when you'd like me to take another look. It seems form your commits like you've addressed all my concerns. |
@xylar You're welcome to take another look. I did make changes in response to all your suggestions. I figured I'd just wait for @mark-petersen's review. |
Sounds good! |
Thank you @cbegeman for this helpful conversion from compass legacy. Tested with gnu optimized on grizzly. Created all plots after run. For example, here is a plot, required little fix I just pushed.
|
config_use_mom_del2 = .true. | ||
config_mom_del2 = 10.0 | ||
config_implicit_bottom_drag_coeff = 1.0e-2 | ||
config_use_cvmix_convection = .false. |
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.
@mark-petersen, you pushed this change as part of your commit. I want to make sure it was intentional, since it wasn't mentioned in the commit message.
In general, I think it's a better practice to suggest changes as part of a review rather than pushing them yourself.
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.
You are right, that was unintentional. See comment below, I was testing that at the same time. I just corrected it, but I'll do the suggest changes
method next time.
@mark-petersen Thanks for reviewing and catching the change needed to the viz script! |
3f1ddf9
to
cb36336
Compare
That last plot is not terribly insightful, but shows that everything works as expected. Unfortunately, this PR revealed an unrelated problem (the point of these tests!). In debug, all these tests fail in the CVMix convection routine:
I think that last line should be
because the original was an optional argument, and in our case it is not passed in, so we get a debug error when it tries to use it. I don't know why this idealized case triggers this error (in debug only) but the global cases do not. If that is indeed the fix, it is a correction for the cvmix repo, not even MPAS-Ocean. So I think I'll communicate with Luke and make a cvmix issue if needed, but not hold up this PR. For this test case, I think convection shouldn't even be needed - it ran fine without it. |
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.
Also run successfully with intel 19 on grizzly, fails with debug as noted above. I think the cvmix convection failure is out of scope for this PR, so I'm approving it. Thanks!
I confirmed that my suggested fix in cvmix above,
does fix this problem, i.e. I can run the test cases in this PR with gnu debug without errors. |
Issue reported: CVMix/CVMix-src#92 |
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 reran with the latest changes using gfortran on Ubuntu and everything looks good to me.
Thanks for the hard work on this one, @cbegeman! |
This PR ports the internal wave test group from legacy compass.