Skip to content

Commit

Permalink
Fixed a bug in UFS/WW3 interface (Longuet-Higgins)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephzhang8 committed Mar 27, 2024
1 parent 17123e9 commit a230bfd
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Hydro/misc_subs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6186,7 +6186,8 @@ subroutine compute_wave_force_lon(RSXX0,RSXY0,RSYY0)
REAL(rkind), intent(in) :: RSXX0(np),RSXY0(np),RSYY0(np) !from WW3, [N/m]

!REAL(rkind), allocatable :: DSXX3D(:,:,:),DSXY3D(:,:,:),DSYY3D(:,:,:)
REAL(rkind) :: DSXX3D(2,NVRT,nsa),DSXY3D(2,NVRT,nsa),DSYY3D(2,NVRT,nsa)
REAL(rkind) :: DSXX3D(2,NVRT,nsa),DSXY3D(2,NVRT,nsa),DSYY3D(2,NVRT,nsa), &
&SXX3D(NVRT,npa),SXY3D(NVRT,npa),SYY3D(NVRT,npa)
integer :: IS,i
REAL(rkind) :: HTOT,sum1,sum2,sum3,tmp

Expand Down Expand Up @@ -6227,6 +6228,11 @@ subroutine compute_wave_force_lon(RSXX0,RSXY0,RSYY0)
RSXY(i)=RSXY(i)/rho0
RSYY(i)=RSYY(i)/rho0
endif !idry

!Add vertical dimension
SXX3D(:,i)=RSXX(i)
SXY3D(:,i)=RSXY(i)
SYY3D(:,i)=RSYY(i)
enddo !i

!new39
Expand All @@ -6235,9 +6241,9 @@ subroutine compute_wave_force_lon(RSXX0,RSXY0,RSYY0)


! Computing gradients of the depth-averaged radiation stress (m^2/s/s)
CALL hgrad_nodes(2,0,nvrt,npa,nsa,RSXX,DSXX3D) !(dSxx/dx , dSxx/dy )
CALL hgrad_nodes(2,0,nvrt,npa,nsa,RSYY,DSYY3D) !(dSyy/dx , dSyy/dy )
CALL hgrad_nodes(2,0,nvrt,npa,nsa,RSXY,DSXY3D) !(dSxy/dx , dSxy/dy )
CALL hgrad_nodes(2,0,nvrt,npa,nsa,SXX3D,DSXX3D) !(dSxx/dx , dSxx/dy )
CALL hgrad_nodes(2,0,nvrt,npa,nsa,SYY3D,DSYY3D) !(dSyy/dx , dSyy/dy )
CALL hgrad_nodes(2,0,nvrt,npa,nsa,SXY3D,DSXY3D) !(dSxy/dx , dSxy/dy )
CALL exchange_s3d_2(DSXX3D)
CALL exchange_s3d_2(DSYY3D)
CALL exchange_s3d_2(DSXY3D)
Expand Down

0 comments on commit a230bfd

Please sign in to comment.