Skip to content

Commit

Permalink
Computation of velmax more efficient.
Browse files Browse the repository at this point in the history
  • Loading branch information
p-costa committed Jan 11, 2024
1 parent e9681c3 commit 51c9f57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/acdi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ subroutine acdi_set_gamma(n,gam_factor,u,v,w,gam)
uc = 0.5*(u(i,j,k) + u(i-1,j,k))
vc = 0.5*(v(i,j,k) + v(i,j-1,k))
wc = 0.5*(w(i,j,k) + w(i,j,k-1))
vel = sqrt(uc**2 + vc**2 + wc**2)
vel = uc**2 + vc**2 + wc**2
velmax = max(velmax,vel)
end do
end do
end do
!$acc end data
!$acc wait(1)
call MPI_ALLREDUCE(MPI_IN_PLACE,velmax,1,MPI_REAL_RP,MPI_MAX,MPI_COMM_WORLD,ierr)
gam = velmax*gam_factor
gam = sqrt(velmax)*gam_factor
end subroutine acdi_set_gamma
!
subroutine acdi_transport_pf(nx,ny,nz,dxi,dyi,dzi,dzci,dzfi,gam,seps,u,v,w,psi,dpsidt)
Expand Down

0 comments on commit 51c9f57

Please sign in to comment.