Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip out tabs and end-of-line comments when reading from HEMCO_Config.rc -- Closes #150 #151

Merged
merged 1 commit into from
Jun 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/Core/hco_chartools_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,10 @@ END SUBROUTINE GetNextLine
!
SUBROUTINE HCO_ReadLine( LUN, LINE, EOF, RC )
!
! !USES:
!
USE Hco_CharPak_Mod, ONLY : CStrip
!
! !INPUT PARAMETERS:
!
INTEGER, INTENT(IN ) :: LUN ! Stream LUN
Expand All @@ -946,7 +950,7 @@ SUBROUTINE HCO_ReadLine( LUN, LINE, EOF, RC )
!
! !LOCAL VARIABLES:
!
INTEGER :: IOS
INTEGER :: IOS, C
CHARACTER(LEN=255) :: MSG
CHARACTER(LEN=4095) :: DUM

Expand Down Expand Up @@ -991,6 +995,14 @@ SUBROUTINE HCO_ReadLine( LUN, LINE, EOF, RC )
LINE = DUM(1:LEN(LINE))
ENDIF

! Strip tabs and other non-printing characters but keep spaces
CALL CStrip( Line, KeepSpaces=.TRUE. )

! Skip any comments at the end of a line (unless the
! comment character # is in the first column)
C = INDEX( Line, '#' )
IF ( C > 1 ) Line = Line(1:C-1)

END SUBROUTINE HCO_ReadLine
!EOC
END MODULE HCO_CharTools_Mod