anchor.diff:    Re_BufSz  = 0
     Db_BufSz  = 0
     Int_BufSz  = 0
  -      Re_BufSz   = Re_BufSz   + SIZE(InData%F_stop)  ! F_stop
  -      Re_BufSz   = Re_BufSz   + SIZE(InData%F_ext)  ! F_ext
  -      Re_BufSz   = Re_BufSz   + SIZE(InData%F_fr)  ! F_fr
  -      Re_BufSz   = Re_BufSz   + SIZE(InData%C_ctrl)  ! C_ctrl
  -      Re_BufSz   = Re_BufSz   + SIZE(InData%C_Brake)  ! C_Brake
  -      Re_BufSz   = Re_BufSz   + SIZE(InData%F_table)  ! F_table
  +      Re_BufSz   = Re_BufSz   + 1  ! DummyOtherState
     IF ( Re_BufSz  .GT. 0 ) THEN 
        ALLOCATE( ReKiBuf(  Re_BufSz  ), STAT=ErrStat2 )
        IF (ErrStat2 /= 0) THEN 
  
positive.code:       OutData%F_table = UNPACK(ReKiBuf( Re_Xferred:Re_Xferred+(SIZE(OutData%F_table))-1 ), mask1, 0.0_ReKi )
        Re_Xferred   = Re_Xferred   + SIZE(OutData%F_table)
      DEALLOCATE(mask1)
   END SUBROUTINE TMD_UnPackOtherState
  
   SUBROUTINE TMD_CopyParam( SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg )
     TYPE(TMD_ParameterType), INTENT(IN) :: SrcParamData
  
negative.code:   LOGICAL, ALLOCATABLE           :: mask3(:,:,:)
    LOGICAL, ALLOCATABLE           :: mask4(:,:,:,:)
    LOGICAL, ALLOCATABLE           :: mask5(:,:,:,:,:)
    INTEGER(IntKi)                 :: ErrStat2
    CHARACTER(ErrMsgLen)           :: ErrMsg2
    CHARACTER(*), PARAMETER        :: RoutineName = 'TMD_UnPackOtherState'
   ! 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%DummyOtherState = ReKiBuf( Re_Xferred )
        Re_Xferred   = Re_Xferred + 1
   END SUBROUTINE TMD_UnPackOtherState
  
   SUBROUTINE TMD_CopyMisc( SrcMiscData, DstMiscData, CtrlCode, ErrStat, ErrMsg )
     TYPE(TMD_MiscVarType), INTENT(IN) :: SrcMiscData
     TYPE(TMD_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 = 'TMD_CopyMisc'
  ! 
     ErrStat = ErrID_None
     ErrMsg  = ""
      DstMiscData%F_stop = SrcMiscData%F_stop
      DstMiscData%F_ext = SrcMiscData%F_ext
      DstMiscData%F_fr = SrcMiscData%F_fr
      DstMiscData%C_ctrl = SrcMiscData%C_ctrl
      DstMiscData%C_Brake = SrcMiscData%C_Brake
      DstMiscData%F_table = SrcMiscData%F_table
   END SUBROUTINE TMD_CopyMisc
  
   SUBROUTINE TMD_DestroyMisc( MiscData, ErrStat, ErrMsg )
    TYPE(TMD_MiscVarType), INTENT(INOUT) :: MiscData
    INTEGER(IntKi),  INTENT(  OUT) :: ErrStat
    CHARACTER(*),    INTENT(  OUT) :: ErrMsg
    CHARACTER(*),    PARAMETER :: RoutineName = 'TMD_DestroyMisc'
    INTEGER(IntKi)                 :: i, i1, i2, i3, i4, i5 
  ! 
    ErrStat = ErrID_None
    ErrMsg  = ""
   END SUBROUTINE TMD_DestroyMisc
  
   SUBROUTINE TMD_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(TMD_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 = 'TMD_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
        Re_BufSz   = Re_BufSz   + SIZE(InData%F_stop)  ! F_stop
        Re_BufSz   = Re_BufSz   + SIZE(InData%F_ext)  ! F_ext
        Re_BufSz   = Re_BufSz   + SIZE(InData%F_fr)  ! F_fr
        Re_BufSz   = Re_BufSz   + SIZE(InData%C_ctrl)  ! C_ctrl
        Re_BufSz   = Re_BufSz   + SIZE(InData%C_Brake)  ! C_Brake
        Re_BufSz   = Re_BufSz   + SIZE(InData%F_table)  ! F_table
    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
  
        ReKiBuf ( Re_Xferred:Re_Xferred+(SIZE(InData%F_stop))-1 ) = PACK(InData%F_stop,.TRUE.)
        Re_Xferred   = Re_Xferred   + SIZE(InData%F_stop)
        ReKiBuf ( Re_Xferred:Re_Xferred+(SIZE(InData%F_ext))-1 ) = PACK(InData%F_ext,.TRUE.)
        Re_Xferred   = Re_Xferred   + SIZE(InData%F_ext)
        ReKiBuf ( Re_Xferred:Re_Xferred+(SIZE(InData%F_fr))-1 ) = PACK(InData%F_fr,.TRUE.)
        Re_Xferred   = Re_Xferred   + SIZE(InData%F_fr)
        ReKiBuf ( Re_Xferred:Re_Xferred+(SIZE(InData%C_ctrl))-1 ) = PACK(InData%C_ctrl,.TRUE.)
        Re_Xferred   = Re_Xferred   + SIZE(InData%C_ctrl)
        ReKiBuf ( Re_Xferred:Re_Xferred+(SIZE(InData%C_Brake))-1 ) = PACK(InData%C_Brake,.TRUE.)
        Re_Xferred   = Re_Xferred   + SIZE(InData%C_Brake)
        ReKiBuf ( Re_Xferred:Re_Xferred+(SIZE(InData%F_table))-1 ) = PACK(InData%F_table,.TRUE.)
        Re_Xferred   = Re_Xferred   + SIZE(InData%F_table)
   END SUBROUTINE TMD_PackMisc
  
   SUBROUTINE TMD_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(TMD_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 = 'TMD_UnPackMisc'
   ! buffers to store meshes, if any
    REAL(ReKi),      ALLOCATABLE   :: Re_Buf(:)
    REAL(DbKi),      ALLOCATABLE   :: Db_Buf(:)
  