-
Notifications
You must be signed in to change notification settings - Fork 3
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
Create a calving CFL limit and apply to adaptive timestepper #33
Conversation
There is reason to think it is incorrect to allow calving to remove more than a whole grid cell in a given timestep - a CFL condition for calving. This commit calculates a calving CFL and adds it to the adaptive timestepper. It's important to note that the calving CFL is calculated from the *previous* timestep, because determining the calving CFL prior to starting the timestep is prohibitively difficult. That would require doing advection and other operations to generate the geometry that the calvingVelocity will be based on just to calculate the CFL limit, and then going back and actually progressing through the time step for real once the dt has been set. So this addition works under the principle that the calving CFL limit will not change a lot from timestep to timestep, thus a lagged CFL limit is a useful way to adapt the timestep. In initial tests this appears to work for the simple MISMIP+ test case. Note that this additional work is required beyond this commit: * Right now it is only calculated if using the von Mises calving law * It is not calculated on the initial time * Restarts are not handled * There is not yet an option to disable this * Adjustments may be desired for how the option for what fraction of the calving CFL to use interacts with the general CFL dt fraction option * some general clean up may be desired
ebd678f
to
6188da9
Compare
This commit adds the calving CFL calculation to all the other calving laws that use a calvingVelocity: specified_velocity, eigencalving, ISMIP6-retreat, and damage-rate This calculation should be low cost, so I've enabled it in these routines, regardless of if it is being used. I anticipate its result will be a useful diagnostic even if it is not being applied in the timestepper.
42dab2a
to
80f3aa0
Compare
The calving CFL application can be now controlled with the option config_adaptive_timestep_include_calving. If that option is true, the calculation is only applied if a calving law that calculates calvingVelocity is actually enabled, to avoid attempting to apply the calvingCFLDt variable when it is not being calculated. This commit also changes config_adaptive_timestep_CFL_fraction so that it is only applied to the advective CFL. That is typically how it has been used. I did not change the option name to avoid breaking backwards compatibility of namelist files. With this change, there is no longer a master adjustment - there are only adjustments to the individual candidate CFL conditions. Note that the diffusive CFL does not have a fraction, but it is rarely used, so that is fine for now.
This commit fixes a longstanding annoyance where an error would be triggered if the adaptive timestepper’s force interval calculation resulted in a timestep less than the limit specified by config_min_adaptive_timestep
This is needed for the calving CFL to behave correctly on a restart. This variable is only needed in a restart file if the calving CFL is actually being applied, but including it always because it is only a scalar value, and adding logic for that would be complicated.
This is needed to get the calving CFL to work properly on the first timestep because the calving CFL calculation is made on the timestep prior to its application. To ensure there is no actual calving for rate-based calving laws, the model deltat is temporarily set to 0 before calling the calving routines. Note that non-rate-based calving laws (thickness, damage thresholds, etc.) will now be applied on the initial time whereas before they were not. But I think that behavior is actually preferable. We don't have any tests or routine configurations using those calving laws currently, so that change will not disrupt anything.
Required for von Mises calving to work on initial time
e7fe763
to
7d9b03e
Compare
* Convert limiting timestep values reported to days * Add a message saying which process controlled the timestep * Add a new output variable for which process controlled the timestep so that behavior could be analyzed more easily in post-processing if desired.
This assesses if using the calving CFL from the previous timestep is sufficient.
Make use of new features added in MALI-Dev/E3SM#33
These changes have only small impacts on the behavior of the calving routine, but add some minor cleanup.
ce930ca
to
5122a22
Compare
It accidentally got dropped in an earlier commit.
Results of full_integration suite:
The greenland failures are because this PR applies the calving routine on the initial time, whereas before it was not applied until the first time step. For rate-based calving laws, applying calving on the initial time has no effect because dt=0, but for threshold-based calving laws, this change will apply calving on the initial time. The greenland cases all are currently using thickness-based calving, so applying calving on the initial time removes floating ice from a handful of grid cells in NE Greenland. As I mention in the commit messages, I think we actually prefer to have threshold-based calving applied on the initial time, so this change is desireable. The Therefore, I would consider all these changes as blessed. To actually test this PR, I would run the @trhille , you may also want to run one of your Humboldt paper runs to ensure there are no major differences. |
I see the same 5 tests failing baseline comparison.
|
I also tested this on the Humboldt_1to10km_r04_20210615 mesh using the most aggressive mass loss scenario from the perturbed parameter ensemble in my paper (HadGEM2 climate, 170 kPa von Mises threshold stress, q = 1/7). Happily, these changes result in only minor differences from the original simulation, which used an executable compiled using https://github.com/MALI-Dev/E3SM/tree/d0c286778a6a035c600af891a268ed9f843aac52 and https://github.com/sandialabs/Albany/tree/ecbc0182015fda8d6a2bb29eaa3a47c260f40b13. The green curve used The orange curve (this branch) used
The ratio of timestep taken to CFL calculated at the end of the timestep (i.e., the effect of the one-timestep lag in CFL condition calculation) looks pretty good here: |
I ran the
See MPAS-Dev/compass#386 for test results. |
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.
@matthewhoffman, this is great! I had a few minor suggestions here and there. One concern that could complicate things is that I think we should include face-melting in the CFL condition calculation, although it is unlikely to exceed calving rates.
components/mpas-albany-landice/src/mode_forward/mpas_li_calving.F
Outdated
Show resolved
Hide resolved
components/mpas-albany-landice/src/mode_forward/mpas_li_calving.F
Outdated
Show resolved
Hide resolved
components/mpas-albany-landice/src/mode_forward/mpas_li_calving.F
Outdated
Show resolved
Hide resolved
components/mpas-albany-landice/src/mode_forward/mpas_li_calving.F
Outdated
Show resolved
Hide resolved
These aren't always relevant, but there is no harm in including them, and it is convenient not to have to add them manually when desired.
The change to principalStrainRateRatio is unrelated to this branch, but I happened to notice the missing Time dimension.
@trhille , thanks for the review and the informative testing on this. I updated the PR. Let me know if you think we should add the faceMelting CFL limit or not. I'm inclined to not bother, but I could be convinced. |
@matthewhoffman, thanks for these changes. I don't think any of them will make a difference, but I'll run
Let's leave it as-is for now. It's probably true that in the vast majority of cases, face melting will not be the dominant velocity, and for our short-term Antarctic use cases that won't matter. We can add that in another PR if we determine it is necessary. |
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.
Okay, I'm seeing the same behavior as before when I run full_integration
, so this is good to go!
This brings in the calving CFL PR for MALI that is required to run the new tests: MALI-Dev/E3SM#33
Make use of new features added in MALI-Dev/E3SM#33
This brings in the calving CFL PR for MALI that is required to run the new tests: MALI-Dev/E3SM#33
Make use of new features added in MALI-Dev/E3SM#33
This brings in the calving CFL PR for MALI that is required to run the new tests: MALI-Dev/E3SM#33
Make use of new features added in MALI-Dev/E3SM#33
This brings in the calving CFL PR for MALI that is required to run the new tests: MALI-Dev/E3SM#33
…gdt_test MALI calving dt convergence tests This merge adds a new set of tests for MALI that explore convergence with timestep of the calving physics. This is added in a new test group that runs a configuration multiple times with the adaptive timestepper restricted by different fractions of the calculated calving CFL limit. The results are then analyzed and a summary plot is produced. This test can be applied to a number of different calving laws and meshes and using either data velocity or prognostic velocity. These set of tests are not intended to be run routinely as part of integration, but instead are a tool for evaluating development of calving physics. A test suite is also included that runs a number of these tests that have been evaluated as being useful. There are some known ways this test group could be improved, but given its limited intended usage, they are not worth developing further at this time. A MISMIP+ smoke test is also added as part of this PR. The calving tests were first developed to use the MISMIP+ configuration, which was not yet in COMPASS. Later, things were reorganized to make the calving tests more general and support multiple meshes. Having a MISMIP+ smoke test is generally useful, so that test was retained in this branch after reorganizing things. Note that this PR includes an update to the MALI-Dev submodule to include the merged MALI PR here: MALI-Dev/E3SM#33.
There is reason to think it is incorrect to allow calving to remove more than a whole grid cell in a given timestep - a CFL condition for calving. This merge calculates a calving CFL and adds it to the adaptive timestepper. It's important to note that the calving CFL is calculated from the previous timestep, because determining the calving CFL prior to starting the timestep is prohibitively difficult. That would require doing advection and other operations to generate the geometry that the calvingVelocity will be based on just to calculate the CFL limit, and then going back and actually progressing through the time step for real once the dt has been set. So this addition works under the principle that the calving CFL limit will not change a lot from timestep to timestep, thus a lagged CFL limit is a useful way to adapt the timestep. Testing shows this assumption works very well most, though not all, of the time.
The calving CFL is included in the adaptive timestepper with the new config_adaptive_timestep_include_calving option. The fraction of the calving CFL to use is controlled with the new option config_adaptive_timestep_calvingCFL_fraction.
A number of other related changes are made:
Note could add a check and a warning if the calving CFL on the actual time step exceeds the timestep in use.