1 |
#! /usr/bin/env bash |
2 |
|
3 |
# $Header: $ |
4 |
# $Name: $ |
5 |
|
6 |
#- in order to save disc space, take *.bin files |
7 |
#- from this dir: |
8 |
fromDir="../../tutorial_global_oce_latlon/input" |
9 |
|
10 |
fileList=`( cd $fromDir ; echo bathymetry.bin )` |
11 |
|
12 |
#echo 'fileList=' $fileList |
13 |
|
14 |
#- and do a symbolic link in the current directory |
15 |
# (if the file does not already exist) |
16 |
if test -d $fromDir ; then |
17 |
lnkList='files:' |
18 |
for xx in $fileList |
19 |
do |
20 |
if test -r ${fromDir}/$xx ; then |
21 |
if test ! -r $xx ; then |
22 |
lnkList=${lnkList}" "$xx |
23 |
ln -sf ${fromDir}/$xx . |
24 |
fi |
25 |
fi |
26 |
done |
27 |
echo ' link' $lnkList "from dir:" $fromDir |
28 |
else |
29 |
echo " Error:" $fromDir "not a directory" |
30 |
fi |
31 |
|
32 |
# now link forcing files to yearly names, this is really faking it, since |
33 |
# we use the same files for 1991 and 1992, but it is just a test after all |
34 |
fileList="lev_sss.bin lev_sst.bin ncep_emp.bin ncep_qnet.bin trenberth_taux.bin trenberth_tauy.bin" |
35 |
if test -d $fromDir ; then |
36 |
lnkList='files:' |
37 |
for xx in $fileList |
38 |
do |
39 |
if test -r ${fromDir}/$xx ; then |
40 |
if test ! -r ${xx}_1991 ; then |
41 |
lnkList=${lnkList}" "${xx}_1991 |
42 |
ln -sf ${fromDir}/$xx ./${xx}_1991 |
43 |
fi |
44 |
if test ! -r ${xx}_1992 ; then |
45 |
lnkList=${lnkList}" "${xx}_1992 |
46 |
ln -sf ${fromDir}/${xx} ./${xx}_1992 |
47 |
fi |
48 |
fi |
49 |
done |
50 |
echo ' link' $lnkList "from dir:" $fromDir |
51 |
else |
52 |
echo " Error:" $fromDir "not a directory" |
53 |
fi |