-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Regridding time-series variable's climatology from hybrid to pressure levels breaks due to misaligned axes #721
Comments
I think what is happening is that the variable's climatology is being calculated with "ANN", which collapses the time dimension. In
In line 158 of e3sm_diags/e3sm_diags/driver/utils/general.py Lines 149 to 171 in 6aaa7c2
UPDATE: Root cause and solution below in this comment. Call stack:
|
Additional Findings
Root CauseUsing time series files like in ex1.py results in this issue because:
Possible SolutionsWe need the axes for the climatology variable and the hybrid variables to align. This means we should calculate the climatologies for the hybrid variables beforehand. All variables fed into |
In PR #677, I am doing a complete run of ex1.py to make sure all of the metrics and plots are successfully generated. The last remaining issue is an
xgcm
error that is raised with the variables "U", "V", "OMEGA", and "Z3".Overview
I switched back to the
main
branch to see how the original code was handling this situation and noticed it breaks there too.The
lat_lon_driver.py
tries to regrid the variables "U", "V", "OMEGA", and "Z3" using pressure levels reconstructed from hybrid. The issue is that these variables have already been regridded to 19 pressure levels (source) and no longer have a time axis. Since the variable and pressure level variable (has time axis) do not have matching dimensions, regridding does not work on the variable.This error is raised:
cdms2.error.CDMSError: axis length 129 does not match corresponding dimension 36
.Related code:
e3sm_diags/e3sm_diags/driver/utils/general.py
Lines 132 to 146 in 6aaa7c2
Possible Solutions
From this comment:
We need the axes for the climatology variable and the hybrid variables to align. This means we should calculate the climatologies for the hybrid variables beforehand.
All variables fed into convert_to_pressure_levels(), hybrid_to_plevs() and pressure_to_plevs() should not have a time axis.
Steps to Reproduce (NERSC machine)
main
branchlat_lon_model_vs_model.cfg
to only run one of related variables (e.g., "U")python -m pip install .
Traceback:
The text was updated successfully, but these errors were encountered: