# 1 "/mnt/c/Projects/VSIM/SimulationCore2/Simulator.f90" module Simulator use RedisInterface use Bop use PumpsMain use RopMain use RotaryTableMain use DrawworksMain use FluidFlowMain use TorqueDragMain use MudSystemMain use PipeRams1Main use PipeRams2Main use KillLineMain use ChokeLineMain use BlindRamsMain use AnnularMain use TopDriveMain use CManifolds use GeoMain use ChokeControlMain use COperationScenariosMain ! For Json read and write use CStringConfiguration use CFormation use CReservoir use CShoe use CAccumulator use CBopStack use CHoisting use CPower use CPumpsVariables use CRigSize use CCasingLinerChoke use CPathGeneration use CWellSurveyData use MudPropertiesModule use CBitProblems use CBopProblems use CChokeProblems use CDrillStemProblems use CGaugesProblems use CHoistingProblems use CKickProblems use CLostProblems use CMudTreatmentProblems use COtherProblems use CPumpProblems use CRotaryProblems use OperationScenariosModule use PermissionsModule use UnitySignalsModule use CBopControlPanel use CChokeControlPanel use CChokeManifold use CDataDisplayConsole use CDrillingConsole use CHook use CStandPipeManifold use CTopDrivePanel use DrillingWatchModule use CTanks implicit none type(json_file) :: jsonfile type(json_core):: json integer :: simulationStatus,simulationSpeed,msPerStep,simulationEnd,simulationStep integer,dimension(8)::timearray real :: stepTime !time for each step character(len=:),allocatable::redisInput,redisOutput enum, bind(c) enumerator :: PLAY = 1 enumerator :: PAUSE = 2 enumerator :: STOP = 3 enumerator :: PLAY_TO_DETERMINED_TIME = 4 end enum contains subroutine Simulate(configFilename) character(*)::configFilename integer::t0,t1,t2,t3,t_read=0,t_write=0,t_exec=0,i,status integer,dimension(12)::t,t_modules !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! do i=1,size(t_modules) t_modules(i)=0 end do call initSimulation(configFilename) call initConnection(configFilename,status) if (status<0) then print *,"Can not init connection to redis." stop endif call read_configuration() ! call read_variables() print *,"connection initialized" call init_modules() print *,"modules initialized" ! call cpu_time(T1) simulationStep = 1 do while (.true.) ! print *,"simulationStep=",simulationStep call date_and_time(values=timearray) t0 = timearray(8)+timearray(7)*1000+timearray(6)*60000 ! print *,"start reading." call read_variables() if(simulationStatus==PLAY_TO_DETERMINED_TIME .and. simulationStep>simulationEnd) exit if(simulationStatus==STOP) exit if(simulationStatus==PAUSE) cycle if(logging>4) print *,"end reading" call date_and_time(values=timearray) t1 = timearray(8)+timearray(7)*1000+timearray(6)*60000 t_read = t_read+t1-t0 if(logging>4) print *,"read completed" !! Rafiee, nothing changed call BopStack_Step() call date_and_time(values=timearray) t(1) = timearray(8)+timearray(7)*1000+timearray(6)*60000 t_modules(1) = t_modules(1)+t(1)-t1 !! Tarmigh, now is rewritten call Pump1_Step() call date_and_time(values=timearray) t(2) = timearray(8)+timearray(7)*1000+timearray(6)*60000 t_modules(2) = t_modules(2)+t(2)-t(1) !call Pump2_Step() !! Rafiee call ChokeControl_Step() call date_and_time(values=timearray) t(3) = timearray(8)+timearray(7)*1000+timearray(6)*60000 t_modules(3) = t_modules(3)+t(3)-t(2) !! Tarmigh, now is rewritten call RotaryTable_Step() call date_and_time(values=timearray) t(4) = timearray(8)+timearray(7)*1000+timearray(6)*60000 t_modules(4) = t_modules(4)+t(4)-t(3) !! Tarmigh, now is rewritten call Drawworks_Step() call date_and_time(values=timearray) t(5) = timearray(8)+timearray(7)*1000+timearray(6)*60000 t_modules(5) = t_modules(5)+t(5)-t(4) !! Rafiee call MudSystem_Step() !! Rafiee call PipeRams1_Step() call PipeRams2_Step() !! Rafiee call KillLine_Step() call date_and_time(values=timearray) t(6) = timearray(8)+timearray(7)*1000+timearray(6)*60000 t_modules(6) = t_modules(6)+t(6)-t(5) !! Rafiee call ChokeLine_Step() call date_and_time(values=timearray) t(7) = timearray(8)+timearray(7)*1000+timearray(6)*60000 t_modules(7) = t_modules(7)+t(7)-t(6) call BlindRams_Step() call date_and_time(values=timearray) t(8) = timearray(8)+timearray(7)*1000+timearray(6)*60000 t_modules(8) = t_modules(8)+t(8)-t(7) call Annular_Step() call date_and_time(values=timearray) t(9) = timearray(8)+timearray(7)*1000+timearray(6)*60000 t_modules(9) = t_modules(9)+t(9)-t(8) !!Tarmigh. Step must rewrittem call TopDrive_Step() call date_and_time(values=timearray) t(10) = timearray(8)+timearray(7)*1000+timearray(6)*60000 t_modules(10) = t_modules(10)+t(10)-t(9) ! call Geo_Step() !!Ahmadi call PathFinding_Step() call date_and_time(values=timearray) t(11) = timearray(8)+timearray(7)*1000+timearray(6)*60000 t_modules(11) = t_modules(11)+t(11)-t(10) !! Sheikh ! call FluidFlow_Step() !! Ahmadi call OperationScenarios_Step() !! Write variables to shared files call date_and_time(values=timearray) t2 = timearray(8)+timearray(7)*1000+timearray(6)*60000 ! stepTime = t2-t1 t_modules(12) = t_modules(12)+t2-t(11) t_exec = t_exec+t2-t1 ! call date_and_time(values=timearray) ! t0 = timearray(8)+timearray(7)*1000+timearray(6)*60000 call write_variables() call date_and_time(values=timearray) t3 = timearray(8)+timearray(7)*1000+timearray(6)*60000 t_write = t_write+t3-t2 ! print *,"write completed" ! print *,"t=",t simulationStep = simulationStep + 1 end do ! call write_variables() ! call json%print(jsonroot,'test.json') ! call json%destroy(jsonroot) do i=1,size(t) print *,"t_modules(",i,")=",t_modules(i) end do print *,"Number of steps =",simulationStep-1 print *,"Read Time (from redis) =",t_read print *,"Write Time (to redis)=",t_write print *,"Simulation Time =",t_exec print *,"Total Time =",t_read+t_write+t_exec end subroutine Simulate subroutine initSimulation(configFilename) use json_module use iso_c_binding, only: c_null_char,c_char character(len=*) :: configFilename ! type(json_file) :: jsonfile type(json_value),pointer :: jsonvalue type(json_core) :: jsoncore ! logical :: is_found ! character(len=:),allocatable :: password,address,datakey ! character(len=:),allocatable::c_address,c_password,c_datakey call jsonfile%initialize() ! print *,"init simulation with ",configFilename call jsonfile%load_file(configFilename); if (jsonfile%failed()) then print *,"can not open config file: ",configFilename ; stop endif ! print *,"file read" call jsonfile%json_file_get_root(jsonvalue) call jsoncore%get(jsonvalue,'logging',logging) print *,"logging=",logging end subroutine subroutine write_variables() use CAccumulator use json_module implicit none type(json_value),pointer :: jsonroot character(len=20)::fn ! integer::n_children call json%initialize() call json%create_object(jsonroot,'') ! print *,"status=",simulationStatus ! call json%add(jsonroot,'status',simulationStatus) ! call json%add(jsonroot,'speed',simulationSpeed) ! call json%add(jsonroot,'endstep',simulationEnd) call json%add(jsonroot,'step',simulationStep) ! call ConfigurationToJson(jsonroot) call WarningsToJson(jsonroot) ! call ProblemsToJson(jsonroot) call EquipmentsToJson(jsonroot) ! print *,"write starts" write (fn,*) "data",simulationStep ! call json%print(jsonroot,trim(fn)//".json") call json%serialize(jsonroot,redisInput) ! call compress_string(redisContent) if(logging>4) print *,"Writing to redis:",len(redisInput) call setData(redisInput) ! nullify(redisContent) ! deallocate(redisContent) ! call json%destroy(pval) call json%destroy(jsonroot) ! print *,"write ends" end subroutine subroutine read_configuration() type(json_value),pointer :: jsonroot type(json_value),pointer :: pval call getData(redisOutput) ! print *,len(redisOutput)," bytes read from redis" open(1,file="redisContent.json",status="REPLACE") write(1,"(A)") redisOutput close(1) ! call json%initialize() call jsonfile%initialize() ! call jsonfile%load_file('redisContent.json'); if (jsonfile%failed()) stop call jsonfile%deserialize(redisOutput) call jsonfile%json_file_get_root(jsonroot) ! call json%info(jsonvalue, n_children=n_children) ! print *,"n_children =",n_children call json%get(jsonroot,'status',pval) call json%get(pval,simulationStatus) call json%get(jsonroot,'speed',pval) call json%get(pval,simulationSpeed) if(simulationSpeed==0) simulationSpeed = 1 msPerStep = 100/simulationSpeed call json%get(jsonroot,'endstep',pval) call json%get(pval,simulationEnd) call ConfigurationFromJson(jsonroot) ! call WarningsFromJson(jsonroot) ! call ProblemsFromJson(jsonvalue) ! call EquipmentsFromJson(jsonroot) ! deallocate(redisContent) ! call json%destroy(pval) ! call json%destroy(jsonroot) end subroutine subroutine read_variables() type(json_value),pointer :: jsonroot,pval call getData(redisOutput) ! print *,len(redisOutput)," bytes read from redis" ! open(1,file="redisContent.json",status="REPLACE") ! write(1,"(A)") redisContent ! close(1) call jsonfile%initialize() call jsonfile%deserialize(redisOutput) ! call jsonfile%initialize() ! call jsonfile%load_file('redisContent.json'); if (jsonfile%failed()) stop call jsonfile%json_file_get_root(jsonroot) ! call json%info(jsonvalue, n_children=n_children) ! print *,"n_children =",n_children call json%get(jsonroot,'status',pval) call json%get(pval,simulationStatus) call json%get(jsonroot,'speed',pval) call json%get(pval,simulationSpeed) if(simulationSpeed==0) simulationSpeed = 1 msPerStep = 100/simulationSpeed call json%get(jsonroot,'endstep',pval) call json%get(pval,simulationEnd) print *,simulationStep,"/",simulationEnd ! call ConfigurationFromJson(jsonroot) ! call WarningsFromJson(jsonroot) call ProblemsFromJson(jsonroot) call EquipmentsFromJson(jsonroot) ! deallocate(redisContent) ! call json%destroy(pval) ! call json%destroy(jsonroot) end subroutine subroutine init_modules print *,"initializing modules" !Tarmigh call Pump1_Init() print *,"pump1 initialized" !call Pump2_Init() call RotaryTable_Init() print *,"RT initialized" call Drawworks_Init() call TopDrive_Init() print *,"TD initialized" !Nothing in init (and step) ! call Rop_Init() ! call TorqueDrag_Init() ! call Geo_Step() !! Rafiee call BopStack_Init() call ChokeControl_Init() call MudSystem_Init() print *,"Mudsystem initialized" !Again calls Bop_Startup ! call PipeRams1_Init() ! call PipeRams2_Step() ! call KillLine_Step() ! call ChokeLine_Step() ! call BlindRams_Step() ! call Annular_Step() !! Sheikh ! call FluidFlow_Init() ! print *,"Mudsystem initialized" !! Ahmadi call PathFinding_Init() ! Calls OSInitialization and that sub only subscribes some notif ! call OperationScenarios_Init() end subroutine init_modules subroutine EquipmentsFromJson(parent) type(json_value),pointer :: parent type(json_value),pointer :: p ! 1. get related root call json%get(parent,"Equipments",p) ! 2. add member of data type to new node call BopControlPanelFromJson(p) call ChokeControlPanelFromJson(p) call ChokeManifoldFromJson(p) call DataDisplayConsoleFromJson(p) call DrillingConsoleFromJson(p) ! call HookFromJson(p) call StandPipeManifoldFromJson(p) call TopDrivePanelFromJson(p) ! call DrillingWatchFromJson(p) call TankFromJson(p) end subroutine subroutine EquipmentsToJson(parent) type(json_value),pointer :: parent type(json_value),pointer :: p ! 1. create new node call json%create_object(p,'Equipments') ! 2. add member of data type to new node call BopControlPanelToJson(p) call ChokeControlPanelToJson(p) call ChokeManifoldToJson(p) call DataDisplayConsoleToJson(p) call DrillingConsoleToJson(p) call HookToJson(p) call StandPipeManifoldToJson(p) call TopDrivePanelToJson(p) call DrillingWatchToJson(p) ! call TankToJson(p) ! 3. add new node to parent call json%add(parent,p) end subroutine subroutine ConfigurationToJson(parent) type(json_value),pointer :: parent type(json_value),pointer :: p ! 1. create new node call json%create_object(p,'Configuration') ! 2. add member of data type to new node call StringConfigurationToJson(p) call FormationToJson(p) call ReservoirToJson(p) call ShoeToJson(p) call AccumulatorToJson(p) call BopStackToJson(p) call HoistingToJson(p) call PowerToJson(p) call PumpsToJson(p) call RigSizeToJson(p) call CasingLinerChokeToJson(p) call PathGenerationToJson(p) ! call WellSurveyDataToJson(p) call MudPropertiesToJson(p) ! 3. add new node to parent call json%add(parent,p) end subroutine subroutine WarningsToJson(parent) type(json_value),pointer :: parent type(json_value),pointer :: p ! 1. create new node call json%create_object(p,'Warnings') ! 2. add member of data type to new node call json%add(p,"PumpWithKellyDisconnected",data%Warnings%PumpWithKellyDisconnected) call json%add(p,"PumpWithTopdriveDisconnected",data%Warnings%PumpWithTopdriveDisconnected) call json%add(p,"Pump1PopOffValveBlown",data%Warnings%Pump1PopOffValveBlown) call json%add(p,"Pump1Failure",data%Warnings%Pump1Failure) call json%add(p,"Pump2PopOffValveBlown",data%Warnings%Pump2PopOffValveBlown) call json%add(p,"Pump2Failure",data%Warnings%Pump2Failure) call json%add(p,"Pump3PopOffValveBlown",data%Warnings%Pump3PopOffValveBlown) call json%add(p,"Pump3Failure",data%Warnings%Pump3Failure) call json%add(p,"DrawworksGearsAbuse",data%Warnings%DrawworksGearsAbuse) call json%add(p,"RotaryGearsAbuse",data%Warnings%RotaryGearsAbuse) call json%add(p,"HoistLineBreak",data%Warnings%HoistLineBreak) call json%add(p,"PartedDrillString",data%Warnings%PartedDrillString) call json%add(p,"ActiveTankOverflow",data%Warnings%ActiveTankOverflow) call json%add(p,"ActiveTankUnderVolume",data%Warnings%ActiveTankUnderVolume) call json%add(p,"TripTankOverflow",data%Warnings%TripTankOverflow) call json%add(p,"DrillPipeTwistOff",data%Warnings%DrillPipeTwistOff) call json%add(p,"DrillPipeParted",data%Warnings%DrillPipeParted) call json%add(p,"TripWithSlipsSet",data%Warnings%TripWithSlipsSet) call json%add(p,"Blowout",data%Warnings%Blowout) call json%add(p,"UndergroundBlowout",data%Warnings%UndergroundBlowout) call json%add(p,"MaximumWellDepthExceeded",data%Warnings%MaximumWellDepthExceeded) call json%add(p,"CrownCollision",data%Warnings%CrownCollision) call json%add(p,"FloorCollision",data%Warnings%FloorCollision) call json%add(p,"TopdriveRotaryTableConfilict",data%Warnings%TopdriveRotaryTableConfilict) ! 3. add new node to parent call json%add(parent,p) end subroutine subroutine ProblemsToJson(parent) type(json_value),pointer :: parent type(json_value),pointer :: p ! 1. create new node call json%create_object(p,'Problems') ! 2. add member of data type to new node call BitProblemsToJson(p) call BopProblemsToJson(p) call ChokeProblemsToJson(p) call DrillStemProblemsToJson(p) call GaugesProblemsToJson(p) call HoistingProblemsToJson(p) call KickProblemsToJson(p) call LostProblemsToJson(p) call MudTreatmentProblemsToJson(p) call OtherProblemsToJson(p) call PumpProblemsToJson(p) call RotaryProblemsToJson(p) ! 3. add new node to parent call json%add(parent,p) end subroutine subroutine StateToJson(parent) type(json_value),pointer :: parent type(json_value),pointer :: p ! 1. create new node call json%create_object(p,'State') ! call OperationScenarioToJson(p) call notificationsToJson(p) ! call permissionsToJson(p) ! call unitySignalsToJson(p) ! call StudentStationToJson(p) ! call BopStackInputToJson(p) ! call BopStackAccToJson(p) ! call RamLineToJson(p) ! call AnnularComputationalToJson(p) ! call AnnularToJson(p) ! call PipeRam1ToJson(p) ! call ShearRamToJson(p) ! call PipeRam2ToJson(p) ! call ChokeLineToJson(p) ! call KillLineToJson(p) ! call PumpsToJson(p) ! call RAMToJson(p) ! call RAMSToJson(p) ! call ChokeToJson(p) ! call AirDrivenPumpToJson(p) ! call AirPumpLineToJson(p) ! call CHOOKEToJson(p) ! call DrawworksToJson(p) ! call MudSystemToJson(p) ! call MUDToJson(p) ! call MPumpsToJson(p) ! call PUMPToJson(p) ! call RTableToJson(p) ! call TDSToJson(p) ! call GasType(3)ToJson(p) ! call PressureDisplayToJson(p) ! call FricPressDropToJson(p) ! call ROP_SpecToJson(p) ! call ROP_BitToJson(p) ! call TDGeoToJson(p) ! call F_String(:)ToJson(p) ! call F_CountsToJson(p) ! call F_Interval(:)ToJson(p) ! call OD_Annulus(4)ToJson(p) ! call TD_DrillStemToJson(p) ! call TD_DrillStemsToJson(p) ! call TD_StringToJson(p) ! call TD_CountToJson(p) ! call G_StringElementToJson(p) ! call TD_VolToJson(p) ! call TD_GeneralToJson(p) ! call TD_BOPToJson(p) ! call TD_BOPElement(4)ToJson(p) ! call TD_StConnToJson(p) ! call TD_LoadToJson(p) ! call TD_WellElToJson(p) ! call TD_CasingToJson(p) ! call TD_LinerToJson(p) ! call TD_OpenHoleToJson(p) ! call TD_ROPHoleToJson(p) ! call TD_WellGeneralToJson(p) ! call TD_WellGeo(:)ToJson(p) ! 2. add member of data type to new node ! 3. add new node to parent call json%add(parent,p) end subroutine !use this as a template subroutine notificationsToJson(parent) type(json_value),pointer :: parent type(json_value),pointer :: p ! 1. create new node call json%create_object(p,'Notifications') ! 2. add member of data type to new node ! 3. add new node to parent call json%add(parent,p) end subroutine subroutine ConfigurationFromJson(parent) type(json_value),pointer :: parent type(json_value),pointer :: p ! 1. get related root call json%get(parent,"Configuration",p) call StringConfigurationFromJson(p) call FormationFromJson(p) call ReservoirFromJson(p) call ShoeFromJson(p) call AccumulatorFromJson(p) call BopStackFromJson(p) call HoistingFromJson(p) call PowerFromJson(p) call PumpsFromJson(p) call RigSizeFromJson(p) call CasingLinerChokeFromJson(p) call PathGenerationFromJson(p) call MudPropertiesFromJson(p) ! 3. add new node to parent call json%add(parent,p) end subroutine subroutine WarningsFromJson(parent) type(json_value),pointer :: parent type(json_value),pointer :: p type(json_value),pointer :: pval ! 1. get node call json%get(parent,'Warnings',p) ! ! 2. add member of data type to new node call json%get(p,'PumpWithKellyDisconnected',pval) call json%get(pval,data%Warnings%PumpWithKellyDisconnected) call json%get(p,'PumpWithTopdriveDisconnected',pval) call json%get(pval,data%Warnings%PumpWithTopdriveDisconnected) call json%get(p,'Pump1PopOffValveBlown',pval) call json%get(pval,data%Warnings%Pump1PopOffValveBlown) call json%get(p,'Pump1Failure',pval) call json%get(pval,data%Warnings%Pump1Failure) call json%get(p,'Pump2PopOffValveBlown',pval) call json%get(pval,data%Warnings%Pump2PopOffValveBlown) call json%get(p,'Pump2Failure',pval) call json%get(pval,data%Warnings%Pump2Failure) call json%get(p,'Pump3PopOffValveBlown',pval) call json%get(pval,data%Warnings%Pump3PopOffValveBlown) call json%get(p,'Pump3Failure',pval) call json%get(pval,data%Warnings%Pump3Failure) call json%get(p,'DrawworksGearsAbuse',pval) call json%get(pval,data%Warnings%DrawworksGearsAbuse) call json%get(p,'RotaryGearsAbuse',pval) call json%get(pval,data%Warnings%RotaryGearsAbuse) call json%get(p,'HoistLineBreak',pval) call json%get(pval,data%Warnings%HoistLineBreak) call json%get(p,'PartedDrillString',pval) call json%get(pval,data%Warnings%PartedDrillString) call json%get(p,'ActiveTankOverflow',pval) call json%get(pval,data%Warnings%ActiveTankOverflow) call json%get(p,'ActiveTankUnderVolume',pval) call json%get(pval,data%Warnings%ActiveTankUnderVolume) call json%get(p,'TripTankOverflow',pval) call json%get(pval,data%Warnings%TripTankOverflow) call json%get(p,'DrillPipeTwistOff',pval) call json%get(pval,data%Warnings%DrillPipeTwistOff) call json%get(p,'DrillPipeParted',pval) call json%get(pval,data%Warnings%DrillPipeParted) call json%get(p,'TripWithSlipsSet',pval) call json%get(pval,data%Warnings%TripWithSlipsSet) call json%get(p,'Blowout',pval) call json%get(pval,data%Warnings%Blowout) call json%get(p,'UndergroundBlowout',pval) call json%get(pval,data%Warnings%UndergroundBlowout) call json%get(p,'MaximumWellDepthExceeded',pval) call json%get(pval,data%Warnings%MaximumWellDepthExceeded) call json%get(p,'CrownCollision',pval) call json%get(pval,data%Warnings%CrownCollision) call json%get(p,'FloorCollision',pval) call json%get(pval,data%Warnings%FloorCollision) call json%get(p,'TopdriveRotaryTableConfilict',pval) call json%get(pval,data%Warnings%TopdriveRotaryTableConfilict) end subroutine subroutine ProblemsFromJson(parent) type(json_value),pointer :: parent type(json_value),pointer :: p call json%get(parent,'Warnings',p) call BitProblemsToJson(p) call BopProblemsFromJson(p) call ChokeProblemsFromJson(p) call DrillStemProblemsFromJson(p) call GaugesProblemsFromJson(p) call HoistingProblemsFromJson(p) call KickProblemsFromJson(p) call LostProblemsFromJson(p) call MudTreatmentProblemsFromJson(p) call OtherProblemsFromJson(p) call PumpProblemsFromJson(p) call RotaryProblemsFromJson(p) end subroutine subroutine StateFromJson(parent) type(json_value),pointer :: parent type(json_value),pointer :: p ! 1. create new node ! call json%create_object(p,'State') ! ! call OperationScenarioFromJson(p) ! call notificationsFromJson(p) ! call permissionsFromJson(p) ! call unitySignalsFromJson(p) ! call StudentStationFromJson(p) ! call BopStackInputFromJson(p) ! call BopStackAccFromJson(p) ! call RamLineFromJson(p) ! call AnnularComputationalFromJson(p) ! call AnnularFromJson(p) ! call PipeRam1FromJson(p) ! call ShearRamFromJson(p) ! call PipeRam2FromJson(p) ! call ChokeLineFromJson(p) ! call KillLineFromJson(p) ! call PumpsFromJson(p) ! call RAMFromJson(p) ! call RAMSFromJson(p) ! call ChokeFromJson(p) ! call AirDrivenPumpFromJson(p) ! call AirPumpLineFromJson(p) ! call CHOOKEFromJson(p) ! call DrawworksFromJson(p) ! call MudSystemFromJson(p) ! call MUDFromJson(p) ! call MPumpsFromJson(p) ! call PUMPFromJson(p) ! call RTableFromJson(p) ! call TDSFromJson(p) ! call GasType(3)FromJson(p) ! call PressureDisplayFromJson(p) ! call FricPressDropFromJson(p) ! call ROP_SpecFromJson(p) ! call ROP_BitFromJson(p) ! call TDGeoFromJson(p) ! call F_String(:)FromJson(p) ! call F_CountsFromJson(p) ! call F_Interval(:)FromJson(p) ! call OD_Annulus(4)FromJson(p) ! call TD_DrillStemFromJson(p) ! call TD_DrillStemsFromJson(p) ! call TD_StringFromJson(p) ! call TD_CountFromJson(p) ! call G_StringElementFromJson(p) ! call TD_VolFromJson(p) ! call TD_GeneralFromJson(p) ! call TD_BOPFromJson(p) ! call TD_BOPElement(4)FromJson(p) ! call TD_StConnFromJson(p) ! call TD_LoadFromJson(p) ! call TD_WellElFromJson(p) ! call TD_CasingFromJson(p) ! call TD_LinerFromJson(p) ! call TD_OpenHoleFromJson(p) ! call TD_ROPHoleFromJson(p) ! call TD_WellGeneralFromJson(p) ! call TD_WellGeo(:)FromJson(p) ! 2. add member of data type to new node ! 3. add new node to parent call json%add(parent,p) end subroutine !use this as a template subroutine notificationsFromJson(parent) type(json_value),pointer :: parent ! ! type(json_value),pointer :: p ! 1. create new node ! call json%create_object(p,'Notifications') ! ! 2. add member of data type to new node ! ! 3. add new node to parent ! call json%add(parent,p) end subroutine end module Simulator