anchor.diff:    FLT%floating(flo) = .not.FLT%stranded(flo).and..not.FLT%outside(flo)
     print*, flo, FLT%lon(flo), FLT%lat(flo), FLT%released(flo), FLT%floating(flo)
   enddo
  +
  +
  +! ... Save initial conditions:
  +! ...
  +do flo=1,FLT%n
  +  FLT%time(flo) = zero
  +  if (FLT%released(flo)) then
  +    vp(1) = FLT%lon(flo)
  +    vp(2) = FLT%lat(flo)
  +    if (TCDF%idtemp.gt.0) then
  +      FLT%temp(flo) = hinterpol(nx,ny,TCDF%xm(:),TCDF%ym(:), &
  +                                trhs(:,:,1,1),vp(1),vp(2))
  +    else
  +      FLT%temp(flo) = missing
  +    endif
  +    if (TCDF%idsalt.gt.0) then
  +      FLT%salt(flo) = hinterpol(nx,ny,TCDF%xm(:),TCDF%ym(:), &
  +                                srhs(:,:,1,1),vp(1),vp(2))
  +    else
  +      FLT%salt(flo) = missing
  +    endif
  +    if (TCDF%iddens.gt.0) then
  +      FLT%dens(flo) = hinterpol(nx,ny,TCDF%xm(:),TCDF%ym(:), &
  +                                rrhs(:,:,1,1),vp(1),vp(2))
  +    else
  +      if (TCDF%idtemp.gt.0.and.TCDF%idsalt.gt.0) then
  +        FLT%dens(flo) = sigma0(FLT%temp(flo),FLT%salt(flo))
  +      else
  +        FLT%dens(flo) = missing
  +      endif
  +    endif
  +    FLT%UDF(flo)  = udf(2,(/FLT%lon(flo),FLT%lat(flo)/))
  +  else
  +    FLT%temp(flo) = missing
  +    FLT%salt(flo) = missing
  +    FLT%dens(flo) = missing
  +    FLT%UDF(flo)  = missing
  +  endif
  +  FLT%dist(flo) = zero
  +enddo
  +
  +kout = 1
  +FLT%time(:) = internal_time - initial_time - FLT%release_time(:)
  +system_time = UCDF%time_ref + (tscale*UCDF%t(1)+internal_time)/86400.0_dp
  +FLT%date = jd2date(system_time)
  +call out_save(FLT,kout,file_time,system_time)
  +
   
   
   
  
positive.code: 
        ! ... First, check the float has been released:
        ! ...
        if (FLT%release_time(flo).le.internal_time-initial_time) &
                                                   FLT%released(flo) = .true.
  
        if (FLT%released(flo)) then
          ! ... Now, check if the device is floating
  
negative.code:           ! ... Advance the location of the float from the time t to
            ! ... the time t+dt:
            ! ...
            if (fractional) then
              call spherical_rk5(2,vp,FLT%release_time(flo),fractional_dt,vn,RHS)
            else
              call spherical_rk5(2,vp,internal_time,internal_dt,vn,RHS)
            endif
  
            ! ... Update travelled distance:
            ! ...
  