Skip to content

Conversation

@xylar
Copy link
Collaborator

@xylar xylar commented Jan 14, 2026

We need to drop the nOceanRegions dimension from the control dataset just as we do for the main dataset.

Checklist

  • Testing comment in the PR documents testing used to verify the changes

We need to drop the `nOceanRegions` dimension from the control
dataset just as we do for the main dataset.
@xylar xylar self-assigned this Jan 14, 2026
@xylar xylar added the bug label Jan 14, 2026
@xylar
Copy link
Collaborator Author

xylar commented Jan 14, 2026

Testing

I performed a main vs. control analysis run using E3SM-Project/zppy#772 and this branch. With this fix, the indexNino34 analysis runs successfully whereas without it, I got errors:

analysis task indexNino34 failed during run 
Traceback (most recent call last):
  File "/lcrc/soft/climate/e3sm-unified/e3smu_1_12_0/chrysalis/conda/envs/e3sm_unified_1.12.0_compute/lib/python3.13/site-packages/mpas_analysis/shared/analysis_task.py", line 323, in run
    self.run_task()
    ~~~~~~~~~~~~~^^
  File "/lcrc/soft/climate/e3sm-unified/e3smu_1_12_0/chrysalis/conda/envs/e3sm_unified_1.12.0_compute/lib/python3.13/site-packages/mpas_analysis/ocean/index_nino34.py", line 274, in run_task
    nino34Ref = self._compute_nino34_index(regionSSTRef, calendar)
  File "/lcrc/soft/climate/e3sm-unified/e3smu_1_12_0/chrysalis/conda/envs/e3sm_unified_1.12.0_compute/lib/python3.13/site-packages/mpas_analysis/ocean/index_nino34.py", line 371, in _compute_nino34_index
    return self._running_mean(anomaly, wgts)
           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/lcrc/soft/climate/e3sm-unified/e3smu_1_12_0/chrysalis/conda/envs/e3sm_unified_1.12.0_compute/lib/python3.13/site-packages/mpas_analysis/ocean/index_nino34.py", line 502, in _running_mean
    runningMean[k] = sum(wgts * inputData[k - sp:k + sp + 1].values)
    ~~~~~~~~~~~^^^
  File "/lcrc/soft/climate/e3sm-unified/e3smu_1_12_0/chrysalis/conda/envs/e3sm_unified_1.12.0_compute/lib/python3.13/site-packages/xarray/core/dataarray.py", line 905, in __setitem__
    self.variable[key] = value
    ~~~~~~~~~~~~~^^^^^
  File "/lcrc/soft/climate/e3sm-unified/e3smu_1_12_0/chrysalis/conda/envs/e3sm_unified_1.12.0_compute/lib/python3.13/site-packages/xarray/core/variable.py", line 903, in __setitem__
    indexing.set_with_indexer(indexable, index_tuple, value)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lcrc/soft/climate/e3sm-unified/e3smu_1_12_0/chrysalis/conda/envs/e3sm_unified_1.12.0_compute/lib/python3.13/site-packages/xarray/core/indexing.py", line 1169, in set_with_indexer
    indexable[indexer] = value
    ~~~~~~~~~^^^^^^^^^
  File "/lcrc/soft/climate/e3sm-unified/e3smu_1_12_0/chrysalis/conda/envs/e3sm_unified_1.12.0_compute/lib/python3.13/site-packages/xarray/core/indexing.py", line 1715, in __setitem__
    self._safe_setitem(array, key, value)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/lcrc/soft/climate/e3sm-unified/e3smu_1_12_0/chrysalis/conda/envs/e3sm_unified_1.12.0_compute/lib/python3.13/site-packages/xarray/core/indexing.py", line 1698, in _safe_setitem
    raise exc
  File "/lcrc/soft/climate/e3sm-unified/e3smu_1_12_0/chrysalis/conda/envs/e3sm_unified_1.12.0_compute/lib/python3.13/site-packages/xarray/core/indexing.py", line 1689, in _safe_setitem
    array[key] = value
    ~~~~~^^^^^
ValueError: could not broadcast input array from shape (5,) into shape (1,)

The results with errors are in:

/lcrc/group/e3sm/ac.xylar/zppy/mpas_analysis_model_vs_model/v3.LR.historical_0091/post/analysis/mpas_analysis/ts_1850-2014_climo_1985-2014

The successful ones are in:

/lcrc/group/e3sm/ac.xylar/zppy/mpas_analysis_model_vs_model/v3.LR.historical_0091_el_nino_fix/post/analysis/mpas_analysis/ts_1850-2014_climo_1985-2014

@xylar
Copy link
Collaborator Author

xylar commented Jan 14, 2026

Further testing

I successfully ran the test suite. The output is here:
https://web.lcrc.anl.gov/public/e3sm/diagnostic_output/xasaydavis/analysis_testing/chrysalis/fix-el-nino-main-vs-control/

@xylar xylar merged commit fcc4dab into MPAS-Dev:develop Jan 14, 2026
5 checks passed
@xylar xylar deleted the fix-el-nino-main-vs-control branch January 14, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant