1 |
heimbach |
1.1 |
#! /usr/bin/env bash |
2 |
|
|
|
3 |
jmc |
1.2 |
# $Header: /u/gcmpack/MITgcm/verification/isomip/input_oad/prepare_run,v 1.1 2013/03/29 23:18:56 heimbach Exp $ |
4 |
heimbach |
1.1 |
# $Name: $ |
5 |
jmc |
1.2 |
|
6 |
|
|
#- in order to save disc space, take *.bin files from this dir: |
7 |
|
|
fromDir="../input" |
8 |
|
|
|
9 |
|
|
fileList=`( cd $fromDir ; ls bathy.box icetopo.exp1 phi0surf.exp1.jmd95z )` |
10 |
|
|
|
11 |
|
|
#echo 'fileList=' $fileList |
12 |
|
|
|
13 |
|
|
#- and do a symbolic link in the current directory |
14 |
|
|
# (if the file does not already exist) |
15 |
|
|
if test -d $fromDir ; then |
16 |
|
|
lnkList='files:' |
17 |
|
|
for xx in $fileList |
18 |
|
|
do |
19 |
|
|
if test -r ${fromDir}/$xx ; then |
20 |
|
|
if test ! -r $xx ; then |
21 |
|
|
lnkList=${lnkList}" "$xx |
22 |
|
|
ln -sf ${fromDir}/$xx . |
23 |
|
|
fi |
24 |
|
|
fi |
25 |
|
|
done |
26 |
|
|
echo ' link' $lnkList "from dir:" $fromDir |
27 |
|
|
else |
28 |
|
|
echo " Error:" $fromDir "not a directory" |
29 |
|
|
fi |
30 |
|
|
|
31 |
|
|
#- an take pickup files from this dir: |
32 |
heimbach |
1.1 |
fromDir="../input_ad" |
33 |
|
|
|
34 |
|
|
fileList=`( cd $fromDir ; echo pickup* )` |
35 |
|
|
|
36 |
|
|
#echo 'fileList=' $fileList |
37 |
|
|
|
38 |
jmc |
1.2 |
#- and do a symbolic link in the current directory |
39 |
heimbach |
1.1 |
# (if the file does not already exist) |
40 |
|
|
if test -d $fromDir ; then |
41 |
|
|
lnkList='files:' |
42 |
|
|
for xx in $fileList |
43 |
|
|
do |
44 |
jmc |
1.2 |
if test -r ${fromDir}/$xx ; then |
45 |
|
|
if test ! -r $xx ; then |
46 |
heimbach |
1.1 |
lnkList=${lnkList}" "$xx |
47 |
|
|
ln -sf ${fromDir}/$xx . |
48 |
|
|
fi |
49 |
|
|
fi |
50 |
|
|
done |
51 |
|
|
echo ' link' $lnkList "from dir:" $fromDir |
52 |
|
|
else |
53 |
|
|
echo " Error:" $fromDir "not a directory" |
54 |
|
|
fi |