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 Sep 24, 2024
1 parent 626f11a commit 4bdc715
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions 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 @@ -682,6 +683,8 @@ def build_mali_mesh(self, cell_width, x1, y1, geom_points,
dsMesh = xarray.open_dataset('base_mesh.nc')
logger.info('culling mesh')
dsMesh = cull(dsMesh, logger=logger)
logger.info('soring mesh')
dsMesh = sort_mesh(dsMesh)
logger.info('converting to MPAS mesh')
dsMesh = convert(dsMesh, logger=logger)
logger.info('writing grid_converted.nc')
Expand Down

0 comments on commit 4bdc715

Please sign in to comment.