close

如何利用 Perl 處理 Fortran 輸入檔及執行主程式?

#!/usr/bin/perl

use File::Copy;

for( 1 .. 9 )
{
copy( "test_$_.dat", "input_ini.dat" ) or die "Can't copy file test_$_\n";
system( "./run.F90" );

if ( -d "result_$_" )
{
move("result.dat", "result_$_/result.dat" );
}
else
{
mkdir( "result_$_" );
move("result.dat", "result_$_/result.dat" );
}
}

來源:http://www.geego.com.tw/tech_support/tech_tips_20_how-to-deal-with-fortran-input-file-and-main-execution-program

arrow
arrow
    全站熱搜

    台灣 富捷IT培訓 發表在 痞客邦 留言(0) 人氣()