Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
AFiD/CalcMaxCFL.F90
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
48 lines (43 sloc)
1.5 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
! ! | |
! FILE: CalcMaxCFL.F90 ! | |
! CONTAINS: subroutine CalcMaxCFL ! | |
! ! | |
! PURPOSE: Compute the maximum value of the local CFL ! | |
! stability condition for the explicit terms ! | |
! ! | |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
subroutine CalcMaxCFL(cflm) | |
use param | |
use local_arrays, only: vx,vy,vz | |
use decomp_2d | |
use mpih | |
implicit none | |
real,intent(out) :: cflm | |
integer :: j,k,jp,kp,i,ip | |
real :: qcf | |
cflm=0.00000001d0 | |
! | |
!$OMP PARALLEL DO & | |
!$OMP DEFAULT(none) & | |
!$OMP SHARED(xstart,xend,nxm,vz,vy,vx) & | |
!$OMP SHARED(dz,dy,udx3m) & | |
!$OMP PRIVATE(i,j,k,ip,jp,kp,qcf) & | |
!$OMP REDUCTION(max:cflm) | |
do i=xstart(3),xend(3) | |
ip=i+1 | |
do j=xstart(2),xend(2) | |
jp=j+1 | |
do k=1,nxm | |
kp=k+1 | |
qcf=( abs((vz(k,j,i)+vz(k,j,ip))*0.5d0*dz) & | |
+abs((vy(k,j,i)+vy(k,jp,i))*0.5d0*dy) & | |
+abs((vx(k,j,i)+vx(kp,j,i))*0.5d0*udx3m(k))) | |
cflm = max(cflm,qcf) | |
enddo | |
enddo | |
enddo | |
!$OMP END PARALLEL DO | |
call MpiAllMaxRealScalar(cflm) | |
return | |
end |