Is it correct for regrid_to_lower_res()
to assume second axis is always latitude?
#706
-
I'm refactoring this function in PR #677. It compares the number of latitude coordinates to determine which variable is lower e3sm_diags/e3sm_diags/driver/utils/general.py Lines 240 to 248 in d0aa16b I noticed that this function assumes the second element in import cdms2
filepath = "qa/658-lat-lon-set/cl_Amon_E3SM-2-0_historical_r1i1p1f1_gr_200001-201412.nc"
ds = cdms2.open(filepath)
cl = ds["cl"]
axes1 = cl.getAxisList()
axes1[1]
# id: lev
# Designated a level axis.
# units: hybrid_sigma_pressure
# Length: 30
# First: 3.6434658
# Last: 992.5561
# Other axis attributes:
# axis: Z
# long_name: hybrid level at layer midpoints (1000*(A+B))
# positive: down
# A_var: hyam
# B_var: hybm
# P0_var: P0
# PS_var: PS
# realtopology: linear
# Python id: 0x7f58f03254b0 Additional InformationThe call stack: e3sm_diags/e3sm_diags/driver/lat_lon_driver.py Lines 216 to 218 in d0aa16b e3sm_diags/e3sm_diags/driver/lat_lon_driver.py Lines 21 to 32 in d0aa16b |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Do you have any insight @chengzhuzhang? |
Beta Was this translation helpful? Give feedback.
regrid_to_lower_res() is always used with assumption that two 2D variables are being compared. In the case of 3D variable is supplied, to extract one vertical slice is an operation as prerequisite. When refactoring, we should use more specific axis, rather than asume second axis is always latitude.
i.e. it seems like using cmorized dataset for testing revealed a couple weak points, which is good to have. Existing tests mostly use native-ish E3SM output..