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