mpas_tools.planar_hex.make_planar_hex_mesh
- mpas_tools.planar_hex.make_planar_hex_mesh(nx, ny, dc, nonperiodic_x, nonperiodic_y, outFileName=None, compareWithFileName=None, format=None, engine=None)[source]
Builds an MPAS periodic, planar hexagonal mesh with the requested dimensions, optionally saving it to a file, and returns it as an
xarray.Dataset
.- Parameters:
nx (int) – The number of cells in the x direction
ny (even int) – The number of cells in the y direction (must be an even number for periodicity to work out)
dc (float) – The distance in meters between adjacent cell centers.
nonperiodic_x (bool) – is the mesh non-periodic in x and y directions?
nonperiodic_y (bool) – is the mesh non-periodic in x and y directions?
outFileName (str, optional) – The name of a file to save the mesh to. The mesh is not saved to a file if no file name is supplied.
compareWithFileName (str, optional) – The name of a grid file to compare with to see if they are identical, used for testing purposes
format ({'NETCDF4', 'NETCDF4_CLASSIC', 'NETCDF3_64BIT', ') – NETCDF3_CLASSIC’}, optional The NetCDF format to use for output
engine ({'netcdf4', 'scipy', 'h5netcdf'}, optional) – The library to use for NetCDF output
- Returns:
mesh (xarray.Dataset) – The mesh data set, available for further manipulation such as culling cells or removing periodicity.