anchor.diff:        end if  
      end if
      
  -   !LIN-TODO: Review SubDyn!!!!
      !.....................
      ! SubDyn / ExtPtfm
      !.....................
  
positive.code:    ErrStat = ErrID_None
     ErrMsg  = ""
                 
     ! note that we assume this block matrix has been initialized to the identity matrix before calling this routine
     ! We need to make six calls to SetBlockMatrix for the different output to input mappings
     ! LIN-TODO: Are this row and col still valid GJH 7/31/2020
     ! 1) Row 3, Col 1
     ! 2) Row 5, Col 1
     ! 3) Row 9, Col 7
     ! 4) Row 11, Col 7
     ! 5) Row 15, Col 13
     ! 6) Row 17, Col 13
     
     ! look at how the translational displacement gets transfered to the translational velocity and translational acceleration:
     !-------------------------------------------------------------------------------------------------
  
negative.code:       call SD_JacobianPInput( t_global, SD%Input(1), SD%p, SD%x(STATE_CURR), SD%xd(STATE_CURR), &
                SD%z(STATE_CURR), SD%OtherSt(STATE_CURR),  SD%y, SD%m, ErrStat2, ErrMsg2, &
                dYdu=y_FAST%Lin%Modules(Module_SD)%Instance(1)%D, dXdu=y_FAST%Lin%Modules(Module_SD)%Instance(1)%B )
        if(Failed()) return;
  
        call SD_JacobianPContState( t_global, SD%Input(1), SD%p, SD%x(STATE_CURR), SD%xd(STATE_CURR), &
            SD%z(STATE_CURR), SD%OtherSt(STATE_CURR), SD%y, SD%m, ErrStat2, ErrMsg2,&
            dYdx=y_FAST%Lin%Modules(Module_SD)%Instance(1)%C, dXdx=y_FAST%Lin%Modules(Module_SD)%Instance(1)%A )
        if(Failed()) return;
  
        ! get the operating point
        call SD_GetOP(t_global, SD%Input(1), SD%p, SD%x(STATE_CURR), SD%xd(STATE_CURR), SD%z(STATE_CURR),&
            SD%OtherSt(STATE_CURR), SD%y, SD%m, ErrStat2, ErrMsg2, u_op=y_FAST%Lin%Modules(Module_SD)%Instance(1)%op_u,&
            y_op=y_FAST%Lin%Modules(Module_SD)%Instance(1)%op_y, &
            x_op=y_FAST%Lin%Modules(Module_SD)%Instance(1)%op_x, dx_op=y_FAST%Lin%Modules(Module_SD)%Instance(1)%op_dx)
        if(Failed()) return;
  
        ! write the module matrices:
        if (p_FAST%LinOutMod) then
           OutFileName = trim(LinRootName)//'.'//TRIM(y_FAST%Module_Abrev(Module_SD))      
           call WrLinFile_txt_Head(t_global, p_FAST, y_FAST, y_FAST%Lin%Modules(Module_SD)%Instance(1), OutFileName, Un, ErrStat2, ErrMsg2)
           if(Failed()) return;
              
           if (p_FAST%LinOutJac) then
              ! Jacobians
  