#! /usr/bin/env bash # $Header: /home/ubuntu/mnt/e9_copy/MITgcm_contrib/dyncore_ASP/run/prepare_run,v 1.1 2009/03/10 02:41:14 jmc Exp $ # $Name: $ here=`pwd` #hdir=`basename $here` #hres=`echo $hdir | sed 's/_L.*$//' | sed 's/^.*_//'` #tstc=`echo $hdir | sed 's/^.*\.//'` hdir=`grep the_run_name data | sed 's/.*exp //'` hres=`echo $hdir | sed 's/_L.*$//' | sed 's/^.*\.//'` tstc=`echo $hdir | sed 's/\..*//'` rot=`echo $tstc | sed 's/^.-//' | sed 's/-.*$//'` echo "dir='$hdir' ; h-resolution='$hres' ; test-case='$tstc' ; rotation='$rot'" #- take files from this dir: fromDir="../input_${hres}_12" fileList=`( cd $fromDir ; ls fCor*.${rot}_${hres}.*bin )` #- and do a symbolic link in the current directory # (if the file does not already exist) if test -d $fromDir ; then lnkList='files:' for xx in $fileList do if test -r ${fromDir}/$xx ; then yy=`echo $xx | sed "s/\.${rot}_${hres}//"` if test ! -r $yy ; then lnkList=${lnkList}" "$yy ln -sf ${fromDir}/$xx $yy fi fi done echo ' link' $lnkList echo " from dir: $fromDir (sufx='${rot}_${hres}')" else echo " Error:" $fromDir "not a directory" fi