-
Notifications
You must be signed in to change notification settings - Fork 2
/
check_OK.csh
executable file
·119 lines (106 loc) · 2.25 KB
/
check_OK.csh
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/csh
# Script is assumped to be run in the directory where
# the modeling system was run.
set VERBOSE = $1
set PROG = $2
if ( ( $PROG == real.exe ) || ( $PROG == ideal.exe ) ) then
set PRINT = $3
if ( $VERBOSE == TRUE ) then
if ( ! -e wrfinput_d01 ) then
echo No input file generated
exit (1)
else
echo OK: WRF preproc input file generated
endif
endif
grep -q "SUCCESS COMPLETE" $PRINT
set OK = $status
if ( $VERBOSE == TRUE ) then
if ( $OK != 0 ) then
echo No SUCCESS message in $PRINT
exit (2)
else
echo OK: SUCCESS found in $PRINT
endif
endif
if ( $PROG == real.exe ) then
foreach f ( wrfinput_d* wrfbdy_d01 )
ncdump $f | grep -iq "nan,"
set OK = $status
if ( $VERBOSE == TRUE ) then
if ( $OK == 0 ) then
echo Found NaN in REAL $f
exit (3)
else
echo OK: No NaN in REAL for $f
endif
endif
end
else if ( $PROG == ideal.exe ) then
foreach f ( wrfinput_d* )
ncdump $f | grep -iq "nan,"
set OK = $status
if ( $VERBOSE == TRUE ) then
if ( $OK == 0 ) then
echo Found NaN in IDEAL $f
exit (4)
else
echo OK: No NaN in IDEAL for $f
endif
endif
end
endif
else if ( $PROG == wrf.exe ) then
set PRINT = $3
set HOW_MANY = `ls -1 | grep wrfo | wc -l`
if ( $VERBOSE == TRUE ) then
if ( $HOW_MANY == 0 ) then
echo No WRF output file generated
exit (5)
else
echo OK: WRF output files generated
endif
endif
grep -q "SUCCESS COMPLETE" $PRINT
set OK = $status
if ( $VERBOSE == TRUE ) then
if ( $OK != 0 ) then
echo No SUCCESS message in $PRINT
exit (6)
else
echo OK: SUCCESS found in $PRINT
endif
endif
foreach f ( wrfout* )
ncdump $f | grep -iq "nan,"
set OK = $status
if ( $VERBOSE == TRUE ) then
if ( $OK == 0 ) then
echo Found NaN in $f
exit (7)
else
echo OK: No NaN in $f
endif
endif
end
else if ( $PROG == diffwrf ) then
set EXEC = $3
set FILE1 = $4
set FILE2 = $5
if ( -e fort.88 ) then
rm -rf fort.88
endif
if ( -e fort.98 ) then
rm -rf fort.98
endif
$EXEC $FILE1 $FILE2 >& /dev/null
if ( $VERBOSE == TRUE ) then
if ( ( -e fort.88 ) || ( -e fort.98 ) ) then
echo Diffs in $FILE1 $FILE2
$EXEC $FILE1 $FILE2
exit (8)
else
echo OK: diffwrf
endif
endif
endif