mpas_tools.mesh.creation.build_mesh.build_spherical_mesh

mpas_tools.mesh.creation.build_mesh.build_spherical_mesh(cellWidth, lon, lat, earth_radius, out_filename='base_mesh.nc', plot_cellWidth=True, dir='./')[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)

  • earth_radius (float) – Earth radius in meters

  • 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.

  • dir (str, optional) – A directory in which a temporary directory will be added with files produced during mesh conversion and then deleted upon completion.