155 |
echo "-1" >> tmp3.txt |
echo "-1" >> tmp3.txt |
156 |
# On the SGI O3K (*not* the O2K), "cat -n" inserts a ":" after the line number |
# On the SGI O3K (*not* the O2K), "cat -n" inserts a ":" after the line number |
157 |
cat tmp3.txt | sed -e 's|:||g' > tmp4.txt |
cat tmp3.txt | sed -e 's|:||g' > tmp4.txt |
158 |
digits_of_similarity=`./tmp_cmpnum < tmp4.txt` |
digits_of_similarity=`./tr_cmpnum < tmp4.txt` |
159 |
if [ $digits_of_similarity -eq 99 ]; then |
if [ $digits_of_similarity -eq 99 ]; then |
160 |
if [ $verbose -gt 0 ]; then |
if [ $verbose -gt 0 ]; then |
161 |
echo testoutput_for_prop: No comparison was available for \"$2\" 1>&2 |
echo testoutput_for_prop: No comparison was available for \"$2\" 1>&2 |
196 |
join t06.txt t16.txt > t6.txt |
join t06.txt t16.txt > t6.txt |
197 |
echo "-1" >> t5.txt |
echo "-1" >> t5.txt |
198 |
echo "-1" >> t6.txt |
echo "-1" >> t6.txt |
199 |
digits_5=`./tmp_cmpnum < t5.txt` |
digits_5=`./tr_cmpnum < t5.txt` |
200 |
digits_6=`./tmp_cmpnum < t6.txt` |
digits_6=`./tr_cmpnum < t6.txt` |
201 |
dashnum $digits_5 $digits_6 |
dashnum $digits_5 $digits_6 |
202 |
rm -f t[01][56].txt t[56].txt |
rm -f t[01][56].txt t[56].txt |
203 |
} |
} |
605 |
# create codelet for comparing model output |
# create codelet for comparing model output |
606 |
|
|
607 |
printf "creating the comparison code... " |
printf "creating the comparison code... " |
608 |
cat > tmp_cmpnum.c <<EOF |
cat > tr_cmpnum.c <<EOF |
609 |
#include <stdio.h> |
#include <stdio.h> |
610 |
#include <math.h> |
#include <math.h> |
611 |
int main( int argc, char** argv ) { |
int main( int argc, char** argv ) { |
612 |
int linnum,best,lncnt; |
int linnum,cmplin,best,lncnt; |
613 |
double a,b,abave,relerr; |
double a,b,abave,relerr; |
614 |
best = -22; |
best = -22; |
615 |
lncnt = 0; |
lncnt = 0; |
618 |
if (linnum == -1) break; |
if (linnum == -1) break; |
619 |
scanf("%lf", &a); scanf("%lf", &b); |
scanf("%lf", &a); scanf("%lf", &b); |
620 |
abave = 0.5*(fabs(a)+fabs(b)); |
abave = 0.5*(fabs(a)+fabs(b)); |
621 |
if (abave > 0.0) { |
if ( abave == abave ) { |
622 |
relerr=fabs(a-b)/abave; |
if (abave > 0.0) { |
623 |
if (relerr > 0.0) { linnum = (int)rint(log10(relerr)); } |
relerr=fabs(a-b)/abave; |
624 |
else { linnum = -16 ; } |
if (relerr > 0.0) { cmplin = (int)rint(log10(relerr)); } |
625 |
best = (best > linnum) ? best : linnum; |
else { cmplin = -16 ; } |
626 |
} |
best = (best > cmplin) ? best : cmplin; } |
627 |
|
else { cmplin = -22 ; } |
628 |
|
/* printf("%d ; %lf ; %lf\n",cmplin,a,b); */ |
629 |
|
} |
630 |
|
else { |
631 |
|
/* printf("%lf ; %lf ; %lf\n",abave,a,b); */ |
632 |
|
break; } |
633 |
} |
} |
634 |
if (lncnt == 999) best=-29; |
if (lncnt == 999) best=-29; |
635 |
|
if (linnum != -1) best=-99; |
636 |
printf("%d\n", -best); |
printf("%d\n", -best); |
637 |
return 0; |
return 0; |
638 |
} |
} |
639 |
EOF |
EOF |
640 |
$CC -o tmp_cmpnum tmp_cmpnum.c -lm |
$CC -o tr_cmpnum tr_cmpnum.c -lm |
641 |
|
|
642 |
if [ -x ./tmp_cmpnum ]; then |
if [ -x ./tr_cmpnum ]; then |
643 |
echo "OK" |
echo "OK" |
644 |
return 0 |
return 0 |
645 |
else |
else |
1232 |
fi |
fi |
1233 |
fi |
fi |
1234 |
|
|
1235 |
# rm -f tmp_cmpnum.f a.out |
rm -f tr_cmpnum.c tr_cmpnum |
|
rm -f tmp_cmpnum.c tmp_cmpnum |
|
1236 |
|
|
1237 |
if test "x$CLEANUP" != xt ; then |
if test "x$CLEANUP" != xt ; then |
1238 |
cat $SUMMARY | sed 's/ -- -- -- --//g' |
cat $SUMMARY | sed 's/ -- -- -- --//g' |