chkexpout.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/bash
  2. # ./chkexpout.sh model expid
  3. #set -xuve
  4. model=$1
  5. expid=$2
  6. src1=/esnas/exp/$model
  7. src2=/esnas/exp/$model/restartfiles
  8. src30=/esnas/exp/$model/gribfiles
  9. src3=/esnas/exp/$model/rawfiles
  10. src4=/esnas/exp/$model/cmorfiles
  11. sdates=$(ls -1 $src1/$expid | grep [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])
  12. for s in $sdates; do
  13. mems=$(ls -1 $src1/$expid/$s | grep fc)
  14. for m in $mems; do
  15. if [[ -d $src1/$expid/$s/$m ]]; then
  16. l=$(ls -1 $src1/$expid/$s/$m | grep logfiles | wc -l)
  17. mm=""
  18. if [[ -d $src1/$expid/$s/$m/outputs ]]; then
  19. a=$(ls -1 $src1/$expid/$s/$m/outputs | grep MMA | wc -l)
  20. o=$(ls -1 $src1/$expid/$s/$m/outputs | grep MMO | wc -l)
  21. sz=$(du -chs $src1/$expid/$s/$m/outputs | grep total | awk '{print $1}')
  22. mm="MMA=$a MMO=$o MM_SZ=$sz"
  23. fi
  24. rest=""
  25. # old option
  26. if [[ -d $src1/$expid/$s/$m/restarts ]]; then
  27. r=$(ls -1 $src1/$expid/$s/$m/restarts | grep REST | wc -l)
  28. sz=$(du -chs $src1/$expid/$s/$m/restarts | grep total | awk '{print $1}')
  29. rest="REST=$r REST_SZ=$sz"
  30. fi
  31. # old option
  32. if [[ -d $src2/$expid/$s/$m/restarts ]]; then
  33. r=$(ls -1 $src2/$expid/$s/$m/restarts | grep REST | wc -l)
  34. sz=$(du -chs $src2/$expid/$s/$m/restarts | grep total | awk '{print $1}')
  35. rest="REST=$r REST_SZ=$sz"
  36. fi
  37. grb=""
  38. if [[ -d $src3/$expid/$s/$m/outputs ]]; then
  39. gg=$(ls -1 $src3/$expid/$s/$m/outputs | grep ICMGG | wc -l)
  40. sh=$(ls -1 $src3/$expid/$s/$m/outputs | grep ICMSH | wc -l)
  41. sz=$(du -chs $src3/$expid/$s/$m/outputs | grep total | awk '{print $1}')
  42. grb="GG=$gg SH=$sh GRB_SZ=$sz"
  43. fi
  44. cmor=""
  45. if [[ -d $src4/$expid/$s/$m/outputs ]]; then
  46. ca=$(ls -1 $src4/$expid/$s/$m/outputs | grep CMORA | wc -l)
  47. co=$(ls -1 $src4/$expid/$s/$m/outputs | grep CMORO | wc -l)
  48. sz=$(du -chs $src4/$expid/$s/$m/outputs | grep total | awk '{print $1}')
  49. cmor="CMORA=$ca CMORO=$co CMOR_SZ=$sz"
  50. fi
  51. echo "$expid $s $m LOGS=$l ${mm} ${rest} $grb $cmor"
  52. fi
  53. done
  54. done
  55. du -chs $src1/$expid | grep $expid
  56. du -chs $src2/$expid | grep $expid
  57. du -chs $src30/$expid | grep $expid
  58. du -chs $src3/$expid | grep $expid
  59. du -chs $src4/$expid | grep $expid