Changeset 5156


Ignore:
Timestamp:
Aug 1, 2024, 5:58:40 PM (5 months ago)
Author:
abarral
Message:

Add 1D and iso bench
Better svn branch detection for lmdz
Add script to test convergence locally
Lint check_version.sh

Location:
BOL/script_install_amaury
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • BOL/script_install_amaury/check_version.sh

    r4676 r5156  
    11#!/bin/bash
    2 # $Id$
    3 
    4 #set -vx
     2
     3set -eu
    54
    65# AFAIRE
     
    2221#########################################################################
    2322
    24 version_ref=latest
    25 resolution=48x36x39
    26 compilo=gfortran
    27 parallel=mpi_omp
    28 # Option pour le debug du script check_version lui meme qui consiste a ne
    29 # pars reexecuter l'installation et les simulations mais a simplement
    30 # refaire les diff sur des simulations existantes.
    31 justcheck=0 # just compare results not writing of results in RESUBENCH
    32 tmpdir=/tmp/`whoami` ; mkdir -p $tmpdir
    33 tmpdir=/home/lmdz/tmp
    34 rel_svn=""
    35 local_d=`pwd`
    36 
    37 install=1
    38 rad=rrtm
    39 check_1D=1
    40 check_SP=1
    41 check_1p1=1
    42 check_Debug=1
    43 check_isotopes=1
    44 check_parallel=1
    45 check_compile=1
    46 check_ini=1
    47 mail_address=lmdz-commit@listes.lmd.ipsl.fr
    48 MODEL=""
    49 branche=trunk
    50 
    51 #########################################################################
    52 # Pour aller chercher des fichiers par wget si pas sur le cpte lmdz
    53 #########################################################################
    54 
    55 if [ `whoami` = lmdz ] ; then
    56    get="ln -sf /u/lmdz/WWW"
     23function get() {  # fetch lmdz files
     24  local file=$1
     25
     26  if [[ -f $file ]]; then return; fi
     27  # TODO  in the final version:    \rm -f if exists
     28
     29  if [[ $(whoami) = "lmdz" ]]; then
     30     ln -sf "/u/lmdz/WWW/$file" .
     31  else
     32     wget "https://www.lmd.jussieu.fr/~lmdz/$file"
     33  fi
     34}
     35
     36function set_default_args_val() {
     37  version_ref="latest"
     38  resolution="48x36x39"
     39  parallel="mpi_omp"
     40  # Option pour le debug du script check_version lui meme qui consiste a ne
     41  # pars reexecuter l'installation et les simulations mais a simplement
     42  # refaire les diff sur des simulations existantes.
     43  justcheck=0 # just compare results not writing of results in RESUBENCH
     44  tmpdir="/tmp/$(whoami)"; mkdir -p "$tmpdir"
     45  tmpdir="/home/lmdz/tmp"
     46  rel_svn=""
     47  local_d=$(pwd)
     48
     49  install=1
     50  rad=rrtm
     51  check_1D=1
     52  check_1p1=1
     53  check_isotopes=1
     54  check_parallel=1
     55  check_compile=1
     56  check_ini=1
     57  mail_address=lmdz-commit@listes.lmd.ipsl.fr
     58  MODEL=""
     59  branche=trunk
     60}
     61
     62function read_user_options() {
     63  while (($# > 0)); do
     64      case $1 in
     65          "-h") cat <<fin
     66    check_version.sh [-h] version [-latest version_ref]
     67    version is the name of the version of LMDZ to be checked modipsl.version.tar.gz
     68    version_ref is the version to be compared with.
     69    Default "latest".
     70    options:
     71      -justcheck  : just check results, do not overwrite anything
     72      -r svn : revision
     73      -latest latest : latest is the date of the last version tested
     74      -model_dir : directory where tun run the bench if LMDZ is already installed
     75fin
     76            exit 2;;
     77
     78        "-justcheck") justcheck=1; shift;;
     79        "-r") rel_svn="$2"; shift; shift;;
     80        "-latest") version_ref="$2"; shift; shift;;
     81        "-model_dir") MODEL="$2"; shift; shift;;
     82        *) version="$1"; shift;;
     83     esac
     84  done
     85}
     86
     87set_default_args_val
     88read_user_options "$@"
     89
     90################################################################################
     91# Definition des noms des repertoires à comparer
     92################################################################################
     93
     94if [[ $MODEL = "" ]]; then
     95   MODEL=$tmpdir/LMDZ$version$rel_svn
     96   branche=$(echo "$version" |cut -c 10-)
     97   datelmdz=$(echo "$version" | cut -d. -f1)
    5798else
    58    get="wget https://www.lmd.jussieu.fr/~lmdz"
    59 fi
    60 
    61 #########################################################################
    62 # Options du script
    63 #########################################################################
    64 
    65 while (($# > 0))
    66   do
    67   case $1 in
    68       "-h") cat <<fin
    69 check_version.sh [-h] version [-latest version_ref]
    70 version is the name of the version of LMDZ to be checked modipsl.version.tar.gz
    71 version_ref is the version to be compared with.
    72 Default "latest".
    73 options:
    74   -c compiler : sets the compiler to use
    75   -justcheck  : just check results, do not overwrite anything
    76   -r svn : revision
    77   -latest latest : latest is the date of the last version tested
    78   -model_dir : directory where tun run the bench if LMDZ is already installed
    79 fin
    80           exit;;
    81 
    82       "-c") compilo="$2" ; shift ; shift ;;
    83       "-justcheck") justcheck=1 ; shift ;;
    84       "-r") rel_svn="$2" ; shift ; shift ;;
    85       "-latest") version_ref="$2" ; shift ; shift ;;
    86       "-model_dir") MODEL="$2" ; shift ; shift ;;
    87       *) version="$1" ; shift ;;
    88    esac
    89 done
    90 
    91 ################################################################################
    92 # Definition des noms des repertoires à comparer
    93 ################################################################################
    94 
    95 # branche=`echo $version | cut -d. -f2`
    96 if [ "$MODEL" = "" ] ; then
    97    MODEL=$tmpdir/LMDZ$version$rel_svn
    98    branche=`echo $version |cut -c 10-`
    99    datelmdz=`echo $version | cut -d. -f1`
    100 else
    101    #if [ $install = 1 ] ; then echo Use model_dir only if the model is already installed ; exit ; fi
    10299   install=0
    103    if [ "`echo $MODEL | cut -c1`" != "/" ] ; then MODEL=`pwd`/$MODEL ; fi # MODEL transformed in absolute path if not
    104    datelmdz=`date +%Y%m%d`$$
    105 fi
    106 
    107 echo version $version $branche $datelmdz
    108 RESU_D=~/WWW/RESUBENCH/$branche/$compilo
    109 if [ $justcheck = 0 ] ; then
    110    resubench=$RESU_D/$datelmdz$rel_svn
    111    if [ -d $resubench ] ; then mv $resubench $resubench$$ ; fi
    112    mkdir -p $resubench
    113 fi
    114 latest=$RESU_D/$version_ref
    115 echo $latest
     100   if [[ "$(echo "$MODEL" | cut -c1)" != "/" ]]; then MODEL=$(pwd)/$MODEL; fi # MODEL transformed in absolute path if not
     101   datelmdz=$(date +%Y%m%d)$$
     102fi
     103
     104echo "version $version $branche $datelmdz"
     105RESU_D=~/WWW/RESUBENCH/$branche/defaul
     106if [[ $justcheck = 0 ]]; then
     107   resubench="$RESU_D/$datelmdz$rel_svn"
     108   if [[ -d $resubench ]]; then mv "$resubench" "$resubench$$"; fi
     109   mkdir -p "$resubench"
     110fi
     111latest="$RESU_D/$version_ref"
     112echo "$latest"
    116113
    117114# recuperation de la version a laquelle on compare pour le message final :
    118 comparea=`ls -ld $RESU_D/$version_ref | awk -F/ ' { print $NF } '`
    119 echo comparea $comparea
    120 
    121 ################################################################################
    122 echo 0. Installation du modele
    123 ################################################################################
    124 
    125 # Edition de install.sh, install.sh avec bench 48x36x19
    126 if [ $install = 1 ] ; then
    127    cd $tmpdir
    128    if [ "$rel_svn" = "" ] ; then opt_svn="" ; else opt_svn="-r $rel_svn" ; fi
    129    \rm -f install_lmdz.sh ; $get/pub/install_lmdz.sh ; chmod +x install_lmdz.sh
    130    # On install sans les bench pour que les benchs soient faits à la main
    131    # ./install_lmdz.sh -v $version $opt_svn -d $resolution -SCM -parallel $parallel -veget CMIP6
    132      ./install_lmdz.sh -unstable -v $version $opt_svn -d $resolution      -parallel $parallel -veget CMIP6 -bench 0
    133 fi
     115comparea=$(ls -ld "$RESU_D/$version_ref" | awk -F/ ' { print $NF } ')
     116echo "comparea $comparea"
     117
     118function install_model() {
     119  local opt_svn
     120
     121  echo "0. Installation du modele"
     122
     123  # Edition de install.sh, install.sh avec bench 48x36x19
     124  if [[ $install = 1 ]]; then
     125     cd $tmpdir
     126     if [[ $rel_svn = "" ]]; then opt_svn=""; else opt_svn="-r $rel_svn"; fi
     127     get "pub/install_lmdz.sh"; chmod +x install_lmdz.sh
     128     # On install sans les bench pour que les benchs soient faits à la main
     129     ./install_lmdz.sh -unstable -v "$version" "$opt_svn" -d $resolution -parallel $parallel -veget CMIP6 -bench 0
     130  fi
     131}
     132
     133install_model
    134134
    135135################################################################################
     
    137137################################################################################
    138138
    139 if [ $check_1D = 1 ] ; then
     139if [ $check_1D = 1 ]; then
    140140   cd $MODEL
    141    if [ ! -d 1D ] ; then $get/pub/1D/1D.tar.gz ; tar xvf 1D.tar.gz ; fi     # get 1D model
    142    if [ ! -d 1D/EXEC ] ; then mv 1D/EXEC 1D/SAVE_EXEC$$ ; fi
    143    cd 1D ; sed -e "s:^listecas=.*$:listecas=ARMCU/REF:" run.sh ; ./run.sh   # run 1D model
    144    # Controling outputs for the ARMCU/REF test case
     141   if [ ! -d 1D ]; then $get/pub/1D/1D.tar.gz; tar xvf 1D.tar.gz; fi     # get 1D model
     142   if [ ! -d 1D/EXEC ]; then mv 1D/EXEC 1D/SAVE_EXEC$$; fi
     143   cd 1D; sed -e "s:^listecas=.*$:listecas=ARMCU/REF:" run.sh; ./run.sh   # run 1D model
     144   # Controling outputs for the ARMCU/REF test case -d $dim"
    145145   outf=$MODEL/1D/EXEC/6AL79/ARMCU/REF/restartphy.nc
    146    if [ -f $outf ] ; then
    147        if [ $justcheck = 0 ] ; then
     146   if [ -f $outf ]; then
     147       if [ $justcheck = 0 ]; then
    148148          mkdir -p $resubench/ARMCU/REF
    149149          cp $outf $resubench/ARMCU/REF/
    150150       fi
    151151       cmp -s $outf $latest/ARMCU/REF/restartphy.nc
    152        if [ $? = 0 ] ; then converge1D=U ; else converge1D=u ; fi
     152       if [ $? = 0 ]; then converge1D=U; else converge1D=u; fi
    153153   else
    154154      converge1D=-
     
    164164LMDZdir=`pwd`
    165165echo LMDZdir $LMDZdir
    166 if [ -d $BENCH ] ; then mkdir -p SAVE$$ ; mv BENCH$resolution SAVE$$ ; fi
    167 $get/pub/3DBenchs/bench_lmdz_$resolution.tar.gz ; tar xvf bench_lmdz_$resolution.tar.gz
    168 cd $BENCH ; $get/pub/3DBenchs/BENCHCMIP6.tar.gz . ;  tar xvf BENCHCMIP6.tar.gz
     166if [ -d $BENCH ]; then mkdir -p SAVE$$; mv BENCH$resolution SAVE$$; fi
     167$get/pub/3DBenchs/bench_lmdz_$resolution.tar.gz; tar xvf bench_lmdz_$resolution.tar.gz
     168cd $BENCH; $get/pub/3DBenchs/BENCHCMIP6.tar.gz .;  tar xvf BENCHCMIP6.tar.gz
    169169sed -i'' -e "s:VEGET=n:VEGET=y:" config.def
    170 ./compilegcm_fcm.sh ; ./bench.sh > out.bench 2>&1
    171 
    172 
    173 if [ -f restartphy.nc ] ; then
    174    if [ ! -f gcm.install ] ; then \cp -f gcm.e gcm.install ; fi
     170./compilegcm_fcm.sh; ./bench.sh > out.bench 2>&1
     171
     172
     173if [ -f restartphy.nc ]; then
     174   if [ ! -f gcm.install ]; then \cp -f gcm.e gcm.install; fi
    175175
    176176#########################################################################
     
    190190
    191191   # Ici on se contente d'analyser le bench automatique qui vient de tourner
    192    if [ $justcheck = 0 ] ; then mkdir -p $resubench/$BENCH; fi
    193    if [ -f restartphy.nc ] ; then
    194        if [ $justcheck = 0 ] ; then
     192   if [ $justcheck = 0 ]; then mkdir -p $resubench/$BENCH; fi
     193   if [ -f restartphy.nc ]; then
     194       if [ $justcheck = 0 ]; then
    195195           ncks -M -m -h -v ps -O restart.nc $resubench/$BENCH/ps.nc
    196196           cp restart.nc $resubench/$BENCH/restart.nc
    197197       fi
    198198       cmp -s ./restart.nc $latest/$BENCH/restart.nc
    199       if [ $? = 0 ] ; then converge=S ; else converge=s ; fi
     199      if [ $? = 0 ]; then converge=S; else converge=s; fi
    200200   else
    201201      converge=-
     
    208208   # On utilse l'executable du bench de base
    209209
    210    if [ $check_1p1 = 1 ] ; then
     210   if [ $check_1p1 = 1 ]; then
    211211      \cp -f gcm.install gcm.e
    212212      suf=NPv6.0.14splith
    213213      sed -e 's/VEGET=y/VEGET=n/' config.def_oraer > config.def
    214       if [ -f physiq.def_$suf ] ; then \cp -f physiq.def_$suf physiq.def ; fi
     214      if [ -f physiq.def_$suf ]; then \cp -f physiq.def_$suf physiq.def; fi
    215215      $get/Distrib/unpun.sh
    216       chmod +x unpun.sh ; ./unpun.sh -parallel $parallel
     216      chmod +x unpun.sh; ./unpun.sh -parallel $parallel
    217217      cmp -s SIM2/ps_end.nc SIM1+1/ps_end.nc
    218       if [ $? = 0 ] ; then
     218      if [ $? = 0 ]; then
    219219          unpun=OK
    220220      else
     
    226226# 2016/06/21 : comparaison des versions nouvelles physique (dans SIM1)
    227227   cd $LMDZdir/$BENCH
    228    if [ -f SIM1/restartphy.nc ] ; then
    229        if [ $justcheck = 0 ] ; then
     228   if [ -f SIM1/restartphy.nc ]; then
     229       if [ $justcheck = 0 ]; then
    230230           ncks -M -m -h -v ps -O SIM1/restart.nc $resubench/$BENCH/ps$suf.nc
    231231           cp SIM1/restart.nc $resubench/$BENCH/restart$suf.nc
     
    233233       \rm sechiba_out_2.nc sechiba_history.nc sechiba_rest_out.nc
    234234       cmp -s SIM1/restart.nc $latest/$BENCH/restart$suf.nc
    235       if [ $? = 0 ] ; then convergeNP=N ; else convergeNP=n ; fi
     235      if [ $? = 0 ]; then convergeNP=N; else convergeNP=n; fi
    236236   else
    237237      convergeNP=-
     
    243243
    244244   cd $LMDZdir/$BENCH
    245    if [ -f compilegcm.sh -a $check_compile = 1 ] ; then
     245   if [ -f compilegcm.sh -a $check_compile = 1 ]; then
    246246      \rm -f gcm.e
    247247      ./compilegcm.sh -debug
     
    252252      cd ../
    253253      suf=D
    254       if [ -f SIMD/restartphy.nc ] ; then
    255           if [ $justcheck = 0 ] ; then
     254      if [ -f SIMD/restartphy.nc ]; then
     255          if [ $justcheck = 0 ]; then
    256256              ncks -M -m -h -v ps -O SIMD/restart.nc $resubench/$BENCH/ps$suf.nc
    257257              cp SIMD/restart.nc $resubench/$BENCH/restart$suf.nc
    258258          fi
    259259          cmp -s SIMD/restart.nc $latest/$BENCH/restart$suf.nc
    260           if [ $? = 0 ] ; then convergeD=D ; else convergeD=d ; fi
     260          if [ $? = 0 ]; then convergeD=D; else convergeD=d; fi
    261261      else
    262262         convergeD=-
     
    269269
    270270echo CHECK $parallel $check_parallel
    271    if [ "$parallel" = "mpi_omp" -a $check_parallel = 1 ] ; then
     271   if [ "$parallel" = "mpi_omp" -a $check_parallel = 1 ]; then
    272272      mkdir -p $LMDZdir/$BENCH/SIM1_41
    273273      cd $LMDZdir/$BENCH/SIM1_41
     
    277277      echo ON EST AVANT LE CMP
    278278      cmp -s SIMD/restart.nc SIM1_41/restart.nc
    279       if [ $? = 0 ] ; then
    280           if [ "$unpun" = "OK" ] ; then
     279      if [ $? = 0 ]; then
     280          if [ "$unpun" = "OK" ]; then
    281281             unpun=OK2
    282282          else
     
    292292   #########################################################################
    293293
    294    if [ $check_isotopes = 1 ] ; then
     294   if [ $check_isotopes = 1 ]; then
    295295      cd $LMDZdir
    296296      pwd
     
    300300      ./compile.sh
    301301      exec=../bin/gcm_48x36x39_phylmdiso_${rad}_seq_iso_isoverif.e
    302       if [ -f $exec ] ; then
     302      if [ -f $exec ]; then
    303303             $exec > listing 2>&1
    304304             suf=I
    305              if [ -f restartphy.nc ] ; then
    306                  if [ $justcheck = 0 ] ; then
     305             if [ -f restartphy.nc ]; then
     306                 if [ $justcheck = 0 ]; then
    307307                     cp restart.nc $resubench/$BENCH/restart$suf.nc
    308308                 fi
    309309                 cmp -s restart.nc $latest/$BENCH/restart$suf.nc
    310                  if [ $? = 0 ] ; then convergeI=I ; else convergeI=i ; fi
     310                 if [ $? = 0 ]; then convergeI=I; else convergeI=i; fi
    311311             else
    312312                 # compiled but failed the isoverif test
     
    325325   #########################################################################
    326326
    327    if [ $check_ini = 1 ] ; then
     327   if [ $check_ini = 1 ]; then
    328328      cd $LMDZdir
    329329      rm -rf INIT
     
    334334      $get/Distrib/initialisation.sh
    335335      sed -e 's/grid_resolution=48x36x39/grid_resolution='$resolution'/' initialisation.sh > ini.sh
    336       chmod +x ini.sh ; ./ini.sh
    337       if [ -f limit.nc ] ; then
     336      chmod +x ini.sh; ./ini.sh
     337      if [ -f limit.nc ]; then
    338338         var=Tsoil01srf01
    339          if [ $justcheck = 0 ] ; then
     339         if [ $justcheck = 0 ]; then
    340340             mkdir -p $resubench/START$resolution
    341341             ncks -M -m -h -v $var startphy.nc -O  $resubench/START$resolution/$var.nc
     
    343343         fi
    344344          cmp -s  startphy.nc  $latest/START$resolution/startphy.nc
    345          if [ $? = 0 ] ; then
     345         if [ $? = 0 ]; then
    346346             init=OK
    347347         else
     
    362362fi
    363363
    364 if [ $justcheck = 0 ] ; then
     364if [ $justcheck = 0 ]; then
    365365    latest=$RESU_D/latest
    366366    \rm -f $latest
     
    379379svnrel=`svn info $LMDZ | grep 'Changed Rev' | head -1 | awk ' { print $4 } '`
    380380#FH 20160822
    381 if [ "$svnrel" = "" ] ; then
     381if [ "$svnrel" = "" ]; then
    382382  svnrel=`svn info $LMDZ | grep vision | head -1 | awk ' { print $2 } '`
    383383fi
    384384
    385385ccc=$converge$convergeNP$convergeD$converge1D$convergeI
    386 if [ "$ccc" = "SNDUI" ] ; then ccc="OK " ;  fi
     386if [ "$ccc" = "SNDUI" ]; then ccc="OK ";  fi
    387387
    388388
     
    425425cat tmp.message
    426426
    427 if [ $mail_address != "" ] &&  [ $justcheck = 0 ] ; then
     427if [ $mail_address != "" ] &&  [ $justcheck = 0 ]; then
    428428   ssh lmdz@django "mail -s 'Nouvelle version pour install_lmdz.sh' $mail_address < "$local_d"/tmp.message"
    429429#   ssh lmdz@lmdz-forge "mail -s 'Nouvelle version pour install_lmdz.sh' $mail_address < "$local_d"/tmp.message"
     
    435435grep -q 'OK     OK      OK2     OK' tmp.resu
    436436RET=$?
    437 if [ ${RET} -eq 0 ] ; then
     437if [ ${RET} -eq 0 ]; then
    438438  echo "Quality control checks out for version $version"
    439439  echo "We cleanup $tmpdir/LMDZ$version"
  • BOL/script_install_amaury/install_lmdz.sh

    r5083 r5156  
    4949}
    5050
     51function get_svn_branch {
     52  local url=$1
     53  local rev=$2
     54  local res
     55
     56  res=$(svn log -v -q "$url" -r "$rev" -l 1 | cut -d "/" -f -4)
     57  if echo "$res" | grep -q "/trunk/"; then
     58    res=$(echo "$res" | grep "/trunk/" | head -1 | cut -d "/" -f 2-3)
     59  elif echo "$res" | grep -q "/branches/"; then
     60    res=$(echo "$res" | grep "/branches/" | head -1 | cut -d "/" -f 2-4)
     61  else
     62    echo "Could not determine svn branch for $url, r=$rev"
     63  fi
     64  echo "$res"
     65}
     66
    5167function set_default_params {
    5268    # Valeur par défaut des parametres
     
    6177    benchphysiq=""
    6278    compphysiq="lmd"
     79    is_1D="n"
     80    fortran_file="gcm"
    6381
    6482    parallel="none"
     
    249267    if [[ $arch_dir = "" ]]; then
    250268      arch_dir="$MODEL/modipsl/config/IPSLCM7/ARCH/";
    251     elif ! readlink -fe "$arch_dir"; then
     269    elif ! readlink -fe "$arch_dir" >/dev/null; then
    252270      echo "STOP: no arch dir <$arch_dir>"; exit 1
     271    fi
     272
     273    if ! (echo "$grid_resolution" | grep -q "x"); then
     274      is_1D="y"
     275      fortran_file="lmdz1d"
    253276    fi
    254277}
     
    313336        echo "problem installing with compiler $compiler"; exit 1
    314337    fi
    315     \rm tt a.out tt.f90
     338    rm tt a.out tt.f90
    316339}
    317340
     
    320343
    321344    mkdir -p "$MODEL"
    322     MODEL=$(readlink -e -f "$MODEL"); echo "$MODEL"  # absolute path
     345    MODEL=$(readlink -e -f "$MODEL"); echo "MODEL: $MODEL"  # absolute path
    323346    if [[ ! -d "$MODEL/modipsl" ]]; then
    324347        echo "##########################################################"
    325         echo "Download a slightly modified version of LMDZ"
     348        echo "Downloading a slightly modified version of modipsl+LMDZ"
    326349        echo "##########################################################"
    327350        cd "$MODEL"
     
    332355        gunzip "modipsl.$version.tar.gz" &>> get.log
    333356        tar xf "modipsl.$version.tar" &>> get.log
    334         \rm "modipsl.$version.tar"
     357        rm "modipsl.$version.tar"
    335358        cd - &> /dev/null
    336359    fi
     
    463486
    464487    if $ncdf_compiler -I"$ncdfdir"/include test_netcdf90.f90 -L"$ncdfdir"/lib -lnetcdff -lnetcdf -Wl,-rpath="$ncdfdir"/lib && ./a.out; then
    465         \rm test_netcdf90.f90 a.out
     488        rm test_netcdf90.f90 a.out
    466489    else
    467490        cat <<EOF
     
    615638            local lmdzbranch
    616639            echo "Fetching LMDZ $svn_lmdz from the repository"
    617             lmdzbranch=$(svn log -v -q https://svn.lmd.jussieu.fr/LMDZ -r "$svn_lmdz" | grep LMDZ | head -1 | sed -e 's:trunk/.*$:trunk:' | awk '{print $2}')
     640            lmdzbranch=$(get_svn_branch "https://svn.lmd.jussieu.fr/LMDZ" "$svn_lmdz")
     641            echo "branch is $lmdzbranch"
    618642            cd "$MODEL/modipsl/modeles"
    619643            rm -rf LMD*
    620             svn co -r "$svn_lmdz" "https://svn.lmd.jussieu.fr/LMDZ$lmdzbranch" LMDZ
     644            svn co -r "$svn_lmdz" "https://svn.lmd.jussieu.fr/LMDZ/$lmdzbranch" LMDZ
    621645            cd - > /dev/null
    622646        fi
     
    636660
    637661    if [[ $used_lmdz_rev -le 4185 ]]; then
    638         exe_name="bin/gcm_${grid_resolution}_phy${compphysiq}_${suff_para}${suff_orc}${suff_aer}${suff_iso}.e"
     662        exe_name="bin/${fortran_file}_${grid_resolution}_phy${compphysiq}_${suff_para}${suff_orc}${suff_aer}${suff_iso}.e"
    639663    else
    640         exe_name="bin/gcm_${grid_resolution}_phy${compphysiq}_${rad}${suff_para}${suff_orc}${suff_aer}${suff_iso}.e"
     664        exe_name="bin/${fortran_file}_${grid_resolution}_phy${compphysiq}_${rad}${suff_para}${suff_orc}${suff_aer}${suff_iso}.e"
    641665    fi
    642666
     
    660684    makelmdz="makelmdz_fcm $optim_flag -arch $arch -j $make_j"
    661685    local para_compile_opt="-mem -parallel $parallel"; if [[ $parallel = "none" ]]; then para_compile_opt=""; fi
    662     echo "$jobcmd ./$makelmdz $opt_rad $opt_cosp $opt_makelmdz_xios $opt_aer $opt_inlandsis $opt_isotopes -p $compphysiq -d ${grid_resolution} -v $fcm_veget_version $para_compile_opt gcm" > compile.sh
     686    echo "$jobcmd ./$makelmdz $opt_rad $opt_cosp $opt_makelmdz_xios $opt_aer $opt_inlandsis $opt_isotopes -p $compphysiq -d ${grid_resolution} -v $fcm_veget_version $para_compile_opt $fortran_file" > compile.sh
    663687    echo "Compiling lmdz using $(\cat compile.sh) (log: $lmdzlog) $(date)"
    664688    chmod +x ./compile.sh
     
    677701
    678702function run_bench {
     703    local bench_cmd="./bench.sh"
     704
    679705    cd "$MODEL/modipsl/modeles/LMDZ"*
    680706
     
    683709        ./init.sh
    684710    elif [[ $bench = 1 ]]; then
    685         \rm -rf "BENCH${grid_resolution}"
    686         local bench=bench_lmdz_${grid_resolution}
     711      rm -rf "BENCH${grid_resolution}"
     712      local bench=bench_lmdz_${grid_resolution}
     713      if [[ $compphysiq = "lmdiso" ]]; then bench=bench_lmdz_iso_${grid_resolution}; fi
     714
     715      if [[ $is_1D = "y" ]] ; then  # 1D
     716        myget "1D/1D.tar.gz"
     717        mkdir -p "BENCH${grid_resolution}"
     718        tar xf "1D.tar.gz" -C "BENCH${grid_resolution}" --strip-components=1
     719        cd "BENCH${grid_resolution}"
     720        # Below: ugly, but until we rewrite the 1D case...
     721        sed -i'' -e "s:^listecas=.*$:listecas=ARMCU/REF:" -e "s:cd \$local/bin ; ./compile -L \$L:#cd \$local/bin ; ./compile -L \$L:" \
     722            -e "s:./compile -L \$llm:#./compile -L \$llm:" -e "s:ln -sf \$bin/\\\\\${main}\${suffixe}.e .:ln -sf ../../../../../$exe_name \\\\\${main}\${suffixe}.e:" -e "s:gzip listing:cp listing restartphy.nc ../../../../; exit 0:" \
     723            run.sh
     724        cp "../$exe_name" bin/
     725        bench_cmd="./run.sh -rad $rad"  # suppress ferret commands that launch after bench is "over"
     726      else
    687727        myget "3DBenchs/$bench.tar.gz"
    688         tar xf "$bench.tar.gz"
     728        mkdir "BENCH${grid_resolution}"
     729        tar xf "$bench.tar.gz" -C "BENCH${grid_resolution}" --strip-components=1
    689730
    690731        if [[ $cosp = "v1" || $cosp = "v2" ]]; then
     
    786827        cd "BENCH${grid_resolution}"
    787828
    788         local bench_cmd="./bench.sh"
    789829        if [[ ${parallel:0:3} = "mpi" ]]; then
    790830            # Lancement avec deux procs mpi et 2 openMP
     
    822862            echo "./gcm.e &> listing" > bench.sh
    823863        fi
     864        chmod +x bench.sh
    824865        # Getting orchidee stuff
    825866        if [[ $veget = 'CMIP6' || $veget = "orch2.0" ]]; then  # TODO once we have a 2.2 bench, add it here (or in planned separate bench script)
     
    862903        fi
    863904
     905        fi
     906
    864907        if [[ -f ../arch.env ]]; then source ../arch.env; fi
    865908
    866         echo "EXECUTION DU BENCH"
     909        echo "STARTING BENCH"
    867910        date
    868911        if (! $bench_cmd &> out.bench) || ! (tail -n 1 listing | grep "Everything is cool"); then
Note: See TracChangeset for help on using the changeset viewer.