




|
Tech Tips20
How to deal with Fortran data files and run Fortran program in Perl.
Author: Ben|Date: 2009/07/10|Back to Tech Tips
#!/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" ); } } |