subroutine TopDrive_MainSolver !use CDataDisplayConsoleVariables !use CDrillingConsoleVariables ! use CSimulationVariables use TopDrive_VARIABLES use CDrillWatchVariables use CWarningsVariables use CSounds use CTopDrivePanelVariables IMPLICIT NONE !if ( (TopDriveTdsPowerState==-1) .and. (RpmKnob==0.) ) then !FWD if ( TopDrivePanel%TopDriveTdsPowerState==-1 ) then !.and. (IsStopped == .false.) TDS%SoundBlower = .true. !Call SetSoundBlowerRT(TDS%SoundBlower) TopDrivePanel%TopDriveTdsPowerLed = 1 !IF ( RTTransmissionLever /=0 .and. RotaryGearsAbuse==0 ) THEN !be in clutch mode ???? TDS%N_new = (TopDrivePanel%RpmKnob/250.d0)*965.d0 ! 0 Top Drive Malfunction ----> Drive Motor Failure call TopDrive_Malfunction_MotorFailure if (((TDS%N_new-TDS%N_old)/TDS%time_step)>193.) then TDS%N_ref = (193.*TDS%time_step)+TDS%N_old else if (((TDS%N_old-TDS%N_new)/TDS%time_step)>193.) then TDS%N_ref = (-193.*TDS%time_step)+TDS%N_old else TDS%N_ref = TDS%N_new end if CALL TopDrive_INPUTS CALL TopDrive_Solver TDS%N_old = TDS%N_ref !else if ( (TopDriveTdsPowerState==1) .and. (RpmKnob==0.) ) then !REV else if ( (TopDrivePanel%TopDriveTdsPowerState==1) ) then !REV .and. (IsStopped == .false.) TDS%SoundBlower = .true. !Call SetSoundBlowerRT(TDS%SoundBlower) TopDrivePanel%TopDriveTdsPowerLed = 1 TDS%N_new = (TopDrivePanel%RpmKnob/250.d0)*965.d0 !===> Top Drive Malfunction ----> Drive Motor Failure call TopDrive_Malfunction_MotorFailure if (((TDS%N_new-TDS%N_old)/TDS%time_step)>193.) then TDS%N_ref = (193.*TDS%time_step)+TDS%N_old else if (((TDS%N_old-TDS%N_new)/TDS%time_step)>193.) then TDS%N_ref = (-193.*TDS%time_step)+TDS%N_old else TDS%N_ref = TDS%N_new end if CALL TopDrive_INPUTS CALL TopDrive_Solver TDS%N_old = TDS%N_ref else if( (TopDrivePanel%TopDriveTdsPowerState /= 0) ) then !.and. (IsStopped == .false.) TDS%SoundBlower = .true. !Call SetSoundBlowerRT(TDS%SoundBlower) TopDrivePanel%TopDriveTdsPowerLed = 1 else TDS%SoundBlower = .false. !Call SetSoundBlowerRT(TDS%SoundBlower) TopDrivePanel%TopDriveTdsPowerLed = 0 end if Call TopDrive_OffMode end if end subroutine TopDrive_MainSolver