现代Fortran:无标签的输出格式 [英] Modern Fortran: Output format without label
本文介绍了现代Fortran:无标签的输出格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找一种无需使用标签即可指定输出格式的方法.
I am looking for a way to specify the output format without using a label.
要了解我的意思,请加上标签:
To understand what I mean, with label:
write(*,1001) icount, x, y
1001 format (i5,f5.2,e12.3)
没有标签应该是我将format (i5,f5.2,e12.3)
放置在write语句中的某处,例如write(*,format(i5,f5.2,e12.3)) icount, x, y
Without label should be that I put format (i5,f5.2,e12.3)
somewhere in the write statement, something like write(*,format(i5,f5.2,e12.3)) icount, x, y
我想我最近在某个地方看到过这个,但不幸的是我再也找不到了.如果存在,则为较新的Fortran版本的功能.也许是Fortran 90?也许是Fortran 2008?
I think I saw this somewhere recently but unfortunately I cannot find this again. If it exists it is a feature of a newer Fortran version. Maybe Fortran 90? maybe Fortran 2008?
推荐答案
尝试
write(*,'(i5,f5.2,e12.3)') icount, x, y
这篇关于现代Fortran:无标签的输出格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文