From 30ac91eb8722f3c28475fb8a4e723940540f2052 Mon Sep 17 00:00:00 2001 From: SteveDoyle2 Date: Tue, 9 Apr 2024 14:13:47 -0700 Subject: [PATCH] cards may now have comments inside them; fixes #67 - lines must start with a $, so a space is not considered a comment --- Source/LK1/L1U/NEXTC.f90 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Source/LK1/L1U/NEXTC.f90 b/Source/LK1/L1U/NEXTC.f90 index e600d891..00950f51 100644 --- a/Source/LK1/L1U/NEXTC.f90 +++ b/Source/LK1/L1U/NEXTC.f90 @@ -89,6 +89,22 @@ SUBROUTINE NEXTC ( CARD, ICONT, IERR ) CALL READERR ( IOCHK, INFILE, MESSAG, REC_NO, OUNT, 'Y' ) FATAL_ERR = FATAL_ERR + 1 ENDIF + + ! we (maybe) found a comment line inside the card + ! loop until we find a non-comment line using the same + ! block as above + ! + ! NOTE: comment lines must start with a $, so a space is + ! not considered a comment + DO WHILE (TCARD(1:1) == '$') + READ(IN1,101,IOSTAT=IOCHK) TCARD ! Read next card + CARD_IN = TCARD + IF (IOCHK /= 0) THEN + REC_NO = -99 + CALL READERR ( IOCHK, INFILE, MESSAG, REC_NO, OUNT, 'Y' ) + FATAL_ERR = FATAL_ERR + 1 + ENDIF + ENDDO ! Remove any comments within the CARD by deleting everything from $ on (after col 1)