Hi,

I have recently upgraded from PGI fortran version 15.3 to version 16.4.

The code that ran well under 15.3 has significant issues when compiled with 16.4.

I assume this is down to a coding error that I have made which was tolerated under the previous version.

I have pasted a subroutine below which is intended to estimate a timestep value. This provided the correct value when compiled using 15.3 but gives dt=0 with 16.4

Can you advise on any apparent sources of this issue?

Would be very grateful for any advice

Tim.

```
subroutine calc_timestep()
use memory_allocation
real*4 Fa
real*4 ax,ay,az
real*4 dotval
real*4 dt_f,dt_cv
real*4 t1
CFL_number = 0.3
dt_f = 1000.0
dt_cv = 1000.0
! ----------------------------------------------------------------------
!$acc parallel loop private(xcell,ycell,zcell,p_j,j,dx,dy,dz,r, &
!$acc ax,ay,az,Fa) &
!$acc reduction(min:dt_f) &
!$acc reduction(min:dt_cv) &
!$acc reduction(max:t1)
do i = 1,num_particles
xcell = ZONE_ID(1,i)
ycell = ZONE_ID(2,i)
zcell = ZONE_ID(3,i)
ax = ACCEL(1,i)
ay = ACCEL(2,i)
az = ACCEL(3,i)
ax = 0.00
ay = 0.00
az = 0.00
t1 = 0.0
Fa = max(sqrt((ax*ax)+(ay*ay)+(az*az)),0.001) ! dont let Fa=0
dt_f = min(dt_f,sqrt(h/Fa)) ! because you divide by it here...
do p_j = 1,NPIZPL(xcell,ycell,zcell)
j = ZPLIST(xcell,ycell,zcell,p_j)
if(i.ne.j) then
dx = position(1,i) - position(1,j)
dy = position(2,i) - position(2,j)
dz = position(3,i) - position(3,j)
r = sqrt((dx*dx)+(dy*dy)+(dz*dz))
if(r.gt.h10.and.r.le.h2) then
du = velocity(1,i) - velocity(1,j)
dv = velocity(2,i) - velocity(2,j)
dw = velocity(3,i) - velocity(3,j)
dotval = (du*dx) + (dv*dy) + (dw*dz)
t1 = max(t1,abs((h*dotval)/(r*r)))
endif ! r le 2 h
endif ! i ne j
enddo ! j loop
dt_cv = min(dt_cv,(h/(real_speed_c + t1)))
enddo ! i loop
!$acc wait
dt = CFL_number * min(dt_f,dt_cv)
```

[/code]