-
Notifications
You must be signed in to change notification settings - Fork 45
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
First array entry skipped when adding from array #9
Comments
This problem is fixed by adding two lines to #if defined __GFORTRAN__
! This is a stupid workaround for gfortran bugs (tested with 7.2.0)
select type (val)
type is (character(len=*))
call me%add(val(i),int_fmt,real_fmt,trim_str)
type is (real(wp))
call me%add(val(i),int_fmt,real_fmt,trim_str)
class default
call me%add(val(i),int_fmt,real_fmt,trim_str)
end select The fix is similar to the one added for character inputs. This bug is especially confusing to me because I tried adding another do loop with a |
After further testing I've verified that this bug doesn't occur with the Intel Fortran compiler. |
I'm using gfortran 9.2.1 from the Fedora 31 package set. I'll try the updated test and report back. |
Sorry it took me a while to get back to this. I'm still getting this issue with the other branch when I replace csv_write_test.f90 with the program in my first post. |
Following up on this, it was a bug in older versions of gfortran. With a sufficiently new version (tested with 11.2.1) the above code will generate the correct CSV file:
|
If
csv_write_test.f90
is modified to construct an input array from array values, the first entry is ignored:test.csv:
The text was updated successfully, but these errors were encountered: