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