anchor.diff:     INTEGER         :: I, iOffset, iNode  ! generic counter variable
      INTEGER         :: nodeIndx
      
  -   CALL MeshCreate( BlankMesh        = inputMesh                           &
  -                  ,IOS               = COMPONENT_INPUT                     &
  -                  ,Nnodes            = size(INodes_I) + size(INodes_L) + size(INodes_C)      &
  -                  ,ErrStat           = ErrStat                             &
  -                  ,ErrMess           = ErrMsg                              &
  -                  ,Force             = .TRUE.                              &
  -                  ,Moment            = .TRUE.                              )
  -   ! --- Interface nodes
  -   iOffset = 0
  -   DO I = 1,size(INodes_I)
  -      Point = Nodes(INodes_I(I), 2:4)
  -      CALL MeshPositionNode(inputMesh, I+iOffSet, Point, ErrStat, ErrMsg); IF(ErrStat/=ErrID_None) RETURN
  -      CALL MeshConstructElement(inputMesh, ELEMENT_POINT, ErrStat, ErrMsg, I+iOffset)
  -   ENDDO
  -   ! --- Interior nodes
  -   iOffset = size(INodes_I)
  -   DO I = 1,size(INodes_L)
  -      Point = Nodes(INodes_L(I), 2:4)
  -      CALL MeshPositionNode(inputMesh, I+iOffSet, Point, ErrStat, ErrMsg); IF(ErrStat/=ErrID_None) RETURN
  -      CALL MeshConstructElement(inputMesh, ELEMENT_POINT, ErrStat, ErrMsg, I+iOffset)
  -   END DO
  -   ! --- Base Reaction nodes 
  -   iOffset = size(INodes_I) + size(INodes_L)
  -   DO I = 1,size(INodes_C)
  -      Point = Nodes(INodes_C(I), 2:4)
  -      CALL MeshPositionNode(inputMesh, I+iOffSet, Point, ErrStat, ErrMsg); IF(ErrStat/=ErrID_None) RETURN
  -      CALL MeshConstructElement(inputMesh, ELEMENT_POINT, ErrStat, ErrMsg, I+iOffset)
  -   END DO
  +   CALL MeshCreate( BlankMesh        = inputMesh         &
  +                  ,IOS               = COMPONENT_INPUT   &
  +                  ,Nnodes            = size(Nodes,1)     &
  +                  ,ErrStat           = ErrStat           &
  +                  ,ErrMess           = ErrMsg            &
  +                  ,Force             = .TRUE.            &
  +                  ,Moment            = .TRUE.            )
  +
  +   if (NO_Y2_MAP) then
  +      DO I = 1,size(Nodes,1)
  +         Point = Nodes(I, 2:4)
  +         CALL MeshPositionNode(inputMesh, I, Point, ErrStat, ErrMsg); IF(ErrStat/=ErrID_None) RETURN
  +         CALL MeshConstructElement(inputMesh, ELEMENT_POINT, ErrStat, ErrMsg, I)
  +      ENDDO 
  +   else
  +     ! --- Interface nodes
  +     iOffset = 0
  +     DO I = 1,size(INodes_I)
  +        Point = Nodes(INodes_I(I), 2:4)
  +        CALL MeshPositionNode(inputMesh, I+iOffSet, Point, ErrStat, ErrMsg); IF(ErrStat/=ErrID_None) RETURN
  +        CALL MeshConstructElement(inputMesh, ELEMENT_POINT, ErrStat, ErrMsg, I+iOffset)
  +     ENDDO
  +     ! --- Interior nodes
  +     iOffset = size(INodes_I)
  +     DO I = 1,size(INodes_L)
  +        Point = Nodes(INodes_L(I), 2:4)
  +        CALL MeshPositionNode(inputMesh, I+iOffSet, Point, ErrStat, ErrMsg); IF(ErrStat/=ErrID_None) RETURN
  +        CALL MeshConstructElement(inputMesh, ELEMENT_POINT, ErrStat, ErrMsg, I+iOffset)
  +     END DO
  +     ! --- Base Reaction nodes 
  +     iOffset = size(INodes_I) + size(INodes_L)
  +     DO I = 1,size(INodes_C)
  +        Point = Nodes(INodes_C(I), 2:4)
  +        CALL MeshPositionNode(inputMesh, I+iOffSet, Point, ErrStat, ErrMsg); IF(ErrStat/=ErrID_None) RETURN
  +        CALL MeshConstructElement(inputMesh, ELEMENT_POINT, ErrStat, ErrMsg, I+iOffset)
  +     END DO
  +   endif
      CALL MeshCommit ( inputMesh, ErrStat, ErrMsg); IF(ErrStat/=ErrID_None) RETURN
            
      ! Create the Interior Points output mesh as a sibling copy of the input mesh
  
