Changeset 86
- Timestamp:
- Dec 11, 2018, 5:55:17 PM (7 years ago)
- Files:
-
- 4 edited
-
bench_AROME.sh (modified) (1 diff)
-
models/AROME/prep_config_tunning.py (modified) (4 diffs)
-
models/AROME/serie_AROME.sh (modified) (5 diffs)
-
models/LMDZ/serie_LMDZ.sh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
bench_AROME.sh
r69 r86 1 1 #!/bin/bash 2 2 3 model=AROME 4 case=ARMCU 5 subcase=REF 6 7 DATE=`date "+%Y%m%d"` 8 9 MULTIMETRICS=TRUE 10 ./setup.sh $model BENCHMARK/$model/$DATE 11 cd WORK/BENCHMARK/$model/$DATE 12 13 # To be modified if namelists and binaries are not at the default location 14 cat << EOF > param_AROME 15 nlev=90 16 timestep=50 17 cycle=41t1_op1.11_MUSC 18 simuREF=AROME_OPER 19 namref=$REP_MUSC/namelist/AROME/namarp_41t1_AROME_HTUNE 20 namsfx=$REP_MUSC/namelist/SURFEX/nam.sfx.tl127.CMIP6.v631 21 MASTER=/home/honnert/pack/41t1_op1.11_MUSC/bin/MASTERODB 22 PGD=/home/honnert/pack/41t1_op1.11_MUSC/bin/PGD 23 PREP=/home/honnert/pack/41t1_op1.11_MUSC/bin/PREP 24 EOF 25 26 cat << EOF > expe_setup.R 27 ############################################################################# 28 # Purpose : define the setup of the experiments, i.e.the case, subcase, 29 # target variables and wave number. 30 #######################################i###################################### 31 # available targetvar 32 # theta500 : potential temperature at 500m 33 # qv500 : water vapor at 500m 34 # zhneb : effective height of cloud 35 # nebmax : max nebulosity 36 # nebzmin : base of clouds (min z with neb > 5% nebmax) 37 # nebzmax : top of clouds (max z with neb > 5% nebmax) 38 #######################################i##################################### 39 case_name="$case" 40 subcase_name="$subcase" 41 #targetvar<- c("theta500") 42 #plotvar="theta" # qv ou rneb 43 # Exemple for multi-target experiment : 44 targetvar<- c("theta500","qv500","zhneb","nebmax") 45 nmetrique=length(targetvar) 46 # Wave number 47 WAVEN=1 48 EOF 49 50 echo '###########################' 51 echo 'Executing param2R.sh' 52 #./param2R.sh 10 3 AROME_tuning_compa_thermique_PM09.txt > param2R.out 2> param2R.err 53 ./param2R.sh 30 3 AROME_tuning_compa_thermique_PM09.txt > param2R.out 2> param2R.err 54 cat param2R.err 55 56 echo '###########################' 57 echo 'Executing serie_AROME.sh' 58 ./serie_AROME.sh $case $subcase > serie_AROME.out 2> serie_AROME.err 59 cat serie_AROME.err 60 61 echo '###########################' 62 echo 'Executing htune_ncdf2Rdata.R' 63 Rscript htune_ncdf2Rdata.R > htune_ncdf2Rdata.out 2> htune_ncdf2Rdata.err 64 cat htune_ncdf2Rdata.err 65 66 echo '###########################' 67 echo 'Executing htune_EmulatingSCM_CS2.R' 68 # simple metrics 69 if [ $MULTIMETRICS == TRUE ];then 70 Rscript htune_EmulatingSCM.R > htune_EmulatingSCM.out 2> htune_EmulatingSCM.err 71 cat htune_EmulatingSCM.err 72 else 73 Rscript htune_EmulatingSCM_CS2.R > htune_EmulatingSCM_CS2.out 2> htune_EmulatingSCM_CS2.err 74 cat htune_EmulatingSCM_CS2.err 3 if [ `pwd | grep -o HighTune | wc -l` -gt 1 ] 4 then 5 echo "Careful: the HighTune string appears more than once in your current directory:" 6 pwd 7 echo "This is going to be a problem! Make sure it appears only once!" 8 # some sed commands won't work otherwise; this should be improved. 9 exit 75 10 fi 76 11 77 if [ $MULTIMETRICS == TRUE ];then 78 #pdfjam WAVE1/ARMCU/REF/Plots_LOO.pdf 1 79 pdfjam WAVE1/$case/$subcase/Plots_LOO.pdf 1 80 pdf2ps Plots_LOO-1-pdfjam.pdf 81 ps2epsi Plots_LOO-1-pdfjam.ps 82 epstopdf Plots_LOO-1-pdfjam.epsi 83 pdfjam Plots_LOO-1-pdfjam.pdf InputSpace_wave1.pdf --nup 2x1 --landscape --outfile result_mm.pdf 84 evince result_mm.pdf & 85 else 86 pdfjam Rplots.pdf 2 87 pdf2ps Rplots-2-pdfjam.pdf 88 ps2epsi Rplots-2-pdfjam.ps 89 epstopdf Rplots-2-pdfjam.epsi 90 pdfjam Rplots-2-pdfjam.pdf InputSpace_wave1.pdf --nup 2x1 --landscape --outfile result.pdf 91 evince result.pdf & 12 model=LMDZ 13 cas=ARMCU/REF 14 param=param 15 bench=2 16 17 while (($# > 0)) ; do 18 case $1 in 19 -bench) bench=$2 ; shift ; shift ;; 20 -param) param=$2 ; shift ; shift ;; 21 -help) echo Usage "$0 [-bench N] [-param param_file] [model]" ; exit ;; 22 *) model=$1 ; shift ;; 23 esac 24 done 25 26 if [ $model == AROME ];then 27 cas=ARMCU 28 subcase=REF 29 fi 30 if [ $model == ECRAD ] ; then 31 cas=ARMCU/008 92 32 fi 93 33 94 echo '##########################################################' 95 echo Next version will start heating water at tea time 96 echo '##########################################################' 34 WDIR=BENCH$bench$model 35 ./setup.sh $model $WDIR 36 cd WORK/$WDIR 97 37 38 ./param2R.sh 30 3 $param 39 if [ $? -eq 0 ]; then 40 sed -i "s/WAVEN=.*/WAVEN=1/g" expe_setup.R 41 if [ $model == AROME ];then 42 echo ./serie_$model.sh $cas $subcase 1 43 ./serie_$model.sh $cas $subcase 1 44 else 45 ./serie_$model.sh $cas 1 46 fi 47 echo bench=$bench 48 if [ $? -eq 0 ]; then 49 if [ $bench = 1 ] ; then 50 compute_metrics_csv.sh 51 Rscript htune_csv2Rdata.R 52 Rscript htune_EmulatingMultiMetric.R 53 elif [ $bench = 3 ] ; then 54 # csv bench. 55 echo 'Compute_multicas_onemetric+csv' 56 compute_multicas_onemetric.sh 57 Rscript htune_csv2Rdata_many-met.R 58 Rscript htune_EmulatingMultiMetric.R 59 elif [ $bench = 2 ] ; then 60 # old bench. To be removed 61 echo 'Emulating_CS2' 62 Rscript htune_ncdf2Rdata.R 63 Rscript htune_EmulatingSCM_CS2.R 64 else 65 # bench with optionally multi metrics computed witing R 66 echo 'Emulating_MultiMetric' 67 Rscript htune_ncdf2Rdata.R 68 Rscript htune_EmulatingMultiMetric.R 69 fi 98 70 71 72 echo '##########################################################' 73 echo Next version will start heating water at tea time 74 echo '##########################################################' 75 76 pdfjam Rplots.pdf 2 77 pdf2ps Rplots-2-pdfjam.pdf 78 ps2epsi Rplots-2-pdfjam.ps 79 epstopdf Rplots-2-pdfjam.epsi 80 pdfjam Rplots-2-pdfjam.pdf InputSpace_wave1.pdf --nup 2x1 --landscape --outfile result.pdf 81 evince InputSpace_wave1.pdf & 82 fi 83 fi -
models/AROME/prep_config_tunning.py
r8 r86 2 2 import sys 3 3 4 import configMUSC4 #import configMUSC 5 5 6 6 nsimus = int(sys.argv[1]) … … 11 11 model = sys.argv[6] 12 12 13 rep0 = configMUSC.mainrep 13 config = sys.argv[7] 14 cycle = sys.argv[8] 15 MASTER = sys.argv[9] 16 if model == 'ARPCLIMAT': 17 PGD = sys.argv[10] 18 PREP = sys.argv[11] 19 namsfx = sys.argv[12] 20 14 21 15 if model == 'ARPCLIMAT': 16 config = 'CMIP6' 17 cycle = 'arp631' 18 MASTER = '/Users/romainroehrig/rootpack/arp603_export.01.MPIGNU640.x/bin/MASTERODB' 19 PGD = '/Users/romainroehrig/rootpack/arp603_export.01.MPIGNU640.x/bin/PGD' 20 PREP = '/Users/romainroehrig/rootpack/arp603_export.01.MPIGNU640.x/bin/PREP' 21 elif model == 'AROME': 22 config = 'AROME_OPER' 23 cycle = '41t1_op1.11_MUSC' 24 MASTER ='/home/honnert/Bureau/MUSC/pack/' + cycle + '/bin/MASTERODB' 25 elif model == 'ARPEGE': 26 config = 'ARPEGE_OPER' 27 cycle = '41t1_op1.11_MUSC' 28 MASTER = '/home/honnert/Bureau/MUSC/pack/' + cycle + '/bin/MASTERODB' 22 23 #rep0 = configMUSC.mainrep 24 25 #if model == 'ARPCLIMAT': 26 # config = 'CMIP6' 27 # cycle = 'arp631' 28 # MASTER = '/Users/romainroehrig/rootpack/arp603_export.01.MPIGNU640.x/bin/MASTERODB' 29 # PGD = '/Users/romainroehrig/rootpack/arp603_export.01.MPIGNU640.x/bin/PGD' 30 # PREP = '/Users/romainroehrig/rootpack/arp603_export.01.MPIGNU640.x/bin/PREP' 31 #elif model == 'AROME': 32 # config = 'AROME_OPER' 33 # cycle = '41t1_op1.11_MUSC' 34 # MASTER ='/home/honnert/Bureau/MUSC/pack/' + cycle + '/bin/MASTERODB' 35 #elif model == 'ARPEGE': 36 # config = 'ARPEGE_OPER' 37 # cycle = '41t1_op1.11_MUSC' 38 # MASTER = '/home/honnert/Bureau/MUSC/pack/' + cycle + '/bin/MASTERODB' 29 39 30 40 repnamelist = os.getcwd() + '/WAVE{0}/namelist'.format(nwave) … … 33 43 fout = 'config_{0}_{1}.{2}_{3}-{4:0>3}.py'.format(cycle,config,name,nwave,i+1) 34 44 g = open(fout,'w') 35 print >> g, "rep0 = '{0}'\n".format(rep0)36 45 print >> g, "config = '{0}.{1}_{2}-{3:0>3}'".format(config,name,nwave,i+1) 37 46 print >> g, "cycle = '{0}'".format(cycle) … … 42 51 print >> g, "namATMref = '{0}/namref.{1}_{2}-{3:0>3}'".format(repnamelist,name,nwave,i+1) 43 52 if model == 'ARPCLIMAT': 44 print >> g, "namSFXref = rep0 + '/main/namelist/SURFEX/nam.sfx.tl127.CMIP6.v631'"53 print >> g, "namSFXref = '{0}'".format(namsfx) 45 54 g.close() 46 55 -
models/AROME/serie_AROME.sh
r56 r86 3 3 #set -ex 4 4 5 if [ $# = 0 ] || [ $# = 1 ] ; then 6 cat <<eod 7 Use : serie_AROME.sh CASE SUBCASE 8 eod 9 exit 10 fi 5 if [ $# -lt 2 ] ; then 6 echo Use : ./serie_AROME.sh CASE SUBCASE WAVE 7 exit 1 ; fi 8 11 9 12 10 DIRMUSC=$REP_MUSC … … 23 21 subcase=$2 24 22 name='SCM' 25 nwave= 126 27 PARAM=$WORKDIR/WAVE 1/Par1D_Wave${nwave}.asc23 nwave=$3 24 25 PARAM=$WORKDIR/WAVE${nwave}/Par1D_Wave${nwave}.asc 28 26 29 27 repout=$WORKDIR/WAVE${nwave}/${case}/${subcase} … … 31 29 DIRCONFIG=$WORKDIR/WAVE$nwave/config 32 30 33 34 31 # A few variables in the environment to specify the simulation configuration (model component) 35 32 # Please edit param_AROME 36 33 37 34 . ./param_AROME 35 # Type of cleaning : no, nc, lfa, nclfa, all 36 clean='no' 38 37 39 38 #Use for rerunning some simulations in case of some (random) crashes (useful on mac) … … 128 127 rm -f $DIRMUSC/SURFEX/${cycle}/${simuREF}.${name}_${nwave}-$i 129 128 fi 129 if [ $clean == 'nc' ]; then 130 rm -rf $DIRMUSC/simulations/${cycle}/${simuREF}.${name}_${nwave}-$i/L${nlev}_${timestep}s/$case/$subcase/Output/netcdf/*.nc 131 fi 132 if [ $clean == 'lfa' ]; then 133 rm -rf $DIRMUSC/simulations/${cycle}/${simuREF}.${name}_${nwave}-$i/L${nlev}_${timestep}s/$case/$subcase/Output/LFAf/*.lfa 134 fi 135 if [ $clean == 'nclfa' ]; then 136 rm -rf $DIRMUSC/simulations/${cycle}/${simuREF}.${name}_${nwave}-$i/L${nlev}_${timestep}s/$case/$subcase/Output/netcdf/*.nc 137 rm -rf $DIRMUSC/simulations/${cycle}/${simuREF}.${name}_${nwave}-$i/L${nlev}_${timestep}s/$case/$subcase/Output/LFAf/*.lfa 138 fi 139 if [ $clean == 'all' ]; then 140 rm -rf $DIRMUSC/simulations/${cycle}/${simuREF}.${name}_${nwave}-$i 141 fi 130 142 done 131 143 … … 172 184 run_MUSC_cases.py $DIRCONFIG/config_${cycle}_${simuREF}.${name}_${nwave}-$i.py $case $subcase 173 185 # Pour être cohérent avec le calcul fait sur les LES 174 cdo houravg $DIRMUSC/simulations/${cycle}/${simuREF}.${name}_${nwave}-$i/L${nlev}_${timestep}s/$case/$subcase/Output/netcdf/Out_klevel.nc $repout/${name}_${nwave}-$i.nc || echo $i >> $WORKDIR/$ERROUT 186 cdo houravg $DIRMUSC/simulations/${cycle}/${simuREF}.${name}_${nwave}-$i/L${nlev}_${timestep}s/$case/$subcase/Output/netcdf/Out_klevel.nc $repout/tmp_${name}_${nwave}-$i.nc || echo $i >> $WORKDIR/$ERROUT 187 #cdo houravg $DIRMUSC/simulations/${cycle}/${simuREF}.${name}_${nwave}-$i/L${nlev}_${timestep}s/$case/$subcase/Output/netcdf/Out_klevel.nc $repout/${name}_${nwave}-$i.nc || echo $i >> $WORKDIR/$ERROUT 188 cd $repout 189 ncks -v wpvp_conv,wpthp_conv,wpthp_pbl,wpup_conv,wpup_pbl,wpqp_conv,wpqp_pbl -d levh,1,91 tmp_${name}_${nwave}-$i.nc ${name}_${nwave}-$i.nc 190 175 191 if [ $model == 'ARPCLIMAT' ]; then 176 192 rm -f $DIRMUSC/SURFEX/${cycle}/${simuREF}.${name}_${nwave}-$i -
models/LMDZ/serie_LMDZ.sh
r83 r86 18 18 19 19 20 LMDZdir=/home/ couvreux/TUNING/HighTune/../../LMDZtrunk20 LMDZdir=/home/honnert/HighTune/../../LMDZtrunk 21 21 EXPE=`pwd`/WAVE$WAVEN 22 22
Note: See TracChangeset
for help on using the changeset viewer.
