Skip to content

Conversation

@andrewdnolan
Copy link
Collaborator

@andrewdnolan andrewdnolan commented May 8, 2025

Only need to check for is_periodic with non-spherical meshes. Reordering will avoid issues with restart files.

Fixes #31.

@andrewdnolan andrewdnolan requested a review from xylar May 8, 2025 14:38
@andrewdnolan andrewdnolan self-assigned this May 8, 2025
@andrewdnolan andrewdnolan added the bug Something isn't working label May 8, 2025
@andrewdnolan
Copy link
Collaborator Author

Testing

The code snippet:

import mosaic
import xarray as xr
mesh_file = '/global/cfs/cdirs/e3sm/inputdata/ocn/mpas-o/ARRM10to60E2r1/mpaso.ARRM10to60E2r1.rstFrom1monthG-chrys.220802.nc'

ds = xr.open_dataset(mesh_file)
descriptor = mosaic.Descriptor(ds)

Now works without any issues. @xylar Checking a restart file from the periodic simulation could be good, since that's an edge case not covered here. Though that seems like a really rare thing in practice.

@xylar
Copy link
Collaborator

xylar commented May 8, 2025

We definitely do restart tests on meshes that are periodic so I think maybe it's just that the periodic attributes aren't written out for spherical meshes (where they are nonsense). But I haven't been able to prove that.

Copy link
Collaborator

@xylar xylar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change makes a lot of sense to me.

@andrewdnolan andrewdnolan merged commit a3af718 into E3SM-Project:main May 14, 2025
5 checks passed
@andrewdnolan andrewdnolan deleted the handle_missing_attr branch October 9, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restart files don't have is_periodic attribute

2 participants