@@ -485,6 +485,71 @@ def setup(self):
485485 }
486486 )
487487
488+ def test_multidim (self ):
489+ # 11,20 11,21
490+ # 1,0 1,1
491+ #
492+ #
493+ # 0,0 0,1
494+ # 10,20 10,21
495+ lat = np .array ([[10 , 10 ], [11 , 11 ]])
496+ lon = np .array ([[20 , 21 ], [20 , 21 ]])
497+ lat_bnds = np .array (
498+ [
499+ [[9.5 , 9.5 , 10.5 , 10.5 ], [9.5 , 9.5 , 10.5 , 10.5 ]],
500+ [[10.5 , 10.5 , 11.5 , 11.5 ], [10.5 , 10.5 , 11.5 , 11.5 ]],
501+ ]
502+ )
503+ lon_bnds = np .array (
504+ [
505+ [
506+ [19.5 , 21.5 , 21.5 , 19.5 ],
507+ [20.5 , 21.5 , 21.5 , 19.5 ],
508+ ],
509+ [
510+ [19.5 , 21.5 , 21.5 , 19.5 ],
511+ [20.5 , 21.5 , 21.5 , 19.5 ],
512+ ],
513+ ]
514+ )
515+
516+ ds = xr .Dataset (
517+ data_vars = {
518+ "ts" : (("x" , "y" ), [[1.2 , 1.3 ], [0.9 , 2.2 ]]),
519+ "lat_bnds" : (("x" , "y" , "n" ), lat_bnds ),
520+ "lon_bnds" : (("x" , "y" , "n" ), lon_bnds ),
521+ },
522+ coords = {
523+ "lat" : (
524+ ("x" , "y" ),
525+ lat ,
526+ {
527+ "units" : "degrees_north" ,
528+ "long_name" : "latitude" ,
529+ "axis" : "y" ,
530+ "bounds" : "lat_bnds" ,
531+ },
532+ ),
533+ "lon" : (
534+ ("x" , "y" ),
535+ lon ,
536+ {
537+ "units" : "degrees_east" ,
538+ "long_name" : "longitude" ,
539+ "axis" : "x" ,
540+ "bounds" : "lon_bnds" ,
541+ },
542+ ),
543+ },
544+ )
545+
546+ output_grid = grid .create_gaussian_grid (4 )
547+
548+ regridder = regrid2 .Regrid2Regridder (ds , output_grid )
549+
550+ with pytest .raises (RuntimeError ):
551+ regridder .horizontal ("ts" , ds )
552+
488553 # source ordering is time, height, lat, lon
489554 @pytest .mark .parametrize (
490555 "ordering" ,
0 commit comments