From 7e9e745aa07dd2fc1d03268dd029339d27569936 Mon Sep 17 00:00:00 2001 From: bzhao Date: Mon, 31 Mar 2025 15:30:30 -0400 Subject: [PATCH] rotate Agrid currents to zonal and meridional directions --- MOM6_GEOSPlug/MOM6_GEOSPlug.F90 | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/MOM6_GEOSPlug/MOM6_GEOSPlug.F90 b/MOM6_GEOSPlug/MOM6_GEOSPlug.F90 index 783c40e..6c7e779 100644 --- a/MOM6_GEOSPlug/MOM6_GEOSPlug.F90 +++ b/MOM6_GEOSPlug/MOM6_GEOSPlug.F90 @@ -914,21 +914,18 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC ) call ocean_model_get_UV_surf(Ocean_State, Ocean, 'ua', U, isc, jsc) ! this comes to us in m/s call ocean_model_get_UV_surf(Ocean_State, Ocean, 'va', V, isc, jsc) ! this comes to us in m/s - if(associated(UW )) then + if(associated(UW ) .and. associated(VW )) then where(MOM_2D_MASK(:,:) > 0.0) - UW = real(U, kind=GeosKind) + UW = real(U, kind=GeosKind) * cos_rot + real(V, kind=GeosKind) * sin_rot + VW = real(V, kind=GeosKind) * cos_rot - real(U, kind=GeosKind) * sin_rot elsewhere UW=0.0 - end where - endif - - if(associated(VW )) then - where(MOM_2D_MASK(:,:) > 0.0) - VW = real(V, kind=GeosKind) - elsewhere VW=0.0 end where - end if + else + print *, 'Both UW and VW MUST be allocated.' + ASSERT_(.false.) + endif ! B-grid currents (for CICE dynamics) U = 0.0; V = 0.0