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