@@ -780,9 +780,9 @@ def _make_names(prefixes):
780780 "nav_lev" ,
781781 ]
782782)
783- _X_NAMES = _make_names (["x" ])
784- _Y_NAMES = _make_names (["y" ])
785- _Z_NAMES = _VERTICAL_NAMES
783+ _X_NAMES = _make_names (["x" , "nlon" , "i" , "ni" ])
784+ _Y_NAMES = _make_names (["y" , "nlat" , "j" , "nj" ])
785+ _Z_NAMES = _VERTICAL_NAMES + [ "olevel" , "level" , "zlevel" ]
786786_LATITUDE_NAMES = _make_names (["lat" , "latitude" , "gphi" , "nav_lat" ])
787787_LONGITUDE_NAMES = _make_names (["lon" , "longitude" , "glam" , "nav_lon" ])
788788
@@ -1193,3 +1193,24 @@ def test_differentiate_positive_upward(obj):
11931193 obj .z .attrs ["positive" ] = "zzz"
11941194 with pytest .raises (ValueError ):
11951195 obj .cf .differentiate ("z" , positive_upward = True )
1196+
1197+
1198+ def test_cmip6_attrs ():
1199+ da = xr .DataArray (
1200+ np .ones ((10 , 10 )),
1201+ dims = ("nlon" , "nlat" ),
1202+ coords = {
1203+ "nlon" : (
1204+ "nlon" ,
1205+ np .arange (10 ),
1206+ {"long_name" : "cell index along first dimension" },
1207+ ),
1208+ "nlat" : (
1209+ "nlat" ,
1210+ np .arange (10 ),
1211+ {"long_name" : "cell index along second dimension" },
1212+ ),
1213+ },
1214+ )
1215+ assert da .cf .axes ["X" ] == ["nlon" ]
1216+ assert da .cf .axes ["Y" ] == ["nlat" ]
0 commit comments