|
- subroutine TD_StringConnectionModes
-
- Use CHoistingVariables
- Use CDrillingConsoleVariables
- use UnitySignalVariables
- ! Use CKellyConnectionEnumVariables
- ! Use CElevatorConnectionEnumVariables
- ! Use CSlipsEnumVariables
- ! Use COperationConditionEnumVariables
- use SoftwareInputsVariables
- ! Use CZeroStringSpeed
- ! Use CTdsConnectionModesEnumVariables
- ! Use CTdsElevatorModesEnumVariables
- Use COperationScenariosVariables
- Use TD_DrillStemComponents
- Use TD_WellElements
- Use TD_WellGeometry
- Use TD_GeneralData
- Use TD_StringConnectionData
- Use Drawworks_VARIABLES!, only: Drawworks
-
-
-
- implicit none
- integer :: i , kk
- Real(8) :: LengthSum
-
-
-
-
-
-
-
- !!=====> Read Data
- !kk = 0
- !LengthSum = 0.d0
- !
- !Do i = TD_String%DrillStemComponentsNumbs , 1 , -1
- ! if (TD_DrillStems(i)%ComponentType==3) then
- ! kk = i
- ! exit
- ! else if (TD_DrillStems(i)%ComponentType==5 .or. TD_DrillStems(i)%ComponentType==7) then
- ! LengthSum = LengthSum+TD_DrillStems(i)%LengthIni
- ! end if
- !End Do
-
-
-
-
-
-
-
- !####C_Program -----> Hoisting%DriveType =
- ! = 0 TopDrive_DriveType
- ! = 1 Kelly_DriveType
-
- !####C_Program -----> TD_StConn%KellyDriveTypeMode =
- ! = 0 Drill Mode (Kelly)
- ! = 1 Trip Mode (Elevator)
- ! = 2 TopDrive Mode
-
- if ( Hoisting%DriveType==1 .and. Get_OperationCondition()==OPERATION_DRILL ) then
- TD_StConn%KellyDriveTypeMode = 0
- else if ( Hoisting%DriveType==1 .and. Get_OperationCondition()==OPERATION_TRIP ) then
- TD_StConn%KellyDriveTypeMode = 1
- else if ( Hoisting%DriveType==0 ) then
- TD_StConn%KellyDriveTypeMode = 2
- end if
-
- TD_StConn%HookHeight = Drawworks%TDHookHeight ! unit: [ft]
- TD_StConn%ElevatorConst = 17.985d0 ! [ft] Elevator Length(14.84) ????????????????? adad ha daghigh shavand
- TD_StConn%ElevatorECG = OperationScenario%ECG ! [ft]
- TD_StConn%KellyConst = 63.280d0 ! [ft] Kelly Length(61.74) + Safety Valve Length(1.54)
- TD_StConn%KellyElementConst = 41.840d0 ! [ft] Kelly Element Length(40.3) + Safety Valve Length(1.54)
- TD_StConn%TDSLength = 24.08d0 !??????????????????? ! [ft]
- TD_StConn%TDSToolJointLength = 0.77d0 !??????????????????? ! [ft]
- TD_StConn%TDSElevatorLength = 26.837d0 !?????? ! TDS with Elevator Length [ft]
- TD_StConn%TDSElevatorToolLength= 0.859d0 !??????????????????? ! [ft]
- TD_StConn%TDSElevatorECG = 2.454d0 ! [ft]
- TD_Load%NumOfCables = Hoisting%NumberOfLine
- TD_Load%WeightTB = Hoisting%TravelingBlockWeight ! [lb]
- TD_Load%WeightTD = Hoisting%TopDriveWeight ! [lb]
- TD_Load%KellyWeight = Hoisting%KellyWeight ! [lb]
-
-
-
-
-
-
-
-
- !=====> Velocity Calculation
- TD_StConn%HookVelocity = (TD_StConn%HookHeight-TD_StConn%HookHeightOld)/TD_General%TimeStep ! [ft/s]
-
-
-
-
-
-
-
-
-
- !====================================================
- ! Add or Remove DrillStem Components
- !====================================================
- Call TD_AddComponents
-
- Call TD_RemoveComponents
-
-
- !=====> Read Data
- kk = 0
- LengthSum = 0.d0
-
- Do i = TD_String%DrillStemComponentsNumbs , 1 , -1
- if (TD_DrillStems(i)%ComponentType==3) then
- kk = i
- exit
- else if (TD_DrillStems(i)%ComponentType==5 .or. TD_DrillStems(i)%ComponentType==7) then
- LengthSum = LengthSum+TD_DrillStems(i)%LengthIni
- end if
- End Do
- !print*, 'kk' , kk
- !print*, 'TD_DrillStems(kk)%LengthIni0=' , TD_DrillStems(kk)%LengthIni
-
-
-
-
- !====================================================
- ! String Connection Mode Determination
- !====================================================
-
- !####TD_StConn%StringConnectionMode =
- ! = 0 Slips Set ???????
- ! = 1 Kelly Connected to String
- ! = 2 Kelly Nothing Connected
- ! = 3 Kelly Connected to Single
- ! = 4 Elevator Connected to String
- ! = 5 Elevator Nothing Connected
- ! = 6 Elevator Connected to Stand
- ! = 7 Elevator Connected to Single
- ! = 8 Elevator Latch String
- ! = 18 Elevator Latch Single
- ! = 19 Elevator Latch Stand
- ! = 9 TDS CONNECTION SPINE
- ! = 10 TDS CONNECTION STRING
- ! = 11 TDS CONNECTION NOTHING .and. TDS ELEVATOR LATCH STRING
- ! = 12 TDS CONNECTION NOTHING .and. TDS ELEVATOR CONNECTION STRING
- ! = 13 TDS CONNECTION NOTHING .and. TDS ELEVATOR CONNECTION NOTHING
- ! = 14 TDS CONNECTION NOTHING .and. TDS ELEVATOR CONNECTION STAND
- ! = 15 TDS CONNECTION NOTHING .and. TDS ELEVATOR CONNECTION SINGLE
- ! = 16 TDS CONNECTION NOTHING .and. TDS ELEVATOR LATCH SINGLE
- ! = 17 TDS CONNECTION NOTHING .and. TDS ELEVATOR LATCH STAND
-
-
-
-
-
- !if (TD_String%DlTouch<=0.) then ![ft]
- ! if(TD_StConn%HookVelocity<=0.) then
- ! TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- ! TD_StConn%StringVelocity = 0.0d0
- ! return
- ! end if
- !end if
-
-
-
- !=====> Connection Height Determination
-
- if ( TD_StConn%KellyDriveTypeMode==0 ) then
-
- if(Get_KellyConnection() == KELLY_CONNECTION_STRING) then
- TD_Count%KellyNewStatus(1) = 1
- else
- TD_Count%KellyNewStatus(1) = 0
- !TD_Count%KellyOldStatus(1) = 0
- end if
-
- if(Get_KellyConnection()==KELLY_CONNECTION_NOTHING) then
- TD_Count%KellyNewStatus(2) = 1
- else
- TD_Count%KellyNewStatus(2) = 0
- !TD_Count%KellyOldStatus(2) = 0
- end if
-
- if(Get_KellyConnection()==KELLY_CONNECTION_SINGLE) then
- TD_Count%KellyNewStatus(3) = 1
- else
- TD_Count%KellyNewStatus(3) = 0
- !TD_Count%KellyOldStatus(3) = 0
- end if
-
-
- if ( Get_KellyConnection() == KELLY_CONNECTION_STRING ) then
- TD_StConn%StringConnectionMode = 1
- !print*, 'TD_StConn%ConnectionHeight10=' , TD_StConn%ConnectionHeight
- !print*, 'TD_StConn%KellyElementConst1=' , TD_StConn%KellyElementConst
- !print*, 'TD_DrillStems(kk)%LengthIni1=' , TD_DrillStems(kk)%LengthIni
- if (TD_Count%KellyOldStatus(2)==1 .and. TD_Count%KellyNewStatus(1)/=TD_Count%KellyOldStatus(1)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight+TD_StConn%KellyElementConst
- TD_Count%KellyOldStatus(1) = TD_Count%KellyNewStatus(1)
- TD_Count%KellyOldStatus(2) = 0
- else if (TD_Count%KellyOldStatus(3)==1 .and. TD_Count%KellyNewStatus(1)/=TD_Count%KellyOldStatus(1)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight+TD_StConn%KellyElementConst+30.d0 !TD_DrillStems(kk)%LengthIni
- TD_Count%KellyOldStatus(1) = TD_Count%KellyNewStatus(1)
- TD_Count%KellyOldStatus(3) = 0
- end if
- !print*, 'TD_StConn%ConnectionHeight1=' , TD_StConn%ConnectionHeight
- if ( Get_Slips() == SLIPS_SET_END ) then
- !!if ( TD_StConn%HookVelocity>0. ) then
- !! Print*, '*** UnSet Slips ***' !?????????
- !!end if
- TD_StConn%KellyConnectionHeight = TD_StConn%HookHeight-(TD_StConn%KellyConst-TD_StConn%KellyElementConst) !?????????
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
- else
- !if (TD_String%DlTouch<=0. .and. TD_StConn%HookVelocity<=0.) then
- ! TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- ! TD_StConn%StringVelocity = 0.0d0
- !else
- TD_StConn%KellyConnectionHeight = TD_StConn%HookHeight-(TD_StConn%KellyConst-TD_StConn%KellyElementConst) !??????????
- TD_StConn%ConnectionHeight = TD_StConn%KellyConnectionHeight
- TD_StConn%StringVelocity = TD_StConn%HookVelocity
- !end if
- end if
-
- else if ( Get_KellyConnection() == KELLY_CONNECTION_NOTHING ) then
- TD_StConn%StringConnectionMode = 2
- !print*, 'TD_StConn%ConnectionHeight20=' , TD_StConn%ConnectionHeight
- !print*, 'TD_StConn%KellyElementConst2=' , TD_StConn%KellyElementConst
- if (TD_Count%KellyOldStatus(1)==1 .and. TD_Count%KellyNewStatus(2)/=TD_Count%KellyOldStatus(2)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight-TD_StConn%KellyElementConst
- TD_Count%KellyOldStatus(2) = TD_Count%KellyNewStatus(2)
- TD_Count%KellyOldStatus(1) = 0
- else if (TD_Count%KellyOldStatus(3)==1 .and. TD_Count%KellyNewStatus(2)/=TD_Count%KellyOldStatus(2)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(2) = TD_Count%KellyNewStatus(2)
- TD_Count%KellyOldStatus(3) = 0
- else if (TD_Count%KellyOldStatus(5)==1 .and. TD_Count%KellyNewStatus(2)/=TD_Count%KellyOldStatus(2)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(2) = TD_Count%KellyNewStatus(2)
- TD_Count%KellyOldStatus(5) = 0
- end if
- !print*, 'TD_StConn%ConnectionHeight2=' , TD_StConn%ConnectionHeight
- TD_StConn%KellyConnectionHeight = TD_StConn%HookHeight-TD_StConn%KellyConst
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
-
- else if ( Get_KellyConnection() == KELLY_CONNECTION_SINGLE ) then
- !print*, 'KELLY_CONNECTION_SINGLE' , TD_StConn%ConnectionHeight
- TD_StConn%StringConnectionMode = 3
- !print*, 'TD_StConn%ConnectionHeight30=' , TD_StConn%ConnectionHeight
- !print*, 'TD_StConn%KellyElementConst3=' , TD_StConn%KellyElementConst
- !print*, 'TD_DrillStems(kk)%LengthIni3=' , TD_DrillStems(kk)%LengthIni
- if (TD_Count%KellyOldStatus(1)==1 .and. TD_Count%KellyNewStatus(3)/=TD_Count%KellyOldStatus(3)) then
- !print*, 'KELLY_CONNECTION_SINGLE1' , TD_StConn%ConnectionHeight
- !print*, 'TD_StConn%KellyElementConst=' , TD_StConn%KellyElementConst
- !print*, 'TD_DrillStems(kk)%LengthIni=' , TD_DrillStems(kk)%LengthIni
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight-TD_StConn%KellyElementConst-30.d0 !TD_DrillStems(kk)%LengthIni
- TD_Count%KellyOldStatus(3) = TD_Count%KellyNewStatus(3)
- TD_Count%KellyOldStatus(1) = 0
- else if (TD_Count%KellyOldStatus(2)==1 .and. TD_Count%KellyNewStatus(3)/=TD_Count%KellyOldStatus(3)) then
- !print*, 'KELLY_CONNECTION_SINGLE2' , TD_StConn%ConnectionHeight
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(3) = TD_Count%KellyNewStatus(3)
- TD_Count%KellyOldStatus(2) = 0
- end if
- !print*, 'TD_StConn%ConnectionHeight3=' , TD_StConn%ConnectionHeight
- !print*, 'KELLY_CONNECTION_SINGLE3' , TD_StConn%ConnectionHeight
- TD_StConn%KellyConnectionHeight = TD_StConn%HookHeight-TD_StConn%KellyConst-TD_DrillStems(kk)%LengthIni
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
- !print*, 'KELLY_CONNECTION_SINGLE4' , TD_StConn%ConnectionHeight
- end if
- !print*, 'KELLY_CONNECTION_SINGLE5' , TD_StConn%ConnectionHeight
-
- else if ( TD_StConn%KellyDriveTypeMode==1 ) then
-
- if(Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING) then
- TD_Count%KellyNewStatus(4) = 1
- else
- TD_Count%KellyNewStatus(4) = 0
- !TD_Count%KellyOldStatus(4) = 0
- end if
-
- if(Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING) then
- TD_Count%KellyNewStatus(5) = 1
- else
- TD_Count%KellyNewStatus(5) = 0
- !TD_Count%KellyOldStatus(5) = 0
- end if
-
- if(Get_ElevatorConnection() == ELEVATOR_CONNECTION_STAND) then
- TD_Count%KellyNewStatus(6) = 1
- else
- TD_Count%KellyNewStatus(6) = 0
- !TD_Count%KellyOldStatus(6) = 0
- end if
-
- if(Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE) then
- TD_Count%KellyNewStatus(7) = 1
- else
- TD_Count%KellyNewStatus(7) = 0
- !TD_Count%KellyOldStatus(7) = 0
- end if
-
- if(Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) then
- TD_Count%KellyNewStatus(8) = 1
- else
- TD_Count%KellyNewStatus(8) = 0
- !TD_Count%KellyOldStatus(8) = 0
- end if
-
- if(Get_ElevatorConnection() == ELEVATOR_LATCH_SINGLE) then
- TD_Count%KellyNewStatus(18) = 1
- else
- TD_Count%KellyNewStatus(18) = 0
- !TD_Count%KellyOldStatus(18) = 0
- end if
-
- if(Get_ElevatorConnection() == ELEVATOR_LATCH_STAND) then
- TD_Count%KellyNewStatus(19) = 1
- else
- TD_Count%KellyNewStatus(19) = 0
- !TD_Count%KellyOldStatus(19) = 0
- end if
-
-
- if ( Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING ) then
- TD_StConn%StringConnectionMode = 4
- if (TD_Count%KellyOldStatus(5)==1 .and. TD_Count%KellyNewStatus(4)/=TD_Count%KellyOldStatus(4)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(4) = TD_Count%KellyNewStatus(4)
- TD_Count%KellyOldStatus(5) = 0
- else if (TD_Count%KellyOldStatus(6)==1 .and. TD_Count%KellyNewStatus(4)/=TD_Count%KellyOldStatus(4)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight+(3.d0*TD_DrillStems(kk)%LengthIni)
- TD_Count%KellyOldStatus(4) = TD_Count%KellyNewStatus(4)
- TD_Count%KellyOldStatus(6) = 0
- else if (TD_Count%KellyOldStatus(7)==1 .and. TD_Count%KellyNewStatus(4)/=TD_Count%KellyOldStatus(4)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight+TD_DrillStems(kk)%LengthIni
- TD_Count%KellyOldStatus(4) = TD_Count%KellyNewStatus(4)
- TD_Count%KellyOldStatus(7) = 0
- else if (TD_Count%KellyOldStatus(8)==1 .and. TD_Count%KellyNewStatus(4)/=TD_Count%KellyOldStatus(4)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(4) = TD_Count%KellyNewStatus(4)
- TD_Count%KellyOldStatus(8) = 0
- end if
- if ( Get_Slips() == SLIPS_SET_END ) then
- !if ( TD_StConn%HookVelocity>0. ) then
- ! Print*, '*** UnSet Slips ***' !???????????????????
- !end if
- TD_StConn%ElevatorHeight = TD_StConn%HookHeight-TD_StConn%ElevatorConst !?????????????
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
- else
- TD_StConn%ElevatorHeight = TD_StConn%HookHeight-TD_StConn%ElevatorConst
- TD_StConn%ConnectionHeight = TD_StConn%HookHeight-TD_StConn%ElevatorConst+(LengthSum+TD_StConn%ElevatorECG) !(LengthSum+TD_DrillStems(kk)%ToolJointRange)
- TD_StConn%StringVelocity = TD_StConn%HookVelocity
- end if
-
- else if ( Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING ) then
- TD_StConn%StringConnectionMode = 5
- if (TD_Count%KellyOldStatus(4)==1 .and. TD_Count%KellyNewStatus(5)/=TD_Count%KellyOldStatus(5)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(5) = TD_Count%KellyNewStatus(5)
- TD_Count%KellyOldStatus(4) = 0
- else if (TD_Count%KellyOldStatus(6)==1 .and. TD_Count%KellyNewStatus(5)/=TD_Count%KellyOldStatus(5)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(5) = TD_Count%KellyNewStatus(5)
- TD_Count%KellyOldStatus(6) = 0
- else if (TD_Count%KellyOldStatus(7)==1 .and. TD_Count%KellyNewStatus(5)/=TD_Count%KellyOldStatus(5)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(5) = TD_Count%KellyNewStatus(5)
- TD_Count%KellyOldStatus(7) = 0
- else if (TD_Count%KellyOldStatus(8)==1 .and. TD_Count%KellyNewStatus(5)/=TD_Count%KellyOldStatus(5)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(5) = TD_Count%KellyNewStatus(5)
- TD_Count%KellyOldStatus(8) = 0
- else if (TD_Count%KellyOldStatus(2)==1 .and. TD_Count%KellyNewStatus(5)/=TD_Count%KellyOldStatus(5)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(5) = TD_Count%KellyNewStatus(5)
- TD_Count%KellyOldStatus(2) = 0
- end if
- TD_StConn%ElevatorHeight = TD_StConn%HookHeight-TD_StConn%ElevatorConst
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
-
- else if ( Get_ElevatorConnection() == ELEVATOR_CONNECTION_STAND ) then
- TD_StConn%StringConnectionMode = 6
- if (TD_Count%KellyOldStatus(4)==1 .and. TD_Count%KellyNewStatus(6)/=TD_Count%KellyOldStatus(6)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight-(3.*TD_DrillStems(kk)%LengthIni)
- TD_Count%KellyOldStatus(6) = TD_Count%KellyNewStatus(6)
- TD_Count%KellyOldStatus(4) = 0
- else if (TD_Count%KellyOldStatus(5)==1 .and. TD_Count%KellyNewStatus(6)/=TD_Count%KellyOldStatus(6)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(6) = TD_Count%KellyNewStatus(6)
- TD_Count%KellyOldStatus(5) = 0
- else if (TD_Count%KellyOldStatus(7)==1 .and. TD_Count%KellyNewStatus(6)/=TD_Count%KellyOldStatus(6)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(6) = TD_Count%KellyNewStatus(6)
- TD_Count%KellyOldStatus(7) = 0
- else if (TD_Count%KellyOldStatus(8)==1 .and. TD_Count%KellyNewStatus(6)/=TD_Count%KellyOldStatus(6)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(6) = TD_Count%KellyNewStatus(6)
- TD_Count%KellyOldStatus(8) = 0
- end if
- TD_StConn%ElevatorHeight = TD_StConn%HookHeight-TD_StConn%ElevatorConst-(3.*TD_DrillStems(kk)%LengthIni)
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
-
- else if ( Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE ) then
- TD_StConn%StringConnectionMode = 7
- if (TD_Count%KellyOldStatus(4)==1 .and. TD_Count%KellyNewStatus(7)/=TD_Count%KellyOldStatus(7)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight-TD_DrillStems(kk)%LengthIni
- TD_Count%KellyOldStatus(7) = TD_Count%KellyNewStatus(7)
- TD_Count%KellyOldStatus(4) = 0
- else if (TD_Count%KellyOldStatus(5)==1 .and. TD_Count%KellyNewStatus(7)/=TD_Count%KellyOldStatus(7)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(7) = TD_Count%KellyNewStatus(7)
- TD_Count%KellyOldStatus(5) = 0
- else if (TD_Count%KellyOldStatus(6)==1 .and. TD_Count%KellyNewStatus(7)/=TD_Count%KellyOldStatus(7)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(7) = TD_Count%KellyNewStatus(7)
- TD_Count%KellyOldStatus(6) = 0
- else if (TD_Count%KellyOldStatus(8)==1 .and. TD_Count%KellyNewStatus(7)/=TD_Count%KellyOldStatus(7)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(7) = TD_Count%KellyNewStatus(7)
- TD_Count%KellyOldStatus(8) = 0
- end if
- TD_StConn%ElevatorHeight = TD_StConn%HookHeight-TD_StConn%ElevatorConst-TD_DrillStems(kk)%LengthIni
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
-
- else if ( Get_ElevatorConnection() == ELEVATOR_LATCH_STRING ) then
- TD_StConn%StringConnectionMode = 8
- if (TD_Count%KellyOldStatus(4)==1 .and. TD_Count%KellyNewStatus(8)/=TD_Count%KellyOldStatus(8)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(8) = TD_Count%KellyNewStatus(8)
- TD_Count%KellyOldStatus(4) = 0
- else if (TD_Count%KellyOldStatus(5)==1 .and. TD_Count%KellyNewStatus(8)/=TD_Count%KellyOldStatus(8)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(8) = TD_Count%KellyNewStatus(8)
- TD_Count%KellyOldStatus(5) = 0
- else if (TD_Count%KellyOldStatus(6)==1 .and. TD_Count%KellyNewStatus(8)/=TD_Count%KellyOldStatus(8)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(8) = TD_Count%KellyNewStatus(8)
- TD_Count%KellyOldStatus(6) = 0
- else if (TD_Count%KellyOldStatus(7)==1 .and. TD_Count%KellyNewStatus(8)/=TD_Count%KellyOldStatus(8)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(8) = TD_Count%KellyNewStatus(8)
- TD_Count%KellyOldStatus(7) = 0
- end if
- TD_StConn%ElevatorHeight = TD_StConn%HookHeight-TD_StConn%ElevatorConst
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
-
- else if ( Get_ElevatorConnection() == ELEVATOR_LATCH_SINGLE ) then
- TD_StConn%StringConnectionMode = 18
- if (TD_Count%KellyOldStatus(5)==1 .and. TD_Count%KellyNewStatus(18)/=TD_Count%KellyOldStatus(18)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(18) = TD_Count%KellyNewStatus(18)
- TD_Count%KellyOldStatus(5) = 0
- else if (TD_Count%KellyOldStatus(7)==1 .and. TD_Count%KellyNewStatus(18)/=TD_Count%KellyOldStatus(18)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(18) = TD_Count%KellyNewStatus(18)
- TD_Count%KellyOldStatus(7) = 0
- else if (TD_Count%KellyOldStatus(8)==1 .and. TD_Count%KellyNewStatus(18)/=TD_Count%KellyOldStatus(18)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(18) = TD_Count%KellyNewStatus(18)
- TD_Count%KellyOldStatus(8) = 0
- end if
- TD_StConn%ElevatorHeight = TD_StConn%HookHeight-TD_StConn%ElevatorConst
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
-
- else if ( Get_ElevatorConnection() == ELEVATOR_LATCH_STAND ) then
- TD_StConn%StringConnectionMode = 19
- if (TD_Count%KellyOldStatus(5)==1 .and. TD_Count%KellyNewStatus(19)/=TD_Count%KellyOldStatus(19)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(19) = TD_Count%KellyNewStatus(19)
- TD_Count%KellyOldStatus(5) = 0
- else if (TD_Count%KellyOldStatus(6)==1 .and. TD_Count%KellyNewStatus(19)/=TD_Count%KellyOldStatus(19)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(19) = TD_Count%KellyNewStatus(19)
- TD_Count%KellyOldStatus(6) = 0
- else if (TD_Count%KellyOldStatus(8)==1 .and. TD_Count%KellyNewStatus(19)/=TD_Count%KellyOldStatus(19)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(19) = TD_Count%KellyNewStatus(19)
- TD_Count%KellyOldStatus(8) = 0
- end if
- TD_StConn%ElevatorHeight = TD_StConn%HookHeight-TD_StConn%ElevatorConst
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
- end if
-
- else if ( TD_StConn%KellyDriveTypeMode==2 ) then
-
- if( Get_TdsConnectionModes()==TDS_CONNECTION_SPINE ) then
- TD_Count%KellyNewStatus(9) = 1
- else
- TD_Count%KellyNewStatus(9) = 0
- !TD_Count%KellyOldStatus(9) = 0
- end if
-
- if( Get_TdsConnectionModes()==TDS_CONNECTION_STRING ) then
- TD_Count%KellyNewStatus(10) = 1
- else
- TD_Count%KellyNewStatus(10) = 0
- !TD_Count%KellyOldStatus(10) = 0
- end if
-
- if( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_LATCH_STRING ) then
- TD_Count%KellyNewStatus(11) = 1
- else
- TD_Count%KellyNewStatus(11) = 0
- !TD_Count%KellyOldStatus(11) = 0
- end if
-
- if( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_STRING ) then
- TD_Count%KellyNewStatus(12) = 1
- else
- TD_Count%KellyNewStatus(12) = 0
- !TD_Count%KellyOldStatus(12) = 0
- end if
-
- if( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_NOTHING ) then
- TD_Count%KellyNewStatus(13) = 1
- else
- TD_Count%KellyNewStatus(13) = 0
- !TD_Count%KellyOldStatus(13) = 0
- end if
-
- if( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_STAND ) then
- TD_Count%KellyNewStatus(14) = 1
- else
- TD_Count%KellyNewStatus(14) = 0
- !TD_Count%KellyOldStatus(14) = 0
- end if
-
- if( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_SINGLE ) then
- TD_Count%KellyNewStatus(15) = 1
- else
- TD_Count%KellyNewStatus(15) = 0
- !TD_Count%KellyOldStatus(15) = 0
- end if
-
- if( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_LATCH_SINGLE ) then
- TD_Count%KellyNewStatus(16) = 1
- else
- TD_Count%KellyNewStatus(16) = 0
- !TD_Count%KellyOldStatus(16) = 0
- end if
-
- if( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_LATCH_STAND ) then
- TD_Count%KellyNewStatus(17) = 1
- else
- TD_Count%KellyNewStatus(17) = 0
- !TD_Count%KellyOldStatus(17) = 0
- end if
-
- if ( Get_TdsConnectionModes()==TDS_CONNECTION_SPINE ) then
- TD_StConn%StringConnectionMode = 9
- if (TD_Count%KellyOldStatus(10)==1 .and. TD_Count%KellyNewStatus(9)/=TD_Count%KellyOldStatus(9)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(9) = TD_Count%KellyNewStatus(9)
- TD_Count%KellyOldStatus(10) = 0
- else if (TD_Count%KellyOldStatus(11)==1 .and. TD_Count%KellyNewStatus(9)/=TD_Count%KellyOldStatus(9)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(9) = TD_Count%KellyNewStatus(9)
- TD_Count%KellyOldStatus(11) = 0
- else if (TD_Count%KellyOldStatus(13)==1 .and. TD_Count%KellyNewStatus(9)/=TD_Count%KellyOldStatus(9)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(9) = TD_Count%KellyNewStatus(9)
- TD_Count%KellyOldStatus(13) = 0
- end if
- if ( Get_Slips() == SLIPS_SET_END ) then
- !if ( TD_StConn%HookVelocity>0. ) then
- ! Print*, '*** UnSet Slips ***' !???????????????????
- !end if
- TD_StConn%TDSHeight = TD_StConn%HookHeight-TD_StConn%TDSLength-TD_StConn%TDSToolJointLength !?????????????
- TD_StConn%TDSElevatorHeight = TD_StConn%HookHeight-TD_StConn%TDSElevatorLength !?????????????
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
- else
- TD_StConn%TDSHeight = TD_StConn%HookHeight-TD_StConn%TDSLength-TD_StConn%TDSToolJointLength !?????????????
- TD_StConn%TDSElevatorHeight = TD_StConn%HookHeight-TD_StConn%TDSElevatorLength !?????????????
- TD_StConn%ConnectionHeight = TD_StConn%TDSHeight
- TD_StConn%StringVelocity = TD_StConn%HookVelocity
- end if
-
- else if ( Get_TdsConnectionModes()==TDS_CONNECTION_STRING ) then
- TD_StConn%StringConnectionMode = 10
- if (TD_Count%KellyOldStatus(9)==1 .and. TD_Count%KellyNewStatus(10)/=TD_Count%KellyOldStatus(10)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(10) = TD_Count%KellyNewStatus(10)
- TD_Count%KellyOldStatus(9) = 0
- end if
- if ( Get_Slips() == SLIPS_SET_END ) then
- !if ( TD_StConn%HookVelocity>0. ) then
- ! Print*, '*** UnSet Slips ***' !???????????????????
- !end if
- TD_StConn%TDSHeight = TD_StConn%HookHeight-TD_StConn%TDSLength-TD_StConn%TDSToolJointLength !?????????????
- TD_StConn%TDSElevatorHeight = TD_StConn%HookHeight-TD_StConn%TDSElevatorLength !?????????????
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
- else
- TD_StConn%TDSHeight = TD_StConn%HookHeight-TD_StConn%TDSLength-TD_StConn%TDSToolJointLength !?????????????
- TD_StConn%TDSElevatorHeight = TD_StConn%HookHeight-TD_StConn%TDSElevatorLength !?????????????
- TD_StConn%ConnectionHeight = TD_StConn%TDSHeight
- TD_StConn%StringVelocity = TD_StConn%HookVelocity
- end if
-
- else if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_LATCH_STRING ) then
- TD_StConn%StringConnectionMode = 11
- if (TD_Count%KellyOldStatus(9)==1 .and. TD_Count%KellyNewStatus(11)/=TD_Count%KellyOldStatus(11)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(11) = TD_Count%KellyNewStatus(11)
- TD_Count%KellyOldStatus(9) = 0
- else if (TD_Count%KellyOldStatus(12)==1 .and. TD_Count%KellyNewStatus(11)/=TD_Count%KellyOldStatus(11)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(11) = TD_Count%KellyNewStatus(11)
- TD_Count%KellyOldStatus(12) = 0
- else if (TD_Count%KellyOldStatus(13)==1 .and. TD_Count%KellyNewStatus(11)/=TD_Count%KellyOldStatus(11)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(11) = TD_Count%KellyNewStatus(11)
- TD_Count%KellyOldStatus(13) = 0
- else if (TD_Count%KellyOldStatus(16)==1 .and. TD_Count%KellyNewStatus(11)/=TD_Count%KellyOldStatus(11)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight+(TD_DrillStems(kk)%LengthIni)
- TD_Count%KellyOldStatus(11) = TD_Count%KellyNewStatus(11)
- TD_Count%KellyOldStatus(16) = 0
- else if (TD_Count%KellyOldStatus(17)==1 .and. TD_Count%KellyNewStatus(11)/=TD_Count%KellyOldStatus(11)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight+(3.d0*TD_DrillStems(kk)%LengthIni)
- TD_Count%KellyOldStatus(11) = TD_Count%KellyNewStatus(11)
- TD_Count%KellyOldStatus(17) = 0
- end if
- TD_StConn%TDSHeight = TD_StConn%HookHeight-TD_StConn%TDSLength !?????????????
- TD_StConn%TDSElevatorHeight = TD_StConn%HookHeight-TD_StConn%TDSElevatorLength !?????????????
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
-
- else if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_STRING ) then
- TD_StConn%StringConnectionMode = 12
- if (TD_Count%KellyOldStatus(11)==1 .and. TD_Count%KellyNewStatus(12)/=TD_Count%KellyOldStatus(12)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(12) = TD_Count%KellyNewStatus(12)
- TD_Count%KellyOldStatus(11) = 0
- else if (TD_Count%KellyOldStatus(14)==1 .and. TD_Count%KellyNewStatus(12)/=TD_Count%KellyOldStatus(12)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight+(3.d0*TD_DrillStems(kk)%LengthIni)
- TD_Count%KellyOldStatus(12) = TD_Count%KellyNewStatus(12)
- TD_Count%KellyOldStatus(14) = 0
- else if (TD_Count%KellyOldStatus(15)==1 .and. TD_Count%KellyNewStatus(12)/=TD_Count%KellyOldStatus(12)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight+(TD_DrillStems(kk)%LengthIni)
- TD_Count%KellyOldStatus(12) = TD_Count%KellyNewStatus(12)
- TD_Count%KellyOldStatus(15) = 0
- end if
- if ( Get_Slips() == SLIPS_SET_END ) then
- !if ( TD_StConn%HookVelocity>0. ) then
- ! Print*, '*** UnSet Slips ***' !???????????????????
- !end if
- TD_StConn%TDSHeight = TD_StConn%HookHeight-TD_StConn%TDSLength !?????????????
- TD_StConn%TDSElevatorHeight = TD_StConn%HookHeight-TD_StConn%TDSElevatorLength !?????????????
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
- else
- TD_StConn%TDSHeight = TD_StConn%HookHeight-TD_StConn%TDSLength !?????????????
- TD_StConn%TDSElevatorHeight = TD_StConn%HookHeight-TD_StConn%TDSLength-TD_StConn%TDSElevatorLength !?????????????
- TD_StConn%ConnectionHeight = TD_StConn%HookHeight-TD_StConn%TDSElevatorLength+(LengthSum+TD_StConn%TDSElevatorECG) !?????????????
- TD_StConn%StringVelocity = TD_StConn%HookVelocity
- end if
-
- else if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_NOTHING ) then
- TD_StConn%StringConnectionMode = 13
- if (TD_Count%KellyOldStatus(9)==1 .and. TD_Count%KellyNewStatus(13)/=TD_Count%KellyOldStatus(13)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(13) = TD_Count%KellyNewStatus(13)
- TD_Count%KellyOldStatus(9) = 0
- else if (TD_Count%KellyOldStatus(11)==1 .and. TD_Count%KellyNewStatus(13)/=TD_Count%KellyOldStatus(13)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(13) = TD_Count%KellyNewStatus(13)
- TD_Count%KellyOldStatus(11) = 0
- else if (TD_Count%KellyOldStatus(12)==1 .and. TD_Count%KellyNewStatus(13)/=TD_Count%KellyOldStatus(13)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(13) = TD_Count%KellyNewStatus(13)
- TD_Count%KellyOldStatus(12) = 0
- else if (TD_Count%KellyOldStatus(14)==1 .and. TD_Count%KellyNewStatus(13)/=TD_Count%KellyOldStatus(13)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(13) = TD_Count%KellyNewStatus(13)
- TD_Count%KellyOldStatus(14) = 0
- else if (TD_Count%KellyOldStatus(15)==1 .and. TD_Count%KellyNewStatus(13)/=TD_Count%KellyOldStatus(13)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(13) = TD_Count%KellyNewStatus(13)
- TD_Count%KellyOldStatus(15) = 0
- else if (TD_Count%KellyOldStatus(16)==1 .and. TD_Count%KellyNewStatus(13)/=TD_Count%KellyOldStatus(13)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(13) = TD_Count%KellyNewStatus(13)
- TD_Count%KellyOldStatus(16) = 0
- end if
- TD_StConn%TDSHeight = TD_StConn%HookHeight-TD_StConn%TDSLength !?????????????
- TD_StConn%TDSElevatorHeight = TD_StConn%HookHeight-TD_StConn%TDSElevatorLength !?????????????
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
-
- else if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_STAND ) then
- TD_StConn%StringConnectionMode = 14
- if (TD_Count%KellyOldStatus(12)==1 .and. TD_Count%KellyNewStatus(14)/=TD_Count%KellyOldStatus(14)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight-(3.d0*TD_DrillStems(kk)%LengthIni)
- TD_Count%KellyOldStatus(14) = TD_Count%KellyNewStatus(14)
- TD_Count%KellyOldStatus(12) = 0
- else if (TD_Count%KellyOldStatus(13)==1 .and. TD_Count%KellyNewStatus(14)/=TD_Count%KellyOldStatus(14)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(14) = TD_Count%KellyNewStatus(14)
- TD_Count%KellyOldStatus(13) = 0
- else if (TD_Count%KellyOldStatus(17)==1 .and. TD_Count%KellyNewStatus(14)/=TD_Count%KellyOldStatus(14)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(14) = TD_Count%KellyNewStatus(14)
- TD_Count%KellyOldStatus(17) = 0
- end if
- TD_StConn%TDSHeight = TD_StConn%HookHeight-TD_StConn%TDSLength !?????????????
- TD_StConn%TDSElevatorHeight = TD_StConn%HookHeight-TD_StConn%TDSElevatorLength !?????????????
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
-
- else if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_SINGLE ) then
- TD_StConn%StringConnectionMode = 15
- if (TD_Count%KellyOldStatus(12)==1 .and. TD_Count%KellyNewStatus(15)/=TD_Count%KellyOldStatus(15)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight-(TD_DrillStems(kk)%LengthIni)
- TD_Count%KellyOldStatus(15) = TD_Count%KellyNewStatus(15)
- TD_Count%KellyOldStatus(12) = 0
- else if (TD_Count%KellyOldStatus(13)==1 .and. TD_Count%KellyNewStatus(15)/=TD_Count%KellyOldStatus(15)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(15) = TD_Count%KellyNewStatus(15)
- TD_Count%KellyOldStatus(13) = 0
- else if (TD_Count%KellyOldStatus(16)==1 .and. TD_Count%KellyNewStatus(15)/=TD_Count%KellyOldStatus(15)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(15) = TD_Count%KellyNewStatus(15)
- TD_Count%KellyOldStatus(16) = 0
- end if
- TD_StConn%TDSHeight = TD_StConn%HookHeight-TD_StConn%TDSLength !?????????????
- TD_StConn%TDSElevatorHeight = TD_StConn%HookHeight-TD_StConn%TDSElevatorLength !?????????????
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
-
- else if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_LATCH_SINGLE ) then
- TD_StConn%StringConnectionMode = 16
- if (TD_Count%KellyOldStatus(11)==1 .and. TD_Count%KellyNewStatus(16)/=TD_Count%KellyOldStatus(16)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight-(TD_DrillStems(kk)%LengthIni)
- TD_Count%KellyOldStatus(16) = TD_Count%KellyNewStatus(16)
- TD_Count%KellyOldStatus(11) = 0
- else if (TD_Count%KellyOldStatus(13)==1 .and. TD_Count%KellyNewStatus(16)/=TD_Count%KellyOldStatus(16)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(16) = TD_Count%KellyNewStatus(16)
- TD_Count%KellyOldStatus(13) = 0
- else if (TD_Count%KellyOldStatus(15)==1 .and. TD_Count%KellyNewStatus(16)/=TD_Count%KellyOldStatus(16)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_Count%KellyOldStatus(16) = TD_Count%KellyNewStatus(16)
- TD_Count%KellyOldStatus(15) = 0
- end if
- TD_StConn%TDSHeight = TD_StConn%HookHeight-TD_StConn%TDSLength !?????????????
- TD_StConn%TDSElevatorHeight = TD_StConn%HookHeight-TD_StConn%TDSElevatorLength !?????????????
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
-
- else if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_LATCH_STAND ) then
- TD_StConn%StringConnectionMode = 17
- if (TD_Count%KellyOldStatus(11)==1 .and. TD_Count%KellyNewStatus(17)/=TD_Count%KellyOldStatus(17)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight-(3.d0*TD_DrillStems(kk)%LengthIni)
- TD_Count%KellyOldStatus(17) = TD_Count%KellyNewStatus(17)
- TD_Count%KellyOldStatus(11) = 0
- else if (TD_Count%KellyOldStatus(14)==1 .and. TD_Count%KellyNewStatus(17)/=TD_Count%KellyOldStatus(17)) then
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight+(3.d0*TD_DrillStems(kk)%LengthIni)
- TD_Count%KellyOldStatus(17) = TD_Count%KellyNewStatus(17)
- TD_Count%KellyOldStatus(14) = 0
- end if
- TD_StConn%TDSHeight = TD_StConn%HookHeight-TD_StConn%TDSLength !?????????????
- TD_StConn%TDSElevatorHeight = TD_StConn%HookHeight-TD_StConn%TDSElevatorLength !?????????????
- TD_StConn%ConnectionHeight = TD_StConn%ConnectionHeight
- TD_StConn%StringVelocity = 0.0d0
- end if
-
-
- end if
-
- !Print*, 'TD_StConn%StringConnectionMode=' , TD_StConn%StringConnectionMode
- !print* , 'TD_StConn%ConnectionHeight=' , TD_StConn%ConnectionHeight
- !Print*, 'TD_StConn%StringConnectionMode=' , TD_StConn%StringConnectionMode
- !print*, 'TD_String%DrillStemComponentsNumbs=' , TD_String%DrillStemComponentsNumbs
- !!Print*, 'TD_Count%KellyNewStatus(1)=' , TD_Count%KellyNewStatus(1)
- !Print*, 'TD_Count%KellyOldStatus(1)=' , TD_Count%KellyOldStatus(1)
- !Print*, 'TD_Count%KellyNewStatus(2)=' , TD_Count%KellyNewStatus(2)
- !Print*, 'TD_Count%KellyOldStatus(2)=' , TD_Count%KellyOldStatus(2)
- !Print*, 'TD_Count%KellyNewStatus(3)=' , TD_Count%KellyNewStatus(3)
- !Print*, 'TD_Count%KellyOldStatus(3)=' , TD_Count%KellyOldStatus(3)
-
-
-
-
-
-
- if ( (any(TD_StConn%StringConnectionMode==(/1,9,10/))) .or. DrillingConsole%CloseSafetyValve==.true. ) then !for fluid module
- TD_StConn%FluidStringConnectionMode = 1 !string is connected
- !else if ( (any(TD_StConn%StringConnectionMode==(/1,9,10/))) .or. DrillingConsole%CloseSafetyValve==.true. ) then
- !
- else
- TD_StConn%FluidStringConnectionMode = 0 !string is not connected
- end if
-
-
-
-
-
-
- !====================================================
- ! Zero String Speed
- !====================================================
- if ( abs(TD_StConn%StringVelocity)<=0.05d0 ) then ! [ft/s]
- TD_Load%ZeroStringSpeed = 1
- Call Set_ZeroStringSpeed(.true.)
- else
- TD_Load%ZeroStringSpeed = 0
- Call Set_ZeroStringSpeed(.false.)
- end if
-
-
-
-
-
-
-
- end subroutine
|