positive.code:    ! interpolate u to find u_interp = u(t) = u_n     
     CALL SD_Input_ExtrapInterp( u, utimes, u_interp, t, ErrStat2, ErrMsg2 ); CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,'SD_AM2')
     m%udotdot_TP = (/u_interp%TPMesh%TranslationAcc(:,1), u_interp%TPMesh%RotationAcc(:,1)/)
     CALL ConstructUFL( u_interp, p, m, m%UFL )     
                  
     ! extrapolate u to find u_interp = u(t + dt)=u_n+1
     CALL SD_Input_ExtrapInterp(u, utimes, u_interp, t+p%SDDeltaT, ErrStat2, ErrMsg2); CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,'SD_AM2')
     udotdot_TP2 = (/u_interp%TPMesh%TranslationAcc(:,1), u_interp%TPMesh%RotationAcc(:,1)/)
     CALL ConstructUFL( u_interp, p, m, UFL2 )     
     
     ! calculate (u_n + u_n+1)/2
     udotdot_TP2 = 0.5_ReKi * ( udotdot_TP2 + m%udotdot_TP )
  
negative.code:    INTEGER(IntKi) :: i
     INTEGER(IntKi) :: SDnode
     INTEGER(IntKi) :: y2Node
     if (NO_Y2_MAP) then
        DO I = 1,SIZE(SDtoMesh)
           SDtoMesh( I ) = I
        END DO
     else
        y2Node = 0
        ! Interface nodes (IDI)
        DO I = 1,SIZE(p%Nodes_I,1)
           y2Node = y2Node + 1      
           SDnode = p%Nodes_I(I,1)
           SDtoMesh( SDnode ) = y2Node ! TODO add safety check
        END DO
        ! Interior nodes (IDL)
        DO I = 1,SIZE(p%Nodes_L,1)
           y2Node = y2Node + 1      
           SDnode = p%Nodes_L(I,1)
           SDtoMesh( SDnode ) = y2Node ! TODO add safety check
        END DO
        ! Base Reaction nodes (IDC)
        DO I = 1,SIZE(p%Nodes_C,1) 
           y2Node = y2Node + 1      
           SDnode = p%Nodes_C(I,1)
           SDtoMesh( SDnode ) = y2Node ! TODO add safety check
        END DO
     endif
  END SUBROUTINE SD_Y2Mesh_Mapping
  !>
  SUBROUTINE Y2Mesh_SD_Mapping(p, MeshtoSD)
     TYPE(SD_ParameterType), INTENT(IN   )  :: p           !< Parameters
     INTEGER(IntKi),         INTENT(  OUT)  :: MeshtoSD(:) !< index/mapping of mesh nodes with SD mesh
     INTEGER(IntKi) :: I
     if (NO_Y2_MAP) then
        DO I = 1,SIZE(MeshtoSD)
           MeshtoSD( I ) = I
        END DO
     else
        MeshtoSD(                      1:p%nNodes_I)                       = p%Nodes_I(:,1)
        MeshtoSD(p%nNodes_I+           1:p%nNodes_I+p%nNodes_L)            = p%Nodes_L(:,1)
        MeshtoSD(p%nNodes_I+p%nNodes_L+1:p%nNodes_I+p%nNodes_L+p%nNodes_C) = p%Nodes_C(:,1)
     endif
  END SUBROUTINE Y2Mesh_SD_Mapping
  
  !------------------------------------------------------------------------------------------------------
  