Skip to content

Commit

Permalink
Addressed minor naming inconsistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
p-costa committed Apr 10, 2024
1 parent 533a8e3 commit 8cc6f9f
Showing 1 changed file with 42 additions and 42 deletions.
84 changes: 42 additions & 42 deletions src/mom.f90
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,26 @@ subroutine momx_a(nx,ny,nz,dxi,dyi,dzfi,u,v,w,dudt)
real(rp), dimension(0:,0:,0:), intent(in ) :: u,v,w
real(rp), dimension( :, :, :), intent(inout) :: dudt
integer :: i,j,k
real(rp) :: uuip,uuim,uvjp,uvjm,uwkp,uwkm
real(rp) :: uuip,uuim,vujp,vujm,wukp,wukm
!
!$acc parallel loop collapse(3) default(present) private(uuip,uuim,uvjp,uvjm,uwkp,uwkm) async(1)
!$OMP PARALLEL DO COLLAPSE(3) DEFAULT(shared) PRIVATE(uuip,uuim,uvjp,uvjm,uwkp,uwkm)
!$acc parallel loop collapse(3) default(present) private(uuip,uuim,vujp,vujm,wukp,wukm) async(1)
!$OMP PARALLEL DO COLLAPSE(3) DEFAULT(shared) PRIVATE(uuip,uuim,vujp,vujm,wukp,wukm)
do k=1,nz
do j=1,ny
do i=1,nx
uuip = 0.25*( u(i+1,j,k)+u(i,j,k) )*( u(i+1,j ,k )+u(i,j ,k ) )
uuim = 0.25*( u(i-1,j,k)+u(i,j,k) )*( u(i-1,j ,k )+u(i,j ,k ) )
uvjp = 0.25*( u(i,j+1,k)+u(i,j,k) )*( v(i+1,j ,k )+v(i,j ,k ) )
uvjm = 0.25*( u(i,j-1,k)+u(i,j,k) )*( v(i+1,j-1,k )+v(i,j-1,k ) )
uwkp = 0.25*( u(i,j,k+1)+u(i,j,k) )*( w(i+1,j ,k )+w(i,j ,k ) )
uwkm = 0.25*( u(i,j,k-1)+u(i,j,k) )*( w(i+1,j ,k-1)+w(i,j ,k-1) )
uuip = 0.25*( u(i+1,j ,k )+u(i,j ,k ) )*( u(i,j,k)+u(i+1,j,k) )
uuim = 0.25*( u(i-1,j ,k )+u(i,j ,k ) )*( u(i,j,k)+u(i-1,j,k) )
vujp = 0.25*( v(i+1,j ,k )+v(i,j ,k ) )*( u(i,j,k)+u(i,j+1,k) )
vujm = 0.25*( v(i+1,j-1,k )+v(i,j-1,k ) )*( u(i,j,k)+u(i,j-1,k) )
wukp = 0.25*( w(i+1,j ,k )+w(i,j ,k ) )*( u(i,j,k)+u(i,j,k+1) )
wukm = 0.25*( w(i+1,j ,k-1)+w(i,j ,k-1) )*( u(i,j,k)+u(i,j,k-1) )
!
! Momentum balance
!
dudt(i,j,k) = dudt(i,j,k) + &
dxi*( -uuip + uuim ) + &
dyi*( -uvjp + uvjm ) + &
dzfi(k)*( -uwkp + uwkm )
dyi*( -vujp + vujm ) + &
dzfi(k)*( -wukp + wukm )
end do
end do
end do
Expand All @@ -68,12 +68,12 @@ subroutine momy_a(nx,ny,nz,dxi,dyi,dzfi,u,v,w,dvdt)
do k=1,nz
do j=1,ny
do i=1,nx
uvip = 0.25*( v(i,j,k)+v(i+1,j,k) )*( u(i ,j,k )+u(i ,j+1,k ) )
uvim = 0.25*( v(i,j,k)+v(i-1,j,k) )*( u(i-1,j,k )+u(i-1,j+1,k ) )
vvjp = 0.25*( v(i,j,k)+v(i,j+1,k) )*( v(i ,j,k )+v(i ,j+1,k ) )
vvjm = 0.25*( v(i,j,k)+v(i,j-1,k) )*( v(i ,j,k )+v(i ,j-1,k ) )
wvkp = 0.25*( v(i,j,k)+v(i,j,k+1) )*( w(i ,j,k )+w(i ,j+1,k ) )
wvkm = 0.25*( v(i,j,k)+v(i,j,k-1) )*( w(i ,j,k-1)+w(i ,j+1,k-1) )
uvip = 0.25*( u(i ,j,k )+u(i ,j+1,k ) )*( v(i,j,k)+v(i+1,j,k) )
uvim = 0.25*( u(i-1,j,k )+u(i-1,j+1,k ) )*( v(i,j,k)+v(i-1,j,k) )
vvjp = 0.25*( v(i ,j,k )+v(i ,j+1,k ) )*( v(i,j,k)+v(i,j+1,k) )
vvjm = 0.25*( v(i ,j,k )+v(i ,j-1,k ) )*( v(i,j,k)+v(i,j-1,k) )
wvkp = 0.25*( w(i ,j,k )+w(i ,j+1,k ) )*( v(i,j,k)+v(i,j,k+1) )
wvkm = 0.25*( w(i ,j,k-1)+w(i ,j+1,k-1) )*( v(i,j,k)+v(i,j,k-1) )
!
! Momentum balance
!
Expand Down Expand Up @@ -101,12 +101,12 @@ subroutine momz_a(nx,ny,nz,dxi,dyi,dzci,u,v,w,dwdt)
do k=1,nz
do j=1,ny
do i=1,nx
uwip = 0.25*( w(i,j,k)+w(i+1,j,k) )*( u(i ,j ,k)+u(i ,j ,k+1) )
uwim = 0.25*( w(i,j,k)+w(i-1,j,k) )*( u(i-1,j ,k)+u(i-1,j ,k+1) )
vwjp = 0.25*( w(i,j,k)+w(i,j+1,k) )*( v(i ,j ,k)+v(i ,j ,k+1) )
vwjm = 0.25*( w(i,j,k)+w(i,j-1,k) )*( v(i ,j-1,k)+v(i ,j-1,k+1) )
wwkp = 0.25*( w(i,j,k)+w(i,j,k+1) )*( w(i ,j ,k)+w(i ,j ,k+1) )
wwkm = 0.25*( w(i,j,k)+w(i,j,k-1) )*( w(i ,j ,k)+w(i ,j ,k-1) )
uwip = 0.25*( u(i ,j ,k)+u(i ,j ,k+1) )*( w(i,j,k)+w(i+1,j,k) )
uwim = 0.25*( u(i-1,j ,k)+u(i-1,j ,k+1) )*( w(i,j,k)+w(i-1,j,k) )
vwjp = 0.25*( v(i ,j ,k)+v(i ,j ,k+1) )*( w(i,j,k)+w(i,j+1,k) )
vwjm = 0.25*( v(i ,j-1,k)+v(i ,j-1,k+1) )*( w(i,j,k)+w(i,j-1,k) )
wwkp = 0.25*( w(i ,j ,k)+w(i ,j ,k+1) )*( w(i,j,k)+w(i,j,k+1) )
wwkm = 0.25*( w(i ,j ,k)+w(i ,j ,k-1) )*( w(i,j,k)+w(i,j,k-1) )
!
! Momentum balance
!
Expand Down Expand Up @@ -649,7 +649,7 @@ subroutine mom_xyz_ad(nx,ny,nz,dxi,dyi,dzci,dzfi,visc,u,v,w,dudt,dvdt,dwdt,dudtd
real(rp) :: u_ccm,u_pcm,u_cpm,u_cmc,u_pmc,u_mcc,u_ccc,u_pcc,u_mpc,u_cpc,u_cmp,u_mcp,u_ccp, &
v_ccm,v_pcm,v_cpm,v_cmc,v_pmc,v_mcc,v_ccc,v_pcc,v_mpc,v_cpc,v_cmp,v_mcp,v_ccp, &
w_ccm,w_pcm,w_cpm,w_cmc,w_pmc,w_mcc,w_ccc,w_pcc,w_mpc,w_cpc,w_cmp,w_mcp,w_ccp
real(rp) :: uuip,uuim,uvjp,uvjm,uwkp,uwkm, &
real(rp) :: uuip,uuim,vujp,vujm,wukp,wukm, &
uvip,uvim,vvjp,vvjm,wvkp,wvkm, &
uwip,uwim,vwjp,vwjm,wwkp,wwkm
real(rp) :: dudxp,dudxm,dudyp,dudym,dudzp,dudzm, &
Expand All @@ -664,7 +664,7 @@ subroutine mom_xyz_ad(nx,ny,nz,dxi,dyi,dzci,dzfi,visc,u,v,w,dudt,dvdt,dwdt,dudtd
!$acc private(u_ccm,u_pcm,u_cpm,u_cmc,u_pmc,u_mcc,u_ccc,u_pcc,u_mpc,u_cpc,u_cmp,u_mcp,u_ccp) &
!$acc private(v_ccm,v_pcm,v_cpm,v_cmc,v_pmc,v_mcc,v_ccc,v_pcc,v_mpc,v_cpc,v_cmp,v_mcp,v_ccp) &
!$acc private(w_ccm,w_pcm,w_cpm,w_cmc,w_pmc,w_mcc,w_ccc,w_pcc,w_mpc,w_cpc,w_cmp,w_mcp,w_ccp) &
!$acc private(uuip,uuim,uvjp,uvjm,uwkp,uwkm) &
!$acc private(uuip,uuim,vujp,vujm,wukp,wukm) &
!$acc private(uvip,uvim,vvjp,vvjm,wvkp,wvkm) &
!$acc private(uwip,uwim,vwjp,vwjm,wwkp,wwkm) &
!$acc private(dudxp,dudxm,dudyp,dudym,dudzp,dudzm) &
Expand All @@ -679,7 +679,7 @@ subroutine mom_xyz_ad(nx,ny,nz,dxi,dyi,dzci,dzfi,visc,u,v,w,dudt,dvdt,dwdt,dudtd
!$OMP PRIVATE(u_ccm,u_pcm,u_cpm,u_cmc,u_pmc,u_mcc,u_ccc,u_pcc,u_mpc,u_cpc,u_cmp,u_mcp,u_ccp) &
!$OMP PRIVATE(v_ccm,v_pcm,v_cpm,v_cmc,v_pmc,v_mcc,v_ccc,v_pcc,v_mpc,v_cpc,v_cmp,v_mcp,v_ccp) &
!$OMP PRIVATE(w_ccm,w_pcm,w_cpm,w_cmc,w_pmc,w_mcc,w_ccc,w_pcc,w_mpc,w_cpc,w_cmp,w_mcp,w_ccp) &
!$OMP PRIVATE(uuip,uuim,uvjp,uvjm,uwkp,uwkm) &
!$OMP PRIVATE(uuip,uuim,vujp,vujm,wukp,wukm) &
!$OMP PRIVATE(uvip,uvim,vvjp,vvjm,wvkp,wvkm) &
!$OMP PRIVATE(uwip,uwim,vwjp,vwjm,wwkp,wwkm) &
!$OMP PRIVATE(dudxp,dudxm,dudyp,dudym,dudzp,dudzm) &
Expand Down Expand Up @@ -749,12 +749,12 @@ subroutine mom_xyz_ad(nx,ny,nz,dxi,dyi,dzci,dzfi,visc,u,v,w,dudt,dvdt,dwdt,dudtd
!
! x advection
!
uuip = 0.25*(u_pcc+u_ccc)*(u_pcc+u_ccc)
uuim = 0.25*(u_mcc+u_ccc)*(u_mcc+u_ccc)
uvjp = 0.25*(u_cpc+u_ccc)*(v_pcc+v_ccc)
uvjm = 0.25*(u_cmc+u_ccc)*(v_pmc+v_cmc)
uwkp = 0.25*(u_ccp+u_ccc)*(w_pcc+w_ccc)
uwkm = 0.25*(u_ccm+u_ccc)*(w_pcm+w_ccm)
uuip = 0.25*(u_pcc+u_ccc)*(u_ccc+u_pcc)
uuim = 0.25*(u_mcc+u_ccc)*(u_ccc+u_mcc)
vujp = 0.25*(v_pcc+v_ccc)*(u_ccc+u_cpc)
vujm = 0.25*(v_pmc+v_cmc)*(u_ccc+u_cmc)
wukp = 0.25*(w_pcc+w_ccc)*(u_ccc+u_ccp)
wukm = 0.25*(w_pcm+w_ccm)*(u_ccc+u_ccm)
!
dudtd_xy_s = &
visc*(dudxp-dudxm)*dxi + &
Expand All @@ -763,8 +763,8 @@ subroutine mom_xyz_ad(nx,ny,nz,dxi,dyi,dzci,dzfi,visc,u,v,w,dudt,dvdt,dwdt,dudtd
visc*(dudzp-dudzm)*dzfi(k)
dudt_s = &
-(uuip -uuim )*dxi - &
(uvjp -uvjm )*dyi - &
(uwkp -uwkm )*dzfi(k)
(vujp -vujm )*dyi - &
(wukp -wukm )*dzfi(k)
!
! y diffusion
!
Expand All @@ -777,12 +777,12 @@ subroutine mom_xyz_ad(nx,ny,nz,dxi,dyi,dzci,dzfi,visc,u,v,w,dudt,dvdt,dwdt,dudtd
!
! y advection
!
uvip = 0.25*(v_ccc+v_pcc)*(u_ccc+u_cpc)
uvim = 0.25*(v_ccc+v_mcc)*(u_mcc+u_mpc)
uvip = 0.25*(u_ccc+u_cpc)*(v_ccc+v_pcc)
uvim = 0.25*(u_mcc+u_mpc)*(v_ccc+v_mcc)
vvjp = 0.25*(v_ccc+v_cpc)*(v_ccc+v_cpc)
vvjm = 0.25*(v_ccc+v_cmc)*(v_ccc+v_cmc)
wvkp = 0.25*(v_ccc+v_ccp)*(w_ccc+w_cpc)
wvkm = 0.25*(v_ccc+v_ccm)*(w_ccm+w_cpm)
wvkp = 0.25*(w_ccc+w_cpc)*(v_ccc+v_ccp)
wvkm = 0.25*(w_ccm+w_cpm)*(v_ccc+v_ccm)
!
dvdtd_xy_s = &
visc*(dvdxp-dvdxm)*dxi + &
Expand All @@ -805,10 +805,10 @@ subroutine mom_xyz_ad(nx,ny,nz,dxi,dyi,dzci,dzfi,visc,u,v,w,dudt,dvdt,dwdt,dudtd
!
! z advection
!
uwip = 0.25*(w_ccc+w_pcc)*(u_ccc+u_ccp)
uwim = 0.25*(w_ccc+w_mcc)*(u_mcc+u_mcp)
vwjp = 0.25*(w_ccc+w_cpc)*(v_ccc+v_ccp)
vwjm = 0.25*(w_ccc+w_cmc)*(v_cmc+v_cmp)
uwip = 0.25*(u_ccc+u_ccp)*(w_ccc+w_pcc)
uwim = 0.25*(u_mcc+u_mcp)*(w_ccc+w_mcc)
vwjp = 0.25*(v_ccc+v_ccp)*(w_ccc+w_cpc)
vwjm = 0.25*(v_cmc+v_cmp)*(w_ccc+w_cmc)
wwkp = 0.25*(w_ccc+w_ccp)*(w_ccc+w_ccp)
wwkm = 0.25*(w_ccc+w_ccm)*(w_ccc+w_ccm)
!
Expand Down

0 comments on commit 8cc6f9f

Please sign in to comment.