Skip to content

Commit

Permalink
Add sort_mesh call to build_mali_mesh framework function.
Browse files Browse the repository at this point in the history
Sorting the global indicies will improve memory performance of
`cellsOnCell` and such. Additionally, sorting will help with
PIO decompostion and ice-sheet-coupler communication.
  • Loading branch information
andrewdnolan committed Oct 1, 2024
1 parent 626f11a commit 4338977
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compass/landice/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from mpas_tools.logging import check_call
from mpas_tools.mesh.conversion import convert, cull
from mpas_tools.mesh.creation import build_planar_mesh
from mpas_tools.mesh.creation.sort_mesh import sort_mesh
from netCDF4 import Dataset
from scipy.interpolate import NearestNDInterpolator, interpn

Expand Down Expand Up @@ -745,10 +746,11 @@ def build_mali_mesh(self, cell_width, x1, y1, geom_points,

check_call(args, logger=logger)

logger.info('culling and converting')
logger.info('culling, converting, and sorting')
dsMesh = xarray.open_dataset('culled.nc')
dsMesh = cull(dsMesh, logger=logger)
dsMesh = convert(dsMesh, logger=logger)
dsMesh = sort_mesh(dsMesh)
write_netcdf(dsMesh, 'dehorned.nc')

args = ['create_landice_grid_from_generic_MPAS_grid.py', '-i',
Expand Down

0 comments on commit 4338977

Please sign in to comment.