-
Notifications
You must be signed in to change notification settings - Fork 0
/
prcalc.f90
executable file
·35 lines (35 loc) · 969 Bytes
/
prcalc.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
!
! this subroutine performs the calculation of the corrected pressure.
! this depends on the fractional step
!
subroutine prcalc
use param
use local_arrays, only: pr,dph
use mpi_param, only: kstart,kend
implicit none
integer :: kp,km,jm,jp,jc,kc,ic,ip,im
real :: be
!
! the pressure is evaluated at the center of the box.
!
! p^{n+1} = p^{n} + phi^{n+1} - b * Nabla^2 phi^{n+1}
!
be=al*beta
do kc=kstart,kend
kp=kc+1
km=kc-1
do jc=1,n2m
jm=jmv(jc)
jp=jpv(jc)
do ic=1,n1m
im=imv(ic)
ip=ipv(ic)
pr(ic,jc,kc)=pr(ic,jc,kc)+dph(ic,jc,kc)-be*( &
(dph(ip,jc,kc)-2.0*dph(ic,jc,kc)+dph(im,jc,kc))*dx1q+ &
(dph(ic,jp,kc)-2.0*dph(ic,jc,kc)+dph(ic,jm,kc))*dx2q+ &
(dph(ic,jc,kp)-2.0*dph(ic,jc,kc)+dph(ic,jc,km))*dx3q)
enddo
enddo
enddo
return
end