source: BOL/Multi_atlas/make_index_html.sh @ 4697

Last change on this file since 4697 was 4341, checked in by musat, 20 months ago

Inclut environnement spirit et dernieres corrections (2/3)
IonelaMusat?

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