anchor.diff:  
            ! Find out which load components are actually in use
         CALL UniqueRealValues( RawData4D(:,5), TmpRealArr, K, ErrStatTmp,ErrMsgTmp )
  -      CALL SetErrStat( ErrStatTmp, ErrMsgTmp, ErrStat, ErrMsg, RoutineName )
  -
  -         ! If the value of K is more than 6, we have some serious issues
  -      IF ( K > 6 ) CALL SetErrStat( ErrID_Fatal, ' More than 6 load components found in column 4 of '// &
  -                     TRIM(Filename4D)//'.', ErrStat,ErrMsg,RoutineName)
  +
  +         ! Now figure out how many bodies there are. Each body will have up to 6 components.  The component
  +         ! column can be up to 6*N where N is the number of bodies in the file.  We will assume that we don't
  +         ! skip groups of bodies.
  +      Data4D%NumBodies = ceiling((maxval(TmpRealArr)-0.1_ReKi) / 6.0_ReKi)    ! Account for any uncertainty in the number
  +      IF ( Data4D%NumBodies < 1 ) CALL SetErrStat( ErrID_Fatal, ' No WAMIT bodies found (no positive load component numbers in column 4) in '// &
  +                     TRIM(Filename4D)//'.', ErrStat,ErrMsg,RoutineName )
  +      IF ( Data4D%NumBodies > 1 ) CALL SetErrStat( ErrID_Info, ' Found data for '//TRIM(Num2LStr(Data4D%NumBodies))//' WAMIT bodies in '// &
  +                     TRIM(Filename4D)//'.', ErrStat,ErrMsg,RoutineName )
         IF ( ErrStat >= AbortErrLev ) THEN
  +         IF (ALLOCATED(TmpRealArr))       DEALLOCATE(TmpRealArr,STAT=ErrStatTmp)
            IF (ALLOCATED(RawData4D))        DEALLOCATE(RawData4D,STAT=ErrStatTmp)
            IF (ALLOCATED(RawData4DTmp))     DEALLOCATE(RawData4DTmp,STAT=ErrStatTmp)
  -         IF (ALLOCATED(TmpRealArr))       DEALLOCATE(TmpRealArr,STAT=ErrStatTmp)
            IF (ALLOCATED(TmpDataRow))       DEALLOCATE(TmpDataRow,STAT=ErrStatTmp)
            IF (ALLOCATED(TmpWvFreq1))       DEALLOCATE(TmpWvFreq1,STAT=ErrStatTmp)
  -         IF (ALLOCATED(TmpWvFreq2))       DEALLOCATE(TmpWvFreq2,STAT=ErrStatTmp)
            CALL CleanUp
            RETURN
         ENDIF
  +
  +
  +         ! Now that we know how many bodies are in the file, allocate the size of the arrays
  +      CALL AllocAry( Data4D%DataIsSparse,   6*Data4D%NumBodies, ' Array for tracking which dimension indices are sparsely populated', ErrStatTmp, ErrMsgTmp )
  +      CALL AllocAry( Data4D%LoadComponents, 6*Data4D%NumBodies, ' Array for tracking which dimension indices contain information',    ErrStatTmp, ErrMsgTmp )
  +      Data4D%DataIsSparse = .TRUE.        ! Assume the data is sparse, then change this after checking on the dimensions of interest.
  +
  +     CALL SetErrStat( ErrStatTmp, ErrMsgTmp, ErrStat, ErrMsg, RoutineName )
  +
   
            ! Now check the values we got back and set the LoadComponents flags for those with data. The
            ! load component direction must be between 1 and 6 (translational: 1,2,3; rotational: 4,5,6).
         Data4D%LoadComponents = .FALSE.
         DO I=1,K
  -         IF ( NINT(TmpRealArr(I)) < 1 .OR. NINT(TmpRealArr(K)) > 6 ) THEN
  +         IF ( NINT(TmpRealArr(I)) < 1 .OR. NINT(TmpRealArr(K)) > 6*Data4D%NumBodies ) THEN
               CALL SetErrStat( ErrID_Fatal, ' Load components listed in column 4 of '//TRIM(Filename4D)// &
  -                  ' must be between 1 and 6.', ErrStat,ErrMsg,RoutineName)
  +                  ' must be between 1 and '//TRIM(Num2LStr(6*Data4D%NumBodies))//' for '//TRIM(Num2LStr(Data4D%NumBodies))// &
  +                  ' WAMIT bodies.', ErrStat,ErrMsg,RoutineName)
               IF (ALLOCATED(RawData4D))        DEALLOCATE(RawData4D,STAT=ErrStatTmp)
               IF (ALLOCATED(RawData4DTmp))     DEALLOCATE(RawData4DTmp,STAT=ErrStatTmp)
               IF (ALLOCATED(TmpRealArr))       DEALLOCATE(TmpRealArr,STAT=ErrStatTmp)
  
positive.code:       IF ( p%MnDriftF ) THEN
           IF ( MnDriftData%DataIs3D ) THEN
                 ! Check the dimensions used.  The LoadComponents(I) flag will be set to .TRUE. if data was found in the file
              DO I=1,6
                 IF ( p%MnDriftDims(I) .AND. ( .NOT. MnDriftData%Data3D%LoadComponents(I) ) ) &
                    CALL SetErrStat( ErrID_Warn, ' '//TRIM(MnDriftData%Filename)//' does not contain information for the '// &
                          TRIM(Num2LStr(I))//' force component for the MnDrift method.  Setting this component to zero.',    &
                          ErrStat,ErrMsg,'WAMIT2_Init')
              ENDDO
           ELSE IF ( MnDriftData%DataIs4D ) THEN
                 ! Check the dimensions used.  The LoadComponents(I) flag will be set to .TRUE. if data was found in the file
              DO I=1,6
                 IF ( p%MnDriftDims(I) .AND. ( .NOT. MnDriftData%Data4D%LoadComponents(I) )  )&
                    CALL SetErrStat( ErrID_Warn, ' '//TRIM(MnDriftData%Filename)//' does not contain information for the '// &
                          TRIM(Num2LStr(I))//' force component for the MnDrift method.  Setting this component to zero.',    &
                          ErrStat,ErrMsg,'WAMIT2_Init')
              ENDDO
           ELSE  ! We didn't find any data to use...
              CALL SetErrStat( ErrID_Fatal, ' Programming error.  MnDrift flag is set, but no data has been read in.',ErrStat,ErrMsg, 'WAMIT2_Init')
           ENDIF
           IF ( ErrStat >= AbortErrLev ) THEN
              CALL CleanUp
  
negative.code:       IF ( p%MnDriftF ) THEN
           IF ( MnDriftData%DataIs3D ) THEN
              CALL Read_DataFile3D( TRIM(MnDriftData%Filename), MnDriftData%Data3D, ErrStatTmp, ErrMsgTmp )
              CALL SetErrStat( ErrStatTmp, ErrMsgTmp, ErrStat, ErrMsg, RoutineName)
           ELSEIF ( MnDriftData%DataIs4D ) THEN
              MnDriftData%Data4D%IsSumForce = .FALSE.
              CALL Read_DataFile4D( TRIM(MnDriftData%Filename), MnDriftData%Data4D, ErrStatTmp, ErrMsgTmp )
              CALL SetErrStat( ErrStatTmp, ErrMsgTmp, ErrStat, ErrMsg, RoutineName)
           ELSE
              CALL SetErrStat( ErrID_Fatal, ' Programming error.  MnDrift method flags incorrectly set by '// &
                    'CheckInitInput subroutine.', ErrStat, ErrMsg, RoutineName )
           ENDIF
           IF ( ErrStat >= AbortErrLev ) THEN
              CALL CleanUp
  