Skip to content

Commit e92f2b8

Browse files
authored
Merge pull request #96 from GEOS-ESM/bugfix/zhaobin74/fix-Agrid-currents-rotation
2 parents c1d83d2 + bd0e1a3 commit e92f2b8

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

MOM6_GEOSPlug/MOM6_GEOSPlug.F90

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -914,21 +914,18 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
914914
call ocean_model_get_UV_surf(Ocean_State, Ocean, 'ua', U, isc, jsc) ! this comes to us in m/s
915915
call ocean_model_get_UV_surf(Ocean_State, Ocean, 'va', V, isc, jsc) ! this comes to us in m/s
916916

917-
if(associated(UW )) then
917+
if(associated(UW ) .and. associated(VW )) then
918918
where(MOM_2D_MASK(:,:) > 0.0)
919-
UW = real(U, kind=GeosKind)
919+
UW = real(U, kind=GeosKind) * cos_rot + real(V, kind=GeosKind) * sin_rot
920+
VW = real(V, kind=GeosKind) * cos_rot - real(U, kind=GeosKind) * sin_rot
920921
elsewhere
921922
UW=0.0
922-
end where
923-
endif
924-
925-
if(associated(VW )) then
926-
where(MOM_2D_MASK(:,:) > 0.0)
927-
VW = real(V, kind=GeosKind)
928-
elsewhere
929923
VW=0.0
930924
end where
931-
end if
925+
else
926+
print *, 'Both UW and VW MUST be allocated.'
927+
ASSERT_(.false.)
928+
endif
932929

933930
! B-grid currents (for CICE dynamics)
934931
U = 0.0; V = 0.0

0 commit comments

Comments
 (0)