anchor.diff:  !
   !    This file is part of the NWTC Subroutine Library.
   !
  -!    ServoDyn is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as
  +!    NWTC_Num is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as
   !    published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   !
   !    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  
positive.code: 
        ! Global numeric-related variables.
  
     REAL(DbKi)                   :: D2R_D                                        ! Factor to convert degrees to radians in double precision
     REAL(DbKi)                   :: Inf_D                                        ! IEEE value for NaN (not-a-number) in double precision
     REAL(DbKi)                   :: Inv2Pi_D                                     ! 0.5/Pi (1/(2*Pi)) in double precision
     REAL(DbKi)                   :: NaN_D                                        ! IEEE value for Inf (infinity) in double precision
     REAL(DbKi)                   :: Pi_D                                         ! Ratio of a circle's circumference to its diameter in double precision
     REAL(DbKi)                   :: PiBy2_D                                      ! Pi/2 in double precision
     REAL(DbKi)                   :: R2D_D                                        ! Factor to convert radians to degrees in double precision
     REAL(DbKi)                   :: RPM2RPS_D                                    ! Factor to convert revolutions per minute to radians per second in double precision
     REAL(DbKi)                   :: RPS2RPM_D                                    ! Factor to convert radians per second to revolutions per minute in double precision
     REAL(DbKi)                   :: TwoByPi_D                                    ! 2/Pi in double precision
     REAL(DbKi)                   :: TwoPi_D                                      ! 2*Pi in double precision
  
  
     REAL(ReKi)                   :: D2R                                          ! Factor to convert degrees to radians
     REAL(ReKi)                   :: Inf                                          ! IEEE value for NaN (not-a-number)
     REAL(ReKi)                   :: Inv2Pi                                       ! 0.5/Pi = 1 / (2*pi)
     REAL(ReKi)                   :: NaN                                          ! IEEE value for Inf (infinity)
     REAL(ReKi)                   :: Pi                                           ! Ratio of a circle's circumference to its diameter
     REAL(ReKi)                   :: PiBy2                                        ! Pi/2
     REAL(ReKi)                   :: R2D                                          ! Factor to convert radians to degrees
     REAL(ReKi)                   :: RPM2RPS                                      ! Factor to convert revolutions per minute to radians per second
     REAL(ReKi)                   :: RPS2RPM                                      ! Factor to convert radians per second to revolutions per minute
     REAL(ReKi)                   :: TwoByPi                                      ! 2/Pi
     REAL(ReKi)                   :: TwoPi                                        ! 2*Pi
  
     INTEGER, PARAMETER           :: BITS_IN_ADDR  = C_INTPTR_T*8                 ! The number of bits in an address (32-bit or 64-bit).
  
  
  !=======================================================================
  
negative.code: 
     ! It contains the following routines:
  
     !  SUBROUTINE AddOrSub2Pi           ( OldAngle, NewAngle )
     !  SUBROUTINE BSortReal             ( RealAry, NumPts )
     !  FUNCTION   CROSS_PRODUCT         ( Vector1, Vector2 )
     !  SUBROUTINE CubicSplineInit       ( AryLen, XAry, YAry, Coef )                                   ! Calculate coefficients for irregularly spaced array to use cubic splines.
     !  SUBROUTINE CubicSplineInitM      ( XAry, YAry, Coef, ErrStat, ErrMsg )                          ! Initialize cubic splines for multiple tables of irregularly space data.
     !  FUNCTION   CubicSplineInterp     ( X, AryLen, XAry, YAry,       Coef )                          ! Interpolate a irregularly spaced array using cubic splines.
     !  FUNCTION   CubicSplineInterpM    ( X, XAry, YAry, Coef, ErrStat, ErrMsg )                       ! Interpolate using cubic splines for multiple tables of irregularly space data.
     !  FUNCTION   EqualRealNos          ( ReNum1, ReNum2 )
     !  SUBROUTINE Eye                   ( A, ErrStat, ErrMsg )                                         ! sets A equal to the identity matrix (A can have 2 or 3 dimensions)
     !  SUBROUTINE GaussElim             ( AugMat, NumEq, x, ErrStat, ErrMsg )                          ! Performs Gauss-Jordan elimination to solve Ax=b for x; AugMat = [A b]
     !  SUBROUTINE GetOffsetReg          ( Ary, NumPts, Val, Ind, Fract, ErrStat, ErrMsg )              ! Determine index of the point in Ary just below Val and the fractional distance to the next point in the array.
     !  SUBROUTINE GL_Pts                ( IPt, NPts, Loc, Wt [, ErrStat] )
     !  FUNCTION   IndexCharAry          ( CVal, CAry )
     !  FUNCTION   InterpBin             ( XVal, XAry, YAry, ILo, AryLen )                              ! Generic interface for InterpBinComp and InterpBinReal.
     !  FUNCTION   InterpBinComp         ( XVal, XAry, YAry, ILo, AryLen )
     !  FUNCTION   InterpBinReal         ( XVal, XAry, YAry, ILo, AryLen )
     !  FUNCTION   InterpStp             ( XVal, XAry, YAry, ILo, AryLen )                              ! Generic interface for InterpStpComp and InterpStpReal.
     !  FUNCTION   InterpStpComp         ( XVal, XAry, YAry, Ind, AryLen )
     !  FUNCTION   InterpStpReal         ( XVal, XAry, YAry, Ind, AryLen )
     !  FUNCTION   IsSymmetric           ( A )                                                          ! Function to determine if A(:,:) is symmetric
     !  SUBROUTINE LocateBin             ( XVal, XAry, Ind, AryLen )
     !  SUBROUTINE LocateStp             ( XVal, XAry, Ind, AryLen )
     !  FUNCTION   Mean                  ( Ary, AryLen )                                                ! Function to calculate the mean value of a vector array.
     !  SUBROUTINE MPi2Pi                ( Angle )
     !  SUBROUTINE RegCubicSplineInit    ( AryLen, XAry, YAry, DelX, Coef )                             ! Calculate coefficients for regularly spaced array to use cubic splines.
     !  SUBROUTINE RegCubicSplineInitM   ( XAry, YAry, DelX, Coef, ErrStat, ErrMsg )                    ! Interpolate using cubic splines for multiple tables of regularly space data.
     !  FUNCTION   RegCubicSplineInterp  ( X, AryLen, XAry, YAry, DelX, Coef )                          ! Interpolate a regularly spaced array using cubic splines.
     !  FUNCTION   RegCubicSplineInterpM ( X, XAry, YAry, DelX, Coef, ErrStat, ErrMsg )                 ! Initialize cubic splines for multiple tables of regularly space data.
     !  SUBROUTINE RombergInt            ( f, a, b, R, err, eps, ErrStat )
     !  SUBROUTINE SetConstants
     !  SUBROUTINE SmllRotTrans          ( RotationType, Theta1, Theta2, Theta3, TransMat, ErrTxt )
     !  SUBROUTINE SortUnion             ( Ary1, N1, Ary2, N2, Ary, N )
     !  FUNCTION   StdDevFn              ( Ary, AryLen, Mean )                                          ! Function to calculate the standard deviation of a vector array.
  
  
     USE                                          NWTC_IO
     USE, INTRINSIC                            :: ISO_C_Binding, ONLY: C_INTPTR_T                       ! the size of a pointer (number of bytes)
  
     IMPLICIT NONE
  
  