- 积分
- 0
- 注册时间
- 2005-4-1
- 仿真币
-
- 最后登录
- 1970-1-1
|
I want to generate strings “rf1.rpt”, “rf2.rpt”, ------, “rf1.dat”, “rf2.dat”, ------. I used the following Fortran script:
character*10 A_char, A_char1, A_char2
do 10 k=1,100
write(A_char,'(I2)') k
write(*,*) A_char
A_char1='rf'//A_char//'.rpt'
A_char2='rf'//A_char//'.dat'
write(*,*) A_char1, A_char2
open(13, file='A_char1')
open(21, file='A_char2')
When I compile it, there are 2 warnings:
Warning: Expression does not contribute to result A_char1='rf'//A_char//'.rpt'
--------^
Warning: Expression does not contribute to result A_char2='rf'//A_char//'.dat'
--------^
When I run it, I found that A_char1 is not rf1.rpt but rf1 and that A_char2 is not rf2 but rf2.dat. The results are consistent with the warnings there.
Any suggestion? I believe that I made silly mistakes. |
|