Skip to content

Commit

Permalink
Merge pull request #1521 from ExtremeFLOW/fix/check-file-csv-countlines
Browse files Browse the repository at this point in the history
Check for existence of csv file in `count_lines`
  • Loading branch information
njansson authored Sep 30, 2024
2 parents 6859db9 + 79ee989 commit fde7d4f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/io/csv_file.f90
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,11 @@ function csv_file_count_lines(this) result(n)
integer :: n
integer :: ierr, file_unit

open(file = trim(this%fname), status = 'old', newunit = file_unit)
call this%check_exists()

open(file = trim(this%fname), status = 'old', newunit = file_unit, &
iostat = ierr)
if (ierr .ne. 0) call neko_error("Error while opening " // trim(this%fname))
rewind(file_unit)

n = 0
Expand Down

0 comments on commit fde7d4f

Please sign in to comment.