|
- # 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Unity/UnityModule.f90"
- module UnityModule
- use SimulationVariables
- implicit none
- contains
- subroutine UnityInputsFromJson(jsonfile)
- type(json_file)::jsonfile
- logical::found
-
- call jsonfile%get('UnityInputs.ElevatorConnectionPossible',data%Equipments%UnityInputs%ElevatorConnectionPossible,found)
- if ( .not. found ) call logg(4,"Not found: UnityInputs%ElevatorConnectionPossible")
- call jsonfile%get('UnityInputs.JointConnectionPossible',data%Equipments%UnityInputs%JointConnectionPossible,found)
- if ( .not. found ) call logg(4,"Not found: UnityInputs%JointConnectionPossible")
- call jsonfile%get('UnityInputs.IsKellyBushingSetInTable',data%Equipments%UnityInputs%IsKellyBushingSetInTable,found)
- if ( .not. found ) call logg(4,"Not found: UnityInputs%IsKellyBushingSetInTable")
- call jsonfile%get('UnityInputs.ElevatorPickup',data%Equipments%UnityInputs%ElevatorPickup,found)
- if ( .not. found ) call logg(4,"Not found: UnityInputs%ElevatorPickup")
- call jsonfile%get('UnityInputs.NearFloorPosition',data%Equipments%UnityInputs%NearFloorPosition,found)
- if ( .not. found ) call logg(4,"Not found: UnityInputs%NearFloorPosition")
- call jsonfile%get('UnityInputs.SingleSetInMouseHole',data%Equipments%UnityInputs%SingleSetInMouseHole,found)
- if ( .not. found ) call logg(4,"Not found: UnityInputs%SingleSetInMouseHole")
- call jsonfile%get('UnityInputs.TdsConnectionPossible',data%Equipments%UnityInputs%TdsConnectionPossible,found)
- if ( .not. found ) call logg(4,"Not found: UnityInputs%TdsConnectionPossible")
- call jsonfile%get('UnityInputs.TdsStemIn',data%Equipments%UnityInputs%TdsStemIn,found)
- if ( .not. found ) call logg(4,"Not found: UnityInputs%TdsStemIn")
- end subroutine
-
- subroutine UnityOutputsToJson(parent)
- type(json_value),pointer :: parent
- type(json_core) :: json
- type(json_value),pointer :: p
-
- ! 1. create new node
- call json%create_object(p,'Unity')
-
- ! 2. add member of data type to new node
- call json%add(p,"KellyHoseVibrationRate",data%Equipments%UnityOutputs%KellyHoseVibrationRate)
- call json%add(p,"BlowoutFromStringPercent",data%Equipments%UnityOutputs%BlowoutFromStringPercent)
- call json%add(p,"Pedal",data%Equipments%UnityOutputs%Pedal)
- call json%add(p,"FlowRate",data%Equipments%UnityOutputs%FlowRate)
- call json%add(p,"RotaryRpm",data%Equipments%UnityOutputs%RotaryRpm)
- call json%add(p,"BlowoutFromString",data%Equipments%UnityOutputs%BlowoutFromString)
- call json%add(p,"BlowoutFromAnnular",data%Equipments%UnityOutputs%BlowoutFromAnnular)
- call json%add(p,"FlowFromReturnLine",data%Equipments%UnityOutputs%FlowFromReturnLine)
- call json%add(p,"FlowFromKelly",data%Equipments%UnityOutputs%FlowFromKelly)
- call json%add(p,"FlowFromFillupHead",data%Equipments%UnityOutputs%FlowFromFillupHead)
- call json%add(p,"FlowKellyDisconnect",data%Equipments%UnityOutputs%FlowKellyDisconnect)
- call json%add(p,"FlowPipeDisconnect",data%Equipments%UnityOutputs%FlowPipeDisconnect)
-
- ! 3. add new node to parent
- call json%add(parent,p)
- end subroutine
-
- logical function Get_ElevatorPickup()
- Get_ElevatorPickup = data%Equipments%UnityInputs%ElevatorPickup
- end function
-
- logical function Get_IsKellyBushingSetInTable()
- Get_IsKellyBushingSetInTable = data%Equipments%UnityInputs%IsKellyBushingSetInTable
- end function
- logical function Get_JointConnectionPossible()
- Get_JointConnectionPossible = data%Equipments%UnityInputs%JointConnectionPossible
- end function
- logical function Get_ElevatorConnectionPossible()
- implicit none
- Get_ElevatorConnectionPossible = data%Equipments%UnityInputs%ElevatorConnectionPossible
- end function
- logical function Get_NearFloorPosition()
- Get_NearFloorPosition = data%Equipments%UnityInputs%NearFloorPosition
- end function
- subroutine Set_NearFloorPosition(v)
- implicit none
- logical, intent(in) :: v
- ! #ifdef ExcludeExtraChanges
- ! if(data%Equipments%UnityInputs%NearFloorPosition == v) return
- ! #endif
- data%Equipments%UnityInputs%NearFloorPosition = v
- !**call data%Equipments%UnityInputs%OnNearFloorPositionChange%RunAll()
- if(log_level>4) then
- if(print_log) print*, 'NearFloorPosition =', data%Equipments%UnityInputs%NearFloorPosition
- endif
- end subroutine
-
- logical function Get_SingleSetInMouseHole()
- Get_SingleSetInMouseHole = data%Equipments%UnityInputs%SingleSetInMouseHole
- end function
-
- logical function Get_TdsConnectionPossible()
- Get_TdsConnectionPossible = data%Equipments%UnityInputs%TdsConnectionPossible
- end function
-
- logical function Get_TdsStemIn()
- Get_TdsStemIn = data%Equipments%UnityInputs%TdsStemIn
- end function
-
- subroutine Set_BlowoutFromString(v)
- implicit none
- logical, intent (in) :: v
- data%Equipments%UnityOutputs%BlowoutFromString = v
- # 101
-
- end subroutine
-
- logical function Get_BlowoutFromString()
- implicit none
- Get_BlowoutFromString = data%Equipments%UnityOutputs%BlowoutFromString
- end function
-
- subroutine Set_BlowoutFromAnnular(v)
- implicit none
- logical, intent (in) :: v
- data%Equipments%UnityOutputs%BlowoutFromAnnular = v
- # 115
-
- end subroutine
-
- logical function Get_BlowoutFromAnnular()
- implicit none
- Get_BlowoutFromAnnular = data%Equipments%UnityOutputs%BlowoutFromAnnular
- end function
-
-
-
-
-
- subroutine Set_FlowFromReturnLine(v)
- implicit none
- logical, intent (in) :: v
- data%Equipments%UnityOutputs%FlowFromReturnLine = v
- # 133
-
- end subroutine
-
- logical function Get_FlowFromReturnLine()
- implicit none
- Get_FlowFromReturnLine = data%Equipments%UnityOutputs%FlowFromReturnLine
- end function
-
-
-
- subroutine Set_FlowFromKelly(v)
- implicit none
- real, intent (in) :: v
- data%Equipments%UnityOutputs%FlowFromKelly = v
- # 149
-
- end subroutine
-
- real function Get_FlowFromKelly()
- implicit none
- Get_FlowFromKelly = data%Equipments%UnityOutputs%FlowFromKelly
- end function
-
-
-
-
-
- subroutine Set_FlowFromFillupHead(v)
- implicit none
- real, intent (in) :: v
- data%Equipments%UnityOutputs%FlowFromFillupHead = v
- # 167
-
- end subroutine
-
- real function Get_FlowFromFillupHead()
- implicit none
- Get_FlowFromFillupHead = data%Equipments%UnityOutputs%FlowFromFillupHead
- end function
-
-
-
-
-
-
- subroutine Set_FlowKellyDisconnect(v)
- implicit none
- logical, intent (in) :: v
- data%Equipments%UnityOutputs%FlowKellyDisconnect = v
- # 186
-
- end subroutine
-
- logical function Get_FlowKellyDisconnect()
- implicit none
- Get_FlowKellyDisconnect = data%Equipments%UnityOutputs%FlowKellyDisconnect
- end function
-
-
-
-
- subroutine Set_FlowPipeDisconnect(v)
- implicit none
- logical, intent (in) :: v
- data%Equipments%UnityOutputs%FlowPipeDisconnect = v
- # 203
-
- end subroutine
-
- logical function Get_FlowPipeDisconnect()
- implicit none
- Get_FlowPipeDisconnect = data%Equipments%UnityOutputs%FlowPipeDisconnect
- end function
-
- subroutine Set_BlowoutFromStringPercent(v)
- implicit none
- real(8), intent (in) :: v
- data%Equipments%UnityOutputs%BlowoutFromStringPercent = v
- # 217
-
- end subroutine
-
- real(8) function GetBlowoutFromStringPercent()
- implicit none
- GetBlowoutFromStringPercent = data%Equipments%UnityOutputs%BlowoutFromStringPercent
- end function
-
- subroutine Calc_KellyHoseVibrationRate(spm1, spm2)
- use CScaleRange
- implicit none
- real(8), intent (in) :: spm1, spm2
- real :: total
- total = (spm1 + spm2)/2
- data%Equipments%UnityOutputs%KellyHoseVibrationRate = ScaleRange(total, 0.0, 10.0, 0.0, 120.0)
- # 234
-
- end subroutine
-
- real(8) function GetKellyHoseVibrationRate()
- implicit none
- GetKellyHoseVibrationRate = data%Equipments%UnityOutputs%KellyHoseVibrationRate
- end function
-
- subroutine Set_Pedal(v)
- implicit none
- real(8), intent (in) :: v
- data%Equipments%UnityOutputs%Pedal = v
- # 248
-
- end subroutine
-
- real(8) function GetPedal()
- implicit none
- GetPedal = data%Equipments%UnityOutputs%Pedal
- end function
-
- subroutine Set_FlowRate(v)
- implicit none
- real(8), intent (in) :: v
- data%Equipments%UnityOutputs%FlowRate = v
- # 262
-
- end subroutine
-
-
- real(8) function GetFlowRate()
- implicit none
- GetFlowRate = data%Equipments%UnityOutputs%FlowRate
- end function
- subroutine Set_RotaryRpm(v)
- implicit none
- real(8), intent (in) :: v
- data%Equipments%UnityOutputs%RotaryRpm = v
- # 276
-
- end subroutine
-
- real(8) function GetRotaryRpm()
- implicit none
- GetRotaryRpm = data%Equipments%UnityOutputs%RotaryRpm
- end function
-
- end module UnityModule
|