Launcher 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # This Launcher is only a wrapper to preserve compatibility between ELPiN and
  2. # auto-nemo and auto-ecearth prpjects.
  3. set -xuve
  4. # Script to correctly configure the tool
  5. WORKING_DIR=$(readlink -f "`dirname \"$0\"`")
  6. cd $WORKING_DIR
  7. [ ! -f bin/mpp_domain_decomposition.exe ] && { ./Configure && exit 0 || exit 1 ;}
  8. # Initializing Variables
  9. ECE=FALSE
  10. # Parse arguments
  11. for arg in $@ ;do
  12. case $arg in
  13. "-s" )
  14. SIMPLIFIED=TRUE
  15. ;;
  16. "-e" )
  17. ECE=TRUE
  18. ;;
  19. "ORCA2" )
  20. RESOLUTION=ORCA2
  21. ;;
  22. "ORCA1" )
  23. RESOLUTION=ORCA1
  24. ;;
  25. "ORCA025" )
  26. RESOLUTION=ORCA025
  27. ;;
  28. "ORCA12" )
  29. RESOLUTION=ORCA12
  30. ;;
  31. [0-9]* )
  32. MAX_NUMPROC=$arg
  33. ;;
  34. *)
  35. echo "unknown parameter $arg" 1>&2
  36. exit 1
  37. ;;
  38. esac
  39. done
  40. [ -z $RESOLUTION ] && echo "Error: Resolution not specified!" 1>&2 && exit 1
  41. [[ $ECE == TRUE ]] && { [[ $RESOLUTION = ORCA2 ]] || [[ $RESOLUTION == ORCA12 ]] ;} && echo "Resolution $RESOLUTION not available in EC-Earth" 1>&2 && exit 1
  42. [[ $ECE == "TRUE" ]] && bathy=bathymetries/ece_bathy_meter_${RESOLUTION}.nc || bathy=bathymetries/nemo_bathy_meter_${RESOLUTION}.nc
  43. ./ELPiNv2.cmd $bathy $MAX_NUMPROC
  44. set +xuve