Forum Moderators: bakedjake
-------------------------------
NCLIB=-L/home/octavius/netcdf/src/libsrc -lnetcdf
NCINC=-I/home/octavius/netcdf/src/f90
-I/home/octavius/df/src/libsrc
FFLAGSM = -fast
DEFINES= $(DEFS1) $(DEFS)
FFLAGS = $(FPPON) $(DEFINES) $(FFLAGSM)
FC=pgf90
LODCAOBJS = Read00.o
read00: $(LODCAOBJS)
$(FC) $(FFLAGS) $(NCINC) -o $@ $(LODCAOBJS) $(NCINB) $(NCLIB)
Read00.o:Read00.f
pgf90 $(NCINC) $(FFLAGS) -c Read00.f
-------------------------------------
Save the following as replace.pl then
chmod 755 replace.pl
perl replace.pl make
#!/usr/bin/perl
# warning, code comes with no warranty!my $nmake = 20; # number of output make files, only works for less than 100 now
my $template="";
while(<>){
$template .= $_;
}
for(my $i = 0; $i < $nmake; $i++){
my $newfile = $template;
my $istring=$i;
if($i < 10){
$istring = "0$i";
}
$newfile =~ s/00/$istring/mgs;
my $filename = "make$istring";
open OUT, ">$filename" or die "can't open $filename $!";
print OUT $newfile;
close OUT;
}