-
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 MALI mesh convergence tests #690
Open
matthewhoffman
wants to merge
16
commits into
MPAS-Dev:main
Choose a base branch
from
matthewhoffman:landice/mesh_convergence_test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add MALI mesh convergence tests #690
matthewhoffman
wants to merge
16
commits into
MPAS-Dev:main
from
matthewhoffman:landice/mesh_convergence_test
Conversation
This file contains 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
matthewhoffman
added
land ice
in progress
This PR is not ready for review or merging
labels
Sep 1, 2023
matthewhoffman
added a commit
to MALI-Dev/E3SM
that referenced
this pull request
Sep 6, 2023
This merge adds a flux-correct transport (FCT) scheme to MALI for thickness and tracer advection, ported over with MALI-relevant modification from MPAS-Ocean's routines, which are based on Skamarock and Gassmann (2011) (https://doi.org/10.1175/MWR-D-10-05056.1). This uses a blend of 3rd and 4th order fluxes to achieve monotonicity. The FCT routine is only used for tracers in MPAS-Ocean, whereas here it is modified for use with both thickness and tracers. The user can specify 2nd, 3rd, or 4th order advection with the config_horiz_tracer_adv_order option, but only config_horiz_tracer_adv_order = 3 with 0 < config_advection_coef_3rd_order < 1 is truly FCT. The config_advection_coef_3rd_order option specifies the blend between 3rd and 4th order fluxes used in the flux correction. config_advection_coef_3rd_order = 1.0 is purely 3rd order, while config_advection_coef_3rd_order = 0.0 is purely 4th order. The default value of 0.25 is taken from the MPAS-Ocean default and may not be appropriate for all situations. Note that all higher-order advection must reduce to 1st order at the boundaries. This also adds a new variable passiveTracer2d, that can be used to verify advection schemes. Currently supported combinations of thickness and tracer advection with fct include: 1. config_thickness_advection = 'fo'; config_tracer_advection = 'fct' 2. config_thickness_advection = 'fct'; config_tracer_advection = 'fct' 3. config_thickness_advection = 'fct'; config_tracer_advection = 'none' FCT tracer advection with no thickness advection and FCT thickness advection with FO tracer advection could be added, but we do not currently anticipate using them. Therefore, we have left them out of this PR as they would add unnecessary complexity to the code. When used with forward Euler time integration, FCT requires a severely reduced time step relative to first order advection. Testing shows that CFL fraction on the order of 0.1 is likely sufficiently small, but this is probably case-dependent. Once Runge-Kutta time integration is operational, it is recommended to use that instead of forward Euler. At the time of merging, there is a very slight conservation error (<0.1% in the grounded slab test shown below) for tracers when using FCT for both thickness and tracer advection, while mass is fully conserved. Tracers are conserved when using FO thickness advection with FCT tracer advection. The convergence order has not yet been verified, but testing is under way using a new mesh convergence COMPASS test: MPAS-Dev/compass#690. * trhille/add_higher_order_advection: (46 commits) Enable fct thickness advection without tracer advection Change passiveTracer to passiveTracer2d Only pass layer thickness tracer for first call to fct Fix the case of fo thickness, none tracer advection Fix bug with activeTracerHorizontalAdvectionEdgeFlux Make activeTracerHorizontalAdvectionEdgeFlux optional Throw error forr fct thickness with fo tracer Simple cleanup after code review Make conserve tracer volume Fix first order flux at ice edge Make fct conserve mass Call li_tracer_advection_fct_tend for thickness and tracers separately Clean up 2nd order mask Make 2nd order and 3rd-4th order masks mutually exclusive Try new mask for 2nd order terms Change normalThicknessFlux, layerThickness, and tracer definitions Pass layerThickness as tracer instead of array of 1s Increase max number of tracers to accomodate passiveTracer Add passiveTracer to help verify advection schemes Fix bug in marking boundaryCell ...
matthewhoffman
force-pushed
the
landice/mesh_convergence_test
branch
from
September 7, 2023 16:28
0be65fe
to
95e99e1
Compare
trhille
force-pushed
the
landice/mesh_convergence_test
branch
from
November 8, 2023 00:04
a6b1a99
to
3f0b4a5
Compare
This is copied from the ocean's planar_convergence test case with minor adjustments to work for the landice core.
Also modify the mesh_convergence test-group-level architecture to be flexible enough to support these two different test cases.
Adding both a test group stream and a test case stream will result in the union of their contents, so I've moved test-case-specific variables to the test-case streams file.
This commit changes a lot of details about the convergence tests to get them both working at the same time after the halfar one broke the horizontal_advection one. Changes include: * replacing dt_1km cfg option with target_velocity that is then used to figure out an appropriate timestep that can be scaled for all resolutions. Note this change may not be desirable in the end, because there are a number of reasons one might want to directly control the dt. e.g. Halfar has a diffusive CFL constraint, which the current logic to set the dt from the target velocity is unable to deal with, and for FCT, one may want to take substantially smaller dt. * change horizontal_advection to use glacier-like velocities and times * change the duration cfg option to use years * minor cfg and plotting updates
All advection will reduce to first order at margin, so the dome center error provides a metric of error "away" from the margin.
* drop 16 km and add 1 km to ensemble. 16 km appears too coarse to be very useful, especially for halfar, where it makes a dome of only 7 grid cells * adjust halfar target_velocity accordingly (accounting for diffusive cfl) * move start time of year 1 to the test group level so it applies to both tests
This is identical to the horizontal_advection test of a passive tracer, but Gaussian bump is applied to thickness field and tracer advection is not considered. This isolates the analysis to a single advection call; if there are issues with the thickness advection, we presumably cannot expect tracer advection to converge properly. It might have been possible to create an argument to toggle between versions, but it was easier (and arguably less confusing) to just make a copy. This uses a Gaussian bump of 1000 m sitting on top of a 1000 m base layer in a doubly periodic mesh. This ensures a margin-less domain, which would avoid the issue of advection degrading to 1st order at margins.
have compass expect seperate files for the dome and rmse convergence.
Change restart output interval from 30 days to 30 years.
Update passiveTracer to passiveTracer2d in analysis.py for horizontal_advection.
trhille
force-pushed
the
landice/mesh_convergence_test
branch
from
August 19, 2024 20:53
080d1f0
to
754a540
Compare
Change clobber mode from truncate to overwrite because we want to be able to use restarts without losing the initial time level in the output file.
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 introduces 3 mesh resolution convergence tests for MALI, copying from the planar_convergence test group in the ocean.
Checklist
api.rst
) has any new or modified class, method and/or functions listedMALI-Dev
submodule has been updated with relevant MALI changesTesting
in this PR) any testing that was used to verify the changes