From ea5f99da3f934acacb4dfb51284523cdbf01ed46 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Mon, 15 Jul 2024 09:02:01 -0500 Subject: [PATCH 1/2] Cull ISOMIP+ planar base mesh This should allow us to perform conservative remapping of topography. --- polaris/ocean/tasks/isomip_plus/mesh/planar.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/polaris/ocean/tasks/isomip_plus/mesh/planar.py b/polaris/ocean/tasks/isomip_plus/mesh/planar.py index a23a14402..a05265b71 100644 --- a/polaris/ocean/tasks/isomip_plus/mesh/planar.py +++ b/polaris/ocean/tasks/isomip_plus/mesh/planar.py @@ -1,6 +1,7 @@ import numpy as np import pyproj from mpas_tools.io import write_netcdf +from mpas_tools.mesh.conversion import cull from mpas_tools.planar_hex import make_planar_hex_mesh from mpas_tools.translate import translate @@ -79,4 +80,6 @@ def run(self): ds_mesh[f'lon{suffix}'] = (f'n{suffix}', np.deg2rad(lon)) add_isomip_plus_xy(ds_mesh) - write_netcdf(ds_mesh, 'base_mesh.nc') + # cull the mesh to remove periodicity + ds_nonperiodic = cull(ds_mesh) + write_netcdf(ds_nonperiodic, 'base_mesh.nc') From 3407555b29b7246224664efb29a56a2cceff9a38 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Mon, 15 Jul 2024 09:05:23 -0500 Subject: [PATCH 2/2] Remap conserve with smoothing to base mesh We were not doing this before because the base mesh might be periodic, but periodicity is now being removed. --- polaris/ocean/tasks/isomip_plus/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/polaris/ocean/tasks/isomip_plus/__init__.py b/polaris/ocean/tasks/isomip_plus/__init__.py index f2636507f..9bc56a932 100644 --- a/polaris/ocean/tasks/isomip_plus/__init__.py +++ b/polaris/ocean/tasks/isomip_plus/__init__.py @@ -75,9 +75,9 @@ def _get_shared_steps(mesh_type, resolution, mesh_name, resdir, component, base_mesh.set_shared_config(config, link='isomip_plus_topo.cfg') subdir = f'{resdir}/topo/map_base' - # we remap the topography onto the base mesh without smoothing and with - # the bilinear method because the conserve method doesn't work with - # periodic meshes + # we remap the topography onto the base mesh with smoothing, which + # requires the conserve method. This only works because we have already + # culled planar meshes to remove periodicity topo_map_base = TopoMap(component=component, name='topo_map_base', subdir=subdir, @@ -85,8 +85,8 @@ def _get_shared_steps(mesh_type, resolution, mesh_name, resdir, component, mesh_name=mesh_name, mesh_step=base_mesh, mesh_filename='base_mesh.nc', - method='bilinear', - smooth=False) + method='conserve', + smooth=True) subdir = f'{resdir}/topo/remap_base' topo_remap_base = TopoRemap(component=component,