pgf90: FILE INQUIRE and SIZE option does not work

OS: 2.6.18-308.13.1.el5PAE #1 SMP i686 i686 i386 GNU/Linux
pgif90 versions: 12.5-0, 11.9-0

Program main
integer :: file_sz
OPEN(UNIT=10,FILE=‘test.in’)
INQUIRE(UNIT=10, SIZE=file_sz)
print*,file_sz
CLOSE(UNIT=10)
END

ls:
-rw-r–r-- 1 5 Feb 18 09:49 test.in

This program always returns a large negative number for file_sz (it should be 5). Is SIZE= not implemented? Same program (and test.in file) using gfortran and ifort works correctly.

Hi Breitenfeld,

Thanks for the report. I’ve written a problem report (TPR#19140) and sent it to our engineers for further investigation.

  • Mat

Could you tell me the status of this, was it a bug? was it reproducible?

Thanks

Hi Breitenfeld,

I just confirmed that TPR#19140 was fixed in the 13.3 release.

% pgfortran -V13.2 test.f90
% a.out
   1670019224
% a.out
   -521048312
% pgfortran -V13.3 test.f90
% a.out
            0

Thanks again for reporting this issue.

  • Mat

I just check the INQUIRE function using

pgf90 14.3-0 64-bit target on x86-64 Linux

and the INQUIRE function no longer works. Using the file:

-rw-r–r--. 1 brtnfld 2544 Mar 20 15:19 tget_file_image.h5

and the program:

Program main
integer :: file_sz
OPEN(UNIT=10,FILE=‘tget_file_image.h5’)
INQUIRE(UNIT=10, SIZE=file_sz)
print*,file_sz
CLOSE(UNIT=10)
END

With 14.3 the file_sz is always zero 0

With

pgf90 13.7-0 32-bit it returns 2544
pgf90 13.7-0 64-bit it returns 2544

which is correct

So it looks like the function is again broken :(

Very Sorry about this. It looks to have started failing again in 14.2. We normally catch these but for some reason the test for TPR#19140 missed being added to our regression test suite. I’ve reopened the TPR and asked then to make sure it gets added once fixed again.

  • Mat

The problem reported form this account is fixed in the current 14.4 release.
Thanks for the submission.

regards,
dave