Prevent code stop when an input line containing only spaces or tabs is present in the "cards" section of input

This commit is contained in:
Lorenzo Paulatto (naquite) 2024-07-15 11:52:53 +02:00
parent 3e1ea72d92
commit 1879f18993
1 changed files with 4 additions and 3 deletions

View File

@ -123,7 +123,7 @@ CONTAINS
CHARACTER(len=256) :: input_line
CHARACTER(len=80) :: card
LOGICAL :: tend
INTEGER :: i
INTEGER :: i, ios
!
! read_line reads from unit parse_unit
!
@ -145,7 +145,8 @@ CONTAINS
input_line( i : i ) = capital( input_line( i : i ) )
ENDDO
!
READ (input_line, *) card
READ (input_line, *, iostat=ios) card
IF(ios/=0) card=''
!
IF ( trim(card) == 'AUTOPILOT' ) THEN
!
@ -747,7 +748,7 @@ CONTAINS
k2 < 0 .or. k2 > 1 .or. &
k3 < 0 .or. k3 > 1 ) CALL errore &
('card_kpoints', 'invalid offsets: must be 0 or 1', 1)
IF ( nk1 <= 0 .or. nk2 <= 0 .or. nk3 <= 0 ) CALL errore &
IF ( nk1 < 0 .or. nk2 < 0 .or. nk3 < 0 ) CALL errore &
('card_kpoints', 'invalid values for nk1, nk2, nk3', 1)
ALLOCATE ( xk(3,1), wk(1) ) ! prevents problems with debug flags
! ! when init_startk is called in iosys