-
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 inactive top cell global ocean test case #164
base: main
Are you sure you want to change the base?
Conversation
9d8a44f
to
d69b7e7
Compare
@xylar At some point, it would be good to get your feedback on this but no rush. Both |
402c058
to
8b5bd8c
Compare
Wow, @cbegeman, I'll take a more careful look at this soon but it looks really great so far! |
Using this test case and a branch with related MPAS-Ocean bugfixes, I have located two terms that lead to a non-bfb solution between
I haven't yet found any obvious bugs in the relevant code. |
@xylar I think this test case is working as expected. Do you want to give it a look and let me know if other changes or testing are needed? Still no rush on this. |
Yep, I'll take a look soon. I was hoping to look at this today but didn't get to it yet. |
28d3085
to
7358150
Compare
@cbegeman, this is really great! I tested a merge of this branch with #171, together with your branch https://github.com/cbegeman/E3SM/tree/ocn/bugfix-inactive-top-cells merged with For the QUwISC240 test case, I got NaNs in I have a suggested addition. I would be really nice to have another test case under global ocean for each configuration with inactive top cells. It would only work if you had run the init and performance tests both with and without inactive top cells, so it would be helpful to have test suites defined for this check. (The QU240 version could also be included in the nightly test suite.) If results are not identical when comparing My other request would be to clean up the PEP8 issues that are mentioned here #164 (comment) and which will update automatically as you push changes to this PR branch. |
When I run in debug mode, I'm seeing errors in
|
Actually, regarding my last comment, I think the issue is that the top layer has zero thickness. So the issue isn't to do with init mode in MPAS-Ocean at all, but rather that the 1D vertical coordinate it's being given isn't valid. Could we give the 1D vertical coordinate a non-zero, positive value for the first entry so it doesn't cause divide-by-zero issues? Or does that cause trouble with computations elsewhere? |
@xylar Thanks for all your feedback and suggestions. Is there a reason that you propose adding an additional test case that does the xarray trim and then validate, rather than adding a new method or function
to either |
@cbegeman, that would be a good way to go. I hadn't thought about it. I would suggest adding a Presumably, you will just need to check whether the files |
@cbegeman, I thought about this a bit further. We don't usually put any output files at the test-case level, just within steps. So it would be better if the output gets cropped as part of the |
@xylar Thanks for giving it some thought. I think I understand how to implement it as you suggested. Do you mind if I throw the |
Hmm, that doesn't really seem like the right place or it to me. |
d2fdfe3
to
5f249ec
Compare
@xylar You can ignore this while on vacation. I didn't know the best way to set up a comparison with the baseline because the baseline has a different test name than the inactive cell run (e.g., Other than that I think the test is good to go, and I added the check for zero layer thickness in init mode to that bugfix branch. |
@cbegeman, thanks for working on this. I think I see the dilemma: validation was only designed either for comparison with a baseline or within a test case, not between test cases. I'll give it some thought and try to come up with a better way when I come back. |
@cbegeman, I'm getting back to thinking about the validation problem here. I'm going to try to come up with a general solution outside of this branch/PR so we can rebase this onto that work. |
Thanks, @xylar! |
@xylar Ok, let's merge this PR soon with the two terms that cause the non-BFB result disabled so it is BFB. I'll re-test and hopefully push that change shortly. |
Sounds good! |
@cbegeman, the rebase may be challenging at this point. If you want me to do it (or parts of it), let me know. |
Use `minLevelCell` instead of an argument to determine the number of inactive top levels.
Store the `inactive_top_comp_subdir` so we know what files to compare with during validation. Use `ds.load()` when modifying `minLevelCell` in the initial state to prevent issues with reading from and writing to the same file. Crop inactive top cells after writing out the modified initial state (because we now use the modified `minLevelCell`). Set the default to `inactive_top_cells = 0` in a new `init.cfg` instead of the config file for the QU240 mesh.
Move cropping of inactive top cells to ForwardStep so it is explicitly included as an output of that step. Give `init.nc` as the mesh file for cropping. For validation, point to the output file from the version of the performance test without inactive top cells for `filename2`.
c0d5b9e
to
4b9d8df
Compare
4b9d8df
to
8308c57
Compare
@xylar I've finished the rebase and made a few changes to how the case works. I think it makes more sense to have There is one lingering issue I spotted but didn't get around to fixing. The initial condition ends up with real values at k=1:minLevelCell-1. It doesn't affect the test outcome because those values are not used, but I think we should set them to the fill value. |
This test case is designed to determine the proper functioning of inactive top cells (i.e.,
minLevelCell > 1
). The test follows the configuration ofQU240/PHC/performance_test
except an additional vertical layer is added andminLevelCell
andmaxLevelCell
are shifted down the column by 1. A pass of this test constitutes bit-for-bit comparison withQU240/PHC/performance_test
.