install.sh 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #!/bin/bash
  2. echo "##################"
  3. echo "Release you want :"
  4. echo "##################"
  5. repertoirdebase=`pwd`
  6. PS3='> ' # le prompt
  7. COMPIL=("dev" "trunk" "primavera" "3.2.2" "3.2.3" "3.3.0")
  8. select CHOIX in "${COMPIL[@]}" ; do
  9. case $REPLY in
  10. 1)
  11. TAG="ecearth_$CHOIX"
  12. CHOIX="3.2.2"
  13. echo ""
  14. ;;
  15. 2)
  16. TAG="ecearth_$CHOIX"
  17. cp $CHOIX/runtime/classic/ctrl/namelist.nemo-ORCA1L75-coupled.cfg.sh $HOME/modeles/ecearth/ecearth_${CHOIX}/runtime/classic/ctrl
  18. echo ""
  19. ;;
  20. 6)
  21. TAG="ecearth_$CHOIX"
  22. cp $CHOIX/runtime/classic/ctrl/file_def_nemo-opa.xml $HOME/modeles/ecearth/ecearth_${CHOIX}/runtime/classic/ctrl/
  23. cp $CHOIX/runtime/classic/ctrl/file_def_nemo-lim3.xml $HOME/modeles/ecearth/ecearth_${CHOIX}/runtime/classic/ctrl/
  24. cp $CHOIX/runtime/classic/ctrl/namelist.lim3-ORCA1L75.cfg.sh $HOME/modeles/ecearth/ecearth_${CHOIX}/runtime/classic/ctrl/
  25. cp $CHOIX/runtime/classic/ctrl/namelist.nemo-ORCA1L75-coupled.cfg.sh $HOME/modeles/ecearth/ecearth_${CHOIX}/runtime/classic/ctrl/
  26. ;;
  27. *)
  28. TAG="ecearth_$CHOIX"
  29. echo ""
  30. ;;
  31. esac
  32. break
  33. done
  34. TARGET="$HOME/modeles/ecearth/$TAG"
  35. case "$CHOIX" in
  36. *3.3.0*)
  37. echo "New 3.3.0 release"
  38. sed -i '$ d' $TARGET/sources/config-build.xml
  39. cat $CHOIX/sources/config-build.xml >> $TARGET/sources/config-build.xml
  40. cp $CHOIX/sources/zenobe-intelmpi.xml $TARGET/sources/platform
  41. cp $CHOIX/sources/lemaitre3-intelmpi.xml $TARGET/sources/platform
  42. #
  43. cp $CHOIX/runtime/classic/config-run.xml $TARGET/runtime/classic/config-run.xml
  44. cp $CHOIX/runtime/classic/platform/zenobe-intelmpi.xml $TARGET/runtime/classic/platform
  45. cp $CHOIX/runtime/classic/platform/lemaitre3-intelmpi.xml $TARGET/runtime/classic/platform
  46. ;;
  47. *3.2.3*)
  48. echo "3.2.3 release"
  49. cp $CHOIX/sources/config-build.xml $TARGET/sources/config-build.xml
  50. cp $CHOIX/sources/zenobe-intelmpi.xml $TARGET/sources/platform
  51. cp $CHOIX/sources/lemaitre3-intelmpi.xml $TARGET/sources/platform
  52. #
  53. cp $CHOIX/runtime/classic/config-run.xml $TARGET/runtime/classic/config-run.xml
  54. cp $CHOIX/runtime/classic/zenobe-intelmpi.xml $TARGET/runtime/classic/platform
  55. cp $CHOIX/runtime/classic/lemaitre3-intelmpi.xml $TARGET/runtime/classic/platform
  56. ;;
  57. *primavera*)
  58. echo "Primavera release"
  59. sed -i '$ d' $TARGET/sources/config-build.xml
  60. cat $CHOIX/sources/config-build.xml >> $TARGET/sources/config-build.xml
  61. #
  62. cp $CHOIX/runtime/classic/config-run.xml $TARGET/runtime/classic/config-run.xml
  63. #
  64. ;;
  65. *)
  66. echo "<3.2.2 release"
  67. cp $CHOIX/sources/config-build.xml $TARGET/sources/config-build.xml
  68. #
  69. cp $CHOIX/runtime/classic/config-run.xml $TARGET/runtime/classic/config-run.xml
  70. ;;
  71. esac
  72. machine=`uname --nodename`
  73. case "$machine" in
  74. *lm3*)
  75. echo "Lemaitre3"
  76. cp $CHOIX/sources/nemo_lemaitre3_arch-ecconf.fcm.tmpl $TARGET/sources/nemo-3.6/ARCH/arch-ecconf.fcm.tmpl
  77. #cp $CHOIX/sources/runoff-mapper_lemaitre3_Makefile.tmpl $TARGET/sources/runoff-mapper/src/Makefile.tmpl
  78. cp $CHOIX/runtime/classic/platform/lemaitre3.cfg.tmpl $TARGET/runtime/classic/platform/lemaitre3.cfg.tmpl
  79. cat $CHOIX/runtime/classic/lemaitre3.sh.tmpl > $TARGET/runtime/classic/ece-ifs+nemo.sh.tmpl
  80. cat $CHOIX/runtime/classic/ece-ifs+nemo.sh.tmpl >> $TARGET/runtime/classic/ece-ifs+nemo.sh.tmpl
  81. ;;
  82. *zenobe*)
  83. echo "Zenobe"
  84. cp $CHOIX/runtime/classic/platform/zenobe.cfg.tmpl $TARGET/runtime/classic/platform/zenobe.cfg.tmpl
  85. cat $CHOIX/runtime/classic/zenobe.sh.tmpl > $TARGET/runtime/classic/ece-ifs+nemo.sh.tmpl
  86. cat $CHOIX/runtime/classic/ece-ifs+nemo.sh.tmpl >> $TARGET/runtime/classic/ece-ifs+nemo.sh.tmpl
  87. ;;
  88. *frontal*)
  89. echo "Zenobe"
  90. cp $CHOIX/runtime/classic/platform/zenobe.cfg.tmpl $TARGET/runtime/classic/platform/zenobe.cfg.tmpl
  91. cat $CHOIX/runtime/classic/zenobe.sh.tmpl > $TARGET/runtime/classic/ece-ifs+nemo.sh.tmpl
  92. cat $CHOIX/runtime/classic/ece-ifs+nemo.sh.tmpl >> $TARGET/runtime/classic/ece-ifs+nemo.sh.tmpl
  93. ;;
  94. *)
  95. echo "Unknown machine"
  96. ;;
  97. esac
  98. echo "Patch applied to ${TARGET}"