Skip to content

Commit

Permalink
added the processing of [COMMENT] in csv files
Browse files Browse the repository at this point in the history
  • Loading branch information
casper-boon committed Mar 15, 2023
1 parent 58ea02f commit e4eab46
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
4 changes: 2 additions & 2 deletions include/aed.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
!# #
!# http:https://aquatic.science.uwa.edu.au/ #
!# #
!# Copyright 2013 - 2022 - The University of Western Australia #
!# Copyright 2013 - 2023 - The University of Western Australia #
!# #
!# AED is free software: you can redistribute it and/or modify #
!# it under the terms of the GNU General Public License as published by #
Expand All @@ -28,7 +28,7 @@
#ifndef _AED_H_
#define _AED_H_

#define AED_VERSION "2.1.0"
#define AED_VERSION "2.1.1"

#define MAX_MODELS 40

Expand Down
39 changes: 38 additions & 1 deletion src/aed_csv_reader.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
!# #
!# http:https://aquatic.science.uwa.edu.au/ #
!# #
!# Copyright 2013 - 2022 - The University of Western Australia #
!# Copyright 2013 - 2023 - The University of Western Australia #
!# #
!# AED is free software: you can redistribute it and/or modify #
!# it under the terms of the GNU General Public License as published by #
Expand Down Expand Up @@ -238,6 +238,42 @@ END FUNCTION char_in_str
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


!###############################################################################
SUBROUTINE strip_comments(buf)
!-------------------------------------------------------------------------------
!ARGUMENTS
CHARACTER(len=*), INTENT(inout) :: buf
!
!LOCALS
INTEGER lnt, res
!
!-------------------------------------------------------------------------------
!BEGIN
lnt = LEN_TRIM(buf)
res = char_in_str('[', buf)

DO WHILE ( res .NE. 0 )
IF ( buf(res+1:res+1) .EQ. 'C' .AND. &
buf(res+2:res+2) .EQ. 'O' .AND. &
buf(res+3:res+3) .EQ. 'M' .AND. &
buf(res+4:res+4) .EQ. 'M' .AND. &
buf(res+5:res+5) .EQ. 'E' .AND. &
buf(res+6:res+6) .EQ. 'N' .AND. &
buf(res+7:res+7) .EQ. 'T' .AND. &
buf(res+8:res+8) .EQ. ']' ) THEN
DO WHILE ( res .LE. lnt)
buf(res:res) = ' '
res=res+1
ENDDO
res = 0
ELSE
res = char_in_str('[', buf, res+1)
ENDIF
ENDDO
END SUBROUTINE strip_comments
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


!###############################################################################
LOGICAL FUNCTION next_symbol(aedr, sym)
!-------------------------------------------------------------------------------
Expand Down Expand Up @@ -282,6 +318,7 @@ LOGICAL FUNCTION next_symbol(aedr, sym)
read(UNIT=aedr%lun,FMT='(A)', iostat=iostat) aedr%buf
IF ( iostat .NE. 0) RETURN

CALL strip_comments(aedr%buf)
aedr%buf_len=LEN_TRIM(aedr%buf)
IF ( (aedr%buf_len .GT. 0) .AND. &
(aedr%buf(1:1) .NE. '#') .AND. &
Expand Down

0 comments on commit e4eab46

Please sign in to comment.