module CKickProblemsVariables use CProblemDifinition implicit none public !constants integer :: Gas_FluidType = 0 integer :: Oil_FluidType = 1 integer :: Water_FluidType = 2 ! Input vars type :: KickProblemsType type(CProblem) :: Kick integer :: FluidType integer :: FlowRate integer :: OverBalancePressure logical :: IsAutoMigrationRateSelected real(8) :: AutoMigrationRate end type KickProblemsType type(KickProblemsType)::KickProblems ! procedure (ActionInteger), pointer :: KickPtr contains subroutine ProcessKickProblemsDueTime(time) implicit none integer :: time if(KickProblems%Kick%ProblemType == Time_ProblemType) call ProcessDueTime(KickProblems%Kick, ChangeKick, time) end subroutine subroutine ProcessKickProblemsDuePumpStrokes(strokes) implicit none integer :: strokes if(KickProblems%Kick%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(KickProblems%Kick, ChangeKick, strokes) end subroutine subroutine ProcessKickProblemsDueVolumePumped(volume) implicit none real(8) :: volume if(KickProblems%Kick%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(KickProblems%Kick, ChangeKick, volume) end subroutine subroutine ProcessKickProblemsDueDistanceDrilled(distance) implicit none real(8) :: distance if(KickProblems%Kick%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(KickProblems%Kick, ChangeKick, distance) end subroutine subroutine ChangeKick(status) implicit none integer, intent (in) :: status ! if(associated(KickProblems%KickPtr)) call KickProblems%KickPtr(status) !if(status == Clear_StatusType) print*,'On_Kick_Clear' !if(status == Executed_StatusType) print*,'On_Kick_Execute' endsubroutine ! subroutine SubscribeKick(v) ! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeKick ! !DEC$ ATTRIBUTES ALIAS: 'SubscribeKick' :: SubscribeKick ! implicit none ! procedure (ActionInteger) :: v ! KickProblems%KickPtr => v ! end subroutine end module CKickProblemsVariables