/[MITgcm]/MITgcm_contrib/heimbach/OpenAD/doDiff.bash
ViewVC logotype

Annotation of /MITgcm_contrib/heimbach/OpenAD/doDiff.bash

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Wed Jan 31 15:36:37 2007 UTC (18 years, 5 months ago) by utke
Branch: MAIN
consolidate update scripts

1 utke 1.1 function Usage {
2     echo "Usage: $0 <testName>"
3     echo " where <testName> is for instance shallow_openad"
4     echo " executed in code_<testName>/RefTrans"
5     }
6     if [ $# -ne 1 ]
7     then
8     echo "Error: missing argument"
9     Usage $*
10     exit -1
11     fi
12     testName=$1
13     currPath=${PWD%%/code_${testName}/RefTrans}
14     if [ "$currPath/code_${testName}/RefTrans" != "$PWD" ]
15     then
16     echo "Error: not in code_${testName}/RefTrans"
17     Usage $*
18     exit -2
19     fi
20     if [ -n "$BATCHMODE" ]
21     then
22     fileList='m.out'
23     else
24     fileList='ad_input_code_sf.f ad_input_code_sf.w2f.f ad_input_code_sf.w2f.canon.f ad_input_code_sf.w2f.canon.xaif ad_input_code_sf.w2f.canon.xb.xaif ad_input_code_sf.w2f.canon.xb.x2w.w2f.f ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.f ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.pp.f ad_input_code.w2f.canon.xb.x2w.w2f.rs.pp.f all_mods.xb.x2w.w2f.pp.f m.out'
25     fi
26     for i in `echo ${fileList}`
27     do
28     gunzip -c ${i}.gz > ${i}
29     echo "$i old reference (<) vs new file (>)"
30     echo "------------------------------------------------------------------------------"
31     diff -i -I "file translated from " $i ../../../../../MITgcm/verification/OpenAD/build_${testName}/$i
32     if [ $? -ne 0 -a -z "$BATCHMODE" ]
33     then
34     echo "update reference for $i? [y]/n "
35     read answer
36     if [ "$answer" == "n" ]
37     then
38     echo "not updated"
39     else
40     echo "copying"
41     cp ../../../../../MITgcm/verification/OpenAD/build_${testName}/$i $i
42     gzip -f ${i}
43     fi
44     fi
45     done

  ViewVC Help
Powered by ViewVC 1.1.22