module CDrillStemProblemsVariables use CProblemDifinition implicit none public ! Input vars type:: DrillStemProblemsType type(CProblem) :: StringDragIncrease type(CProblem) :: StringTorqueIncrease type(CProblem) :: StringTorqueFluctuation real(8) :: StringDragIncreaseTime real(8) :: StringTorqueIncreaseTime end type DrillStemProblemsType type(DrillStemProblemsType)::DrillStemProblems ! procedure (ActionInteger), pointer :: StringDragIncreasePtr ! procedure (ActionInteger), pointer :: StringTorqueIncreasePtr ! procedure (ActionInteger), pointer :: StringTorqueFluctuationPtr contains subroutine ProcessDrillStemProblemsDueTime(time) implicit none integer :: time if(DrillStemProblems%StringDragIncrease%ProblemType == Time_ProblemType) call ProcessDueTime(DrillStemProblems%StringDragIncrease, ChangeStringDragIncrease, time) if(DrillStemProblems%StringTorqueIncrease%ProblemType == Time_ProblemType) call ProcessDueTime(DrillStemProblems%StringTorqueIncrease, ChangeStringTorqueIncrease, time) if(DrillStemProblems%StringTorqueFluctuation%ProblemType == Time_ProblemType) call ProcessDueTime(DrillStemProblems%StringTorqueFluctuation, ChangeStringTorqueFluctuation, time) end subroutine subroutine ProcessDrillStemProblemsDuePumpStrokes(strokes) implicit none integer :: strokes if(DrillStemProblems%StringDragIncrease%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(DrillStemProblems%StringDragIncrease, ChangeStringDragIncrease, strokes) if(DrillStemProblems%StringTorqueIncrease%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(DrillStemProblems%StringTorqueIncrease, ChangeStringTorqueIncrease, strokes) if(DrillStemProblems%StringTorqueFluctuation%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(DrillStemProblems%StringTorqueFluctuation, ChangeStringTorqueFluctuation, strokes) end subroutine subroutine ProcessDrillStemProblemsDueVolumePumped(volume) implicit none real(8) :: volume if(DrillStemProblems%StringDragIncrease%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(DrillStemProblems%StringDragIncrease, ChangeStringDragIncrease, volume) if(DrillStemProblems%StringTorqueIncrease%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(DrillStemProblems%StringTorqueIncrease, ChangeStringTorqueIncrease, volume) if(DrillStemProblems%StringTorqueFluctuation%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(DrillStemProblems%StringTorqueFluctuation, ChangeStringTorqueFluctuation, volume) end subroutine subroutine ProcessDrillStemProblemsDueDistanceDrilled(distance) implicit none real(8) :: distance if(DrillStemProblems%StringDragIncrease%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(DrillStemProblems%StringDragIncrease, ChangeStringDragIncrease, distance) if(DrillStemProblems%StringTorqueIncrease%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(DrillStemProblems%StringTorqueIncrease, ChangeStringTorqueIncrease, distance) if(DrillStemProblems%StringTorqueFluctuation%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(DrillStemProblems%StringTorqueFluctuation, ChangeStringTorqueFluctuation, distance) end subroutine subroutine ChangeStringDragIncrease(status) implicit none integer, intent (in) :: status ! if(associated(StringDragIncreasePtr)) call StringDragIncreasePtr(status) !if(status == Clear_StatusType) print*,'On_StringDragIncrease_Clear' !if(status == Executed_StatusType) print*,'On_StringDragIncrease_Execute' endsubroutine subroutine ChangeStringTorqueIncrease(status) implicit none integer, intent (in) :: status ! if(associated(StringTorqueIncreasePtr)) call StringTorqueIncreasePtr(status) !if(status == Clear_StatusType) print*,'On_StringTorqueIncrease_Clear' !if(status == Executed_StatusType) print*,'On_StringTorqueIncrease_Execute' endsubroutine subroutine ChangeStringTorqueFluctuation(status) implicit none integer, intent (in) :: status ! if(associated(StringTorqueFluctuationPtr)) call StringTorqueFluctuationPtr(status) !if(status == Clear_StatusType) print*,'On_StringTorqueFluctuation_Clear' !if(status == Executed_StatusType) print*,'On_StringTorqueFluctuation_Execute' endsubroutine ! subroutine SubscribeStringDragIncrease(v) ! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeStringDragIncrease ! !DEC$ ATTRIBUTES ALIAS: 'SubscribeStringDragIncrease' :: SubscribeStringDragIncrease ! implicit none ! procedure (ActionInteger) :: v ! StringDragIncreasePtr => v ! end subroutine ! subroutine SubscribeStringTorqueIncrease(v) ! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeStringTorqueIncrease ! !DEC$ ATTRIBUTES ALIAS: 'SubscribeStringTorqueIncrease' :: SubscribeStringTorqueIncrease ! implicit none ! procedure (ActionInteger) :: v ! StringTorqueIncreasePtr => v ! end subroutine ! subroutine SubscribeStringTorqueFluctuation(v) ! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeStringTorqueFluctuation ! !DEC$ ATTRIBUTES ALIAS: 'SubscribeStringTorqueFluctuation' :: SubscribeStringTorqueFluctuation ! implicit none ! procedure (ActionInteger) :: v ! StringTorqueFluctuationPtr => v ! end subroutine end module CDrillStemProblemsVariables