1 |
#! /usr/bin/env bash |
2 |
|
3 |
# $Header: /u/gcmpack/MITgcm/verification/global_ocean.90x40x15/input/prepare_run,v 1.1 2006/07/16 00:10:39 jmc Exp $ |
4 |
# $Name: $ |
5 |
|
6 |
#- in order to save disc space, un-gzip files |
7 |
#- from this dir: |
8 |
fromDir="../input.viscA4" |
9 |
|
10 |
fileList=`( cd $fromDir ; echo *.gz | sed 's/\.gz//g' )` |
11 |
|
12 |
#echo 'fileList=' $fileList |
13 |
|
14 |
#- copy the gz file in the current directory and unzip |
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 ${xx}.gz ; then |
21 |
if test ! -r $xx ; then |
22 |
lnkList=${lnkList}" "$xx |
23 |
gunzip -f ${xx}.gz |
24 |
fi |
25 |
fi |
26 |
done |
27 |
#-- a trick to rename pickup by making a symbolic link in the current directory |
28 |
xx='pickup.0000086400' |
29 |
yy='pickup.0000072000' |
30 |
if test ! -r $xx ; then |
31 |
lnkList=${lnkList}" "$xx |
32 |
ln -sf $yy $xx |
33 |
fi |
34 |
#------ |
35 |
echo ' unzip' $lnkList |
36 |
else |
37 |
echo " Error:" $fromDir "not a directory" |
38 |
fi |