How to solve this - input/output keyword is invalid

How to solve this - input/output keyword is invalid


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)


4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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

tempstr = './output/CS.conm2_', iloop
appears suspicious. What is it supposed to do? Perhaps,
write(tempstr,'(A,I0)')'./output/CS.conm2_', iloop
is what was intended?

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)


I0 is probably not correct in his reply


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, 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.

Leave a Comment

Please sign in to add a comment. Not a member? Join today