anchor.diff:     REAL(ReKi), ALLOCATABLE, OPTIONAL,    INTENT(INOUT)           :: dx_op(:)   !< values of first time derivatives of linearized continuous states
      REAL(ReKi), ALLOCATABLE, OPTIONAL,    INTENT(INOUT)           :: xd_op(:)   !< values of linearized discrete states
      REAL(ReKi), ALLOCATABLE, OPTIONAL,    INTENT(INOUT)           :: z_op(:)    !< values of linearized constraint states
  +   INTEGER(IntKi)  :: I
      ! Initialize ErrStat
      ErrStat = ErrID_None
      ErrMsg  = ''
   
  -   IF ( PRESENT( u_op ) ) THEN
  -   END IF
  -
  -   IF ( PRESENT( y_op ) ) THEN
  -   END IF
  -
  -   IF ( PRESENT( x_op ) ) THEN
  -   END IF
  -
  -   IF ( PRESENT( dx_op ) ) THEN
  -   END IF
  -
  -   IF ( PRESENT( xd_op ) ) THEN
  -   END IF
  -   
  -   IF ( PRESENT( z_op ) ) THEN
  -   END IF
  -
  +   if ( present( u_op ) ) then
  +       if (.not. allocated(u_op)) then
  +           call AllocAry(u_op, N_INPUTS, 'u_op', ErrStat, ErrMsg); if(Failed())return
  +       endif
  +       u_op(1:3)   = u%PtfmMesh%TranslationDisp(:,1)
  +       u_op(4:6)   = GetSmllRotAngs(u%PtfmMesh%Orientation(:,:,1), ErrStat, ErrMsg); if(Failed())return
  +       u_op(7:9  ) = u%PtfmMesh%TranslationVel(:,1)
  +       u_op(10:12) = u%PtfmMesh%RotationVel   (:,1)
  +       u_op(13:15) = u%PtfmMesh%TranslationAcc(:,1)
  +       u_op(16:18) = u%PtfmMesh%RotationAcc   (:,1)
  +   end if
  +
  +   if ( present( y_op ) ) then
  +       if (.not. allocated(y_op)) then
  +           call AllocAry(y_op, N_OUTPUTS+p%NumOuts, 'y_op', ErrStat, ErrMsg); if(Failed())return
  +       endif
  +       ! Update the output mesh
  +       y_op(1:3)=y%PtfmMesh%Force(1:3,1)
  +       y_op(4:6)=y%PtfmMesh%Moment(1:3,1)
  +       do i=1,p%NumOuts         
  +           y_op(i+N_OUTPUTS) = y%WriteOutput(i)
  +       end do      
  +   end if
  +
  +   if ( present( x_op ) ) then
  +       if (.not. allocated(x_op)) then
  +           call AllocAry(x_op, 2*p%nCB, 'x_op', ErrStat, ErrMsg); if (Failed())return
  +       endif
  +       x_op(1:p%nCB)         = x%qm(1:p%nCB)
  +       x_op(p%nCB+1:2*p%nCB) = x%qmdot(1:p%nCB)
  +   end if
  +
  +   if ( present( dx_op ) ) then
  +   end if
  +
  +   if ( present( xd_op ) ) then
  +   end if
  +   
  +   if ( present( z_op ) ) then
  +   end if
  +
  +contains
  +    logical function Failed()
  +        CALL SetErrStatSimple(ErrStat, ErrMsg, 'ExtPtfm_GetOP')
  +        Failed =  ErrStat >= AbortErrLev
  +    end function Failed
   END SUBROUTINE ExtPtfm_GetOP
   !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   
  
positive.code:    do I=1,p%nTot; m%PtfmFt(I)=0; end do
     call AllocAry( m%xFlat, 2*p%nCB,'xFlat', ErrStat,ErrMsg); if(Failed()) return
     do I=1,2*p%nCB; m%xFlat(I)=0; end do
     do I=1,18; m%uFlat(I)=0; end do
     
     ! Define initial guess (set up mesh first) for the system inputs here:
     call Init_meshes(u, y, ErrStat, ErrMsg); if(Failed()) return
  
negative.code: 
     PRIVATE
  
     INTEGER(IntKi), parameter :: N_INPUTS = 18
     INTEGER(IntKi), parameter :: N_OUTPUTS = 6
  
     ! ..... Public Subroutines ...................................................................................................
     PUBLIC :: ExtPtfm_Init                           !  Initialization routine
  