module KillLineMain
    implicit none
    public
    contains
    
    ! subroutine KillLine_Setup()
    !     ! use CSimulationVariables
    !     implicit none
    !     call OnSimulationInitialization%Add(KillLine_Init)
    !     call OnSimulationStop%Add(KillLine_Init)
    !     call OnKillLineStep%Add(KillLine_Step)
    !     call OnKillLineOutput%Add(KillLine_Output)
    !     call OnKillLineMain%Add(KillLineMainBody)
    ! end subroutine
    
    ! subroutine KillLine_Init
    !     implicit none
    ! end subroutine KillLine_Init
    
    subroutine KillLine_Step
        use SimulationVariables
        implicit none
        if (data%State%KillLine%finished/=0) then
            call KILL_LINE
            if (data%State%KillLine%IsOpening .or. data%State%KillLine%IsClosing) then
                if(data%State%KillLine%finished==0) then
                    call KILL_LINE_SUB !only body of loop2
                endif
            endif
        else
            call KILL_LINE_SUB
        endif
    end subroutine KillLine_Step
    
    
end module KillLineMain