-
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 drying slope case #352
Conversation
535acf8
to
0c2354d
Compare
This is exciting! I'll give this a look tomorrow. I took off the "legacy" tag because we use that to indicate PRs into the |
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.
This is really great! I'm able to run the test cases successfully through both forward runs but the viz
step is giving me some trouble.
viz
is failing because the csv files are not getting downloaded automatically. It will be necessary to add all of the csv files as input files to the step, using database=drying_slope
as one of the arguments.
Then, I think it would be easier if you just moved the functions from MoviePlotter and TimeSeriesPlotter into Viz. This is because there need to be some shared attributes (times
, damping_coeffs
and datatypes
seem like some obvious ones. These could be passed from Viz over to each of the other classes but I think it just doesn't seem clearly advantageous to have 3 classes in this case.
I do realize that this approach was inherited either from IsomipPlus
or from the legacy version of drying_slope
(or perhaps both) and predates the current compass.
One more thing is that documentation needs to be added before this gets merged.
@xylar Thanks for the detailed review and suggestions! I implemented all those changes and will get the documentation together by Monday. |
0d8e1de
to
4ced8a3
Compare
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.
This is really excellent work! The documentation is very clear. The new organization of the viz
step seems to work really well, too. There are a few new PEP8 details to deal with (see #352 (comment)) and I have some additional very minor ones.
I ran both test cases and the resulting movie is really fun to watch!
""" | ||
""" |
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.
This should probably have a one-sentence description.
super().__init__(test_case=test_case, name='viz') | ||
|
||
damping_coeffs = [0.0025, 0.01] | ||
times = ['0.50', '0.05', '0.40', '0.15', '0.30', '0.25'] |
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.
Would it make sense for these to be in ascending order?
@cbegeman, super. I'll test this today. |
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.
@cbegeman, this is a great setup! I have a few minor comments, hopefully they are useful.
@@ -0,0 +1,28 @@ | |||
config_run_duration='0000_12:00:01' | |||
config_dt='0000_00:00:30' |
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.
The legacy case uses config_dt='0000_00:00:20'
for the 250m resolution. With the current 30s dt, there are some large errors on the right boundary for the 250m case:
I also ran it with a 10 second dt:
The smaller dt progressively improves the boundary mismatch and also improves the drying front (especially for r=0.0025). Maybe we should with with 10s (or even 5 since there's still a slight mismatch with 10?)
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.
@sbrus89 Good idea. How about 8s since that is roughly 1/4 the dt of the lower resolution case?
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.
Sounds good to me.
config_zero_drying_velocity=.true. | ||
config_verify_not_dry=.true. | ||
config_thickness_flux_type='upwind' | ||
config_cvmix_background_viscosity=1e4 |
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 think we should set config_use_cvmix = .false.
.
ny = 28 | ||
|
||
# the size of grid cells (m) | ||
dc = 1000.0 |
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.
Similarly, this doesn't seem to be needed. Can resolution
be passed as an argument to self.add_step(InitialState(test_case=self))
so this can get set in InitialState.run
?
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.
The same, if this is set in the code (in configure()
), it shouldn't be set here, too.
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'll defer to @xylar on whether it makes more sense to take the original approach of having these be config options that are modified in Default.configure
or remove these as config options and set them in InitialState.run
as you suggest. My thinking behind the use of config options was making these dimensions more externally visible, but I can see how it might be misleading since dc
and ny
are not independent.
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 think it's better to include it in configure() and not in the config file, to make a bit clearer that the configure() version always takes priority. You can use the brand new "comment" argument to set() to have the comment included there instead.
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 @xylar! I didn't refresh in time so my comment was a bit lagged but it all worked out.
Co-authored-by: Xylar Asay-Davis <xylarstorm@gmail.com>
294d9d9
to
5d28325
Compare
5d28325
to
5faedd8
Compare
If it were me, I would use |
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 good with this. Hopefully, one of you can run one last set of tests?
@dengwirda, we're ready for your review on this so we can get it in. |
I did run these test cases with the latest commits on anvil. |
5faedd8
to
c175f97
Compare
c175f97
to
98ec328
Compare
Thanks, @cbegeman! Such a good feature to have! |
This PR ports the MPAS-Ocean
drying_slope
test case from legacy, which is based onWarner, J. C., Defne, Z., Haas, K., & Arango, H. G. (2013). A wetting and
drying scheme for ROMS. Computers & geosciences, 58, 54-61.
Currently, we support one vertical coordinate (
sigma
) and two horizontal resolutions (250m, 1km). The test case was verified to produce the same results as the legacy case.