Hi
Can anyone see a problem with the following output statement
WRITE( 10 , "(I5,',F',17(',',F12.5))" ) I_Sim , &
SimAvg%Flat%Year , (SimAvg%Flat%Quarter(Quarter) , Quarter=1,4) , &
(SimAvg%Flat%Month(Month),Month=1,12)
This works fine in 11.0.072 but 11.1.038 bitterly complains with
d:\john\Documents\Projects\RSE\src\simulation_engine.f90(657): error #6181: An extra comma appears in the format list. [,,F,]
d:\john\Documents\Projects\RSE\src\simulation_engine.f90(657): error #6181: An extra comma appears in the format list. [,,F]
Also, is there any reason why I can't compile a file by right clicking in the Solution Explorer in VS2008? This was a nice feature in VS2005.
Thanks
John
Can anyone see a problem with the following output statement
WRITE( 10 , "(I5,',F',17(',',F12.5))" ) I_Sim , &
SimAvg%Flat%Year , (SimAvg%Flat%Quarter(Quarter) , Quarter=1,4) , &
(SimAvg%Flat%Month(Month),Month=1,12)
This works fine in 11.0.072 but 11.1.038 bitterly complains with
d:\john\Documents\Projects\RSE\src\simulation_engine.f90(657): error #6181: An extra comma appears in the format list. [,,F,]
d:\john\Documents\Projects\RSE\src\simulation_engine.f90(657): error #6181: An extra comma appears in the format list. [,,F]
Also, is there any reason why I can't compile a file by right clicking in the Solution Explorer in VS2008? This was a nice feature in VS2005.
Thanks
John
链接已复制
10 回复数
Quoting - jimdempseyatthecove
John,
This may have nothing to do with it but your format descriptor uses 17(... but you are supplying 16 variables to write. Try changing 17 to 16 and see what happens.
Jim Dempsey
No it's ok - 12 months + 4 quarters + 1 year = 17 items (plus the integer)
I put the format into some test code I use and it compiled ok with IVF 10.1.025 -though I didn't use types just plain real arrays.
Ihave VS2008 and right click on my test code gave me a compile option in the popup menu. If you don't see it you could always addthe compile iconto a toolbar (I added it to my Build toolbar ) or use ctrl-F7
so I'm not sure what the cause of the error is (probably a bug in 11.1).
Les
Les,
Apparently we went to different counting schools
[cpp]WRITE( 10 , "(I5,',F',17(',',F12.5))" ) ...
[/cpp]
The year is printed using the I5, leaving the 4 quarters and 12 months (16 values)
Jim
In any case providiing "extra" format information should be completely harmless, and is a pretty common thing
to do. Like this case:
write(10,'(31I4)') (IDATA(imonth,J),J=1,ndays(imonth))
where ndays(imonth)could be 28,29,30, or 31
Quoting - jimdempseyatthecove
Les,
Apparently we went to different counting schools
[cpp]WRITE( 10 , "(I5,',F',17(',',F12.5))" ) ...
[/cpp]
The year is printed using the I5, leaving the 4 quarters and 12 months (16 values)
Jim
Quoting - jimdempseyatthecove
Les,
Apparently we went to different counting schools
[cpp]WRITE( 10 , "(I5,',F',17(',',F12.5))" ) ...
[/cpp]
The year is printed using the I5, leaving the 4 quarters and 12 months (16 values)
Jim
Re: my mental arithmatic. Nothing would suprise me but - What about the I_SIM integer on the same line as the write statement ;-)
Les
Quoting - Kevin Davis (Intel)
John, I cannot reproduce this error. Could you perhaps paste a small complete reproducer?
Hi Kevin,
If I replace the line with
WRITE( * , "(I5,',F',17(',',F12.5))" ) 3 , (1.0,C1=1,17)
I still get error #6181: An extra comma appears in the format list. [,,F,]
A new project (see below), builds OK and produces the expected output. I will keep digging into this
PROGRAM Main
INTEGER :: C1
WRITE( * , "(I5,',F',17(',',F12.5))" ) 3 , (1.0,C1=1,17)
END PROGRAM Main
Thanks
John
Quoting - Kevin Davis (Intel)
John, I cannot reproduce this error. Could you perhaps paste a small complete reproducer?
Any chance you're using the preprocessor on your original source?
- Lorri
Sounds like perhaps a project setting is at play since the new project doesn't exhibit the error. Maybe a quick visual comparison of each project's Properties > Fortran > Command Line setting will shed some light.