Skip to content

Commit

Permalink
Merge pull request #201 from xylar/isomip-plus-cull-periodic-base-mesh
Browse files Browse the repository at this point in the history
Cull ISOMIP+ planar base mesh
  • Loading branch information
xylar authored Jul 15, 2024
2 parents a87a3a4 + 3407555 commit b97100b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions polaris/ocean/tasks/isomip_plus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,18 @@ 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,
config=config,
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,
Expand Down
5 changes: 4 additions & 1 deletion polaris/ocean/tasks/isomip_plus/mesh/planar.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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')

0 comments on commit b97100b

Please sign in to comment.