subroutine DampPsi use basicmod use fluxmod implicit none integer :: i,j,k,n real(8),parameter:: alphabp=0.1d0 ! real(8):: taui real(8):: dhl,dh1l,dh2l,dh3l real(8),parameter:: huge=1.0d90 !$acc kernels dh1l=huge dh2l=huge dh3l=huge !$acc loop collapse(3) independent do k=ks,ke do j=js,je do i=is,ie dh1l = x1a(i+1)-x1a(i) dh2l = x2a(j+1)-x2a(j) dh3l = x3a(k+1)-x3a(k) dhl = min(dh1l,dh2l,dh3l) taui = alphabp * chg /dhl ! cm/s /cm => 1/s bp(i,j,k) = bp(i,j,k)*(1.0d0 - dt*taui) ! if dt = dtloc, damping by factor of (1.0-drate) enddo enddo enddo !$acc end kernels return end subroutine DampPsi