anchor.diff:                                                                                      !!  functions (Xd) with respect to the
                                                                                       !!  constraint states (z) [intent in to avoid deallocation]
      REAL(ReKi), ALLOCATABLE, OPTIONAL,         INTENT(INOUT)           :: dZdz(:,:)  !< Partial derivatives of constraint
  -                                                                                    !! state functions (Z) with respect to
  -                                                                                    !!  the constraint states (z) [intent in to avoid deallocation]
      ! Initialize ErrStat
      ErrStat = ErrID_None
      ErrMsg  = ''
  -
      IF ( PRESENT( dYdz ) ) THEN
         ! Calculate the partial derivative of the output functions (Y) with respect to the constraint states (z) here:
         ! allocate and set dYdz
      END IF
  -
      IF ( PRESENT( dXdz ) ) THEN
         ! Calculate the partial derivative of the continuous state functions (X) with respect to the constraint states (z) here:
         ! allocate and set dXdz
      END IF
  -
      IF ( PRESENT( dXddz ) ) THEN
         ! Calculate the partial derivative of the discrete state functions (Xd) with respect to the constraint states (z) here:
         ! allocate and set dXddz
      END IF
  -
      IF ( PRESENT( dZdz ) ) THEN
         ! Calculate the partial derivative of the constraint state functions (Z) with respect to the constraint states (z) here:
         ! allocate and set dZdz
      END IF
  -
  -
   END SUBROUTINE ExtPtfm_JacobianPConstrState
   !----------------------------------------------------------------------------------------------------------------------------------
   !> Routine to pack the data structures representing the operating points into arrays for linearization.
  
positive.code:    InitOut%Ver = ExtPtfm_Ver
        
     if (InitInp%Linearize) then
        ! If the module does not implement the four Jacobian routines at the end of this template, or the module cannot
        ! linearize with the features that are enabled, stop the simulation if InitInp%Linearize is true.
        CALL SetErrStat( ErrID_Fatal, 'ExtPtfm_MCKF cannot perform linearization analysis.', ErrStat, ErrMsg, 'ExtPtfm_Init')
        ! Otherwise, if the module does allow linearization, return the appropriate Jacobian row/column names and rotating-frame flags here:   
        ! Allocate and set these variables: InitOut%LinNames_y, InitOut%LinNames_x, InitOut%LinNames_xd, InitOut%LinNames_z, InitOut%LinNames_u 
        ! Allocate and set these variables: InitOut%RotFrame_y, InitOut%RotFrame_x, InitOut%RotFrame_xd, InitOut%RotFrame_z, InitOut%RotFrame_u 
     end if
  CONTAINS
      logical function Failed()
  
negative.code:                                                                    !!   functions (Xd) with respect to
                                                                     !!   the continuous states (x) [intent in to avoid deallocation]
     REAL(ReKi), ALLOCATABLE, OPTIONAL,  INTENT(INOUT) :: dZdx(:,:)  !< Partial derivatives of constraint state
                                                                     !!   functions (Z) with respect to
                                                                     !!   the continuous states (x) [intent in to avoid deallocation]
     ! Initialize ErrStat
     ErrStat = ErrID_None
     ErrMsg  = ''
     IF ( PRESENT( dYdx ) ) THEN
        ! allocate and set dYdx
        if (.not. allocated(dYdx)) then
            call AllocAry(dYdx, 6, 2*p%nCB, 'dYdx', ErrStat, ErrMsg); if(Failed()) return
        end if
        dYdx(1:6,1:2*p%nCB) = p%CMat(1:6, 1:2*p%nCB)
     END IF
     IF ( PRESENT( dXdx ) ) THEN
        ! allocate and set dXdx
        if (.not. allocated(dXdx)) then
            call AllocAry(dXdx, 2*p%nCB, 2*p%nCB, 'dXdx', ErrStat, ErrMsg); if(Failed()) return
        end if
        dXdx(1:2*p%nCB,1:2*p%nCB) = p%AMat(1:2*p%nCB,1:2*p%nCB)
     END IF
     IF ( PRESENT( dXddx ) ) THEN
     END IF
     IF ( PRESENT( dZdx ) ) THEN
     END IF
  CONTAINS
      logical function Failed()
          CALL SetErrStatSimple(ErrStat, ErrMsg, 'ExtPtfm_JacobianPInput')
          Failed =  ErrStat >= AbortErrLev
      end function Failed
  END SUBROUTINE ExtPtfm_JacobianPContState
  !----------------------------------------------------------------------------------------------------------------------------------
  !> Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions
  