anchor.diff:      p%C_obj%dt = p%dt
   
       CALL NWTC_Init( )  ! Initialize the NWTC Subroutine Library     
  -    !CALL MAP_InitInput_Initialize(InitInp%C_obj%object, message_from_MAP, status_from_MAP); MAP_CHECKERR() ! Call the constructor for each MAP class to create and instance of each C++ object        
  -    !CALL MAP_Other_Initialize(other%C_obj%object, message_from_MAP, status_from_MAP); MAP_CHECKERR() 
  -    
  -    InitInp%C_obj%object = MAP_InitInput_Create(message_from_MAP,status_from_MAP); MAP_CHECKERR()        ! routine in MAP dll
  -    other%C_obj%object   = MAP_OtherState_Create(message_from_MAP,status_from_MAP); MAP_CHECKERR()       ! routine in MAP dll
  +    
  +    InitInp%C_obj%object = MAP_InitInput_Create(message_from_MAP,status_from_MAP)         ! routine in MAP dll      
  +      CALL MAP_ERROR_CHECKER(message_from_MAP,status_from_MAP,ErrMsg2,ErrStat2)
  +      CALL SetErrStat(ErrStat2,ErrMsg2, ErrStat, ErrMsg, RoutineName)
  +    other%C_obj%object   = MAP_OtherState_Create(message_from_MAP,status_from_MAP)        ! routine in MAP dll
  +      CALL MAP_ERROR_CHECKER(message_from_MAP,status_from_MAP,ErrMsg2,ErrStat2)
  +      CALL SetErrStat(ErrStat2,ErrMsg2, ErrStat, ErrMsg, RoutineName)
       CALL MAP_Initialize_Base(u%C_obj, p%C_obj, x%C_obj, z%C_obj, other%C_obj, y%C_obj, InitOut%C_obj)    ! routine in MAP dll
   
  +IF (ErrStat >= AbortErrLev) RETURN    
  +    
       ! Set the environmental properties:
       !   depth           = water depth [m]
       !   gravity         = the acceleration due to gravity [N] -or- [kg*m/s^2]
  
positive.code:                    other%C_obj     , &                                                   
                     y%C_obj         , &                                                   
                     status_from_MAP , &                                                   
                     message_from_MAP  )                                                    
      MAP_CHECKERR()
  
      ! 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)
             
      
      ! 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)
    END SUBROUTINE MAP_End                                                                         !   -------+
    !==========================================================================================================
  
  
negative.code:                          y%C_obj         , &
                           status_from_MAP , &
                           message_from_MAP ) 
    
        CALL MAP_ERROR_CHECKER(message_from_MAP,status_from_MAP,ErrMsg2,ErrStat2)
        CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat,ErrMsg, RoutineName)
  
      
     IF (ALLOCATED(y%WriteOutput) .AND. ASSOCIATED(y%WrtOutput) ) y%WriteOutput = REAL( y%WrtOutput, ReKi ) 
  
     ! Copy the MAP C output types to the native Fortran mesh output types
  