summaryrefslogtreecommitdiff
path: root/hp_height_study_driver.sh
blob: 4c897e5fa5819bc7d3b32f5399569987501f35f3 (plain)
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
#!/bin/bash

if [[ $1 != "merlin" ]]; then
    mkdir -p results/outputs
    touch results/keff_table
    echo "#" $(date) > results/keff_table
    results_dir=results/outputs
fi


if [[ $1 == "lclrs" ]]; then
    prog=(openmc-inst01.py krusty.py -l -r)
    pool_seq=$(seq 1 45)
elif [[ $1 == "merlin" ]]; then
    prog=(../krusty.py)
    pool_seq=$2
    results_dir=.
else
    prog=(./krusty.py -r)
    pool_seq=$(seq 1 45)
fi

green="\e[0;32m"
reset="\e[0m"

for pool_height in $pool_seq; do
    echo -e "$green Starting runs for $pool_height cm pool height... $reset"
    for sat_height in $(seq $pool_height 45); do
        output_file=$results_dir/p$pool_height\_s$sat_height.out
        "${prog[@]}" -p $pool_height -s $sat_height > $output_file
        keff=$(cat $output_file | grep "Combined k-effective" | cut -d "=" -f 2 | cut -d "+" -f 1)
        pm=$(cat $output_file | grep "Combined k-effective" | cut -d "=" -f 2 | cut -d "-" -f 2)
        md5=$(cat $output_file | grep "MD5:" | cut -d ":" -f 2 | sed "s/ //g")
        echo K-eff $keff +/- $pm found for p=$pool_height and s=$sat_height \($md5\)
        if [[ $1 != "merlin" ]]; then echo $pool_height $sat_height $keff $pm $(hostname) $md5 \($(date)\) >> results/keff_table; fi
    done
done