bdy_reorder 896 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/ksh
  2. # CALLS: bdy_reorder.exe
  3. #set -ax
  4. usage ()
  5. {
  6. echo
  7. echo " bdy_reorder"
  8. echo " ************"
  9. echo
  10. echo " usage: ${0##*/} [-c] file_in file_out"
  11. echo
  12. echo " flags: -c target file is a coordinates.bdy.nc file"
  13. echo " -t template file"
  14. echo
  15. exit 1
  16. }
  17. ln_coordinates=".false."
  18. file_template=""
  19. while getopts ct: opt
  20. do
  21. case ${opt} in
  22. c)
  23. ln_coordinates=".true."
  24. ;;
  25. t)
  26. file_template=${OPTARG}
  27. ;;
  28. [?]) usage
  29. ;;
  30. esac
  31. done
  32. shift $(expr ${OPTIND} - 1)
  33. if [[ $# < 2 ]] ; then
  34. usage
  35. fi
  36. script_dir=$(dirname $0)
  37. file_in=$1
  38. file_out=$2
  39. cat > nam_bdy_reorder << EOC
  40. &nam_bdy_reorder
  41. file_in='${file_in}'
  42. file_out='${file_out}'
  43. file_template='${file_template}'
  44. ln_coordinates=${ln_coordinates}
  45. EOC
  46. echo "/" >> nam_bdy_reorder
  47. ${script_dir}/bdy_reorder.exe
  48. exit 0