Last change
on this file since 42 was
42,
checked in by pinsard, 14 years ago
|
improvements of headers and unset in shell scripts
|
-
Property svn:executable set to
*
-
Property svn:keywords set to
Id
|
File size:
1.5 KB
|
Line | |
---|
1 | #! /bin/sh |
---|
2 | # |
---|
3 | #+ |
---|
4 | # |
---|
5 | # ============= |
---|
6 | # step2_diff.sh |
---|
7 | # ============= |
---|
8 | # |
---|
9 | # ------------------------------------------ |
---|
10 | # launch step2_diff.pro with year argument |
---|
11 | # ------------------------------------------ |
---|
12 | # |
---|
13 | # SYNOPSYS |
---|
14 | # ======== |
---|
15 | # |
---|
16 | # :: |
---|
17 | # |
---|
18 | # $ step2_diff.sh -y year |
---|
19 | # |
---|
20 | # EXAMPLES |
---|
21 | # ======== |
---|
22 | # |
---|
23 | # For test on year 1994:: |
---|
24 | # |
---|
25 | # $ ./step2_diff.sh -y 1994 |
---|
26 | # |
---|
27 | # EVOLUTIONS |
---|
28 | # ========== |
---|
29 | # |
---|
30 | # $Id$ |
---|
31 | # |
---|
32 | # - fplod 20100318T074009Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
33 | # |
---|
34 | # * unset |
---|
35 | # |
---|
36 | # - fplod 2007-08-22T08:50:02Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
37 | # |
---|
38 | # * creation to avoid retall and redefinition of file1 and file2 |
---|
39 | # |
---|
40 | #- |
---|
41 | # |
---|
42 | system=$(uname) |
---|
43 | case "${system}" in |
---|
44 | AIX|IRIX64) |
---|
45 | echo " www : no specific posix checking" |
---|
46 | ;; |
---|
47 | *) |
---|
48 | set -o posix |
---|
49 | ;; |
---|
50 | esac |
---|
51 | unset system |
---|
52 | # |
---|
53 | command=$(basename ${0}) |
---|
54 | # |
---|
55 | usage=" Usage : ${command} -y year" |
---|
56 | # |
---|
57 | while [ ! -z "${1}" ] # ++ pb bash |
---|
58 | do |
---|
59 | case ${1} in |
---|
60 | -y) # year |
---|
61 | year=${2} |
---|
62 | shift |
---|
63 | ;; |
---|
64 | *) # other choice |
---|
65 | echo "eee : unknown option ${1}" |
---|
66 | echo "${usage}" |
---|
67 | exit 1 |
---|
68 | ;; |
---|
69 | esac |
---|
70 | shift # next flag |
---|
71 | done |
---|
72 | unset usage |
---|
73 | # |
---|
74 | # ++ check year validity |
---|
75 | # |
---|
76 | # remove previous output file |
---|
77 | rm Sigma_5d_${year}_grid_T_ORCA2_diff.nc |
---|
78 | # |
---|
79 | # build IDL sequence of commands |
---|
80 | cat <<EOF > /tmp/${command}${$}.pro |
---|
81 | year=getenv('year') |
---|
82 | file1= '/usr/work/sur/fvi/OPA/ORCA2/' + '/Sigma_5d_'+year+'_grid_T.nc' |
---|
83 | file2=getenv('GEOMAG_OD') + '/Sigma_5d_'+year+'_grid_T_ORCA2.nc' |
---|
84 | step2_diff, file1, file2, 'Sigma_5d_'+year+'_grid_T_ORCA2_diff.nc' |
---|
85 | EOF |
---|
86 | # |
---|
87 | unset year |
---|
88 | # |
---|
89 | # launch IDL with the sequence |
---|
90 | ${IDL_DIR}/bin/idl < /tmp/${command}${$}.pro |
---|
91 | # |
---|
92 | # cleanning |
---|
93 | #++rm /tmp/${command}${$}.pro |
---|
94 | # |
---|
95 | # end |
---|
96 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.