#!/bin/bash

pattern1=$1
pattern2=$2

output_values="U_norm_max ssh_norm_max S_max S_min"

#colordiff -y <(grep -r $value --include=\*.yaml results.$pattern1* | sed 's/\s\+/\n/g') <(grep -r $value --include=\*.yaml results.$pattern2* | sed 's/\s\+/\n/g')

for value in $output_values
do
	icdiff -W <(grep -r $value --include=\*.yaml results.$pattern1* | sed 's/\s\+/\n/g') <(grep -r $value --include=\*.yaml results.$pattern2* | sed 's/\s\+/\n/g')
done

echo "Compilation diffs:"
echo "================================================================================================"
icdiff -W <(head -n 70 results.$pattern1/icedyn_adv_pra.lst) <(head -n 70 results.$pattern2/icedyn_adv_pra.lst)

#full
icdiff -W <(tail -n 32 results.$pattern1/result.$pattern1.yaml) <(tail -n 32 results.$pattern2/result.$pattern2.yaml)

#stats
#icdiff -W <(stats.py results.$pattern1/result.$pattern1.yaml) <(tail -n 32 results.$pattern2/result.$pattern2.yaml)
