Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
38 Views

Bug in Intel 2019u1 with INQUIRE and WRITE

I'm seeing a bug in Intel 2019u1 (after updating from 2017u4). The following is a very stripped-down example that shows the problem:

program main
		
  implicit none
  
  integer :: file_id,iostatus
  logical :: status_flag
  character(len=:),allocatable :: str
  
  file_id = 1003
  
  open(unit=file_id,file='test.txt',status='REPLACE',iostat=iostatus)
  
  str = '1'
  inquire(unit=file_id, opened=status_flag, iostat=iostatus)	
  write(file_id,fmt='(A)',advance='NO',iostat=iostatus) str		
  
  str = '2'
  inquire(unit=file_id, opened=status_flag, iostat=iostatus)			
  write(file_id,fmt='(A)',advance='NO',iostat=iostatus) str		
  
  str = '3'
  inquire(unit=file_id, opened=status_flag, iostat=iostatus)		
  write(file_id,fmt='(A)',advance='NO',iostat=iostatus) str
  
  close(unit=file_id)
			
end program main

The contents of the resulting file should be "123", but I'm getting only "3". If I comment out the INQUIRE calls, it works as expected. It seems like the INQUIREs are interfering with or preventing some of the WRITE statements in some way.

I'm using the 64 bit compiler on Windows 10. Same results for both Debug and Release builds.

0 Kudos
2 Replies
Highlighted
New Contributor III
38 Views

Hi Jacob, I can confirm that behavior for PSXE2018u3 and PSXE2019u1. PSXE2017u6 works as expected with inquire present. Gfortran 8.2.1 delivers also '123'. It would be good to open a ticket at OSC to get the Intel team informed.

BR, Johannes

0 Kudos
New Contributor I
38 Views

Done (Support request number 03934032)

0 Kudos