updated shell script

This commit is contained in:
Daniela Farina 2012-12-03 16:00:30 +00:00
parent 9fd9bf5f9c
commit 403ea3a938

View File

@ -60,6 +60,7 @@ for i in 0 1; do
# set output file names # set output file names
id="${mirror[i]}_t$t" id="${mirror[i]}_t$t"
f7file=$out/f7_${id}.txt f7file=$out/f7_${id}.txt
f48file=$out/f48_${id}.txt
rm -f $out/log_${id}.txt rm -f $out/log_${id}.txt
# add header in output file # add header in output file
echo "# =============================" > $f7file echo "# =============================" > $f7file
@ -67,6 +68,7 @@ for i in 0 1; do
echo "# ${mirror[i]}: R0=${r0[i]} z0=${z0[i]}" >> $f7file echo "# ${mirror[i]}: R0=${r0[i]} z0=${z0[i]}" >> $f7file
echo "# time=$t" >> $f7file echo "# time=$t" >> $f7file
echo "# =============================" >> $f7file echo "# =============================" >> $f7file
cp $f7file $f48file
appendheader=0 appendheader=0
#loop on beta #loop on beta
for (( beta=$bmin; beta<=$bmax ; beta=beta+db )); do for (( beta=$bmin; beta<=$bmax ; beta=beta+db )); do
@ -86,14 +88,19 @@ for i in 0 1; do
if (( $appendheader==0 )); then if (( $appendheader==0 )); then
# append parameters to header if first run of the loop # append parameters to header if first run of the loop
cat headers.txt >> $f7file cat headers.txt >> $f7file
cat headers.txt >> $f48file
echo "#beta alpha`head -n 1 fort.7 | sed 's/#//'`" >> $f7file echo "#beta alpha`head -n 1 fort.7 | sed 's/#//'`" >> $f7file
echo "#beta alpha`head -n 1 fort.48 | sed 's/#//'`" >> $f48file
appendheader=1 appendheader=1
fi fi
# add time and alpha values in first two columns # add time and alpha values in first two columns
awk 'NR>1 {print '$beta','$alpha',$0}' fort.7 >> $f7file awk 'NR>1 {print '$beta','$alpha',$0}' fort.7 >> $f7file
awk 'NR>1 {print '$beta','$alpha',$0}' fort.48 >> $f48file
echo "" >> $f48file
done done
#end of alpha loop #end of alpha loop
echo " " >> $f7file echo " " >> $f7file
echo "" >> $f48file
done done
#end of beta loop #end of beta loop
done done