1 | #!/bin/bash |
---|
2 | |
---|
3 | |
---|
4 | comp=$1 |
---|
5 | |
---|
6 | local=`pwd -P` |
---|
7 | login=`whoami` |
---|
8 | hostname=`hostname` |
---|
9 | if [ ${hostname:0:5} = cicla ] ; then |
---|
10 | DODSDIR=/modfs/ipslfs/dods |
---|
11 | HTML00=http://vesg.ipsl.upmc.fr/thredds/fileServer/IPSLFS/$login |
---|
12 | machine=ciclad |
---|
13 | fi |
---|
14 | if [ ${hostname:0:5} = camel ] ; then |
---|
15 | DODSDIR=/modfs/ipslfs/dods |
---|
16 | fi |
---|
17 | if [ ${hostname:0:5} = irene ] ; then |
---|
18 | DODSDIR= |
---|
19 | fi |
---|
20 | if [ ${hostname:0:5} = jean- ] ; then |
---|
21 | DODSDIR= |
---|
22 | fi |
---|
23 | |
---|
24 | COMP_D=$DODSDIR/$login/lmdz/MultiSimu/$comp |
---|
25 | entetef=$COMP_D/entete.html |
---|
26 | |
---|
27 | local=`pwd` |
---|
28 | |
---|
29 | |
---|
30 | compf=$COMP_D/AXE7.html |
---|
31 | HTML=$HTML00/lmdz/MultiSimu/$comp |
---|
32 | |
---|
33 | DIRST=$DODSDIR/$login/lmdz/STATIONS |
---|
34 | HTMLST=$HTML00/lmdz/STATIONS |
---|
35 | |
---|
36 | DEF_FILE=$COMP_D/def.txt |
---|
37 | |
---|
38 | |
---|
39 | if [ -f $entetef ] ; then cat $entetef > $compf ; else \rm -f $compf ; touch $compf ; fi |
---|
40 | |
---|
41 | echo '<hr>' >> $compf |
---|
42 | |
---|
43 | cat <<eod>> $compf |
---|
44 | <h1> Comparaison aux stations </h1> |
---|
45 | |
---|
46 | <hr> |
---|
47 | Responsable : Fredho <br> |
---|
48 | |
---|
49 | eod |
---|
50 | |
---|
51 | liste_sim="" |
---|
52 | for s in `awk ' {print $1} ' $DEF_FILE | uniq` ; do liste_sim="$liste_sim $s" ; done |
---|
53 | |
---|
54 | |
---|
55 | # Regroupement des fichiers images stations concernes |
---|
56 | #---------------------------------------------------- |
---|
57 | mkdir -p $COMP_D/STATIONS ; cd $COMP_D/STATIONS |
---|
58 | |
---|
59 | sortir=1 |
---|
60 | for s in $liste_sim ; do |
---|
61 | if [ -d $DIRST/Figure_AMMA/$s -o -d $DIRST/Figure_SIRTA/$s -o -d $DIRST/Figure_SGP/$s ] ; then |
---|
62 | ln -sf $DIRST/Figure_AMMA/$s/*png . |
---|
63 | ln -sf $DIRST/Figure_SIRTA/$s/*png . |
---|
64 | ln -sf $DIRST/Figure_SGP/$s/*png . |
---|
65 | sortir=0 |
---|
66 | fi |
---|
67 | done |
---|
68 | |
---|
69 | if [ $sortir = 0 ] ; then |
---|
70 | |
---|
71 | # html multi simulations par station |
---|
72 | # ---------------------------------- |
---|
73 | virgu="" |
---|
74 | for year in 2006 2007 2009 2011 2012; do |
---|
75 | echo '<li><h2> '$year' :' >> $compf |
---|
76 | for station in wj ba ag na SIRTA SGP ; do |
---|
77 | if [ "`ls *${station}*_${year}.png`" != "" ] ; then |
---|
78 | lvar=( `ls *${station}*_${year}.png | cut -d_ -f1 | uniq` ) |
---|
79 | echo ${lvar[*]} |
---|
80 | echo ${#lvar[@]} |
---|
81 | lsim=( $liste_sim ) |
---|
82 | lpng="" ; virg="" ; for var in ${lvar[*]} ; do for s in $liste_sim ; do file=${var}_${station}_${s}_${year} ; echo FILE $file ; if [ -f "$file.png" ] ; then lpng="$lpng$virg$file" ; fi ; virg="," ; done ; done |
---|
83 | ~/LMDZ/MultiSimu/concat_html.sh . "OK" $lpng ${#lsim[@]} > $station$year.html |
---|
84 | cat <<eod>> $compf |
---|
85 | $virgu <a href="$HTML/STATIONS/$station$year.html"> $station </a> |
---|
86 | eod |
---|
87 | virgu="," |
---|
88 | fi |
---|
89 | done |
---|
90 | echo '</li></h2>' >> $compf |
---|
91 | done |
---|
92 | |
---|
93 | |
---|
94 | cd $local |
---|
95 | |
---|
96 | for figu in AMMA SIRTA SGP; do |
---|
97 | cat <<eod>> $compf |
---|
98 | <li><h2> $figu simulation : |
---|
99 | eod |
---|
100 | virg="" |
---|
101 | for s in $liste_sim ; do |
---|
102 | if [ -d $DIRST/Figure_$figu/$s ] ; then |
---|
103 | cat <<eod>> $compf |
---|
104 | $virg <a href="$HTMLST/Figure_$figu/$s/index2006.html"> $s </a> |
---|
105 | eod |
---|
106 | virg=, |
---|
107 | fi |
---|
108 | done |
---|
109 | cat <<eod>> $compf |
---|
110 | </li></h2> |
---|
111 | eod |
---|
112 | done |
---|
113 | |
---|
114 | fi # sortir=0 |
---|
115 | |
---|
116 | |
---|
117 | if [ -d $COMP_D/STATSE ] ; then |
---|
118 | cat <<eod>> $compf |
---|
119 | <br><hr><br> |
---|
120 | <h2><li><a href="$HTML/STATSE/index.html"> Cycle saisonniers moyens aux bouees </a> </li></h2> |
---|
121 | eod |
---|
122 | fi |
---|
123 | |
---|
124 | cat <<eod>> $compf |
---|
125 | </body> |
---|
126 | </html> |
---|
127 | eod |
---|
128 | |
---|
129 | |
---|
130 | echo $compf | sed -e 's:/modfs/ipslfs/dods/:http\://vesg.ipsl.upmc.fr/thredds/fileServer/IPSLFS/:' |
---|