Changeset 86


Ignore:
Timestamp:
Dec 11, 2018, 5:55:17 PM (7 years ago)
Author:
htune
Message:
 
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • bench_AROME.sh

    r69 r86  
    11#!/bin/bash
    22
    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
     3if [ `pwd | grep -o HighTune | wc -l` -gt 1 ]
     4then
     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
    7510fi
    7611
    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 &
     12model=LMDZ
     13cas=ARMCU/REF
     14param=param
     15bench=2
     16
     17while (($# > 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
     24done
     25
     26if [ $model == AROME ];then
     27  cas=ARMCU
     28  subcase=REF
     29fi
     30if [ $model == ECRAD ] ; then
     31  cas=ARMCU/008
    9232fi
    9333
    94 echo '##########################################################'
    95 echo Next version will start heating water at tea time
    96 echo '##########################################################'
     34WDIR=BENCH$bench$model
     35./setup.sh $model $WDIR
     36cd WORK/$WDIR
    9737
     38./param2R.sh 30 3 $param
     39if [ $? -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
    9870
     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
     83fi
  • models/AROME/prep_config_tunning.py

    r8 r86  
    22import sys
    33
    4 import configMUSC
     4#import configMUSC
    55
    66nsimus = int(sys.argv[1])
     
    1111model = sys.argv[6]
    1212
    13 rep0 = configMUSC.mainrep
     13config = sys.argv[7]
     14cycle = sys.argv[8]
     15MASTER = sys.argv[9]
     16if model == 'ARPCLIMAT':
     17  PGD = sys.argv[10]
     18  PREP = sys.argv[11]
     19  namsfx = sys.argv[12]
     20 
    1421
    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'
    2939
    3040repnamelist = os.getcwd() + '/WAVE{0}/namelist'.format(nwave)
     
    3343  fout = 'config_{0}_{1}.{2}_{3}-{4:0>3}.py'.format(cycle,config,name,nwave,i+1)
    3444  g = open(fout,'w')
    35   print >> g, "rep0 = '{0}'\n".format(rep0)
    3645  print >> g, "config = '{0}.{1}_{2}-{3:0>3}'".format(config,name,nwave,i+1)
    3746  print >> g, "cycle = '{0}'".format(cycle)
     
    4251  print >> g, "namATMref = '{0}/namref.{1}_{2}-{3:0>3}'".format(repnamelist,name,nwave,i+1)
    4352  if model == 'ARPCLIMAT':
    44     print >> g, "namSFXref = rep0 + '/main/namelist/SURFEX/nam.sfx.tl127.CMIP6.v631'"
     53    print >> g, "namSFXref = '{0}'".format(namsfx)
    4554  g.close()
    4655
  • models/AROME/serie_AROME.sh

    r56 r86  
    33#set -ex
    44
    5 if [ $# = 0 ] || [ $# = 1 ] ; then
    6 cat <<eod
    7 Use : serie_AROME.sh CASE SUBCASE
    8 eod
    9 exit
    10 fi
     5if [ $# -lt 2 ] ; then
     6   echo Use : ./serie_AROME.sh CASE SUBCASE WAVE
     7   exit 1 ; fi
     8
    119
    1210DIRMUSC=$REP_MUSC
     
    2321subcase=$2
    2422name='SCM'
    25 nwave=1
    26 
    27 PARAM=$WORKDIR/WAVE1/Par1D_Wave${nwave}.asc
     23nwave=$3
     24
     25PARAM=$WORKDIR/WAVE${nwave}/Par1D_Wave${nwave}.asc
    2826
    2927repout=$WORKDIR/WAVE${nwave}/${case}/${subcase}
     
    3129DIRCONFIG=$WORKDIR/WAVE$nwave/config
    3230
    33 
    3431# A few variables in the environment to specify the simulation configuration (model component)
    3532# Please edit param_AROME
    3633
    3734. ./param_AROME
     35# Type of cleaning : no, nc, lfa, nclfa, all
     36clean='no'
    3837
    3938#Use for rerunning some simulations in case of some (random) crashes (useful on mac)
     
    128127    rm -f $DIRMUSC/SURFEX/${cycle}/${simuREF}.${name}_${nwave}-$i
    129128  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
    130142done
    131143
     
    172184  run_MUSC_cases.py $DIRCONFIG/config_${cycle}_${simuREF}.${name}_${nwave}-$i.py $case $subcase
    173185# 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
    175191  if [ $model == 'ARPCLIMAT' ]; then
    176192    rm -f $DIRMUSC/SURFEX/${cycle}/${simuREF}.${name}_${nwave}-$i
  • models/LMDZ/serie_LMDZ.sh

    r83 r86  
    1818
    1919
    20 LMDZdir=/home/couvreux/TUNING/HighTune/../../LMDZtrunk
     20LMDZdir=/home/honnert/HighTune/../../LMDZtrunk
    2121EXPE=`pwd`/WAVE$WAVEN
    2222
Note: See TracChangeset for help on using the changeset viewer.