source: branches/UKMO/dev_r5518_DMP_TOOLS/NEMOGCM/TOOLS/BDY_TOOLS/bdy_reorder

Last change on this file was 3239, checked in by davestorkey, 10 years ago

Add bdy_reorder utility to TOOLS directory.

  • Property svn:executable set to *
File size: 896 bytes
Line 
1#!/bin/ksh
2
3# CALLS: bdy_reorder.exe
4
5#set -ax
6usage ()
7{
8   echo
9   echo "  bdy_reorder"
10   echo "  ************"
11   echo
12   echo "  usage: ${0##*/} [-c] file_in file_out"
13   echo
14   echo "  flags:    -c          target file is a coordinates.bdy.nc file"
15   echo "            -t          template file"
16   echo
17   exit 1
18}
19
20ln_coordinates=".false."
21file_template=""
22
23while getopts ct: opt
24do
25  case ${opt} in
26      c) 
27         ln_coordinates=".true." 
28      ;;
29      t) 
30         file_template=${OPTARG}
31      ;;
32      [?]) usage
33      ;;
34  esac
35done
36shift $(expr ${OPTIND} - 1)
37
38if [[ $# < 2 ]] ; then
39   usage
40fi
41
42script_dir=$(dirname $0)
43
44file_in=$1
45file_out=$2
46
47cat > nam_bdy_reorder << EOC
48&nam_bdy_reorder
49file_in='${file_in}'
50file_out='${file_out}'
51file_template='${file_template}'
52ln_coordinates=${ln_coordinates}
53EOC
54echo "/" >> nam_bdy_reorder
55
56${script_dir}/bdy_reorder.exe
57
58exit 0
Note: See TracBrowser for help on using the repository browser.