rebuild.sh 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #!/bin/bash
  2. # Submission script for Zenobe
  3. #PBS -N ECEC_post
  4. #PBS -r y
  5. #PBS -W group_list=ecearth
  6. #
  7. #PBS -l walltime=23:59:00
  8. #PBS -l select=1:ncpus=5:ompthreads=5:vmem=20480mb
  9. #PBS -l pvmem=4096mb
  10. #
  11. #PBS -M francois.klein@uclouvain.be
  12. #PBS -m abe
  13. exec > ${PBS_O_WORKDIR}/${PBS_JOBNAME}.${PBS_JOBID}.log
  14. echo "------------------ Work dir --------------------"
  15. cd ${PBS_O_WORKDIR} && echo ${PBS_O_WORKDIR}
  16. echo "------------------ Job Info --------------------"
  17. echo "jobid : $PBS_JOBID"
  18. echo "jobname : $PBS_JOBNAME"
  19. echo "job type : $PBS_ENVIRONMENT"
  20. echo "submit dir : $PBS_O_WORKDIR"
  21. echo "queue : $PBS_O_QUEUE"
  22. echo "user : $PBS_O_LOGNAME"
  23. echo "threads : $OMP_NUM_THREADS"
  24. set -ue
  25. set +x
  26. # =============================================================================
  27. # *** BEGIN User configuration
  28. # =============================================================================
  29. # -----------------------------------------------------------------------------
  30. # *** General configuration
  31. # -----------------------------------------------------------------------------
  32. # Experiment name (exactly 4 letters!)
  33. exp_name=ECEC
  34. # Directories
  35. start_dir=${PBS_O_WORKDIR}
  36. #start_dir=${PWD}
  37. # Architecture
  38. build_arch=ecconf
  39. nem_numproc=96
  40. # -----------------------------------------------------------------------------
  41. # *** Read platform dependent configuration
  42. # -----------------------------------------------------------------------------
  43. . ${PBS_O_WORKDIR}/ecconf.cfg
  44. configure
  45. # -----------------------------------------------------------------------------
  46. # *** Post NEMO
  47. # -----------------------------------------------------------------------------
  48. rebuild_nemo=${ecearth_src_dir}/util/rebuild_nemo/rebuild_nemo
  49. path=${run_dir}/output/nemo
  50. for dir in ${path}/*
  51. do
  52. cd ${dir}
  53. count=0
  54. for i in $(echo `ls | head -n 1` | tr "_" "\n")
  55. do
  56. count=$(( $count + 1 ))
  57. [[ $count -eq 3 ]] && expdate=${i}
  58. [[ $count -eq 4 ]] && expdate=${expdate}_${i}
  59. done
  60. basename="${exp_name}_1m_${expdate}_"
  61. $rebuild_nemo -t 5 ${basename}grid_T ${nem_numproc}
  62. $rebuild_nemo -t 5 ${basename}grid_U ${nem_numproc}
  63. $rebuild_nemo -t 5 ${basename}grid_V ${nem_numproc}
  64. $rebuild_nemo -t 5 ${basename}grid_W ${nem_numproc}
  65. #$rebuild_nemo -t 5 ${basename}icemoa ${nem_numproc}
  66. #$rebuild_nemo -t 5 ${basename}icemod ${nem_numproc}
  67. mv ${basename}??????.nc ..
  68. cd ..
  69. done
  70. if [ ! -d ${stdout_dir}/nemo ]
  71. then
  72. mkdir -p ${stdout_dir}/nemo
  73. fi
  74. cd ${path}
  75. mv -f *.nc ${stdout_dir}/nemo
  76. # -----------------------------------------------------------------------------