Skip to content

Conversation

@xylar
Copy link
Collaborator

@xylar xylar commented Aug 8, 2025

E3SM will switch to using ADIOS format for restart files in some configurations. But the MPAS-Ocean and -seaice mesh files from the "mesh" stream should always be safe to use for mesh variables (including those for the 3D MPAS-Ocean mesh).

Checklist

  • Developer's Guide has been updated
  • Documentation has been built locally and changes look as expected
  • Testing comment in the PR documents testing used to verify the changes

Fixes #1107

@milenaveneziani
Copy link
Collaborator

Hi @xylar, quick question: would this be backward compatible, ie, if meshStream is undefined in the config file it goes back to using the restart file? Maybe not a good idea in the long run?

@xylar
Copy link
Collaborator Author

xylar commented Aug 11, 2025

Yes, I think that's a reasonable idea. Thanks @milenaveneziani!

@milenaveneziani
Copy link
Collaborator

great. Thanks @xylar!

xylar added 4 commits August 19, 2025 15:47
E3SM will switch to using ADIOS format for restart files in some
configurations.  But the MPAS-Ocean and -seaice mesh files from
the "mesh" stream should always be safe to use for mesh variables
(including those for the 3D MPAS-Ocean mesh).
This enables us to use different streams for ocean and sea-ice
tasks, since the only stream where the mesh is available in
MPAS-seaice is the landIceMasks stream.
@xylar xylar force-pushed the use-mpaso-mesh-file-not-restart branch from 00f059c to ca02c94 Compare August 19, 2025 13:47
@xylar
Copy link
Collaborator Author

xylar commented Aug 19, 2025

Seeing the following error related to BSF:

  File "/gpfs/fs1/home/ac.xylar/chrysalis/miniforge3/envs/mpas_analysis_dev/lib/python3.13/site-packages/mpas_tools/ocean/streamfunction/barotropic.py", line 106, in compute_barotropic_streamfunction
    bsf_vertex = _compute_barotropic_streamfunction_vertex(
        ds_mesh,
    ...<8 lines>...
        tmp_dir,
    )
  File "/gpfs/fs1/home/ac.xylar/chrysalis/miniforge3/envs/mpas_analysis_dev/lib/python3.13/site-packages/mpas_tools/ocean/streamfunction/barotropic.py", line 440, in _compute_barotropic_streamfunction_vertex
    vert_integ_velocity = compute_vertically_integrated_velocity(
        ds_mesh=ds_mesh,
    ...<7 lines>...
        nedges_chunk=horiz_chunk,
    )
  File "/gpfs/fs1/home/ac.xylar/chrysalis/miniforge3/envs/mpas_analysis_dev/lib/python3.13/site-packages/mpas_tools/ocean/streamfunction/velocity.py", line 110, in compute_vertically_integrated_velocity
    vert_index >= min_level_cell, vert_index <= max_level_cell
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/gpfs/fs1/home/ac.xylar/chrysalis/miniforge3/envs/mpas_analysis_dev/lib/python3.13/site-packages/xarray/core/_typed_ops.py", line 708, in __ge__
    return self._binary_op(other, operator.ge)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/gpfs/fs1/home/ac.xylar/chrysalis/miniforge3/envs/mpas_analysis_dev/lib/python3.13/site-packages/xarray/core/dataarray.py", line 4896, in _binary_op
    f(self.variable, other_variable_or_arraylike)
    ~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/gpfs/fs1/home/ac.xylar/chrysalis/miniforge3/envs/mpas_analysis_dev/lib/python3.13/site-packages/xarray/core/_typed_ops.py", line 1130, in __ge__
    return self._binary_op(other, operator.ge)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/gpfs/fs1/home/ac.xylar/chrysalis/miniforge3/envs/mpas_analysis_dev/lib/python3.13/site-packages/xarray/core/variable.py", line 2438, in _binary_op
    f(self_data, other_data) if not reflexive else f(other_data, self_data)
    ~^^^^^^^^^^^^^^^^^^^^^^^
ValueError: operands could not be broadcast together with shapes (60,) (7268,)

@xylar xylar force-pushed the use-mpaso-mesh-file-not-restart branch from ca02c94 to 965dee4 Compare August 19, 2025 18:41
xylar added 3 commits August 19, 2025 15:00
If neither the file in the mesh stream nor the first file matching
the pattern for the restart file exists, raise an error.
@xylar xylar force-pushed the use-mpaso-mesh-file-not-restart branch from 965dee4 to 5c77cac Compare August 19, 2025 20:00
@xylar
Copy link
Collaborator Author

xylar commented Aug 19, 2025

Testing

Okay, after working out a few quirks and bugs, this is working:
https://web.lcrc.anl.gov/public/e3sm/diagnostic_output/ac.xasay-davis/analysis_testing/chrysalis/use-mpaso-mesh-file-not-restart/

@xylar xylar self-assigned this Aug 20, 2025
@xylar xylar merged commit 63282e6 into MPAS-Dev:develop Aug 20, 2025
5 checks passed
@xylar xylar deleted the use-mpaso-mesh-file-not-restart branch August 28, 2025 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need a way to find MPAS-Ocean and -seaice initial conditions

2 participants