module CRotaryProblemsVariables use CProblemDifinition implicit none public ! Input vars type(CProblem) :: MotorFail type(CProblem) :: OverideTorqueLimit procedure (ActionInteger), pointer :: MotorFailPtr procedure (ActionInteger), pointer :: OverideTorqueLimitPtr contains subroutine ProcessRotaryProblemsDueTime(time) implicit none integer :: time if(MotorFail%ProblemType == Time_ProblemType) call ProcessDueTime(MotorFail, ChangeMotorFail, time) if(OverideTorqueLimit%ProblemType == Time_ProblemType) call ProcessDueTime(OverideTorqueLimit, ChangeOverideTorqueLimit, time) end subroutine subroutine ProcessRotaryProblemsDuePumpStrokes(strokes) implicit none integer :: strokes if(MotorFail%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(MotorFail, ChangeMotorFail, strokes) if(OverideTorqueLimit%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(OverideTorqueLimit, ChangeOverideTorqueLimit, strokes) end subroutine subroutine ProcessRotaryProblemsDueVolumePumped(volume) implicit none real(8) :: volume if(MotorFail%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(MotorFail, ChangeMotorFail, volume) if(OverideTorqueLimit%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(OverideTorqueLimit, ChangeOverideTorqueLimit, volume) end subroutine subroutine ProcessRotaryProblemsDueDistanceDrilled(distance) implicit none real(8) :: distance if(MotorFail%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(MotorFail, ChangeMotorFail, distance) if(OverideTorqueLimit%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(OverideTorqueLimit, ChangeOverideTorqueLimit, distance) end subroutine subroutine ChangeMotorFail(status) use RTable_VARIABLES implicit none integer, intent (in) :: status if(associated(MotorFailPtr)) call MotorFailPtr(status) if(status == Clear_StatusType) RTable%MotorFaileMalf=0 if(status == Executed_StatusType) RTable%MotorFaileMalf=1 endsubroutine subroutine ChangeOverideTorqueLimit(status) use RTable_VARIABLES implicit none integer, intent (in) :: status if(associated(OverideTorqueLimitPtr)) call OverideTorqueLimitPtr(status) if(status == Clear_StatusType) RTable%OverideTorqueLimitMalf=0 if(status == Executed_StatusType) RTable%OverideTorqueLimitMalf=1 endsubroutine subroutine SubscribeMotorFail2(v) !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeMotorFail2 !DEC$ ATTRIBUTES ALIAS: 'SubscribeMotorFail2' :: SubscribeMotorFail2 implicit none procedure (ActionInteger) :: v MotorFailPtr => v end subroutine subroutine SubscribeOverideTorqueLimit(v) !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeOverideTorqueLimit !DEC$ ATTRIBUTES ALIAS: 'SubscribeOverideTorqueLimit' :: SubscribeOverideTorqueLimit implicit none procedure (ActionInteger) :: v OverideTorqueLimitPtr => v end subroutine end module CRotaryProblemsVariables