From 832be95f206886d479463b8e4c99a12dd294049d Mon Sep 17 00:00:00 2001 From: MinoruOtani Date: Tue, 29 Dec 2020 17:16:52 +0900 Subject: [PATCH] fix tot_charge in NEB --- Modules/input_parameters.f90 | 2 ++ Modules/read_cards.f90 | 57 +++++++++++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/Modules/input_parameters.f90 b/Modules/input_parameters.f90 index ebb0f80d2..d23d23e6e 100644 --- a/Modules/input_parameters.f90 +++ b/Modules/input_parameters.f90 @@ -1494,6 +1494,7 @@ MODULE input_parameters LOGICAL :: tksout = .false. LOGICAL :: ttemplate = .false. LOGICAL :: twannier = .false. + LOGICAL :: ttotcharge = .false. ! ! ATOMIC_POSITIONS @@ -1622,6 +1623,7 @@ SUBROUTINE reset_input_checks() tksout = .false. tionvel = .false. tcell = .false. + ttotcharge = .false. ! END SUBROUTINE reset_input_checks ! diff --git a/Modules/read_cards.f90 b/Modules/read_cards.f90 index 067bb7476..0703b9d30 100644 --- a/Modules/read_cards.f90 +++ b/Modules/read_cards.f90 @@ -211,7 +211,11 @@ CONTAINS ELSEIF ( trim(card) == 'WANNIER_AC' .and. ( prog == 'WA' )) THEN ! CALL card_wannier_ac( input_line ) - + ! + ELSEIF ( trim(card) == 'TOTAL_CHARGE' ) THEN + ! + CALL card_total_charge( input_line ) + ! ELSE ! IF ( ionode ) & @@ -1935,4 +1939,55 @@ CONTAINS RETURN ! END SUBROUTINE card_wannier_ac + ! + ! + !------------------------------------------------------------------------ + ! BEGIN manual + !---------------------------------------------------------------------- + ! + ! TOTAL_CHARGE + ! + ! set the total charge + ! + ! Syntax: + ! + ! TOTAL_CHARGE + ! tot_charge + ! + ! Example: + ! + ! TOTAL_CHARGE + ! 0.1 + ! + !---------------------------------------------------------------------- + ! END manual + !------------------------------------------------------------------------ + ! + SUBROUTINE card_total_charge( input_line ) + ! + IMPLICIT NONE + ! + CHARACTER(len=256) :: input_line + LOGICAL, EXTERNAL :: matches + INTEGER :: iv, ip, ierr + CHARACTER(len=10) :: lb_mol + CHARACTER(len=256) :: molfile + ! + ! + IF ( ttotcharge ) THEN + CALL errore( ' card_total_charge ', 'two occurrences', 2 ) + ENDIF + ! + CALL read_line( input_line ) + READ( input_line, *, iostat=ierr ) tot_charge + ! + CALL errore( ' card_total_charge ', & + & 'cannot read total_charge from: '//trim(input_line), abs(ierr)) + ! + ttotcharge = .true. + ! + RETURN + ! + END SUBROUTINE card_total_charge + ! END MODULE read_cards_module