C subroutine get_nsteps
C    count the number of time steps and 
C    get the actual final time
C    CGH 20 Nov, 1998
C    untested
C
C This is supposed to be identical to the stop algorithm in saco.
C If the stop algorithm in saco is changed then this should be changed. 

        subroutine get_nsteps(kd0,sec0,kdl,secl,delt,kdf,secf,nsteps)

           integer kd0,kdl,kdf
	   real    sec0,secl,secf
	   real    delt
	   integer nsteps

           integer kd
	   real    seckd

	   kd    = kd0
	   seckd = sec0
	   nsteps = 0

100        continue
              seckd = seckd + delt
              nsteps = nsteps + 1 
              if(seckd.ge.86400.)call up_date(kd,seckd)
              if(kd.lt.kdl) goto 100
	      if((kd.eq.kdl).and.(seckd.lt.secl)) goto 100
101        continue
           kdf = kd
	   secf = seckd

	return
	end
