quantum-espresso/GIPAW/stop_code.f90

37 lines
762 B
Fortran

!
! Copyright (C) 2001-2004 PWSCF group
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
!----------------------------------------------------------------------------
SUBROUTINE stop_code( flag )
!----------------------------------------------------------------------------
!
! ... Synchronize processes before stopping.
!
USE kinds, ONLY : DP
USE mp_global, ONLY : mp_global_end
!
USE parallel_include
!
IMPLICIT NONE
!
LOGICAL :: flag
!
!
CALL mp_global_end ()
!
IF ( flag ) THEN
!
STOP
!
ELSE
!
STOP 1
!
ENDIF
!
END SUBROUTINE stop_code