source: BOL/Multi_atlas/html/make_index_html.sh @ 4505

Last change on this file since 4505 was 4311, checked in by musat, 20 months ago

Suite et fin de la fusion entre la version commune (compte fabric) et la version perso
IonelaMusat?

  • Property svn:executable set to *
File size: 2.7 KB
Line 
1#!/bin/bash
2
3comp=$1
4dataref=$2
5
6login=`whoami`
7
8DODSDIR=/thredds/ipsl
9
10echo DODSDIR : $DODSDIR
11MAIN_SE=$DODSDIR/$login/lmdz/SE
12TS_DA=$DODSDIR/$login/lmdz/TS_DA
13TS_MO=$DODSDIR/$login/lmdz/TS_MO
14MULTIDIR=$DODSDIR/$login/lmdz/MultiSimu
15
16COMP_D=$MULTIDIR/$comp
17
18if [ $dataref = 1 ]; then
19ref=OBS
20elif [ $dataref = 0 ]; then
21ref=`head -1 ${COMP_D}/def.txt | awk ' { print $1"_"$2 } '`
22fi
23
24echo dataref=$dataref
25echo ref=$ref
26
27DEF_FILE=$COMP_D/def.txt ; if [ ! -f $DEF_FILE ] ; then echo renseigner $DEF_FILE ; exit ; fi
28RUNS=""
29RUNS=`awk ' {print $1"_"$2 } ' $DEF_FILE`
30
31echo $RUNS
32
33natlas=`wc -l $COMP_D/atlas-def | awk ' { print $1 } '`
34echo $natlas
35
36for sim in $RUNS; do
37
38 il=1
39 if [ ! -f $COMP_D/atlas-def ] ; then
40    echo Definir les atlas a construire dans $COMP_D/atlas-def
41    echo Example :
42    cat $COMP_D/../CMIP5to6/atlas-def
43 fi
44 while [ $il -le $natlas ] ; do
45    line=`sed -n -e ${il}p $COMP_D/atlas-def`
46    seas=`echo $line | awk ' { print $1 } '`
47    proj=`echo $line | awk ' { print $2 } '`
48    vars=`echo $line | awk ' { print $3 } '`
49    varg=`echo $vars | sed -e 's/,/ /g'`
50
51listvar=""
52for var in $varg; do
53
54case $var in
55          tas) titre='2M Temperature' ;;
56          pr) titre='Precipitation' ;;
57          crest) titre='CRE SW TOA' ;;
58          crelt) titre='CRE LW TOA' ;;
59          crett) titre='CRE Net TOA' ;;
60          rtt) titre='Rad. Net TOA' ;;
61          rstt) titre='Rad. SW TOA' ;;
62          rlut) titre='Rad. LW TOA' ;;
63          prw) titre='Precipitable Water' ;;
64          rsds) titre='Rad. SW Down Sfce' ;;
65          hfls) titre='Latent heat flux' ;;
66          ta) titre='Air Temperature' ;;
67          ua) titre='Zonal wind' ;;
68          hur) titre='Relative Humidity' ;;
69          hurs) titre='Surface Relative Humidity' ;;
70          psl) titre='Sea level pressure' ;;
71          albs) titre='Surface albedo' ;;
72          *) titre=${var} ;;
73esac
74
75if [ "${titre}" == ${var} ]; then 
76 echo WARNING: la variable $var n est pas presente dans make_index_html.sh
77 echo WARNING: Ajouter-la avec un titre dans le case ci-dessus et
78 echo WARNING: relancer job_multi.sh en activant la partie html uniquement!
79fi
80
81cp var_html.html "${var}"_html.html
82
83#echo var=$var"endvar" titre=$titre"endtitre"
84sed -i -e "s/VAR/${var}/g" ${var}_html.html
85sed -i -e "s/TITRE/${titre}/g" ${var}_html.html
86sed -i -e "s/SIMULATION/${sim}/g" ${var}_html.html
87sed -i -e "s/LOGIN/"${login}"/g" ${var}_html.html
88sed -i -e "s/SEASON/"${seas}"/g" ${var}_html.html
89sed -i -e "s/DREF/"${ref}"/g" ${var}_html.html
90sed -i -e "s/REGION/"${proj}"/g" ${var}_html.html
91listvar="$listvar ${var}_html.html"
92done
93cat entete_html.html ${listvar} suff_html.html > ${COMP_D}/ATLAS/index_${proj}_${seas}_${sim}.html
94echo \rm ${listvar}
95\rm ${listvar}
96(( il = $il + 1 ))
97done
98
99done
100
101
102exit
Note: See TracBrowser for help on using the repository browser.