-
Notifications
You must be signed in to change notification settings - Fork 3
/
combine30.sh
executable file
·51 lines (34 loc) · 1.28 KB
/
combine30.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
#!/bin/bash
./get_awr.sh "$@"
if [[ "0" -ne $? ]]; then
# previous script exited with an error.
exit $?
fi
cd ace30
# # For some reasons, makxsf crashes on K-39. Remove it:
# rm 19K_039.*
# prepare single xsdir from separate *.xdr files:
cat ../awr.xsdir *.xdr > xsdir.1
# THe following commented code is to fix xsdir files for activation data. It is not needed currently, so I skip this.
# # ace/*.dir data contain 'filename' and 'route' instead of actual xslib name and 0. Fix this.
# # TODO: this approach does not take into account metastable nuclides. For example, Am242m is called
# # in this set 92242, i.e. exactly as the nuclide in the ground state.
# for d in $(ls *[^m].dir); do
# n=${d%.dir}
# sed 's/filename/'$n'/g; s/route/0/g' $d >> fendl.xsdir
# done
dos2unix -q xsdir.1
# Prepare specs file for makxsf that is used to put all cross-sections into a single file
T=${2:-1}
sed "s/XX/30/g; s/T/$T/g" ../specs.head > specs # specs line header
csplit -q xsdir.1 '/directory/1'
awk '{ print $1 }' xx01 >> specs # list of nuclides
echo >> specs # final empty line
# run makxsf
rm xsdir30.$T fendl30.$T;
makxsf
# copy resulted files to current dir
if [ -f fendl30.$T ]; then
cp fendl30.$T ../.
cp xsdir30.$T ../.
fi;