anchor.diff:        return
      end subroutine cleanup         
   END SUBROUTINE BD_ReadDvrFile
  +
  +SUBROUTINE Dvr_InitializeOutputFile(OutUnit,IntOutput,RootName,ErrStat,ErrMsg)
  +
  +   USE BeamDyn
  +   USE BeamDyn_Types
  +   USE NWTC_Library
  +
  +   INTEGER(IntKi),                    INTENT(  OUT):: OutUnit
  +   TYPE(BD_InitOutputType),           INTENT(IN   ):: IntOutput     ! Output for initialization routine
  +   INTEGER(IntKi),                    INTENT(  OUT):: ErrStat     ! Error status of the operation
  +   CHARACTER(*),                      INTENT(  OUT):: ErrMsg      ! Error message if ErrStat /= ErrID_None
  +   CHARACTER(*),                      INTENT(IN   ):: RootName
  +
  +   integer(IntKi)                            ::  i      
  +   integer(IntKi)                            :: numOuts
  +   INTEGER(IntKi)          :: ErrStat2                     ! Temporary Error status
  +   CHARACTER(ErrMsgLen)    :: ErrMsg2                      ! Temporary Error message
  +   character(*), parameter :: RoutineName = 'Dvr_InitializeOutputFile'
  +
  +   CALL GetNewUnit(OutUnit,ErrStat2,ErrMsg2)
  +   CALL OpenFOutFile ( OutUnit, trim(RootName)//'.out', ErrStat2, ErrMsg2 )
  +      CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
  +      if (ErrStat >= AbortErrLev) return
  +
  +   write (OutUnit,'(/,A)')  'Predictions were generated on '//CurDate()//' at '//CurTime()//' using'//trim(GetNVD(IntOutput%Ver))
  +   write (OutUnit,'()' )    !print a blank line
  +   
  +   numOuts = size(IntOutput%WriteOutputHdr)
  +   !......................................................
  +   ! Write the names of the output parameters on one line:
  +   !......................................................
  +
  +   call WrFileNR ( OutUnit, '     Time           ' )
  +
  +   do i=1,NumOuts
  +      call WrFileNR ( OutUnit, tab//IntOutput%WriteOutputHdr(i) )
  +   end do ! i
  +
  +   write (OutUnit,'()')
  +
  +      !......................................................
  +      ! Write the units of the output parameters on one line:
  +      !......................................................
  +
  +   call WrFileNR ( OutUnit, '      (s)           ' )
  +
  +   do i=1,NumOuts
  +      call WrFileNR ( Outunit, tab//IntOutput%WriteOutputUnt(i) )
  +   end do ! i
  +
  +   write (OutUnit,'()')  
  +
  +
  +END SUBROUTINE Dvr_InitializeOutputFile
  
positive.code:    INTEGER(IntKi)                     :: DvrOut 
  
     CHARACTER(256)    :: DvrInputFile
  
  
     ! local variables
  
negative.code:    ! Initialize some variables:
     ErrStat = ErrID_None
     ErrMsg  = ""
     UnEc = -1
     
     CALL GetNewUnit(UnIn,ErrStat2,ErrMsg2)
        CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
  