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