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

How to solve this - input/output keyword is invalid

Ajain_A_
Beginner
1,118 Views

 

Hello All,

can some somebody help me what is the following bug 


error:  #6640: This input/output keyword is invalid.

error #6332: A UNIT= specifier is required for this I/O operation.


#ifdef CONM2_OUT
   tempstr = './output/CS.conm2_', iloop
   call mg1g12conm2(CS_ID, tempstr)
#endif

 

0 Kudos
3 Replies
mecej4
Honored Contributor III
1,118 Views
Post the actual code that caused the error message. There are no recognizable I/O statements in the fragment posted, but it is hard to tell without seeing the relevant variable and type declarations. The statement [fortran]tempstr = './output/CS.conm2_', iloop[/fortran] appears suspicious. What is it supposed to do? Perhaps, [fortran]write(tempstr,'(A,I0)')'./output/CS.conm2_', iloop[/fortran] is what was intended?
0 Kudos
lklawrie
Beginner
1,118 Views
Well, you've only shown a brief excerpt of your code. As mecej4 says -- the tempstr assignment appears strange, not valid. (I0 is probably not correct in his reply, but otherwise, it is right on track)
0 Kudos
mecej4
Honored Contributor III
1,118 Views
I0 is probably not correct in his reply
Linda, The specification of a zero field width is allowed. It helps produce a minimal length string of digits (no leading blanks or zeros) from an integer. Section 10.7.2.1, Rule (2) of the Fortran 2008 standard says
(6) On output, with I, B, O, Z, F, and G editing, the specified value of the field width w may be zero. In such cases, the processor selects the smallest positive actual field width that does not result in a field filled with asterisks.
0 Kudos
Reply