-
Notifications
You must be signed in to change notification settings - Fork 2
/
nclwrap
executable file
·86 lines (59 loc) · 1.59 KB
/
nclwrap
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
#!/bin/tcsh -f
# wrapper script for making passing of arguments to NCL scripts easier.
# invocation: nclwrap nclscript infile [ [otherfile] outfile]
if ($#argv < 2) then
echo Usage: nclwrap nclscript infile \[ \[otherfile\] outfile\]
exit
endif
set ncl = `basename $1 .ncl`
set var = `basename $2 | cut -f 1 -d _ | cut -f 1 -d .`
if ($ncl == regrid-rcm2rcm || $ncl == coarsen) then
set echo
ncl -Q -n $1 datafile=\"$2\" gridfile=\"$3\" outfile=\"$4\" varname=\"$var\"
unset echo
exit
endif
if ($ncl == patch-regrid) then
set echo
ncl -Q -n $1 infile=\"$2\" wgtfile=\"$3\" outfile=\"$4\" varname=\"$var\"
unset echo
exit
endif
if ($ncl == aggregate) then
set echo
ncl -Q -n $1 infile=\"$2\" outfile=\"$3\" interval=\"$4\" varname=\"$var\" $argv[5-]
unset echo
exit
endif
if ($ncl == wind-vector-plot || $ncl == calc_spd) then
set echo
ncl -Q -n $1 ufile=\"$2\" vfile=\"$3\" outfile=\"$4\" $argv[5-]
unset echo
exit
endif
if ($ncl == gap-find ) then
ncl -Q -n $1 infile=\"$2\" outfile=\"$3\" varname=\"$var\" $argv[4-]
exit
endif
if ($ncl == text2mask ) then
set echo
ncl -Q -n $1 infile=\"$2\" $argv[3-]
unset echo
exit
endif
if ($ncl == datetime ) then
ncl -Q -n $1 infile=\"$2\" $argv[3-]
exit
endif
if ($#argv == 2) then
ncl -Q -n $1 varname=\"$var\" infile=\"$2\"
exit
endif
# [should] work for: time-section-plot, plot-timestep, 3d-plots
set echo
ncl -Q -n $1 varname=\"$var\" infile=\"$2\" outfile=\"$3\" $argv[4-]
unset echo
exit
endif
# Copyright 2009-2012 Univ. Corp. for Atmos. Research
# Author: Seth McGinnis, [email protected]