The Elk Code
sstask.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2012 J. K. Dewhurst, S. Sharma and E. K. U. Gross.
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 sstask(fnum,fext)
7 use modmain
8 use modmpi
9 implicit none
10 ! arguments
11 integer, intent(in) :: fnum
12 character(*), intent(out) :: fext
13 ! local variables
14 logical exist
15 ! only master process should search for file
16 if (.not.mp_mpi) goto 10
17 do iqss=1,nqpt
18 ! construct the spin-spiral file extension
19  call ssfext(iqss,fext)
20 ! determine if the SS file exists
21  inquire(file='SS'//trim(fext),exist=exist)
22  if (.not.exist) then
23  open(fnum,file='SS'//trim(fext),form='FORMATTED')
24  goto 10
25  end if
26 end do
27 iqss=0
28 write(*,'("Info(sstask): nothing more to do")')
29 10 continue
30 ! broadcast to all other processes
31 call mpi_bcast(iqss,1,mpi_integer,0,mpicom,ierror)
32 if (iqss == 0) then
33  fext='.OUT'
34 else
35  call ssfext(iqss,fext)
36 end if
37 end subroutine
38 
logical mp_mpi
Definition: modmpi.f90:17
integer nqpt
Definition: modmain.f90:525
subroutine ssfext(iq, fext)
Definition: ssfext.f90:7
integer iqss
Definition: modmain.f90:297
subroutine sstask(fnum, fext)
Definition: sstask.f90:7
Definition: modmpi.f90:6
integer mpicom
Definition: modmpi.f90:11
integer ierror
Definition: modmpi.f90:19