@@ -52,6 +52,7 @@ def ZeroInterpolator_Vector(
5252 z : np .float32 | np .float64 ,
5353 y : np .float32 | np .float64 ,
5454 x : np .float32 | np .float64 ,
55+ applyConversion : bool ,
5556) -> np .float32 | np .float64 :
5657 """Template function used for the signature check of the interpolation methods for velocity fields."""
5758 return 0.0
@@ -157,6 +158,7 @@ def CGrid_Velocity(
157158 z : np .float32 | np .float64 ,
158159 y : np .float32 | np .float64 ,
159160 x : np .float32 | np .float64 ,
161+ applyConversion : bool ,
160162):
161163 """
162164 Interpolation kernel for velocity fields on a C-Grid.
@@ -274,7 +276,11 @@ def CGrid_Velocity(
274276 U = (1 - xsi ) * U0 + xsi * U1
275277 V = (1 - eta ) * V0 + eta * V1
276278
277- meshJac = 1852 * 60.0 if grid ._mesh == "spherical" else 1
279+ deg2m = 1852 * 60.0
280+ if applyConversion :
281+ meshJac = (deg2m * deg2m * np .cos (np .deg2rad (y ))) if grid ._mesh == "spherical" else 1
282+ else :
283+ meshJac = deg2m if grid ._mesh == "spherical" else 1
278284
279285 jac = i_u ._compute_jacobian_determinant (py , px , eta , xsi ) * meshJac
280286
@@ -527,6 +533,7 @@ def XFreeslip(
527533 z : np .float32 | np .float64 ,
528534 y : np .float32 | np .float64 ,
529535 x : np .float32 | np .float64 ,
536+ applyConversion : bool ,
530537):
531538 """Free-slip boundary condition interpolation for velocity fields."""
532539 return _Spatialslip (vectorfield , ti , position , tau , t , z , y , x , a = 1.0 , b = 0.0 )
@@ -541,6 +548,7 @@ def XPartialslip(
541548 z : np .float32 | np .float64 ,
542549 y : np .float32 | np .float64 ,
543550 x : np .float32 | np .float64 ,
551+ applyConversion : bool ,
544552):
545553 """Partial-slip boundary condition interpolation for velocity fields."""
546554 return _Spatialslip (vectorfield , ti , position , tau , t , z , y , x , a = 0.5 , b = 0.5 )
0 commit comments