mmr0
(Madi Rosevear)
30 April 2025 03:45
1
Hey all, I’m trying to run the regional mom6 package after a break. Using this notebook based off the regional_mom6 demo. It’s failing on the bathymetry creation step with error message
ValueError: chunks must have the same number of elements as dimensions. Expected 4 elements, got 2.
I seem to get the same error with analysis3-25.03, -25.04 and -unstable
Regional mom6 version is 0.6.1
I’ve run this notebook before without issue so I thought it might be to do with the conda environment, but I’m not 100% sure what I was using before.
Any ideas?
1 Like
navidcy
(Navid C. Constantinou)
30 April 2025 05:26
2
From following the stack trace error from above for regional-mom6 v0.6.1 used, it seems like the error is coming from the xesmf regridder:
+ "Afterwards, we run 'tidy_bathymetry' method to skip the expensive interpolation step, and finishing metadata, encoding and cleanup."
)
# If we have a domain large enough for chunks, we'll run regridder with parallel=True
parallel = True
if len(tgrid.chunks) != 2:
parallel = False
print(f"Regridding in parallel: {parallel}")
bathymetry_output = bathymetry_output.chunk(chunks)
# return
regridder = xe.Regridder(
bathymetry_output, tgrid, "bilinear", parallel=parallel
)
bathymetry = regridder(bathymetry_output)
bathymetry.to_netcdf(
self.mom_input_dir / "bathymetry_unfinished.nc", mode="w", engine="netcdf4"
)
print(
"Regridding finished. Now calling `tidy_bathymetry` method for some finishing touches..."
)
Do we know what version of xesfm we have in conda analysis 25.04 compared to the hh5 env 24.07? cc @rbeucher @anton
@mmr0 did you try running with the hh5 env conga-analysis 24.07? Is this OK?
1 Like
rbeucher
(Romain Beucher)
30 April 2025 05:46
3
@CharlesTurner updated 25.04 yesterday. @CharlesTurner can you check the versions for us please?
1 Like
[ct1163@gadi-login-04 module use /g/data/xp65/public/modules && module load conda/analysis3-25.04
Loading conda/analysis3-25.04
Loading requirement: singularity
[ct1163@gadi-login-04 ~]$ python -c "import xesmf; print(xesmf.__version__)"
0.8.7
[ct1163@gadi-login-04 ~]$ module unload conda/analysis3-25.04
Unloading conda/analysis3-25.04
Unloading useless requirement: singularity
[ct1163@gadi-login-04 ~]$ module use /g/data/hh5/public/modules && module load conda/analysis3
Loading conda/analysis3-25.03
Loading requirement: singularity
[ct1163@gadi-login-04 ~]$ python -c "import xesmf; print(xesmf.__version__)"
0.8.8
[ct1163@gadi-login-04 ~]$ module unload conda/analysis3
Unloading conda/analysis3-25.03
Unloading useless requirement: singularity
[ct1163@gadi-login-04 ~]$ module load conda/analysis3-24.07
Loading conda/analysis3-24.07
Loading requirement: singularity
[ct1163@gadi-login-04 ~]$ python -c "import xesmf; print(xesmf.__version__)"
0.8.8
[ct1163@gadi-login-04 ~]$
Looks like xesmf has downgraded from 0.8.8 to 0.8.7. The changelog for 0.8.7 => 0.8.8 does involve some changes to chunking.
I’m looking into what might have caused the version to downgrade now.
1 Like
mmr0
(Madi Rosevear)
30 April 2025 06:04
5
Thanks Navid! Yes I just checked and running it with hh5 env conda-analysis 24.07 solves that problem
Okay, I’ve done some digging and around version 0.8.8 of xesmf, a bunch of version incompatibility pins with esmpy were added .
I haven’t quite pinpointed what this conflicts with, but it seems to be the source of the error. I’ll update when I have more findings.
Hi Madi,
I’ve just been working through some related xesmf issues & bisecting the environment changes.
The conda/analysis3-25.02 & conda/analysis3-25.03 environments contains xesmf 0.8.8, only downgrading to 0.8.7 in analysis3-25.04:
[ct1163@gadi-login-04 ~] $ module use /g/data/xp65/public/modules && module load conda/analysis3-25.02
Loading conda/analysis3-25.02
Loading requirement: singularity
[ct1163@gadi-login-04 ~]$ pip list | grep 'xesmf'
xesmf 0.8.8
[ct1163@gadi-login-04 ~]$ module unload conda/analysis3-25.02
Unloading conda/analysis3-25.02
Unloading useless requirement: singularity
[ct1163@gadi-login-04 ~]$
[ct1163@gadi-login-04 ~]$ module load conda/analysis3-25.03
Loading conda/analysis3-25.03
Loading requirement: singularity
[ct1163@gadi-login-04 ~]$ pip list | grep 'xesmf'
xesmf 0.8.8
[ct1163@gadi-login-04 ~]$ module unload conda/analysis3-25.03
Unloading conda/analysis3-25.03
Unloading useless requirement: singularity
[ct1163@gadi-login-04 ~]$
[ct1163@gadi-login-04 ~]$ module load conda/analysis3-25.04
Loading conda/analysis3-25.04
Loading requirement: singularity
[ct1163@gadi-login-04 ~]$ pip list | grep 'xesmf'
xesmf 0.8.7
Assuming that the xesmf downgrade was the root cause of the issue, I would have expected the notebook to run in the 25.02 & 25.03 environments, and fail in the 25.04 environment, so I suspect the issue might be a little bit more complicated.
I’m currently downloading the copernicus data needed in the notebook which is taking a while… more info to come.