@@ -148,22 +148,22 @@ def CGrid_Velocity(
148148 px = np .array ([grid .lon [yi , xi ], grid .lon [yi , xi + 1 ], grid .lon [yi + 1 , xi + 1 ], grid .lon [yi + 1 , xi ]])
149149 py = np .array ([grid .lat [yi , xi ], grid .lat [yi , xi + 1 ], grid .lat [yi + 1 , xi + 1 ], grid .lat [yi + 1 , xi ]])
150150
151- if vectorfield ._mesh == "spherical" :
151+ if grid ._mesh == "spherical" :
152152 px [0 ] = np .where (px [0 ] < x - 225 , px [0 ] + 360 , px [0 ])
153153 px [0 ] = np .where (px [0 ] > x + 225 , px [0 ] - 360 , px [0 ])
154154 px [1 :] = np .where (px [1 :] - px [0 ] > 180 , px [1 :] - 360 , px [1 :])
155155 px [1 :] = np .where (- px [1 :] + px [0 ] > 180 , px [1 :] + 360 , px [1 :])
156156 c1 = i_u ._geodetic_distance (
157- py [0 ], py [1 ], px [0 ], px [1 ], vectorfield ._mesh , np .einsum ("ij,ji->i" , i_u .phi2D_lin (0.0 , xsi ), py )
157+ py [0 ], py [1 ], px [0 ], px [1 ], grid ._mesh , np .einsum ("ij,ji->i" , i_u .phi2D_lin (0.0 , xsi ), py )
158158 )
159159 c2 = i_u ._geodetic_distance (
160- py [1 ], py [2 ], px [1 ], px [2 ], vectorfield ._mesh , np .einsum ("ij,ji->i" , i_u .phi2D_lin (eta , 1.0 ), py )
160+ py [1 ], py [2 ], px [1 ], px [2 ], grid ._mesh , np .einsum ("ij,ji->i" , i_u .phi2D_lin (eta , 1.0 ), py )
161161 )
162162 c3 = i_u ._geodetic_distance (
163- py [2 ], py [3 ], px [2 ], px [3 ], vectorfield ._mesh , np .einsum ("ij,ji->i" , i_u .phi2D_lin (1.0 , xsi ), py )
163+ py [2 ], py [3 ], px [2 ], px [3 ], grid ._mesh , np .einsum ("ij,ji->i" , i_u .phi2D_lin (1.0 , xsi ), py )
164164 )
165165 c4 = i_u ._geodetic_distance (
166- py [3 ], py [0 ], px [3 ], px [0 ], vectorfield ._mesh , np .einsum ("ij,ji->i" , i_u .phi2D_lin (eta , 0.0 ), py )
166+ py [3 ], py [0 ], px [3 ], px [0 ], grid ._mesh , np .einsum ("ij,ji->i" , i_u .phi2D_lin (eta , 0.0 ), py )
167167 )
168168
169169 lenT = 2 if np .any (tau > 0 ) else 1
@@ -245,9 +245,9 @@ def CGrid_Velocity(
245245
246246 deg2m = 1852 * 60.0
247247 if applyConversion :
248- meshJac = (deg2m * deg2m * np .cos (np .deg2rad (y ))) if vectorfield ._mesh == "spherical" else 1
248+ meshJac = (deg2m * deg2m * np .cos (np .deg2rad (y ))) if grid ._mesh == "spherical" else 1
249249 else :
250- meshJac = deg2m if vectorfield ._mesh == "spherical" else 1
250+ meshJac = deg2m if grid ._mesh == "spherical" else 1
251251
252252 jac = i_u ._compute_jacobian_determinant (py , px , eta , xsi ) * meshJac
253253
0 commit comments