Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MOM_wave_interface.F90 #784

Merged
merged 2 commits into from
Dec 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/user/MOM_wave_interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -798,8 +798,8 @@ subroutine Update_Stokes_Drift(G, GV, US, CS, dz, ustar, dt, dynamics_step)
MidPoint = 0.0
do k = 1,GV%ke
Top = Bottom
MidPoint = Bottom - 0.25*(dz(I,j,k)+dz(I-1,j,k))
Bottom = Bottom - 0.5*(dz(I,j,k)+dz(I-1,j,k))
MidPoint = Bottom - 0.25*(dz(i,j,k)+dz(i+1,j,k))
Bottom = Bottom - 0.5*(dz(i,j,k)+dz(i+1,j,k))
CS%Us_x(I,j,k) = CS%TP_STKX0*exp(MidPoint*DecayScale)
enddo
enddo
Expand All @@ -810,8 +810,8 @@ subroutine Update_Stokes_Drift(G, GV, US, CS, dz, ustar, dt, dynamics_step)
MidPoint = 0.0
do k = 1,GV%ke
Top = Bottom
MidPoint = Bottom - 0.25*(dz(i,J,k)+dz(i,J-1,k))
Bottom = Bottom - 0.5*(dz(i,J,k)+dz(i,J-1,k))
MidPoint = Bottom - 0.25*(dz(i,j,k)+dz(i,j+1,k))
Bottom = Bottom - 0.5*(dz(i,j,k)+dz(i,j+1,k))
CS%Us_y(i,J,k) = CS%TP_STKY0*exp(MidPoint*DecayScale)
enddo
enddo
Expand All @@ -837,7 +837,7 @@ subroutine Update_Stokes_Drift(G, GV, US, CS, dz, ustar, dt, dynamics_step)
bottom = 0.0
do k = 1,GV%ke
Top = Bottom
level_thick = 0.5*(dz(I,j,k)+dz(I-1,j,k))
level_thick = 0.5*(dz(i,j,k)+dz(i+1,j,k))
MidPoint = Top - 0.5*level_thick
Bottom = Top - level_thick

Expand Down Expand Up @@ -894,7 +894,7 @@ subroutine Update_Stokes_Drift(G, GV, US, CS, dz, ustar, dt, dynamics_step)
bottom = 0.0
do k = 1,GV%ke
Top = Bottom
level_thick = 0.5*(dz(i,J,k)+dz(i,J-1,k))
level_thick = 0.5*(dz(i,j,k)+dz(i,j+1,k))
MidPoint = Top - 0.5*level_thick
Bottom = Top - level_thick

Expand Down Expand Up @@ -947,8 +947,8 @@ subroutine Update_Stokes_Drift(G, GV, US, CS, dz, ustar, dt, dynamics_step)
bottom = 0.0
do k = 1,GV%ke
Top = Bottom
MidPoint = Top - 0.25*(dz(I,j,k)+dz(I-1,j,k))
Bottom = Top - 0.5*(dz(I,j,k)+dz(I-1,j,k))
MidPoint = Top - 0.25*(dz(i,j,k)+dz(i+1,j,k))
Bottom = Top - 0.5*(dz(i,j,k)+dz(i+1,j,k))
!bgr note that this is using a u-point I on h-point ustar
! this code has only been previous used for uniform
! grid cases. This needs fixed if DHH85 is used for non
Expand All @@ -964,8 +964,8 @@ subroutine Update_Stokes_Drift(G, GV, US, CS, dz, ustar, dt, dynamics_step)
Bottom = 0.0
do k = 1,GV%ke
Top = Bottom
MidPoint = Bottom - 0.25*(dz(i,J,k)+dz(i,J-1,k))
Bottom = Bottom - 0.5*(dz(i,J,k)+dz(i,J-1,k))
MidPoint = Bottom - 0.25*(dz(i,j,k)+dz(i,j+1,k))
Bottom = Bottom - 0.5*(dz(i,j,k)+dz(i,j+1,k))
!bgr note that this is using a v-point J on h-point ustar
! this code has only been previous used for uniform
! grid cases. This needs fixed if DHH85 is used for non
Expand Down Expand Up @@ -1688,8 +1688,8 @@ subroutine CoriolisStokes(G, GV, dt, h, u, v, Waves)
do k = 1, GV%ke
do j = G%jsc, G%jec
do I = G%iscB, G%iecB
DVel = 0.25*((Waves%us_y(i,J+1,k)+Waves%us_y(i-1,J+1,k)) * G%CoriolisBu(I,J+1)) + &
0.25*((Waves%us_y(i,J,k)+Waves%us_y(i-1,J,k)) * G%CoriolisBu(I,J))
DVel = 0.25*((Waves%us_y(i,J-1,k)+Waves%us_y(i+1,J-1,k)) * G%CoriolisBu(I,J-1)) + &
0.25*((Waves%us_y(i,J,k)+Waves%us_y(i+1,J,k)) * G%CoriolisBu(I,J))
u(I,j,k) = u(I,j,k) + DVEL*dt
enddo
enddo
Expand All @@ -1698,8 +1698,8 @@ subroutine CoriolisStokes(G, GV, dt, h, u, v, Waves)
do k = 1, GV%ke
do J = G%jscB, G%jecB
do i = G%isc, G%iec
DVel = 0.25*((Waves%us_x(I+1,j,k)+Waves%us_x(I+1,j-1,k)) * G%CoriolisBu(I+1,J)) + &
0.25*((Waves%us_x(I,j,k)+Waves%us_x(I,j-1,k)) * G%CoriolisBu(I,J))
DVel = 0.25*((Waves%us_x(I-1,j,k)+Waves%us_x(I-1,j+1,k)) * G%CoriolisBu(I-1,j)) + &
0.25*((Waves%us_x(I,j,k)+Waves%us_x(I,j+1,k)) * G%CoriolisBu(I,J))
v(i,J,k) = v(i,j,k) - DVEL*dt
enddo
enddo
Expand Down
Loading