Skip to content

Commit

Permalink
Merge pull request #121 from xylar/update-to-mpas-tools-0.23.0
Browse files Browse the repository at this point in the history
Update to `mpas_tools` v0.23.0
  • Loading branch information
xylar authored Sep 25, 2023
2 parents 683cfac + 6bf7010 commit e9ed211
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion deploy/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ geometric_features = 1.2.0
jigsaw = 0.9.14
jigsawpy = 0.3.3
mache = 1.16.0
mpas_tools = 0.21.0
mpas_tools = 0.23.0
otps = 2021.10
parallelio = 2.6.0

Expand Down
10 changes: 5 additions & 5 deletions polaris/mesh/spherical.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
import xarray.plot
from jigsawpy.savejig import savejig
from mpas_tools.cime.constants import constants
from mpas_tools.io import write_netcdf
from mpas_tools.logging import check_call
from mpas_tools.mesh.conversion import convert
from mpas_tools.mesh.creation.jigsaw_to_netcdf import jigsaw_to_netcdf
from mpas_tools.ocean.inject_meshDensity import inject_spherical_meshDensity
from mpas_tools.viz.colormaps import register_sci_viz_colormaps
Expand Down Expand Up @@ -103,9 +101,11 @@ def run(self):
sphere_radius=earth_radius)

logger.info('Convert from triangles to MPAS mesh')
write_netcdf(convert(xarray.open_dataset('mesh_triangles.nc'),
dir='.', logger=logger),
mpas_mesh_filename)

args = ['MpasMeshConverter.x',
'mesh_triangles.nc',
mpas_mesh_filename]
check_call(args=args, logger=logger)

if section.getboolean('add_mesh_density'):
logger.info('Add meshDensity into the mesh file')
Expand Down
4 changes: 2 additions & 2 deletions polaris/viz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def _compute_cell_patches(ds, mask):
if dx * dy / 10 > area_cell[cell_index]:
mask[cell_index] = False
else:
polygon = Polygon(vertices, True)
polygon = Polygon(vertices, closed=True)
patches.append(polygon)

p = PatchCollection(patches, alpha=1.)
Expand Down Expand Up @@ -240,7 +240,7 @@ def _compute_edge_patches(ds, mask):
vertices[3, 0] = 1e-3 * x_cell[cell_indices[1]]
vertices[3, 1] = 1e-3 * y_cell[cell_indices[1]]

polygon = Polygon(vertices, True)
polygon = Polygon(vertices, closed=True)
patches.append(polygon)

p = PatchCollection(patches, alpha=1.)
Expand Down

0 comments on commit e9ed211

Please sign in to comment.