-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunall.sh
81 lines (67 loc) · 3.16 KB
/
runall.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
#
#-----------------------------------------------------------------------------------------#
# Bash file to run FRESCO's inputs for different energies. #
# .in files are FRESCO's inputs and .form files are external form factors used by FRESCO. #
#-----------------------------------------------------------------------------------------#
#
FRESCO=fresco #Calling FRESCO
GRACE=python
destino=fort.4 # .form file for each energy must be named fort.4 when running the correspondent .in file for that energy.
XSECS2=xsec_states.out # Data from FRESCO's output fort.13 [Xsec to all excited states one by one].
XSECS3=Cross_sections.out # Cross section output for each energy.
fort=fort.13
fort39=fort.39
lista=lista.txt # names of .in and .form files are here -> generated by frescoPRC tool.
grace_file=graphs.py
outfile=outfile.out # all output files for all energies are saved here.
archivo=prueba.txt #.txt with the name of all NAMELIST inputss
generador=frescoPRC #Modified generator to meet new input reading format (frescoPRC input.inp in console)
rm -f $destino; rm -f $XSECS; rm -f $XSECS2; rm -f $outfile;
#echo "Energy Elastic Absorption Reaction Total (MeV/mb)" > $XSECS3
while read este; do
ini=${este%%.*}
final=$ini.xsec4
#echo $este >> $final
#echo "Energy Elastic Absorption Reaction Total (MeV/mb)" > $final
$generador "$este"
while read input origen; do
base=${input%%.*}
output=$base.out
# Comment next line if you will make a run without any excited band (only G.S band).
ln -fs $origen $destino # This line will cause an error for only G.S band calculation (no .form files generated in that case).
elab=`cat $input | egrep elab | awk '{print $2 }'`
echo Running energy: $elab MeV
$FRESCO < $input > $output
xel=`grep 0.0000 $fort | awk '{print $9}'`
xtot=`grep 0.0000 $fort | awk '{print $8}'`
xabs=`grep -v NaN $fort39 | awk '{print $2}'`
xreac=`grep 0.0000 $fort | awk 'FNR ==2 {print $7}'`
x_gs_0=`grep 0.5 $fort | awk '{print $7}'`
echo ""
echo 'Elastic:' $xel mb
echo 'Reaction:' $xreac mb
echo 'Absorption:' $xabs mb
echo ""
echo $elab $xel $xabs $xreac $xtot >> $final
echo $elab $x_gs_0 >> $XSECS2
cat $output >> $outfile
rm -f $output # Removing each output file after saving it in $outfile.
done < $lista #looping for each pair .in/.form in $lista naming the .form fort.4 so FRESCO identify it.
rm -f $lista
rm -f fort*
rm -f fresco-* #Borrar todos los inputs entre target y target
rm -f DOMEIC16*
done < $archivo
#if [ -d Results ]; then # Results (cross sections, output files and graphs) are moved to another folder.
# echo 'Results of the run moved to "Results" folder'
#else
# mkdir Results
# echo 'Results of the run moved to "Results" folder'
#fi
#if [ -e $grace_file ]; then # If PythonFlag=1 in the tool's input, them make the graphs using python (matplotlib requiered).
# $GRACE $grace_file
# mv Total_CS.eps Results; mv Elastic_CS.eps Results; mv Absorption_CS.eps Results
#fi
#mv $XSECS3 Results; mv $XSECS2 Results; mv $outfile Results
rm -f $destino; rm -f $grace_file # !!Python file removed at the end.