Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29386 Discussions

Runtime error message: no data-edit-descriptor to match a data-item in the I/O list, unit -5?

Darrell
Beginner
4,010 Views
What does the error message below mean? How do I find and fix the problem? [I'm using ifort 11.056 on Mac OSX 10.5.6 Intel Mac Pro 2008 with 32 Gb of memory.]

forrtl: severe (105): there is no data-edit-descriptor to match a data-item in the I/O list, unit -5, file Internal Formatted Write


I compiled with:
mpif90 -g -zero -save*.f
and ran with:
nice mpirun -np 8 a.out

Thinking I had done something stupid like set iunit to a negative number somewhere in this giant loop around thousands of runs (it doesn't happen the first time, it takes days before the error occurs and crashes that part of the run), I wrote the simple test program below to try and duplicate the weird error message. However, it now creates fort.-5 instead of generating the error trap like the other compilers do or writing the file like it does when iunit is positive? I was hoping the other compilers would give me a better error message but they just trigger the error trap as expected.

! test unit=-5 ifort error creates fort.-5

! Portland Group and Gnu Fortran both correctly error off

program test

implicit none

integer iunit

integer ierr

character*256 filename

!

iunit = -5 ! this should be .ge. zero according to spec

filename = 'output.tmp'

print *,'testing: ', trim(filename), ' ', iunit

open (unit=iunit, file=filename, err=200, iostat=ierr)

write (unit=iunit,fmt=123) 22.0 / 7.0

close (unit=iunit, err=200, iostat=ierr)

123 format (G20.9)

print *,'Done'

goto 999

! Error trap

200 print *, 'Error! ',ierr

!

999 continue

end program test

0 Kudos
5 Replies
Steven_L_Intel1
Employee
4,010 Views
Don't use negative numbers for units - you're confusing the run-time library which uses -5 for internal I/O.
0 Kudos
Kevin_D_Intel
Employee
4,010 Views

There was an intentional change in the error issued for the error condition shown in the sample below where there is no data-edit descriptor for the data item.

[plain]program sample
  implicit none
  integer :: n
  n = 1
  write(*,'(''n'')') n
end program sample[/plain]

For the sample program above, the 10.1 compiler previously issued an error like:

forrtl: severe (60): infinite format loop, unit -1, file /dev/ttys000

The 11.0 compiler now issues this form of error:

forrtl: severe (105): there is no data-edit-descriptor to match a data-item in the I/O list, unit -1, file /dev/ttys002

The error you received relates to using a negative unit number, -5, as Steve indicated in an internalwrite similar to the sample.
0 Kudos
Darrell
Beginner
4,010 Views
I'll recompile & rerun adding -trackback compiler option and it should tell me where it hurts. I'm sure I've done something stupid. I'm not using negative numbers for units on purpose, I was just trying to duplicate the problem in a smaller test case. I had suspected a calculated unit overflow until you pointed me in the right direction looking for a write/format mismatch.

I've updated your sample below but it gets error unit -1. Where is unit -5 coming from in the "run-time library for internal I/O"? Thanks for the clue!

c compile: ifort -g -traceback sample.f
program sample
n = 42
print 111, n ! also makes error if use format 113
write(6,111) n
write(*,111) n
write(*,113) n ! unit -1 is from *, error is in format below
111 format ('n = ', i4)
113 format ('missing format for int here')
end program sample

ifort 11.056:
forrtl: severe (105): there is no data-edit-descriptor to match a data-item in the I/O list, unit -1, file /dev/ttys000
Image PC Routine Line Source
a.out 0000000100061D41 Unknown Unknown Unknown
a.out 0000000100060E04 Unknown Unknown Unknown
a.out 000000010003C3C3 Unknown Unknown Unknown
a.out 0000000100019A6F Unknown Unknown Unknown
a.out 000000010001921C Unknown Unknown Unknown
a.out 000000010003B951 Unknown Unknown Unknown
a.out 0000000100038B2F Unknown Unknown Unknown
a.out 0000000100001333 _MAIN__ 13 msg.f
a.out 000000010000119C Unknown Unknown Unknown
a.out 0000000100001134 Unknown Unknown Unknown

gnufortran:
At line 13 of file msg.f
Fortran runtime error: Insufficient data descriptors in format after reversion missing format for int heremissing format for int here

Portland Group:
PGFIO-F-246/formatted write/unit=6/infinite format scan for edit descriptor.
File name = stdout formatted, sequential access record = 6
In source file msg.f, at line number 13

[Back in the day when tech magazines were printed and mailed out via USPS, a 'user interface evagilist' named Tog had a contest on the worst error message of the year. I see he is still alive & preaching at www.asktog.com(The winner was a printer that after you put in paper, printed a sheet with Error: out of paper!) After taking compiler design, I understand the tradeoffs as shown by the three compiler error messages for the same problem above.]

0 Kudos
Kevin_D_Intel
Employee
4,010 Views

I was wrong. Based on Steve's reply, the error does not involve using a negative unit number. The error occurs when using an internal writeas follows:

[cpp]program sample
  implicit none
  integer :: n
  character temp
  n = 1
  write(temp,'(''n'')') n
end program sample[/cpp]

This generates the following error:

forrtl: severe (105): there is no data-edit-descriptor to match a data-item in the I/O list, unit -5, file Internal Formatted Write

Inspect all internal writes in your program and ensure the necessary data edit descriptors have been provided for all the data items being written.
0 Kudos
Steven_L_Intel1
Employee
4,010 Views
The unit -5 was explicitly specified in the original program - this unit number is reserved for use by internal I/O statements. As Kevin notes, though, the unit number is not what's important here but rather the lack of a data-transferring edit descriptor in the format.
0 Kudos
Reply