fortran只将一些输出重定向到stdout

时间:2016-08-13 16:46:17

标签: fortran io-redirection

我是fortran的新手,遇到了以下问题。让我们考虑以下简单的“output.for”:

implicit none
character*10 str1,str2

call get_command_argument(1,setupfile)
open(20, file = setupfile)
read(20,*) str1, str2

write(6,*) str1        ! I want this to go to terminal output
write(6,*) str2        ! I'd like to have this redirected to a file

end

现在我将代码调用为:./output setupfile > outfile.dat 当“str2”被重定向到outfile.dat时,如何强制将“str1”打印到终端输出?

0 个答案:

没有答案