anchor.diff:              flag(ntrac) = 1 
           end if
   
  -!         call errorCheck('coordBoxError' ,errCode)
           ! ===  Check that coordinates belongs to   ===
           ! ===  correct box. Valuable for debugging ===
           if( dble(ib-1).gt.x1 .or. dble(ib).lt.x1 )  then
  
positive.code:     kb = kstart(ntrac)
    
      ! ===  start loop for each trajectory ===
      !         scrivi=.true.
      niterLoop: do 
          niter=niter+1 ! iterative step of trajectory
  !         print *,'niter=',niter
          rg = ts 
  !         rg=dmod(ts,1.d0) ! time interpolation constant between 0 and 1
          rr = 1.d0-rg
  !         print *,'ts=',ts,' rg=',rg,' rr=',rr
          ! Update particle indices and locations
          x0 = x1
          y0 = y1
  
negative.code:             errCode = -54
           endif
  
          ! === diffusion, which adds a random position ===
          ! === position to the new trajectory          ===
          if(doturb==2 .or. doturb==3) then
              call diffuse(x1, y1, z1, ib, jb, kb, dt,imt,jmt,km, dxv,dyu,dzt,h,ah,av,do3d,doturb)
          endif
  
          ! === Optional periodic boundary conditions ===
          ! If activated, a drifter is moved from the appropriate domain edge and 
  