#!/bin/bash

local=`pwd -P`
login=`whoami`
hostname=`hostname`
if [ ${hostname:0:5} = cicla ] ; then
DODSDIR=/thredds/ipsl
dthredds=thredds-su.ipsl.fr/thredds/fileServer/ipsl_thredds
HTML00=http://${dthredds}/$login
machine=ciclad
fi
if [ ${hostname:0:5} = spiri ] ; then
DODSDIR=/thredds/ipsl
dthredds=thredds-su.ipsl.fr/thredds/fileServer/ipsl_thredds
HTML00=http://${dthredds}/$login
machine=spirit
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

set -x
comp=$1
MULTIDIR=$DODSDIR/$login/lmdz/MultiSimu
COMP_D=$MULTIDIR/$comp
PCMDI_D=$COMP_D/PCMDI

   # html pour les métriques
   cat $COMP_D/entete.html doc_pcmdi.html >| $COMP_D/PCMDI.html
   ref=`echo $listsimss | awk ' { print $1 } '`
   echo "<h1> Metrics with respect to forced-by-SST AMIP multi model </h1>" >>  $COMP_D/PCMDI.html
   cat $PCMDI_D/rms_xyt-CMIP5_AMIP-metrics.html >> $COMP_D/PCMDI.html
   echo "<h1> Metrics with respect to coupled CMIP5 simulations (historical)</h1>" >>  $COMP_D/PCMDI.html
   cat $PCMDI_D/rms_xyt-CMIP5_historical-metrics.html >> $COMP_D/PCMDI.html
   echo "<h1> Metrics with respect to IPSLCM5A-LR (clim A verifier)  </h1>" >>  $COMP_D/PCMDI.html
   cat $PCMDI_D/rms_xyt-AR4-metrics.html >> $COMP_D/PCMDI.html

#bias_xy-AR4-metrics.html         bias_xy-CMIP5_historical-metrics.html  cor_xyt-CMIP5_AMIP-metrics.html        rms_xyt-AR4-metrics.html         rms_xyt-CMIP5_historical-metrics.html
#bias_xy-CMIP5_AMIP-metrics.html  cor_xyt-AR4-metrics.html               cor_xyt-CMIP5_historical-metrics.html  rms_xyt-CMIP5_AMIP-metrics.html

