@@ -3951,7 +3951,8 @@ def laplacian_xy(
39513951
39523952 .. versionadded:: 3.12.0
39533953
3954- .. seealso:: `derivative`, `grad_xy`, `iscyclic`, `cf.div_xy`
3954+ .. seealso:: `derivative`, `grad_xy`, `iscyclic`,
3955+ `cf.curl_xy`, `cf.div_xy`
39553956
39563957 :Parameters:
39573958
@@ -4050,6 +4051,12 @@ def laplacian_xy(
40504051 x_coord.Units = _units_radians
40514052 y_coord.Units = _units_radians
40524053
4054+ # Ensure that the lat and lon dimension coordinates have
4055+ # standard names, so that metadata-aware broadcasting
4056+ # works as expected when all of their units are radians.
4057+ x_coord.standard_name = "longitude"
4058+ y_coord.standard_name = "latitude"
4059+
40534060 # Get theta as a field that will broadcast to f, and
40544061 # adjust its values so that theta=0 is at the north pole.
40554062 theta = np.pi / 2 - f.convert(y_key, full_domain=True)
@@ -4078,8 +4085,8 @@ def laplacian_xy(
40784085 f = term1 + term2
40794086
40804087 # Reset latitude and longitude coordinate units
4081- f.dimension_coordinate("X ").Units = x_units
4082- f.dimension_coordinate("Y ").Units = y_units
4088+ f.dimension_coordinate("longitude ").Units = x_units
4089+ f.dimension_coordinate("latitude ").Units = y_units
40834090 else:
40844091 # --------------------------------------------------------
40854092 # Cartesian coordinates
@@ -12392,6 +12399,12 @@ def grad_xy(self, x_wrap=None, one_sided_at_boundary=False, radius=None):
1239212399 x_coord.Units = _units_radians
1239312400 y_coord.Units = _units_radians
1239412401
12402+ # Ensure that the lat and lon dimension coordinates have
12403+ # standard names, so that metadata-aware broadcasting
12404+ # works as expected when all of their units are radians.
12405+ x_coord.standard_name = "longitude"
12406+ y_coord.standard_name = "latitude"
12407+
1239512408 # Get theta as a field that will broadcast to f, and
1239612409 # adjust its values so that theta=0 is at the north pole.
1239712410 theta = np.pi / 2 - f.convert(y_key, full_domain=True)
@@ -12412,11 +12425,11 @@ def grad_xy(self, x_wrap=None, one_sided_at_boundary=False, radius=None):
1241212425 )
1241312426
1241412427 # Reset latitude and longitude coordinate units
12415- X.dimension_coordinate("X ").Units = x_units
12416- X.dimension_coordinate("Y ").Units = y_units
12428+ X.dimension_coordinate("longitude ").Units = x_units
12429+ X.dimension_coordinate("latitude ").Units = y_units
1241712430
12418- Y.dimension_coordinate("X ").Units = x_units
12419- Y.dimension_coordinate("Y ").Units = y_units
12431+ Y.dimension_coordinate("longitude ").Units = x_units
12432+ Y.dimension_coordinate("latitude ").Units = y_units
1242012433 else:
1242112434 # --------------------------------------------------------
1242212435 # Cartesian coordinates
0 commit comments