mpas_tools.ocean.build_mesh.build_spherical_mesh

mpas_tools.ocean.build_mesh.build_spherical_mesh(cellWidth, lon, lat, out_filename='base_mesh.nc', plot_cellWidth=True, vtk_dir='base_mesh_vtk', preserve_floodplain=False, floodplain_elevation=20.0, do_inject_bathymetry=False, logger=None, use_progress_bar=True)[source]

Build an MPAS mesh using JIGSAW with the given cell sizes as a function of latitude and longitude

The result is a mesh file stored in out_filename as well as several intermediate files: mesh.log, mesh-HFUN.msh, mesh.jig, mesh-MESH.msh, mesh.msh, and mesh_triangles.nc.

Parameters
  • cellWidth (ndarray) – m x n array of cell width in km

  • lon (ndarray) – longitude in degrees (length n and between -180 and 180)

  • lat (ndarray) – longitude in degrees (length m and between -90 and 90)

  • out_filename (str, optional) – The file name of the resulting MPAS mesh

  • plot_cellWidth (bool, optional) – Whether to produce a plot of cellWidth. If so, it will be written to cellWidthGlobal.png.

  • vtk_dir (str, optional) – The name of the directory where mesh data will be extracted for viewing in ParaVeiw.

  • preserve_floodplain (bool, optional) – Whether a flood plain (bathymetry above z = 0) should be preserved in the mesh

  • floodplain_elevation (float, optional) – The elevation in meters to which the flood plain is preserved

  • do_inject_bathymetry (bool, optional) – Whether one of the default bathymetry datasets, earth_relief_15s.nc or topo.msh, should be added to the MPAS mesh

  • logger (logging.Logger, optional) – A logger for the output if not stdout

  • use_progress_bar (bool, optional) – Whether to display progress bars (problematic in logging to a file)