Back to home page

MITgcm

 
 

    


Warning, /verification/global_ocean.cs32x15/input.viscA4/prepare_run is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit 15ec4b1e on 2026-02-28 00:30:32 UTC
e6f4278565 Jean*0001 #! /usr/bin/env bash
                0002 
15ec4b1e94 Jean*0003 #- in order to save disc space, take grid files
                0004 #- from this dir:
                0005 fromDir="../../tutorial_held_suarez_cs/input"
                0006 
                0007 fileList=`( cd $fromDir ; ls grid_cs32.face00?.bin )`
                0008 #echo 'fileList=' $fileList
                0009 
                0010 #- from this dir:
                0011 
                0012 #- and do a symbolic link in the current directory
                0013 #   (if the file does not already exist)
                0014 if test -d $fromDir ; then
                0015   lnkList='files:'
                0016   for xx in $fileList
                0017   do
                0018     if test -r ${fromDir}/$xx ; then
                0019       if test ! -r $xx ; then
                0020         lnkList=${lnkList}" "$xx
                0021         ln -sf ${fromDir}/$xx .
                0022       fi
                0023     fi
                0024   done
                0025   echo ' link' $lnkList "from dir:" $fromDir
                0026 else
                0027   echo " Error:" $fromDir "not a directory"
                0028 fi
                0029 
e6f4278565 Jean*0030 #- in order to save disc space, un-gzip files
                0031 #- from this dir:
                0032 fromDir="../input.viscA4"
                0033 
                0034 fileList=`( cd $fromDir ; echo *.gz | sed 's/\.gz//g' )`
                0035 #echo 'fileList=' $fileList
                0036 
88f3b7ad8b Jean*0037 #- copy the gz file in the current directory and unzip
e6f4278565 Jean*0038 #   (if the file does not already exist)
                0039 if test -d $fromDir ; then
88f3b7ad8b Jean*0040   lnkList=''
e6f4278565 Jean*0041   for xx in $fileList
                0042   do
88f3b7ad8b Jean*0043     if test -r ${xx}.gz ; then
                0044       if test ! -r $xx -o $xx -ot ${xx}.gz ; then
                0045         # file does not exist or is older than compressed version:
e6f4278565 Jean*0046         lnkList=${lnkList}" "$xx
                0047         gunzip -f ${xx}.gz
                0048       fi
                0049     fi
                0050   done
88f3b7ad8b Jean*0051   if test "x$lnkList" != 'x' ; then
                0052     echo -n " unzip files:$lnkList " ; lnkList=';'
                0053   fi
e6f4278565 Jean*0054 #-- a trick to rename pickup by making a symbolic link in the current directory
                0055       xx='pickup.0000086400'
                0056       yy='pickup.0000072000'
88f3b7ad8b Jean*0057       if test ! -r $xx ; then
                0058         lnkList="$lnkList +link $yy to $xx"
e6f4278565 Jean*0059         ln -sf $yy $xx
                0060       fi
88f3b7ad8b Jean*0061   echo "$lnkList"
e6f4278565 Jean*0062 #------
                0063 else
                0064   echo " Error:" $fromDir "not a directory"
                0065 fi