launch_sanity_all_mem.bash 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/bin/bash
  2. ##### BASH:
  3. # - launch sanity check of the analyse for each member of the ensemble (after EnKF).
  4. #
  5. # 06/05/2024 A. Delhasse alison.delhasse@uclouvain.be
  6. #
  7. #########
  8. #!/bin/bash
  9. #SBATCH -n 1
  10. #SBATCH -t 00:10:00
  11. #SBATCH -J post_perturbation
  12. #SBATCH -o log/slurm_sanity-%j.out
  13. #SBATCH -e log/slurm_sanity-%j.err
  14. #SBATCH --partition=debug # Partition sur laquelle lancer le travail
  15. ##SBATCH --exclusive # Ressources exclusives
  16. #SBATCH --account=limhr # Compte associé au travail
  17. #SBATCH --mem-per-cpu=64000
  18. ### LOAD MODULES
  19. #module load Python/3.10.4-GCCcore-11.3.0
  20. module --force purge
  21. module load EasyBuild/2023a
  22. module load netCDF-Fortran/4.6.1-gompi-2023a
  23. module load Perl-bundle-CPAN/5.36.1-GCCcore-12.3.0
  24. module load ScaLAPACK/2.2.0-gompi-2023a-fb
  25. module load FFTW.MPI/3.3.10-gompi-2023a
  26. set -x
  27. for mem in `seq 1 5`; do
  28. mname=$(printf "%02d" $mem)
  29. ####------------####
  30. ### CHECK INPUTS ###
  31. ####------------####
  32. if [ ! -f analysis_ice_1${mname}.nc ] ; then
  33. echo "analysis_ice_1${mname}.nc MISSING" ; exit 1
  34. fi
  35. if [ ! -f analysis_oce_1${mname}.nc ] ; then
  36. echo "analysis_oce_1${mname}.nc MISSING" ; exit 2
  37. fi
  38. ####-------------####
  39. ### LAUNCH SANITY ###
  40. ####-------------####
  41. ./sanity_check analysis_ice_1${mname}.nc forecast_ice_1${mname}.nc analysis_oce_1${mname}.nc forecast_oce_1${mname}.nc
  42. [ $? -ne 0 ] && exit 3
  43. ####---------------------####
  44. ### CHECK AND MOVE OUPUTS ###
  45. ####---------------------####
  46. if [ ! -f ice_out.nc ] ; then
  47. echo "ice_out.nc MISSING for mem${mname}"
  48. else
  49. mv ice_out.nc ice_out_1${mname}.nc
  50. cp ice_out_1${mname}.nc new_restart_ice_1${mname}.nc
  51. fi
  52. if [ ! -f oce_out.nc ] ; then
  53. echo "oce_out.nc MISSING for mem${mname}"
  54. else
  55. mv oce_out.nc oce_out_1${mname}.nc
  56. cp oce_out_1${mname}.nc new_restart_oce_1${mname}.nc
  57. fi
  58. echo " Sanity check ${mname} done"
  59. echo""
  60. done #mem