subroutine timest(vf,uf,curv,n,dtin,dt) * ****************************************************** * determine the time step allowed based on the * velocity and the curvature. * ****************************************************** integer n,j double precision vf(0:8192),uf(0:8192),curv(0:8192) double precision dtin,dt,cfl,vmax,cmax,sa,pi,p2,vm common/salpha/sa common/valupi/pi,p2 parameter (cfl=0.5D0) vmax = 0.D0 cmax = 0.D0 do 10 j=1,n vm = dsqrt(vf(j)*vf(j)+uf(j)*uf(j)) vmax = dmax1(vm,vmax) cmax = dmax1(dabs(curv(j)),cmax) 10 continue dt = dmin1( dtin, + cfl/vmax*dmin1(p2*sa/dfloat(n), 1.D0/cmax) ) end