#!/bin/bash echo "##################" echo "Release you want :" echo "##################" repertoirdebase=`pwd` PS3='> ' # le prompt COMPIL=("dev" "trunk" "primavera" "3.2.2" "3.2.3" "3.3.0") select CHOIX in "${COMPIL[@]}" ; do case $REPLY in 1) TAG="ecearth_$CHOIX" CHOIX="3.2.2" echo "" ;; 2) TAG="ecearth_$CHOIX" cp $CHOIX/runtime/classic/ctrl/namelist.nemo-ORCA1L75-coupled.cfg.sh $HOME/modeles/ecearth/ecearth_${CHOIX}/runtime/classic/ctrl echo "" ;; 6) TAG="ecearth_$CHOIX" cp $CHOIX/runtime/classic/ctrl/file_def_nemo-opa.xml $HOME/modeles/ecearth/ecearth_${CHOIX}/runtime/classic/ctrl/ cp $CHOIX/runtime/classic/ctrl/file_def_nemo-lim3.xml $HOME/modeles/ecearth/ecearth_${CHOIX}/runtime/classic/ctrl/ cp $CHOIX/runtime/classic/ctrl/namelist.lim3-ORCA1L75.cfg.sh $HOME/modeles/ecearth/ecearth_${CHOIX}/runtime/classic/ctrl/ cp $CHOIX/runtime/classic/ctrl/namelist.nemo-ORCA1L75-coupled.cfg.sh $HOME/modeles/ecearth/ecearth_${CHOIX}/runtime/classic/ctrl/ ;; *) TAG="ecearth_$CHOIX" echo "" ;; esac break done TARGET="$HOME/modeles/ecearth/$TAG" case "$CHOIX" in *3.3.0*) echo "New 3.3.0 release" sed -i '$ d' $TARGET/sources/config-build.xml cat $CHOIX/sources/config-build.xml >> $TARGET/sources/config-build.xml cp $CHOIX/sources/zenobe-intelmpi.xml $TARGET/sources/platform cp $CHOIX/sources/lemaitre3-intelmpi.xml $TARGET/sources/platform # cp $CHOIX/runtime/classic/config-run.xml $TARGET/runtime/classic/config-run.xml cp $CHOIX/runtime/classic/platform/zenobe-intelmpi.xml $TARGET/runtime/classic/platform cp $CHOIX/runtime/classic/platform/lemaitre3-intelmpi.xml $TARGET/runtime/classic/platform ;; *3.2.3*) echo "3.2.3 release" cp $CHOIX/sources/config-build.xml $TARGET/sources/config-build.xml cp $CHOIX/sources/zenobe-intelmpi.xml $TARGET/sources/platform cp $CHOIX/sources/lemaitre3-intelmpi.xml $TARGET/sources/platform # cp $CHOIX/runtime/classic/config-run.xml $TARGET/runtime/classic/config-run.xml cp $CHOIX/runtime/classic/zenobe-intelmpi.xml $TARGET/runtime/classic/platform cp $CHOIX/runtime/classic/lemaitre3-intelmpi.xml $TARGET/runtime/classic/platform ;; *primavera*) echo "Primavera release" sed -i '$ d' $TARGET/sources/config-build.xml cat $CHOIX/sources/config-build.xml >> $TARGET/sources/config-build.xml # cp $CHOIX/runtime/classic/config-run.xml $TARGET/runtime/classic/config-run.xml # ;; *) echo "<3.2.2 release" cp $CHOIX/sources/config-build.xml $TARGET/sources/config-build.xml # cp $CHOIX/runtime/classic/config-run.xml $TARGET/runtime/classic/config-run.xml ;; esac machine=`uname --nodename` case "$machine" in *lm3*) echo "Lemaitre3" cp $CHOIX/sources/nemo_lemaitre3_arch-ecconf.fcm.tmpl $TARGET/sources/nemo-3.6/ARCH/arch-ecconf.fcm.tmpl #cp $CHOIX/sources/runoff-mapper_lemaitre3_Makefile.tmpl $TARGET/sources/runoff-mapper/src/Makefile.tmpl cp $CHOIX/runtime/classic/platform/lemaitre3.cfg.tmpl $TARGET/runtime/classic/platform/lemaitre3.cfg.tmpl cat $CHOIX/runtime/classic/lemaitre3.sh.tmpl > $TARGET/runtime/classic/ece-ifs+nemo.sh.tmpl cat $CHOIX/runtime/classic/ece-ifs+nemo.sh.tmpl >> $TARGET/runtime/classic/ece-ifs+nemo.sh.tmpl ;; *zenobe*) echo "Zenobe" cp $CHOIX/runtime/classic/platform/zenobe.cfg.tmpl $TARGET/runtime/classic/platform/zenobe.cfg.tmpl cat $CHOIX/runtime/classic/zenobe.sh.tmpl > $TARGET/runtime/classic/ece-ifs+nemo.sh.tmpl cat $CHOIX/runtime/classic/ece-ifs+nemo.sh.tmpl >> $TARGET/runtime/classic/ece-ifs+nemo.sh.tmpl ;; *frontal*) echo "Zenobe" cp $CHOIX/runtime/classic/platform/zenobe.cfg.tmpl $TARGET/runtime/classic/platform/zenobe.cfg.tmpl cat $CHOIX/runtime/classic/zenobe.sh.tmpl > $TARGET/runtime/classic/ece-ifs+nemo.sh.tmpl cat $CHOIX/runtime/classic/ece-ifs+nemo.sh.tmpl >> $TARGET/runtime/classic/ece-ifs+nemo.sh.tmpl ;; *) echo "Unknown machine" ;; esac echo "Patch applied to ${TARGET}"