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:             errCode = -54
           endif
  
  
  ! print *,'ib(after)=',ib,' ia=',ia
  ! print *,'x1=',x1,' y1=',y1,' z1=',z1
          ! === 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
          !         nout=nout+1 ! number of trajectories that have exited the space and time domain
  
          ! === Optional periodic boundary conditions ===
          ! If activated, a drifter is moved from the appropriate domain edge and 
  
negative.code: !=======================================================
  
  ntracLoop: do ntrac=1,ntractot  
  
      ! Counter for sub-interations for each drifter. In the source, this was read in but I am not sure why.
      niter = 0
      Ni = 1 ! counter for when to write to file
  