source: multi_wave.sh @ 243

Last change on this file since 243 was 142, checked in by htune, 7 years ago

Modifications for multi wave.

  • Property svn:executable set to *
File size: 4.4 KB
Line 
1#!/bin/bash
2
3#set -vx
4########################################################################
5# 0/ Initialisation and contols
6########################################################################
7# Default bench
8LLM=130
9LLM=95
10
11for LLM in 95 ; do
12
13model=LMDZ
14metrics=ARMCU_REF_zav-400-600-theta_9_9
15param=param
16bench=""
17wave=1
18WDIR=BENCH$bench$model
19
20for wave in 1 2 3 ; do
21        case $wave in
22                1) cutoff=3 ; metrics="SANDU_REF_nebzave_55_60" ;;
23                2) cutoff=3 ; metrics="SANDU_REF_nebzave_55_60 SANDU_REF_neb4zave_55_60" ;;
24                3) cutoff=3 ; metrics="SANDU_REF_nebzave_55_60 SANDU_REF_neb4zave_55_60 IHOP_REF_Ay-theta_7_9 ARMCU_REF_Ay-theta_7_9" ;;
25                4) cutoff=3 ; metrics="SANDU_REF_nebzave_55_60 SANDU_REF_neb4zave_55_60 IHOP_REF_Ay-theta_7_9 ARMCU_REF_Ay-theta_7_9 ARMCU_REF_nebzave_7_9 ARMCU_REF_neb4zave_7_9 ARMCU_REF_nebmax_7_9" ;;
26                5) cutoff=2 ; metrics="SANDU_REF_nebzave_55_60 SANDU_REF_neb4zave_55_60 IHOP_REF_Ay-theta_7_9 ARMCU_REF_Ay-theta_7_9 ARMCU_REF_nebzave_7_9 ARMCU_REF_neb4zave_7_9 ARMCU_REF_nebmax_7_9" ;;
27                6) cutoff=3 metrics="SANDU_REF_nebzave_55_60 SANDU_REF_neb4zave_55_60 IHOP_REF_Ay-theta_9_9 ARMCU_REF_Ay-theta_7_9 ARMCU_REF_nebzave_7_9 ARMCU_REF_neb4zave_7_9 ARMCU_REF_nebmax_7_9 RICO_REF_nebmax_7_9 RICO_REF_nebzave_7_9 RICO_REF_neb4zave_7_9" ;;
28        esac
29
30SUF=ArticleFC
31param=param_${SUF}
32WDIR=1D${SUF}L$LLM
33
34sed -i -e 's/^LMAX=.*.$/LMAX='$LLM'/' models/LMDZ/serie_LMDZ.sh
35
36if [ `pwd | grep -o HighTune | wc -l` -gt 1 ]
37then
38  echo "Careful: the HighTune string appears more than once in your current directory:"
39  pwd
40  echo "This is going to be a problem! Make sure it appears only once!"
41  # some sed commands won't work otherwise; this should be improved.
42  exit
43fi
44
45while (($# > 0)) ; do
46        case $1 in
47          -bench) bench=$2 ; shift ; shift ;;
48          -param) param=$2 ; shift ; shift ;;
49          -wave)  wave=$2  ; shift ; shift ;;
50          -model) model=$2 ; shift ; shift ;;
51          -metrics) metrics="`echo $2 | sed -e 's/,/ /g'`" ; shift ; shift ;;
52          -help) echo Usage: $0 "[-bench N] [-param param_file] [-wave nwave] [-model model] [-metrics metrics1,metrics2,...] or directly "$0 model"" ; exit 0 ;;
53          -h) echo Usage: $0 "[-bench N] [-param param_file] [-wave nwave] [-model model] [-metrics metrics1,metrics2,...] or directly "$0 model"" ; exit 0 ;;
54          *) model=$1 ; shift ;;
55        esac
56done
57
58./setup.sh $model $WDIR
59cd WORK/$WDIR
60
61echo '##########################################################'
62echo 1/ Building design
63echo '##########################################################'
64
65
66sed -i -e 's/^cutoff=.*.$/cutoff='$cutoff'/' htune_EmulatingMultiMetric.R
67if [ $wave = 1 ] ; then
68 ./param2R.sh 50 3 $param
69else 
70./param2Rwave.sh $wave Wave$wave.RData
71fi 
72
73if [ $? != 0 ]; then
74  echo "Error during param2R.sh"
75  exit 1
76fi
77
78echo '##########################################################'
79echo 2/ Running the requires SCM simulations
80echo '##########################################################'
81
82# extracting the list of required simulations from the list of metrics
83simus=`for m in $metrics ; do if [ ${m:0:3} != RAD ] ; then echo \`echo $m | awk -F_ ' {print $1"/"$2 } '\` ; else echo \`echo $m | awk -F_ ' {print $1"/"$2"/"$3 } '\` ; fi ; done | sort | uniq`
84sed -i "s/WAVEN=.*/WAVEN="$wave"/g" expe_setup.R
85./serie_$model.sh $simus $wave
86
87if [ $? != 0 ]; then
88  echo "Error during serie_"$model".sh"
89  exit 1
90fi
91
92echo '##########################################################'
93echo  3/ Computing metrics
94echo '##########################################################'
95 
96./compute_metrics_csv.sh $metrics -wave $wave
97
98if [ $? != 0 ]; then
99  echo "Error during compute_metrics_csv.sh"
100  exit 1
101fi
102
103echo '##########################################################'
104echo  4/ Building emulators and estimating NROY space $wave
105echo '##########################################################'
106Rscript htune_EmulatingMultiMetric.R -wave $wave
107
108echo '##########################################################'
109echo 5/ Doing graphics for you. Then it will be tea time.
110echo '##########################################################'
111nmetrics=`echo $metrics | wc -w`
112if [ $nmetrics -gt 1 ] ; then pdfjam --nup $nmetrics,$nmetrics WAVE$wave/Plots_Metrics.pdf --outfile tmp.pdf
113else \cp -f WAVE$wave/Plots_Metrics.pdf tmp.pdf ; fi
114pdfjam InputSpace_wave$wave.pdf WAVE$wave/Plots_LOO.pdf tmp.pdf --landscape --outfile WAVE$wave/synthesis.pdf
115evince WAVE$wave/synthesis.pdf &
116
117done
118done
Note: See TracBrowser for help on using the repository browser.