anchor.diff:        ENDIF
         
            ! add the two points for step-change after last entered frequency
  -      Data4D%WvFreq1( Data4D%NumWvFreq1-1 )     = TmpWvFreq1(Data4D%NumWvFreq1-2) + EPSILON(0.0_ReKi)
  +      Data4D%WvFreq1( Data4D%NumWvFreq1-1 )     = Data4D%WvFreq1(Data4D%NumWvFreq1-2) + EPSILON(0.0_ReKi)
         Data4D%WvFreq1( Data4D%NumWvFreq1   )     = HUGE(1.0_ReKi)
                        
   
  
positive.code:          IF (ErrStatTmp /= 0) CALL SetErrStat(ErrID_Fatal,' Cannot allocate temporary array for interpolation of 3D QTF data.', &
                                                  ErrStat, ErrMsg, 'MnDrift_InitCalc')
        ELSE
           ALLOCATE( TmpData4D(MnDriftData%Data4D%NumWvFreq1,MnDriftData%Data4D%NumWvFreq1,MnDriftData%Data4D%NumWvDir1,MnDriftData%Data4D%NumWvDir2),STAT=ErrStatTmp )
           IF (ErrStatTmp /= 0) CALL SetErrStat(ErrID_Fatal,' Cannot allocate temporary array for interpolation of 4D QTF data.', &
                                                  ErrStat, ErrMsg, 'MnDrift_InitCalc')
        ENDIF
  
negative.code:          Data4D%WvFreq2( 1 )                    = 0.0_ReKi
           Data4D%WvFreq2( 2 )                    = MAX( TmpWvFreq2(1) - EPSILON(0.0_ReKi), 0.0_ReKi )  ! make sure the Frequencies are still monotonically increasing
           
           Data4D%WvFreq2( 3:Data4D%NumWvFreq2-2) = TmpWvFreq2
        ENDIF
        
           ! add the two points for step-change after last entered frequency
        Data4D%WvFreq2( Data4D%NumWvFreq2-1 )     = Data4D%WvFreq2(Data4D%NumWvFreq2-2) + EPSILON(0.0_ReKi)
        Data4D%WvFreq2( Data4D%NumWvFreq2   )     = HUGE(1.0_ReKi)
        
  
  