mpas_tools.ocean.coastal_tools.create_background_mesh

mpas_tools.ocean.coastal_tools.create_background_mesh(grd_box, ddeg, mesh_type, dx_min, dx_max, plot_option=False, plot_box=[], call=None)[source]

Create a background field of cell widths

Parameters
  • grd_box (list of float) – A list of 4 floats defining the bounds (min lon, max lon, min lat, max lat) of the grid

  • ddeg (float) – The resolution of the mesh in degrees

  • mesh_type ({‘QU’, ‘EC’, ‘RRS’}) – The type of mesh: quasi-uniform (QU), Eddy-closure (EC) or Rossby-radius scaling (RRS)

  • dx_min (float) – The resolution in meters of a QU mesh or the minimum resolution of of an RRS mesh. This parameter is ignored for EC meshes and the default function arguments to EC_CellWidthVsLat() are used instead.

  • dx_max (float) – The maximum resolution in meters of of an RRS mesh. This parameter is ignored for QU meshes and EC meshes. For EC meshes, the default function arguments are used instead.

  • plot_option (bool, optional) – Whether to plot the resulting cell width and save it to files named bckgrnd_grid_cell_width_vs_lat###.png and bckgnd_grid_cell_width###.png, where ### is given by call and is meant to indicate how many times this function has been called during mesh creation.

  • plot_box (list of float, optional) – The extent of the plot if plot_option=True

  • call (int, optional) – The number of times the function has been called, used to give the plot a unique name.

Returns

  • cell_width (ndarray) – A 2D array of cell widths in meters.

  • lon_grd (ndarray) – A 1D array of longitudes in degrees in the range from -180 to 180

  • lat_grd (ndarray) – A 1D array of latitudes in degrees in the range from -90 to 90