Flist_archfile.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/bin/bash
  2. #set -x
  3. set -o posix
  4. #set -u
  5. #set -e
  6. #+
  7. #
  8. # ==================
  9. # Flist_archfile.sh
  10. # ==================
  11. #
  12. # --------------------------
  13. # Check the compilation file
  14. # --------------------------
  15. #
  16. # SYNOPSIS
  17. # ========
  18. #
  19. # ::
  20. #
  21. # $ Flist_archfile.sh Institute
  22. #
  23. #
  24. # DESCRIPTION
  25. # ===========
  26. #
  27. #
  28. # List arch file available.
  29. # The first line of each file in NEMO/ARCH directory is echoed.
  30. #
  31. #
  32. # EXAMPLES
  33. # ========
  34. #
  35. # ::
  36. #
  37. # $ ./Flist_archfile.sh
  38. #
  39. # $ ./Flist_archfile.sh CNRS
  40. #
  41. # TODO
  42. # ====
  43. #
  44. # option debug
  45. #
  46. #
  47. # EVOLUTIONS
  48. # ==========
  49. #
  50. # $Id: Flist_archfile.sh 4148 2013-11-04 12:54:28Z cetlod $
  51. #
  52. #
  53. #
  54. # * creation
  55. #
  56. #-
  57. if [ -n "$2" ]; then
  58. shift
  59. fi
  60. echo "Available compilers for -m option :"
  61. for file in $(ls ${MAIN_DIR}/ARCH | grep "fcm$" )
  62. do
  63. zvar1=${file#arch-}
  64. zvar2=$(head -1 ${MAIN_DIR}/ARCH/$file)
  65. #echo "${zvar1%.fcm} : ${zvar2#\#}"
  66. printf "%-20s %s %-s\n" "${zvar1%.fcm}" : "${zvar2#\#}"
  67. done
  68. if [ "$1" == "all" ]; then
  69. for dir in $(ls ${MAIN_DIR}/ARCH | grep -v "fcm$" )
  70. do
  71. echo "Available compilers at ${dir} :"
  72. for file in $(ls ${MAIN_DIR}/ARCH/${dir} | grep "fcm$" )
  73. do
  74. zvar1=${file#arch-}
  75. zvar2=$(head -1 ${MAIN_DIR}/ARCH/${dir}/$file)
  76. #echo "${zvar1%.fcm} : ${zvar2#\#}"
  77. printf "%-20s %s %-s\n" "${zvar1%.fcm}" : "${zvar2#\#}"
  78. done
  79. done
  80. elif [ -d ${MAIN_DIR}/ARCH/${1} ]; then
  81. echo "Available compilers at $1 :"
  82. for file in $(ls ${MAIN_DIR}/ARCH/$1 | grep "fcm$" )
  83. do
  84. zvar1=${file#arch-}
  85. zvar2=$(head -1 ${MAIN_DIR}/ARCH/${1}/$file)
  86. #echo "${zvar1%.fcm} : ${zvar2#\#}"
  87. printf "%-20s %s %-s\n" "${zvar1%.fcm}" : "${zvar2#\#}"
  88. done
  89. else
  90. echo "Available consortium member sub-directories :"
  91. for dir in $(ls ${MAIN_DIR}/ARCH | grep -v "fcm$" )
  92. do
  93. echo ${dir}
  94. done
  95. echo "use \"makenemo -h all\" or \"makenemo -m help\" to see compilers available in member's sub-directories"
  96. fi