Skip to content

Commit 9564493

Browse files
authored
Update MOM_wave_interface.F90 (#784)
* Update MOM_wave_interface.F90 The index at the interface has been changed from I-1 ->i+1 and J-1 -> j+1, which helps fixed model error in 3D simulations while keeping halo_size to 1. * Update MOM_wave_interface.F90 Corrected the index for thickness which fixed the issue of 3D wave coupled simulations while keeping the halo_size in thickness as 1
1 parent 9371bb0 commit 9564493

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/user/MOM_wave_interface.F90

+14-14
Original file line numberDiff line numberDiff line change
@@ -798,8 +798,8 @@ subroutine Update_Stokes_Drift(G, GV, US, CS, dz, ustar, dt, dynamics_step)
798798
MidPoint = 0.0
799799
do k = 1,GV%ke
800800
Top = Bottom
801-
MidPoint = Bottom - 0.25*(dz(I,j,k)+dz(I-1,j,k))
802-
Bottom = Bottom - 0.5*(dz(I,j,k)+dz(I-1,j,k))
801+
MidPoint = Bottom - 0.25*(dz(i,j,k)+dz(i+1,j,k))
802+
Bottom = Bottom - 0.5*(dz(i,j,k)+dz(i+1,j,k))
803803
CS%Us_x(I,j,k) = CS%TP_STKX0*exp(MidPoint*DecayScale)
804804
enddo
805805
enddo
@@ -810,8 +810,8 @@ subroutine Update_Stokes_Drift(G, GV, US, CS, dz, ustar, dt, dynamics_step)
810810
MidPoint = 0.0
811811
do k = 1,GV%ke
812812
Top = Bottom
813-
MidPoint = Bottom - 0.25*(dz(i,J,k)+dz(i,J-1,k))
814-
Bottom = Bottom - 0.5*(dz(i,J,k)+dz(i,J-1,k))
813+
MidPoint = Bottom - 0.25*(dz(i,j,k)+dz(i,j+1,k))
814+
Bottom = Bottom - 0.5*(dz(i,j,k)+dz(i,j+1,k))
815815
CS%Us_y(i,J,k) = CS%TP_STKY0*exp(MidPoint*DecayScale)
816816
enddo
817817
enddo
@@ -837,7 +837,7 @@ subroutine Update_Stokes_Drift(G, GV, US, CS, dz, ustar, dt, dynamics_step)
837837
bottom = 0.0
838838
do k = 1,GV%ke
839839
Top = Bottom
840-
level_thick = 0.5*(dz(I,j,k)+dz(I-1,j,k))
840+
level_thick = 0.5*(dz(i,j,k)+dz(i+1,j,k))
841841
MidPoint = Top - 0.5*level_thick
842842
Bottom = Top - level_thick
843843

@@ -894,7 +894,7 @@ subroutine Update_Stokes_Drift(G, GV, US, CS, dz, ustar, dt, dynamics_step)
894894
bottom = 0.0
895895
do k = 1,GV%ke
896896
Top = Bottom
897-
level_thick = 0.5*(dz(i,J,k)+dz(i,J-1,k))
897+
level_thick = 0.5*(dz(i,j,k)+dz(i,j+1,k))
898898
MidPoint = Top - 0.5*level_thick
899899
Bottom = Top - level_thick
900900

@@ -947,8 +947,8 @@ subroutine Update_Stokes_Drift(G, GV, US, CS, dz, ustar, dt, dynamics_step)
947947
bottom = 0.0
948948
do k = 1,GV%ke
949949
Top = Bottom
950-
MidPoint = Top - 0.25*(dz(I,j,k)+dz(I-1,j,k))
951-
Bottom = Top - 0.5*(dz(I,j,k)+dz(I-1,j,k))
950+
MidPoint = Top - 0.25*(dz(i,j,k)+dz(i+1,j,k))
951+
Bottom = Top - 0.5*(dz(i,j,k)+dz(i+1,j,k))
952952
!bgr note that this is using a u-point I on h-point ustar
953953
! this code has only been previous used for uniform
954954
! grid cases. This needs fixed if DHH85 is used for non
@@ -964,8 +964,8 @@ subroutine Update_Stokes_Drift(G, GV, US, CS, dz, ustar, dt, dynamics_step)
964964
Bottom = 0.0
965965
do k = 1,GV%ke
966966
Top = Bottom
967-
MidPoint = Bottom - 0.25*(dz(i,J,k)+dz(i,J-1,k))
968-
Bottom = Bottom - 0.5*(dz(i,J,k)+dz(i,J-1,k))
967+
MidPoint = Bottom - 0.25*(dz(i,j,k)+dz(i,j+1,k))
968+
Bottom = Bottom - 0.5*(dz(i,j,k)+dz(i,j+1,k))
969969
!bgr note that this is using a v-point J on h-point ustar
970970
! this code has only been previous used for uniform
971971
! grid cases. This needs fixed if DHH85 is used for non
@@ -1688,8 +1688,8 @@ subroutine CoriolisStokes(G, GV, dt, h, u, v, Waves)
16881688
do k = 1, GV%ke
16891689
do j = G%jsc, G%jec
16901690
do I = G%iscB, G%iecB
1691-
DVel = 0.25*((Waves%us_y(i,J+1,k)+Waves%us_y(i-1,J+1,k)) * G%CoriolisBu(I,J+1)) + &
1692-
0.25*((Waves%us_y(i,J,k)+Waves%us_y(i-1,J,k)) * G%CoriolisBu(I,J))
1691+
DVel = 0.25*((Waves%us_y(i,J-1,k)+Waves%us_y(i+1,J-1,k)) * G%CoriolisBu(I,J-1)) + &
1692+
0.25*((Waves%us_y(i,J,k)+Waves%us_y(i+1,J,k)) * G%CoriolisBu(I,J))
16931693
u(I,j,k) = u(I,j,k) + DVEL*dt
16941694
enddo
16951695
enddo
@@ -1698,8 +1698,8 @@ subroutine CoriolisStokes(G, GV, dt, h, u, v, Waves)
16981698
do k = 1, GV%ke
16991699
do J = G%jscB, G%jecB
17001700
do i = G%isc, G%iec
1701-
DVel = 0.25*((Waves%us_x(I+1,j,k)+Waves%us_x(I+1,j-1,k)) * G%CoriolisBu(I+1,J)) + &
1702-
0.25*((Waves%us_x(I,j,k)+Waves%us_x(I,j-1,k)) * G%CoriolisBu(I,J))
1701+
DVel = 0.25*((Waves%us_x(I-1,j,k)+Waves%us_x(I-1,j+1,k)) * G%CoriolisBu(I-1,j)) + &
1702+
0.25*((Waves%us_x(I,j,k)+Waves%us_x(I,j+1,k)) * G%CoriolisBu(I,J))
17031703
v(i,J,k) = v(i,j,k) - DVEL*dt
17041704
enddo
17051705
enddo

0 commit comments

Comments
 (0)