#!/bin/bash #set -v login=`whoami` comp=$1 bias=$2 season=$3 proj=$4 ref=$5 shift ; shift ; shift ; shift ; shift sims="$*" nsims=$# echo REF $ref echo SIM $sims login=`whoami` hostname=`hostname` if [ ${hostname:0:5} = cicla ] ; then DODSDIR=/thredds/ipsl HTML=http://vesg.ipsl.upmc.fr/thredds/fileServer/IPSLFS/$login/lmdz/MultiSimu/$comp fi if [ ${hostname:0:5} = camel ] ; then DODSDIR=/thredds/ipsl fi if [ ${hostname:0:5} = irene ] ; then DODSDIR= fi if [ ${hostname:0:5} = jean- ] ; then DODSDIR= fi ATLAS_DIR=$DODSDIR/$login/lmdz/atlas COMP_D=$DODSDIR/$login/lmdz/MultiSimu/$comp ZON_DIR=$COMP_D/ZON ############################################################################# refb=`echo $ref | sed -e 's/_[0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9]//'` years=`echo $ref | sed -e 's/'$refb'//'` echo YEARS $years # Le nom semble avoir changé ... sref=$COMP_D/ATLAS/index_${proj}_${season}_${ref}.html sref=$COMP_D/ATLAS/index_${proj}_${season}_${ref}.html sed -i -e "s:thredds\/ipsl:thredds\/fileServer\/IPSLFS:g" ${sref} ############################################################################# compf=$COMP_D/$bias$proj$season.html echo $compf echo $ref emptyelt=' - ' entete=1 rm -f $compf ; touch $compf echo PROJ $proj echo SEASON $season if [ -f $sref ] ; then for i in `sed -n -e '/TH ALIGN=LEFT.*.li/=' $sref` ; do #for i in `sed -n -e '/
  • /=' $sref` ; do var=`sed -n -e ${i}p $sref | cut -d\( -f2 | cut -d\) -f1` echo $i $var if [ $entete = 1 ] ; then lpdf=`sed -n -e /PDF/= $sref` (( lpdfm1 = $lpdf - 1 )) ; (( lpdfp1 = $lpdf + 1 )) ; echo $lpdfm1 entete=0 #head -$lpdfm1 $sref | sed -e '/border-color:transparent/d' -e '/font-size:80/d' >> $compf ############################################################## # MENU DEROULANT ##############################################################:$ cat $COMP_D/entete.html >> $compf ##################################################################### # Fichiers pour l'enetete ##################################################################### echo '
    ' >> $compf echo '

    Multi atlas, '$season', simulation de référence : '$ref' ('$bias')

    ' >> $compf ##################################################################### sed -n -e $lpdfp1,${i}p $sref >> $compf cat <> $compf OBSERVATIONS $ref eod if [ "$bias" = "BIAS" ] ; then echo ''$ref' (BIAS)' >> $compf ; fi for sim in $sims ; do echo '' $sim '' >> $compf done echo ' ' >> $compf else # entete=1 (( iobs = $i + 4 )) (( iref = $i + 3 )) (( ibiais = $i + 5 )) # Repetition des noms des variables (( ntext = $nsims / 3 + 1 )) iii=1 while [ $iii -le $ntext ] ; do sed -n -e ${i}p $sref | sed -e 's:^::' -e 's/LEFT/LEFT colspan="2"/' >> $compf (( iii = $iii + 1 )) done echo ' ' >> $compf # Inclusion des moyennes zonales if [ -f $ZON_DIR/${var}zon.png ] ; then thredds=/thredds/fileServer/IPSLFS/fabric/lmdz/MultiSimu/$comp/ZON/${var}zon.png echo '' >> $compf else echo $emptyelt >> $compf fi sed -n -e ${iobs}p $sref >> $compf sed -n -e ${iref}p $sref >> $compf if [ "$bias" = "BIAS" ] ; then sed -n -e ${ibiais}p $sref >> $compf ; fi for sim in $sims ; do ######################################################### simb=`echo $sim | sed -e 's/_[0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9]//'` years=`echo $sim | sed -e 's/'$simb'//'` index=$COMP_D/ATLAS/index_${proj}_${season}_${sim}.html # if [ -f $index ] ; then is=`sed -n -e '/ Missing ' >> $compf else if [ "$bias" = "BIAS" ] ; then (( isbiais = $is + 5 )) ; else (( isbiais = $is + 3 )) ; fi sed -n -e ${isbiais}p $index >> $compf fi # fi done echo ' ' >> $compf fi done fi #echo VOTRE MULTIATLAS EST DISPONIBLE SUR $HTML/ACCUEIl.html