From 4bdc715874ccf13d1b06f273bfd176319e63cbc8 Mon Sep 17 00:00:00 2001 From: Andrew Nolan Date: Tue, 24 Sep 2024 08:55:22 -0700 Subject: [PATCH] Add `sort_mesh` call to `build_mali_mesh` framework function. Sorting the global indicies will improve memory performance of `cellsOnCell` and such. Additionally, sorting will help with PIO decompostion and ice-sheet-coupler communication. --- compass/landice/mesh.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compass/landice/mesh.py b/compass/landice/mesh.py index 07bc4833b..f599b7dbc 100644 --- a/compass/landice/mesh.py +++ b/compass/landice/mesh.py @@ -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 @@ -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')