1 |
#! /bin/sh |
#! /usr/bin/env bash |
2 |
|
|
3 |
#-- Import input files from experiment global_ocean.cs32x15 |
# $Header$ |
4 |
#-- Import grid-files from experiment tutorial_held_suarez_cs |
# $Name$ |
5 |
# this reduce the disk space required when downloading this set-up |
|
6 |
|
#- in order to save disc space, from this dir: |
7 |
dirOcn=`pwd` |
fromDir="../../global_ocean.cs32x15/input" |
8 |
impDir='../../global_ocean.cs32x15/input' |
# link files: |
9 |
|
fileList=`(cd $fromDir ; ls *.bin)` |
10 |
echo 'Import Input files from dir:' $impDir |
|
11 |
cd $impDir |
#- and do a symbolic link in the current directory |
12 |
|
# (if the file does not already exist) |
13 |
listF=`ls *.bin` |
if test -d $fromDir ; then |
14 |
for xx in $listF |
lnkList='files:' |
15 |
do |
for xx in $fileList |
16 |
if test -f $dirOcn/$xx |
do |
17 |
then echo 'file' $xx ' already exists' |
if test -r ${fromDir}/$xx ; then |
18 |
else echo ' cp ' $xx |
if test ! -r $xx ; then |
19 |
cp -p -i $xx $dirOcn |
lnkList=${lnkList}" "$xx |
20 |
fi |
ln -sf ${fromDir}/$xx . |
21 |
done |
fi |
22 |
|
fi |
23 |
|
done |
24 |
|
echo ' link' $lnkList "from dir:" $fromDir |
25 |
|
else |
26 |
|
echo " Error:" $fromDir "not a directory" |
27 |
|
fi |
28 |
|
|
29 |
|
#- in order to save disc space, from this dir: |
30 |
|
fromDir='../../tutorial_held_suarez_cs/input' |
31 |
|
# link files: |
32 |
|
fileList=`(cd $fromDir ; ls *.face00?.bin)` |
33 |
|
|
34 |
|
#- and do a symbolic link in the current directory |
35 |
|
# (if the file does not already exist) |
36 |
|
if test -d $fromDir ; then |
37 |
|
lnkList='files:' |
38 |
|
for xx in $fileList |
39 |
|
do |
40 |
|
if test -r ${fromDir}/$xx ; then |
41 |
|
if test ! -r $xx ; then |
42 |
|
lnkList=${lnkList}" "$xx |
43 |
|
ln -sf ${fromDir}/$xx . |
44 |
|
fi |
45 |
|
fi |
46 |
|
done |
47 |
|
echo ' link' $lnkList "from dir:" $fromDir |
48 |
|
else |
49 |
|
echo " Error:" $fromDir "not a directory" |
50 |
|
fi |
51 |
echo '' |
echo '' |
|
|
|
|
cd $dirOcn |
|
|
|
|
|
impDir='../../tutorial_held_suarez_cs/input' |
|
|
|
|
|
echo 'Import Grid-files from dir:' $impDir |
|
|
cd $impDir |
|
|
|
|
|
listF=`ls *.face00?.bin` |
|
|
for xx in $listF |
|
|
do |
|
|
if test -f $dirOcn/$xx |
|
|
then echo 'file' $xx ' already exists' |
|
|
else echo ' cp ' $xx |
|
|
cp -p -i $xx $dirOcn |
|
|
fi |
|
|
done |
|
|
echo '' |
|
|
|
|
|
cd $dirOcn |
|