anchor.diff:        IF(ALLOCATED(Re_Buf )) DEALLOCATE(Re_Buf )
         IF(ALLOCATED(Db_Buf )) DEALLOCATE(Db_Buf )
         IF(ALLOCATED(Int_Buf)) DEALLOCATE(Int_Buf)
  + END SUBROUTINE SrvD_UnPackOtherState
  +
  + SUBROUTINE SrvD_CopyMisc( SrcMiscData, DstMiscData, CtrlCode, ErrStat, ErrMsg )
  +   TYPE(SrvD_MiscVarType), INTENT(IN) :: SrcMiscData
  +   TYPE(SrvD_MiscVarType), INTENT(INOUT) :: DstMiscData
  +   INTEGER(IntKi),  INTENT(IN   ) :: CtrlCode
  +   INTEGER(IntKi),  INTENT(  OUT) :: ErrStat
  +   CHARACTER(*),    INTENT(  OUT) :: ErrMsg
  +! Local 
  +   INTEGER(IntKi)                 :: i,j,k
  +   INTEGER(IntKi)                 :: i1, i1_l, i1_u  !  bounds (upper/lower) for an array dimension 1
  +   INTEGER(IntKi)                 :: ErrStat2
  +   CHARACTER(ErrMsgLen)           :: ErrMsg2
  +   CHARACTER(*), PARAMETER        :: RoutineName = 'SrvD_CopyMisc'
  +! 
  +   ErrStat = ErrID_None
  +   ErrMsg  = ""
  +    DstMiscData%LastTimeCalled = SrcMiscData%LastTimeCalled
  +      CALL SrvD_Copybladeddlltype( SrcMiscData%dll_data, DstMiscData%dll_data, CtrlCode, ErrStat2, ErrMsg2 )
  +         CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg,RoutineName)
  +         IF (ErrStat>=AbortErrLev) RETURN
  +    DstMiscData%FirstWarn = SrcMiscData%FirstWarn
  +    DstMiscData%LastTimeFiltered = SrcMiscData%LastTimeFiltered
  +IF (ALLOCATED(SrcMiscData%xd_BlPitchFilter)) THEN
  +  i1_l = LBOUND(SrcMiscData%xd_BlPitchFilter,1)
  +  i1_u = UBOUND(SrcMiscData%xd_BlPitchFilter,1)
  +  IF (.NOT. ALLOCATED(DstMiscData%xd_BlPitchFilter)) THEN 
  +    ALLOCATE(DstMiscData%xd_BlPitchFilter(i1_l:i1_u),STAT=ErrStat2)
  +    IF (ErrStat2 /= 0) THEN 
  +      CALL SetErrStat(ErrID_Fatal, 'Error allocating DstMiscData%xd_BlPitchFilter.', ErrStat, ErrMsg,RoutineName)
  +      RETURN
  +    END IF
  +  END IF
  +    DstMiscData%xd_BlPitchFilter = SrcMiscData%xd_BlPitchFilter
  +ENDIF
  +      CALL TMD_CopyMisc( SrcMiscData%NTMD, DstMiscData%NTMD, CtrlCode, ErrStat2, ErrMsg2 )
  +         CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg,RoutineName)
  +         IF (ErrStat>=AbortErrLev) RETURN
  +      CALL TMD_CopyMisc( SrcMiscData%TTMD, DstMiscData%TTMD, CtrlCode, ErrStat2, ErrMsg2 )
  +         CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg,RoutineName)
  +         IF (ErrStat>=AbortErrLev) RETURN
  + END SUBROUTINE SrvD_CopyMisc
  +
  + SUBROUTINE SrvD_DestroyMisc( MiscData, ErrStat, ErrMsg )
  +  TYPE(SrvD_MiscVarType), INTENT(INOUT) :: MiscData
  +  INTEGER(IntKi),  INTENT(  OUT) :: ErrStat
  +  CHARACTER(*),    INTENT(  OUT) :: ErrMsg
  +  CHARACTER(*),    PARAMETER :: RoutineName = 'SrvD_DestroyMisc'
  +  INTEGER(IntKi)                 :: i, i1, i2, i3, i4, i5 
  +! 
  +  ErrStat = ErrID_None
  +  ErrMsg  = ""
  +  CALL SrvD_Destroybladeddlltype( MiscData%dll_data, ErrStat, ErrMsg )
  +IF (ALLOCATED(MiscData%xd_BlPitchFilter)) THEN
  +  DEALLOCATE(MiscData%xd_BlPitchFilter)
  +ENDIF
  +  CALL TMD_DestroyMisc( MiscData%NTMD, ErrStat, ErrMsg )
  +  CALL TMD_DestroyMisc( MiscData%TTMD, ErrStat, ErrMsg )
  + END SUBROUTINE SrvD_DestroyMisc
  +
  + SUBROUTINE SrvD_PackMisc( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, SizeOnly )
  +  REAL(ReKi),       ALLOCATABLE, INTENT(  OUT) :: ReKiBuf(:)
  +  REAL(DbKi),       ALLOCATABLE, INTENT(  OUT) :: DbKiBuf(:)
  +  INTEGER(IntKi),   ALLOCATABLE, INTENT(  OUT) :: IntKiBuf(:)
  +  TYPE(SrvD_MiscVarType),  INTENT(IN) :: InData
  +  INTEGER(IntKi),   INTENT(  OUT) :: ErrStat
  +  CHARACTER(*),     INTENT(  OUT) :: ErrMsg
  +  LOGICAL,OPTIONAL, INTENT(IN   ) :: SizeOnly
  +    ! Local variables
  +  INTEGER(IntKi)                 :: Re_BufSz
  +  INTEGER(IntKi)                 :: Re_Xferred
  +  INTEGER(IntKi)                 :: Db_BufSz
  +  INTEGER(IntKi)                 :: Db_Xferred
  +  INTEGER(IntKi)                 :: Int_BufSz
  +  INTEGER(IntKi)                 :: Int_Xferred
  +  INTEGER(IntKi)                 :: i,i1,i2,i3,i4,i5
  +  LOGICAL                        :: OnlySize ! if present and true, do not pack, just allocate buffers
  +  INTEGER(IntKi)                 :: ErrStat2
  +  CHARACTER(ErrMsgLen)           :: ErrMsg2
  +  CHARACTER(*), PARAMETER        :: RoutineName = 'SrvD_PackMisc'
  + ! buffers to store subtypes, if any
  +  REAL(ReKi),      ALLOCATABLE   :: Re_Buf(:)
  +  REAL(DbKi),      ALLOCATABLE   :: Db_Buf(:)
  +  INTEGER(IntKi),  ALLOCATABLE   :: Int_Buf(:)
  +
  +  OnlySize = .FALSE.
  +  IF ( PRESENT(SizeOnly) ) THEN
  +    OnlySize = SizeOnly
  +  ENDIF
  +    !
  +  ErrStat = ErrID_None
  +  ErrMsg  = ""
  +  Re_BufSz  = 0
  +  Db_BufSz  = 0
  +  Int_BufSz  = 0
  +      Db_BufSz   = Db_BufSz   + 1  ! LastTimeCalled
  +   ! Allocate buffers for subtypes, if any (we'll get sizes from these) 
  +      Int_BufSz   = Int_BufSz + 3  ! dll_data: size of buffers for each call to pack subtype
  +      CALL SrvD_Packbladeddlltype( Re_Buf, Db_Buf, Int_Buf, InData%dll_data, ErrStat2, ErrMsg2, .TRUE. ) ! dll_data 
  +        CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
  +        IF (ErrStat >= AbortErrLev) RETURN
  +
  +      IF(ALLOCATED(Re_Buf)) THEN ! dll_data
  +         Re_BufSz  = Re_BufSz  + SIZE( Re_Buf  )
  +         DEALLOCATE(Re_Buf)
  +      END IF
  +      IF(ALLOCATED(Db_Buf)) THEN ! dll_data
  +         Db_BufSz  = Db_BufSz  + SIZE( Db_Buf  )
  +         DEALLOCATE(Db_Buf)
  +      END IF
  +      IF(ALLOCATED(Int_Buf)) THEN ! dll_data
  +         Int_BufSz = Int_BufSz + SIZE( Int_Buf )
  +         DEALLOCATE(Int_Buf)
  +      END IF
  +      Int_BufSz  = Int_BufSz  + 1  ! FirstWarn
  +      Db_BufSz   = Db_BufSz   + 1  ! LastTimeFiltered
  +  Int_BufSz   = Int_BufSz   + 1     ! xd_BlPitchFilter allocated yes/no
  +  IF ( ALLOCATED(InData%xd_BlPitchFilter) ) THEN
  +    Int_BufSz   = Int_BufSz   + 2*1  ! xd_BlPitchFilter upper/lower bounds for each dimension
  +      Re_BufSz   = Re_BufSz   + SIZE(InData%xd_BlPitchFilter)  ! xd_BlPitchFilter
  +  END IF
  +      Int_BufSz   = Int_BufSz + 3  ! NTMD: size of buffers for each call to pack subtype
  +      CALL TMD_PackMisc( Re_Buf, Db_Buf, Int_Buf, InData%NTMD, ErrStat2, ErrMsg2, .TRUE. ) ! NTMD 
  +        CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
  +        IF (ErrStat >= AbortErrLev) RETURN
  +
  +      IF(ALLOCATED(Re_Buf)) THEN ! NTMD
  +         Re_BufSz  = Re_BufSz  + SIZE( Re_Buf  )
  +         DEALLOCATE(Re_Buf)
  +      END IF
  +      IF(ALLOCATED(Db_Buf)) THEN ! NTMD
  +         Db_BufSz  = Db_BufSz  + SIZE( Db_Buf  )
  +         DEALLOCATE(Db_Buf)
  +      END IF
  +      IF(ALLOCATED(Int_Buf)) THEN ! NTMD
  +         Int_BufSz = Int_BufSz + SIZE( Int_Buf )
  +         DEALLOCATE(Int_Buf)
  +      END IF
  +      Int_BufSz   = Int_BufSz + 3  ! TTMD: size of buffers for each call to pack subtype
  +      CALL TMD_PackMisc( Re_Buf, Db_Buf, Int_Buf, InData%TTMD, ErrStat2, ErrMsg2, .TRUE. ) ! TTMD 
  +        CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
  +        IF (ErrStat >= AbortErrLev) RETURN
  +
  +      IF(ALLOCATED(Re_Buf)) THEN ! TTMD
  +         Re_BufSz  = Re_BufSz  + SIZE( Re_Buf  )
  +         DEALLOCATE(Re_Buf)
  +      END IF
  +      IF(ALLOCATED(Db_Buf)) THEN ! TTMD
  +         Db_BufSz  = Db_BufSz  + SIZE( Db_Buf  )
  +         DEALLOCATE(Db_Buf)
  +      END IF
  +      IF(ALLOCATED(Int_Buf)) THEN ! TTMD
  +         Int_BufSz = Int_BufSz + SIZE( Int_Buf )
  +         DEALLOCATE(Int_Buf)
  +      END IF
  +  IF ( Re_BufSz  .GT. 0 ) THEN 
  +     ALLOCATE( ReKiBuf(  Re_BufSz  ), STAT=ErrStat2 )
  +     IF (ErrStat2 /= 0) THEN 
  +       CALL SetErrStat(ErrID_Fatal, 'Error allocating ReKiBuf.', ErrStat, ErrMsg,RoutineName)
  +       RETURN
  +     END IF
  +  END IF
  +  IF ( Db_BufSz  .GT. 0 ) THEN 
  +     ALLOCATE( DbKiBuf(  Db_BufSz  ), STAT=ErrStat2 )
  +     IF (ErrStat2 /= 0) THEN 
  +       CALL SetErrStat(ErrID_Fatal, 'Error allocating DbKiBuf.', ErrStat, ErrMsg,RoutineName)
  +       RETURN
  +     END IF
  +  END IF
  +  IF ( Int_BufSz  .GT. 0 ) THEN 
  +     ALLOCATE( IntKiBuf(  Int_BufSz  ), STAT=ErrStat2 )
  +     IF (ErrStat2 /= 0) THEN 
  +       CALL SetErrStat(ErrID_Fatal, 'Error allocating IntKiBuf.', ErrStat, ErrMsg,RoutineName)
  +       RETURN
  +     END IF
  +  END IF
  +  IF(OnlySize) RETURN ! return early if only trying to allocate buffers (not pack them)
  +
  +  Re_Xferred  = 1
  +  Db_Xferred  = 1
  +  Int_Xferred = 1
  +
  +      DbKiBuf ( Db_Xferred:Db_Xferred+(1)-1 ) = InData%LastTimeCalled
  +      Db_Xferred   = Db_Xferred   + 1
  +      CALL SrvD_Packbladeddlltype( Re_Buf, Db_Buf, Int_Buf, InData%dll_data, ErrStat2, ErrMsg2, OnlySize ) ! dll_data 
  +        CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
  +        IF (ErrStat >= AbortErrLev) RETURN
  +
  +      IF(ALLOCATED(Re_Buf)) THEN
  +        IntKiBuf( Int_Xferred ) = SIZE(Re_Buf); Int_Xferred = Int_Xferred + 1
  +        IF (SIZE(Re_Buf) > 0) ReKiBuf( Re_Xferred:Re_Xferred+SIZE(Re_Buf)-1 ) = Re_Buf
  +        Re_Xferred = Re_Xferred + SIZE(Re_Buf)
  +        DEALLOCATE(Re_Buf)
  +      ELSE
  +        IntKiBuf( Int_Xferred ) = 0; Int_Xferred = Int_Xferred + 1
  +      ENDIF
  +      IF(ALLOCATED(Db_Buf)) THEN
  +        IntKiBuf( Int_Xferred ) = SIZE(Db_Buf); Int_Xferred = Int_Xferred + 1
  +        IF (SIZE(Db_Buf) > 0) DbKiBuf( Db_Xferred:Db_Xferred+SIZE(Db_Buf)-1 ) = Db_Buf
  +        Db_Xferred = Db_Xferred + SIZE(Db_Buf)
  +        DEALLOCATE(Db_Buf)
  +      ELSE
  +        IntKiBuf( Int_Xferred ) = 0; Int_Xferred = Int_Xferred + 1
  +      ENDIF
  +      IF(ALLOCATED(Int_Buf)) THEN
  +        IntKiBuf( Int_Xferred ) = SIZE(Int_Buf); Int_Xferred = Int_Xferred + 1
  +        IF (SIZE(Int_Buf) > 0) IntKiBuf( Int_Xferred:Int_Xferred+SIZE(Int_Buf)-1 ) = Int_Buf
  +        Int_Xferred = Int_Xferred + SIZE(Int_Buf)
  +        DEALLOCATE(Int_Buf)
  +      ELSE
  +        IntKiBuf( Int_Xferred ) = 0; Int_Xferred = Int_Xferred + 1
  +      ENDIF
  +      IntKiBuf ( Int_Xferred:Int_Xferred+1-1 ) = TRANSFER( InData%FirstWarn , IntKiBuf(1), 1)
  +      Int_Xferred   = Int_Xferred   + 1
  +      DbKiBuf ( Db_Xferred:Db_Xferred+(1)-1 ) = InData%LastTimeFiltered
  +      Db_Xferred   = Db_Xferred   + 1
  +  IF ( .NOT. ALLOCATED(InData%xd_BlPitchFilter) ) THEN
  +    IntKiBuf( Int_Xferred ) = 0
  +    Int_Xferred = Int_Xferred + 1
  +  ELSE
  +    IntKiBuf( Int_Xferred ) = 1
  +    Int_Xferred = Int_Xferred + 1
  +    IntKiBuf( Int_Xferred    ) = LBOUND(InData%xd_BlPitchFilter,1)
  +    IntKiBuf( Int_Xferred + 1) = UBOUND(InData%xd_BlPitchFilter,1)
  +    Int_Xferred = Int_Xferred + 2
  +
  +      IF (SIZE(InData%xd_BlPitchFilter)>0) ReKiBuf ( Re_Xferred:Re_Xferred+(SIZE(InData%xd_BlPitchFilter))-1 ) = PACK(InData%xd_BlPitchFilter,.TRUE.)
  +      Re_Xferred   = Re_Xferred   + SIZE(InData%xd_BlPitchFilter)
  +  END IF
  +      CALL TMD_PackMisc( Re_Buf, Db_Buf, Int_Buf, InData%NTMD, ErrStat2, ErrMsg2, OnlySize ) ! NTMD 
  +        CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
  +        IF (ErrStat >= AbortErrLev) RETURN
  +
  +      IF(ALLOCATED(Re_Buf)) THEN
  +        IntKiBuf( Int_Xferred ) = SIZE(Re_Buf); Int_Xferred = Int_Xferred + 1
  +        IF (SIZE(Re_Buf) > 0) ReKiBuf( Re_Xferred:Re_Xferred+SIZE(Re_Buf)-1 ) = Re_Buf
  +        Re_Xferred = Re_Xferred + SIZE(Re_Buf)
  +        DEALLOCATE(Re_Buf)
  +      ELSE
  +        IntKiBuf( Int_Xferred ) = 0; Int_Xferred = Int_Xferred + 1
  +      ENDIF
  +      IF(ALLOCATED(Db_Buf)) THEN
  +        IntKiBuf( Int_Xferred ) = SIZE(Db_Buf); Int_Xferred = Int_Xferred + 1
  +        IF (SIZE(Db_Buf) > 0) DbKiBuf( Db_Xferred:Db_Xferred+SIZE(Db_Buf)-1 ) = Db_Buf
  +        Db_Xferred = Db_Xferred + SIZE(Db_Buf)
  +        DEALLOCATE(Db_Buf)
  +      ELSE
  +        IntKiBuf( Int_Xferred ) = 0; Int_Xferred = Int_Xferred + 1
  +      ENDIF
  +      IF(ALLOCATED(Int_Buf)) THEN
  +        IntKiBuf( Int_Xferred ) = SIZE(Int_Buf); Int_Xferred = Int_Xferred + 1
  +        IF (SIZE(Int_Buf) > 0) IntKiBuf( Int_Xferred:Int_Xferred+SIZE(Int_Buf)-1 ) = Int_Buf
  +        Int_Xferred = Int_Xferred + SIZE(Int_Buf)
  +        DEALLOCATE(Int_Buf)
  +      ELSE
  +        IntKiBuf( Int_Xferred ) = 0; Int_Xferred = Int_Xferred + 1
  +      ENDIF
  +      CALL TMD_PackMisc( Re_Buf, Db_Buf, Int_Buf, InData%TTMD, ErrStat2, ErrMsg2, OnlySize ) ! TTMD 
  +        CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
  +        IF (ErrStat >= AbortErrLev) RETURN
  +
  +      IF(ALLOCATED(Re_Buf)) THEN
  +        IntKiBuf( Int_Xferred ) = SIZE(Re_Buf); Int_Xferred = Int_Xferred + 1
  +        IF (SIZE(Re_Buf) > 0) ReKiBuf( Re_Xferred:Re_Xferred+SIZE(Re_Buf)-1 ) = Re_Buf
  +        Re_Xferred = Re_Xferred + SIZE(Re_Buf)
  +        DEALLOCATE(Re_Buf)
  +      ELSE
  +        IntKiBuf( Int_Xferred ) = 0; Int_Xferred = Int_Xferred + 1
  +      ENDIF
  +      IF(ALLOCATED(Db_Buf)) THEN
  +        IntKiBuf( Int_Xferred ) = SIZE(Db_Buf); Int_Xferred = Int_Xferred + 1
  +        IF (SIZE(Db_Buf) > 0) DbKiBuf( Db_Xferred:Db_Xferred+SIZE(Db_Buf)-1 ) = Db_Buf
  +        Db_Xferred = Db_Xferred + SIZE(Db_Buf)
  +        DEALLOCATE(Db_Buf)
  +      ELSE
  +        IntKiBuf( Int_Xferred ) = 0; Int_Xferred = Int_Xferred + 1
  +      ENDIF
  +      IF(ALLOCATED(Int_Buf)) THEN
  +        IntKiBuf( Int_Xferred ) = SIZE(Int_Buf); Int_Xferred = Int_Xferred + 1
  +        IF (SIZE(Int_Buf) > 0) IntKiBuf( Int_Xferred:Int_Xferred+SIZE(Int_Buf)-1 ) = Int_Buf
  +        Int_Xferred = Int_Xferred + SIZE(Int_Buf)
  +        DEALLOCATE(Int_Buf)
  +      ELSE
  +        IntKiBuf( Int_Xferred ) = 0; Int_Xferred = Int_Xferred + 1
  +      ENDIF
  + END SUBROUTINE SrvD_PackMisc
  +
  + SUBROUTINE SrvD_UnPackMisc( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg )
  +  REAL(ReKi),      ALLOCATABLE, INTENT(IN   ) :: ReKiBuf(:)
  +  REAL(DbKi),      ALLOCATABLE, INTENT(IN   ) :: DbKiBuf(:)
  +  INTEGER(IntKi),  ALLOCATABLE, INTENT(IN   ) :: IntKiBuf(:)
  +  TYPE(SrvD_MiscVarType), INTENT(INOUT) :: OutData
  +  INTEGER(IntKi),  INTENT(  OUT) :: ErrStat
  +  CHARACTER(*),    INTENT(  OUT) :: ErrMsg
  +    ! Local variables
  +  INTEGER(IntKi)                 :: Buf_size
  +  INTEGER(IntKi)                 :: Re_Xferred
  +  INTEGER(IntKi)                 :: Db_Xferred
  +  INTEGER(IntKi)                 :: Int_Xferred
  +  INTEGER(IntKi)                 :: i
  +  LOGICAL                        :: mask0
  +  LOGICAL, ALLOCATABLE           :: mask1(:)
  +  LOGICAL, ALLOCATABLE           :: mask2(:,:)
  +  LOGICAL, ALLOCATABLE           :: mask3(:,:,:)
  +  LOGICAL, ALLOCATABLE           :: mask4(:,:,:,:)
  +  LOGICAL, ALLOCATABLE           :: mask5(:,:,:,:,:)
  +  INTEGER(IntKi)                 :: i1, i1_l, i1_u  !  bounds (upper/lower) for an array dimension 1
  +  INTEGER(IntKi)                 :: ErrStat2
  +  CHARACTER(ErrMsgLen)           :: ErrMsg2
  +  CHARACTER(*), PARAMETER        :: RoutineName = 'SrvD_UnPackMisc'
  + ! buffers to store meshes, if any
  +  REAL(ReKi),      ALLOCATABLE   :: Re_Buf(:)
  +  REAL(DbKi),      ALLOCATABLE   :: Db_Buf(:)
  +  INTEGER(IntKi),  ALLOCATABLE   :: Int_Buf(:)
  +    !
  +  ErrStat = ErrID_None
  +  ErrMsg  = ""
  +  Re_Xferred  = 1
  +  Db_Xferred  = 1
  +  Int_Xferred  = 1
  +      OutData%LastTimeCalled = DbKiBuf( Db_Xferred ) 
  +      Db_Xferred   = Db_Xferred + 1
  +      Buf_size=IntKiBuf( Int_Xferred )
  +      Int_Xferred = Int_Xferred + 1
  +      IF(Buf_size > 0) THEN
  +        ALLOCATE(Re_Buf(Buf_size),STAT=ErrStat2)
  +        IF (ErrStat2 /= 0) THEN 
  +           CALL SetErrStat(ErrID_Fatal, 'Error allocating Re_Buf.', ErrStat, ErrMsg,RoutineName)
  +           RETURN
  +        END IF
  +        Re_Buf = ReKiBuf( Re_Xferred:Re_Xferred+Buf_size-1 )
  +        Re_Xferred = Re_Xferred + Buf_size
  +      END IF
  +      Buf_size=IntKiBuf( Int_Xferred )
  +      Int_Xferred = Int_Xferred + 1
  +      IF(Buf_size > 0) THEN
  +        ALLOCATE(Db_Buf(Buf_size),STAT=ErrStat2)
  +        IF (ErrStat2 /= 0) THEN 
  +           CALL SetErrStat(ErrID_Fatal, 'Error allocating Db_Buf.', ErrStat, ErrMsg,RoutineName)
  +           RETURN
  +        END IF
  +        Db_Buf = DbKiBuf( Db_Xferred:Db_Xferred+Buf_size-1 )
  +        Db_Xferred = Db_Xferred + Buf_size
  +      END IF
  +      Buf_size=IntKiBuf( Int_Xferred )
  +      Int_Xferred = Int_Xferred + 1
  +      IF(Buf_size > 0) THEN
  +        ALLOCATE(Int_Buf(Buf_size),STAT=ErrStat2)
  +        IF (ErrStat2 /= 0) THEN 
  +           CALL SetErrStat(ErrID_Fatal, 'Error allocating Int_Buf.', ErrStat, ErrMsg,RoutineName)
  +           RETURN
  +        END IF
  +        Int_Buf = IntKiBuf( Int_Xferred:Int_Xferred+Buf_size-1 )
  +        Int_Xferred = Int_Xferred + Buf_size
  +      END IF
  +      CALL SrvD_Unpackbladeddlltype( Re_Buf, Db_Buf, Int_Buf, OutData%dll_data, ErrStat2, ErrMsg2 ) ! dll_data 
  +        CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
  +        IF (ErrStat >= AbortErrLev) RETURN
  +
  +      IF(ALLOCATED(Re_Buf )) DEALLOCATE(Re_Buf )
  +      IF(ALLOCATED(Db_Buf )) DEALLOCATE(Db_Buf )
  +      IF(ALLOCATED(Int_Buf)) DEALLOCATE(Int_Buf)
  +      OutData%FirstWarn = TRANSFER( IntKiBuf( Int_Xferred ), mask0 )
  +      Int_Xferred   = Int_Xferred + 1
         OutData%LastTimeFiltered = DbKiBuf( Db_Xferred ) 
         Db_Xferred   = Db_Xferred + 1
     IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN  ! xd_BlPitchFilter not allocated
  
positive.code: ENDIF
  IF (ALLOCATED(ParamData%BlPitchF)) THEN
    DEALLOCATE(ParamData%BlPitchF)
  ENDIF
  IF (ALLOCATED(ParamData%TPitManS)) THEN
    DEALLOCATE(ParamData%TPitManS)
  
negative.code:       Re_Xferred   = Re_Xferred   + SIZE(OutData%TBDepISp)
      DEALLOCATE(mask1)
    END IF
        OutData%TBDrConN = ReKiBuf( Re_Xferred )
        Re_Xferred   = Re_Xferred + 1
        OutData%TBDrConD = ReKiBuf( Re_Xferred )
  