The Elk Code
idle.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2026 J. K. Dewhurst and S. Sharma.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
5 
6 subroutine idle
7 use modmain
8 use modmpi
9 implicit none
10 integer i
11 if (mp_mpi) then
12  write(*,*)
13  write(*,'("Info(idle): Elk in idle mode for ",I0," seconds")') tidle
14  write(*,*)
15  write(*,'("Create RESTART and STOP files, in that order, to restart code")')
16 end if
17 ! set the stop signal to .false.
18 tstop=.false.
19 do i=1,tidle/30
20 ! wait for 30 seconds
21  call execute_command_line('sleep 30')
22 ! check for STOP file
23  call checkstop
24  if (tstop) return
25 end do
26 if (mp_mpi) then
27  write(*,*)
28  write(*,'("Info(idle): idle timeout")')
29 end if
30 end subroutine
31 
logical mp_mpi
Definition: modmpi.f90:17
logical tstop
Definition: modmain.f90:1057
subroutine checkstop
Definition: checkstop.f90:7
subroutine idle
Definition: idle.f90:7
Definition: modmpi.f90:6
integer tidle
Definition: modmain.f90:1309