anchor.diff:                     other%C_obj     , &                                                   
                      y%C_obj         , &                                                   
                      status_from_MAP , &                                                   
  -                   message_from_MAP  )                                                    
  -    MAP_CHECKERR()
  +                   message_from_MAP  )                
  +   CALL MAP_ERROR_CHECKER(message_from_MAP,status_from_MAP,ErrMsg2,ErrStat2)
  +      CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat,ErrMsg, RoutineName)
  +   
   
       ! bjj: we need to nullify Fortran pointers that were associated with C_F_POINTER in the Init routine:
       !        
  -    CALL MAP_C2Fary_CopyConstrState(z, ErrStat, ErrMsg)
  -    CALL MAP_C2Fary_CopyOutput(y, ErrStat, ErrMsg)
  -    CALL MAP_C2Fary_CopyOtherState(other, ErrStat, ErrMsg)
  -    CALL MAP_C2Fary_CopyInput(u, ErrStat, ErrMsg)
  +    CALL MAP_C2Fary_CopyConstrState(z, ErrStat2, ErrMsg2);    CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat,ErrMsg, RoutineName)
  +    CALL MAP_C2Fary_CopyOutput(y, ErrStat2, ErrMsg2);         CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat,ErrMsg, RoutineName)
  +    CALL MAP_C2Fary_CopyOtherState(other, ErrStat2, ErrMsg2); CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat,ErrMsg, RoutineName)
  +    CALL MAP_C2Fary_CopyInput(u, ErrStat2, ErrMsg2);          CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat,ErrMsg, RoutineName)
              
       
       ! Destroy Fortran MAP types
       ! Anything allocated in C should be destroyed in C. Calling these functions only destroys mesh types. 
  -    CALL MAP_DestroyInput(u, ErrStat, ErrMsg)
  -    CALL MAP_DestroyParam(p , ErrStat, ErrMsg)
  -    CALL MAP_DestroyContState(x, ErrStat, ErrMsg)
  -    CALL MAP_DestroyDiscState(xd, ErrStat, ErrMsg)
  -    CALL MAP_DestroyConstrState(z, ErrStat, ErrMsg)
  -    CALL MAP_DestroyOtherState(other, ErrStat, ErrMsg)
  -    CALL MAP_DestroyOutput(y, ErrStat, ErrMsg)
  +    CALL MAP_DestroyInput(u,          ErrStat2, ErrMsg2); CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat,ErrMsg, RoutineName)
  +    CALL MAP_DestroyParam(p ,         ErrStat2, ErrMsg2); CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat,ErrMsg, RoutineName)
  +    CALL MAP_DestroyContState(x,      ErrStat2, ErrMsg2); CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat,ErrMsg, RoutineName)
  +    CALL MAP_DestroyDiscState(xd,     ErrStat2, ErrMsg2); CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat,ErrMsg, RoutineName)
  +    CALL MAP_DestroyConstrState(z,    ErrStat2, ErrMsg2); CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat,ErrMsg, RoutineName)
  +    CALL MAP_DestroyOtherState(other, ErrStat2, ErrMsg2); CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat,ErrMsg, RoutineName)
  +    CALL MAP_DestroyOutput(y,         ErrStat2, ErrMsg2); CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat,ErrMsg, RoutineName)
     END SUBROUTINE MAP_End                                                                         !   -------+
     !==========================================================================================================
   
  
positive.code:        y%ptFairleadLoad%Force(2,i) = -y%FY(i)
         y%ptFairleadLoad%Force(3,i) = -y%FZ(i)
      END DO  
    END SUBROUTINE MAP_CalcOutput                                                                  !   -------+
    !==========================================================================================================
  
  
negative.code:   !                                                                                              !          |
    ! this is different from MAP_ERROR_CHECKER. MAP_ERROR check internal fortran errors, whereas
    ! the former checks errors in the MAP DLL.
    SUBROUTINE MAP_ERROR(ErrMsg, ErrStat, string)
      CHARACTER(1024), INTENT(INOUT) :: ErrMsg 
      INTEGER(IntKi),  INTENT(INOUT) :: ErrStat 
      CHARACTER(*),    INTENT(IN   ) :: string    
  
      IF (ErrStat.NE.ErrID_None) THEN
         ErrMsg = TRIM(ErrMsg)//string
      END IF
    END SUBROUTINE  MAP_ERROR                                                                         !   -------+
    !==========================================================================================================
  
     
  