mirror of https://gitlab.com/QEF/q-e.git
parent
ea9057e7f4
commit
a613d9c089
|
@ -26,15 +26,24 @@
|
|||
! output: the orientation when needed
|
||||
REAL(DP) :: amag
|
||||
INTEGER :: ir ! counter on mesh points
|
||||
|
||||
!$omp parallel do default(shared) private(ir, amag)
|
||||
DO ir = 1, nrxx
|
||||
segni(ir) =1.0_DP
|
||||
IF (lsign) segni(ir)=SIGN(1.0_DP,rho(ir,2)*ux(1)+rho(ir,3)*ux(2)+rho(ir,4)*ux(3))
|
||||
amag=SQRT(rho(ir,2)**2+rho(ir,3)**2+rho(ir,4)**2)
|
||||
rhoout(ir,1)=0.5d0*(rho(ir,1)+segni(ir)*amag)
|
||||
rhoout(ir,2)=0.5d0*(rho(ir,1)-segni(ir)*amag)
|
||||
ENDDO
|
||||
!$omp end parallel do
|
||||
IF (lsign) THEN
|
||||
!$omp parallel do default(shared) private(ir, amag)
|
||||
DO ir = 1, nrxx
|
||||
segni(ir)=SIGN(1.0_DP,rho(ir,2)*ux(1)+rho(ir,3)*ux(2)+rho(ir,4)*ux(3))
|
||||
amag=SQRT(rho(ir,2)**2+rho(ir,3)**2+rho(ir,4)**2)
|
||||
rhoout(ir,1)=0.5d0*(rho(ir,1)+segni(ir)*amag)
|
||||
rhoout(ir,2)=0.5d0*(rho(ir,1)-segni(ir)*amag)
|
||||
ENDDO
|
||||
!$omp end parallel do
|
||||
ELSE
|
||||
!$omp parallel do default(shared) private(ir, amag)
|
||||
DO ir =1, nrxx
|
||||
segni(ir) = 1.0_DP
|
||||
amag=SQRT(rho(ir,2)**2+rho(ir,3)**2+rho(ir,4)**2)
|
||||
rhoout(ir,1)=0.5d0*(rho(ir,1) + amag)
|
||||
rhoout(ir,2)=0.5d0*(rho(ir,1) - amag)
|
||||
END DO
|
||||
!$omp end parallel do
|
||||
END IF
|
||||
RETURN
|
||||
END SUBROUTINE compute_rho
|
||||
|
|
Loading…
Reference in New Issue