uxarray._scrip._write_scrip#

uxarray._scrip._write_scrip(outfile, mesh2_face_nodes, mesh2_node_x, mesh2_node_y, face_areas)#

Function to reassign UGRID formatted variables to SCRIP formatted variables and then writing them out to a netCDF file.

Currently, supports creating unstructured SCRIP grid files following traditional SCRIP naming practices (grid_corner_lat, grid_center_lat, etc).

Unstructured grid SCRIP files will have grid_rank=1 and include variables grid_imask and grid_area in the dataset.

More information on structured vs unstructured SCRIP files can be found here on the Earth System Modeling Framework website.

Parameters
  • outfile (str) – Name of file to be created. Saved to working directory, or to specified location if full path to new file is provided.

  • mesh2_face_nodes (xarray.DataArray) – Face-node connectivity. This variable should come from the Grid object that calls this function

  • mesh2_node_x (xarray.DataArray) – Nodes’ x values. This variable should come from the Grid object that calls this function

  • mesh2_node_y (xarray.DataArray) – Nodes’ y values. This variable should come from the Grid object that calls this function

  • face_areas (numpy.ndarray) – Face areas. This variable should come from the Grid object that calls this function

Returns

ds – Dataset to be returned by _write_scrip. The function returns both the output dataset in SCRIP format for immediate and saves it as an independent netCDF file.

Return type

xarray.Dataset