anchor.diff:       +                    / dels(s) * sign(1.d0, -curvature(s + 1)) 
        +                    * cos(dels(s) * xmagcurve / 2.d0)
                  latvel = -1.d0 * vel(s) * delAcs / depth(s) / dels(s)
  -               if (latvel .gt. 0.0) then
  +               if (latvel .gt. 0.d0) then
                        lag(s) = vel(s) * (deln(s + 1) + deln(s)) / 
        +                        2.d0 / latvel 
                  else
  
positive.code:          end do
        else
           do s = 1, stations - 1
              if (width(s) .ne. 0.0) then
                 forcefactor = rho * vel(s) ** 2.d0 / depth(s) 
       +              * (1.d0 - 2.d0 * depth(s) / width(s))
                 latforce(s) = 0.d0
                 lag(s) = 0.d0
                 xmagcurvep1 = sign(curvature(s + 1), 1.d0) 
                 xmagcurve = sign(curvature(s), 1.d0) 
                 if ((curvature(s + 1) * curvature(s) .gt. 0.0 .and.
       +           xmagcurvep1 .gt. xmagcurve .and.
       +           xmagcurvep1 * width(s) .le. 2.0) .or.
       +          (curvature(s) .eq. 0.0 .and.
       +           xmagcurvep1 * width(s) .le. 2.0)) then
                    delAcs = (Acs(s + 1) - Acs(s))
                 else if (curvature(s + 1) * curvature(s) .lt. 0.0 .and.
       +               xmagcurvep1 * width(s) .le. 2.0) then
                    delAcs = Acs(s + 1) - depth(s) * width(s) / 2.d0
                 else
                    delAcs = 0.d0
  
negative.code:       do s = 2, stnserod - 1
           a = dels(s) 
           b = dels(s - 1) 
           if( a .eq. 0.d0 .or. b .eq. 0.d0 ) then
              print *, 'dels(s) or dels(s-1) equals zero'
              stop
           end if
           c = sqrt((delx(s - 1) + delx(s)) * (delx(s - 1) + delx(s)) + 
       +            (dely(s - 1) + dely(s)) * (dely(s - 1) + dely(s)))
           carg = (a * a + b * b - c * c) / (2.d0 * a * b)
           if( carg .lt. -1.d0 ) then
  c            if( carg .gt. -1.0001 ) carg = -1.d0
               carg = -1.d0
           end if
           if( carg .gt. 1.d0 ) then
  c            if( carg .lt. 1.0001 ) carg = 1.d0
              carg = 1.d0
           end if
  