[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#905266: gfortran: Write and read arrays in unformatted files do not work properly



Control: tags -1 + moreinfo

On 02.08.2018 12:24, Marco wrote:
> Package: gfortran
> Version: 4:8.1.0-1
> Severity: important
> 
> Dear Maintainer,
> 
> I'm running a fortran hydrodynamic model. Here we have a routine writing
> an unformatted file with an header and a real array with the following
> code:
> 
>  write(30,iostat=ierr) time,ivar,m,lmax
>      +                          ,(((vals(l,j,i)
>      +                          ,l=1,ll(j))
>      +                          ,j=1,jj)
>      +                          ,i=1,m)
> 
> and a second routine this file with:
> 
>  read(20,iostat=ierr) time,ivar,m,lmax
>      +                          ,(((vals(l,j,i)
>      +                          ,l=1,ll(j))
>      +                          ,j=1,jj)
>      +                          ,i=1,m)
> 
> where vals is a real array. 
> The problem is that if I write the file and then I read it and I print "vals" 
> it contains 0.00 values. 
> If I set ll(j) = 1 and I write in both the routines: 
>       +                         ,l=1,1)
> the code works.
> 
> With old gfortran versions the code worked, as well as with other compilers.

please could you provide a self-contained example?


Reply to: