-
Notifications
You must be signed in to change notification settings - Fork 328
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
Smooth topography before interp to MPAS #489
Smooth topography before interp to MPAS #489
Conversation
This merge adds a python script for iteratively smoothing topograpthy (from for now, the dataset combining BedMachine and GEBCO) proportional to the resolution of the MPAS mesh, as determined in the base_mesh step. Local weights for the iterative smoothing are determined based on the resolution of the lon/lat grid, the MPAS mesh resolution, the number of iterations of smoothing and a constant multiplicative factor `smoothing` that can be increased or decreased to provide more or less smoothing overall. The default value, `smoothing = 1.0`, smooths the topography by one MPAS cell width. Increasing the number of iterations will typically not increase the amount of smoothing, since less smoothing is performed at each iteration. The exception is that the maximum amount of smoothing is an unweighted nearest-neighbor averaging at each iteration. If a region (commonly the poles) is so stretched on the lon/lat grid that an MPAS cell covers more grid cells than the number of smoothing iterations, it is not possible to smooth over the full width of an MPAS grid cell. In practice, this is not likely to be an important issue. The cost of this approach is significant, taking several minutes even for coarse MPAS meshes (it is performed on the topographic grid, so is largely agnostic to the MPAS resolution). We may need to make the QU240wISC test case a special case where we either skip this process or simplify it in some way to reduce runtime of regression testing. Currently, the approach is only being used for test cases with ice-shelf cavities (the same ones using BedMachine/GEBCO bathymetry). It could be expanded to other test cases if it proves useful.
@mark-petersen, this is the work I mentioned today where I would smooth bathymetry before resampling to the MPAS mesh rather than after. It seems to be working well so far. I'm putting this here as a placeholder for now, not because it's ready to review or merge. @jonbob, I might get your help doing another round of E3SM testing with a new EC60to30wISC mesh once we're a little further along (e.g. we have 64 layers as an option). |
To determine the relationship between nearest-neighbor weights, number of iterations and the width (in grid cells on a regular, logically rectangular grid) of the resulting smoothing, I used this script: A = 2.65
p_iter = 0.5
p_width = 2.25
weight = (width/(A*iterations**p_iter))**p_width This formula is used in the script |
<step executable="./smooth_topo.py"> | ||
<argument flag="--iter">100</argument> | ||
<argument flag="--smoothing">1.0</argument> | ||
<argument flag="--mpi_tasks">4</argument> |
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.
It's annoying that the number of MPI tasks is repeatedly hard coded and not part of the config file or some kind of machine config file. We need to think if there's a better way to do this. This is just one example of where the problem arises.
@prajvala01123, take a look at this when you get a chance. It's probably not the easiest entry point for learning about setting up a new test case for MPAS-Ocean in E3SM, but it will eventually be helpful if you are interested in playing with bathymetric smoothing. |
Needs to be rebased once the next set of COMPASS merges have happened. |
This branch has been moved here: https://github.com/xylar/compass/tree/add_better_topo_smoothing A PR will be made to https://github.com/MPAS-Dev/compass when the time is right. |
This merge adds a python script for iteratively smoothing topograpthy (from for now, the dataset combining BedMachine and GEBCO) proportional to the resolution of the MPAS mesh, as determined in the base_mesh step.
Local weights for the iterative smoothing are determined based on the resolution of the lon/lat grid, the MPAS mesh resolution, the number of iterations of smoothing and a constant multiplicative factor
smoothing
that can be increased or decreased to provide more or less smoothing overall. The default value,smoothing = 1.0
, smooths the topography by one MPAS cell width.Increasing the number of iterations will typically not increase the amount of smoothing, since less smoothing is performed at each iteration. The exception is that the maximum amount of smoothing is an unweighted nearest-neighbor averaging at each iteration. If a region (commonly the poles) is so stretched on the lon/lat grid that an MPAS cell covers more grid cells than the number of smoothing iterations, it is not possible to smooth over the full width of an MPAS grid cell. In practice, this is not likely to be an important issue.
The cost of this approach is significant, taking several minutes even for coarse MPAS meshes (it is performed on the topographic grid, so is largely agnostic to the MPAS resolution). We may
need to make the QU240wISC test case a special case where we either skip this process or simplify it in some way to reduce runtime of regression testing.
Currently, the approach is only being used for test cases with ice-shelf cavities (the same ones using BedMachine/GEBCO bathymetry). It could be expanded to other test cases if it proves useful.