source: modipsl/trunk/util/ins_post @ 12

Last change on this file since 12 was 12, checked in by bellier, 17 years ago

JB: svn now !

  • Property svn:executable set to *
File size: 12.5 KB
Line 
1#!/bin/ksh
2# $Id$
3#-----------------------------------------------
4#- Installation de scripts de post_traitement
5#-----------------------------------------------
6b_n=$(basename $0)
7d_n=$(dirname $0)
8
9#- Saisie et validation des options
10x_v='silencious';
11x_d='normal';
12x_t="";
13x_n="";
14
15while getopts :hvd:t: ops
16  do
17    case $ops in
18      (h)  echo "Usage    : "${b_n} \
19                " [-h] [-v] [-d] [-t h]  [-n f]";
20           echo " -h       : help";
21           echo " -v       : verbose mode";
22           echo " -d       : debug mode";
23           echo " -t h     : target host_name";
24           echo "Defaults  : -t local_host";
25           exit 0;;
26      (v)  x_v='verbose';;
27      (d)  x_d='debug';;
28      (t)  x_t=${OPTARG};;
29      (:)  echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2;
30           exit 2;;
31      (\?) echo ${b_n}" : -"${OPTARG}" option : not supported" 1>&2;
32           exit 2;;
33    esac
34  done
35shift $(($OPTIND-1));
36
37if   [ "$x_t" = "sx8brodie" ]; then
38   b_n_post=$(basename $HOME)
39   d_n_post=$(dirname $HOME | sed 's/home/u/')
40elif [ "$x_t" = "fjvpp" ]; then
41   b_n_post=$(basename $DMFDIR)
42   d_n_post=\/$(dirname $DMFDIR | awk -F\/ '{print $4}')
43elif [ "$x_t" = "sx8mercure" ]; then
44   b_n_post=$(basename $DMFDIR)
45   d_n_post=$(dirname $DMFDIR)
46else
47echo "        !!! WARNING !!!"
48echo " The path for the output files on the storage server,"
49echo " needed for post-traitement files, is not automaticaly set."
50echo " Please specify manually this path by replacing the AAAAAAA"
51echo " string in the Output Job with the desired path."
52echo "        !!! WARNING !!!"
53fi
54#- Traitement des options
55#- REAL precision
56# Target_Host Name
57if [ '\?'${x_t} = '\?' ]; then
58  x_t=`${d_n}/w_i_h`;
59  if [ $? -ne 0 ]; then
60    echo "Bad installation : w_i_h/uname unreachable" 1>&2;
61    exit 1;
62  elif [ "$x_t" = "Unknown" ]; then
63    echo "Local_Host not supported" 1>&2;
64    exit 1;
65  fi;
66fi;
67
68case ${x_t} in
69  ( aix | cray | fjvpp | linux | lxiv7 | lxiv8 | osf1 | \
70    solaris | t3e | sx8brodie | sx8mercure | unix ) ;;
71  (*)
72    echo "Target_Host "${x_t}" not supported" 1>&2;
73    exit 1;;
74esac
75#-
76x_m=$( (cd $d_n ; pwd) | sed -e "s,/util,," )
77
78if [ ${x_v} = 'verbose' ]; then
79  echo '--- Mode              : '${x_v};
80  echo '--- Compilation       : '${x_d};
81  echo '--- Target            : '${x_t};
82  echo '--- Name              : '${x_n};
83  echo '--- MODIPSL directory : '${x_m};
84fi;
85#-
86#-
87l_rep1=`find ${d_n}/.. -name mo2st -print`
88l_rep2=`find ${d_n}/.. -name da2st -print`
89l_rep3=`find ${d_n}/.. -name mo2se -print`
90l_rep4=`find ${d_n}/.. -name da2mo -print`
91l_rep5=`find ${d_n}/.. -name da4mo -print`
92l_rep6=`find ${d_n}/.. -name da2ye -print`
93l_rep7=`find ${d_n}/.. -name da4ye -print`
94l_rep8=`find ${d_n}/.. -name mo2ye -print`
95l_rep9=`find ${d_n}/.. -name mo4ye -print`
96l_rep10=`find ${d_n}/.. -name mo2sn -print`
97l_rep11=`find ${d_n}/.. -name da2sn -print`
98l_rep12=`find ${d_n}/.. -name txt2tar -print`
99l_rep13=`find ${d_n}/.. -name monitoring_script -print`
100l_rep14=`find ${d_n}/.. -name monitoring_loop_script -print`
101l_rep15=`find ${d_n}/.. -name monitoring_loop2_script -print`
102l_rep16=`find ${d_n}/.. -name atlas_cpl_se_ORCA_LIM -print`
103l_rep17=`find ${d_n}/.. -name atlas_cpl_se -print`
104l_rep18=`find ${d_n}/.. -name atlas_cpl_se_LMDZOR -print`
105l_rep19=`find ${d_n}/.. -name atlas_cpl_se_ORCA_LIM2 -print`
106l_rep20=`find ${d_n}/.. -name create_ts -print`
107#-
108#-
109
110
111W_OS=${x_t};
112
113if   [ ${W_OS}  = "sx8brodie" ]; then
114   format='\s'
115elif [ ${W_OS}  = "fjvpp" ]; then
116   format='\d'
117elif [ ${W_OS}  = "sx8mercure" ]; then
118   format='\g'
119else
120echo "        !!! WARNING !!!"
121echo " The display format of numbers,"
122echo " needed for the dates, is not automaticaly set."
123echo " Please specify manually this format by replacing the PPPPPPP"
124echo " string in the Output Job with the desired format."
125echo "        !!! WARNING !!!"
126fi
127
128echo " ";
129echo "Installation of simple execution jobs for $W_OS";
130echo " ";
131#-
132
133for i in $l_rep1 $l_rep2 $l_rep3 $l_rep4 $l_rep5 $l_rep6 $l_rep7 $l_rep8 $l_rep9 $l_rep10 $l_rep11 $l_rep12 $l_rep13 $l_rep14 $l_rep15 $l_rep16 $l_rep17 $l_rep18 $l_rep19 $l_rep20
134do
135  echo " "
136  case $i in
137  "$l_rep1") j=$(dirname $i);
138          MKTR="$j";
139          r=$(cd $j ; pwd);
140          echo "Installation of mo2st.job file in directory : $(cd $j ; pwd) ";
141          typeset -R W_XX[1];
142          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
143          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/mo2st | grep -v '^#-Q- ' $1 > ${r}/mo2st.job ;;
144 "$l_rep2") j=$(dirname $i);
145          MKTR="$j";
146          r=$(cd $j ; pwd);
147          echo "Installation of da2st.job file in directory : $(cd $j ; pwd) ";
148          typeset -R W_XX[1];
149          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
150          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/da2st | grep -v '^#-Q- ' $1 > ${r}/da2st.job ;;
151  "$l_rep3") j=$(dirname $i);
152          MKTR="$j";
153          r=$(cd $j ; pwd);
154          echo "Installation of mo2se.job file in directory : $(cd $j ; pwd) ";
155          typeset -R W_XX[1];
156          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
157          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/mo2se | grep -v '^#-Q- ' $1 > ${r}/mo2se.job ;;
158  "$l_rep4") j=$(dirname $i);
159          MKTR="$j";
160          r=$(cd $j ; pwd);
161          echo "Installation of da2mo.job file in directory : $(cd $j ; pwd) ";
162          typeset -R W_XX[1];
163          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
164          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/da2mo | grep -v '^#-Q- ' $1 > ${r}/da2mo.job ;;
165  "$l_rep5") j=$(dirname $i);
166          MKTR="$j";
167          r=$(cd $j ; pwd);
168          echo "Installation of da4mo.job file in directory : $(cd $j ; pwd) ";
169          typeset -R W_XX[1];
170          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
171          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/da4mo | grep -v '^#-Q- ' $1 > ${r}/da4mo.job ;;
172  "$l_rep6") j=$(dirname $i);
173          MKTR="$j";
174          r=$(cd $j ; pwd);
175          echo "Installation of da2ye.job file in directory : $(cd $j ; pwd) ";
176          typeset -R W_XX[1];
177          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
178          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/da2ye | grep -v '^#-Q- ' $1 > ${r}/da2ye.job ;;
179  "$l_rep7") j=$(dirname $i);
180          MKTR="$j";
181          r=$(cd $j ; pwd);
182          echo "Installation of da4ye.job file in directory : $(cd $j ; pwd) ";
183          typeset -R W_XX[1];
184          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
185          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/da4ye | grep -v '^#-Q- ' $1 > ${r}/da4ye.job ;;
186  "$l_rep8") j=$(dirname $i);
187          MKTR="$j";
188          r=$(cd $j ; pwd);
189          echo "Installation of mo2ye.job file in directory : $(cd $j ; pwd) ";
190          typeset -R W_XX[1];
191          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
192          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/mo2ye | grep -v '^#-Q- ' $1 > ${r}/mo2ye.job ;;
193  "$l_rep9") j=$(dirname $i);
194          MKTR="$j";
195          r=$(cd $j ; pwd);
196          echo "Installation of mo4ye.job file in directory : $(cd $j ; pwd) ";
197          typeset -R W_XX[1];
198          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
199          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/mo4ye | grep -v '^#-Q- ' $1 > ${r}/mo4ye.job ;;
200  "$l_rep10") j=$(dirname $i);
201          MKTR="$j";
202          r=$(cd $j ; pwd);
203          echo "Installation of mo2sn.job file in directory : $(cd $j ; pwd) ";
204          typeset -R W_XX[1];
205          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
206          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/mo2sn | grep -v '^#-Q- ' $1 > ${r}/mo2sn.job ;;
207  "$l_rep11") j=$(dirname $i);
208          MKTR="$j";
209          r=$(cd $j ; pwd);
210          echo "Installation of da2sn.job file in directory : $(cd $j ; pwd) ";
211          typeset -R W_XX[1];
212          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
213          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/da2sn | grep -v '^#-Q- ' $1 > ${r}/da2sn.job ;;
214  "$l_rep12") j=$(dirname $i);
215          MKTR="$j";
216          r=$(cd $j ; pwd);
217          echo "Installation of txt2tar.job file in directory : $(cd $j ; pwd) ";
218          typeset -R W_XX[1];
219          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
220          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/txt2tar | grep -v '^#-Q- ' $1 > ${r}/txt2tar.job ;;
221  "$l_rep13") j=$(dirname $i);
222          MKTR="$j";
223          r=$(cd $j ; pwd);
224          echo "Installation of monitoring_script.job file in directory : $(cd $j ; pwd) ";
225          typeset -R W_XX[1];
226          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
227          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/monitoring_script | grep -v '^#-Q- ' $1 > ${r}/monitoring_script.job ;;
228  "$l_rep14") j=$(dirname $i);
229          MKTR="$j";
230          r=$(cd $j ; pwd);
231          echo "Installation of monitoring_loop_script.job file in directory : $(cd $j ; pwd) ";
232          typeset -R W_XX[1];
233          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
234          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/monitoring_loop_script | grep -v '^#-Q- ' $1 > ${r}/monitoring_loop_script.job ;;
235  "$l_rep15") j=$(dirname $i);
236          MKTR="$j";
237          r=$(cd $j ; pwd);
238          echo "Installation of monitoring_loop2_script.job file in directory : $(cd $j ; pwd) ";
239          typeset -R W_XX[1];
240          set -A W_XX '\#\-D\-' '#-Q- '$W_OS ;
241          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/monitoring_loop2_script | grep -v '^#-Q- ' $1 > ${r}/monitoring_loop2_script.job ;;
242  "$l_rep16") j=$(dirname $i);
243          MKTR="$j";
244          r=$(cd $j ; pwd);
245          echo "Installation of atlas_cpl_se_ORCA_LIM.job file in directory : $(cd $j ; pwd) ";
246          typeset -R W_XX[1];
247          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
248          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/atlas_cpl_se_ORCA_LIM | grep -v '^#-Q- ' $1 > ${r}/atlas_cpl_se_ORCA_LIM.job ;;
249  "$l_rep17") j=$(dirname $i);
250          MKTR="$j";
251          r=$(cd $j ; pwd);
252          echo "Installation of atlas_cpl_se.job file in directory : $(cd $j ; pwd) ";
253          typeset -R W_XX[1];
254          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
255          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/atlas_cpl_se | grep -v '^#-Q- ' $1 > ${r}/atlas_cpl_se.job ;;
256  "$l_rep18") j=$(dirname $i);
257          MKTR="$j";
258          r=$(cd $j ; pwd);
259          echo "Installation of atlas_cpl_se_LMDZOR.job file in directory : $(cd $j ; pwd) ";
260          typeset -R W_XX[1];
261          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
262          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/atlas_cpl_se_LMDZOR | grep -v '^#-Q- ' $1 > ${r}/atlas_cpl_se_LMDZOR.job ;;
263  "$l_rep19") j=$(dirname $i);
264          MKTR="$j";
265          r=$(cd $j ; pwd);
266          echo "Installation of atlas_cpl_se_ORCA_LIM2.job file in directory : $(cd $j ; pwd) ";
267          typeset -R W_XX[1];
268          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
269          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/atlas_cpl_se_ORCA_LIM2 | grep -v '^#-Q- ' $1 > ${r}/atlas_cpl_se_ORCA_LIM2.job ;;
270  "$l_rep20") j=$(dirname $i);
271          MKTR="$j";
272          r=$(cd $j ; pwd);
273          echo "Installation of create_ts.job file in directory : $(cd $j ; pwd) ";
274          typeset -R W_XX[1];
275          set -A W_XX '\#\-D\-' '#-Q- '$W_OS;
276          sed  -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/create_ts | grep -v '^#-Q- ' $1 > ${r}/create_ts.job ;;
277 esac
278done
279echo " ";
280exit 0;
Note: See TracBrowser for help on using the repository browser.