Skip to content

Commit 62d1d7c

Browse files
committed
o Use imask instead of rank as our test cases have grids that don't have grid_rank
1 parent 17b9ea2 commit 62d1d7c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

uxarray/io/_scrip.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ def _to_ugrid(in_ds, out_ds):
1515

1616
source_dims_dict = {}
1717

18-
if in_ds["grid_rank"].all():
18+
# Use imask, area or rank can be used but imask seemed to work for majority of cases
19+
if in_ds["grid_imask"].all():
1920
# Create node_lon & node_lat variables from grid_corner_lat/lon
2021
# Turn latitude and longitude scrip arrays into 1D
2122
corner_lat = in_ds["grid_corner_lat"].values.ravel()
@@ -131,7 +132,7 @@ def _encode_scrip(face_node_connectivity, node_lon, node_lat, face_areas):
131132
Currently, supports creating unstructured SCRIP grid files following traditional
132133
SCRIP naming practices (grid_corner_lat, grid_center_lat, etc).
133134
134-
Unstructured grid SCRIP files will have ``grid_rank=1`` may include variables
135+
Unstructured grid SCRIP files typically have ``grid_rank=1`` and include variables
135136
``grid_imask`` and ``grid_area`` in the dataset.
136137
137138
More information on structured vs unstructured SCRIP files can be found here on the `Earth System Modeling Framework <https://earthsystemmodeling.org/docs/release/ESMF_6_2_0/ESMF_refdoc/node3.html>`_ website.

0 commit comments

Comments
 (0)