#! /bin/sh # # usage: xitgc [-n ncpus] runname # to do an ITG run with runname.in as the input name. # # initialization: # # setenv gfbin ~hammett/gryffin # alias xitgc=$gfbin/xitgc # # setenv NCPUS 2 if [ "$1" = "-n" ]; then shift ncpus=$1 shift else ncpus=1 fi if [ ! -f $1.in ];then echo $1.in "input file for ITG doesn't exist" exit 1 fi # Define default gfbin if it isn't set or is null: gfbin=${gfbin:-gfbin} # # move files from an aborted previous run [ warning, this will # save that run, but overwrites any previous *_old files ]: if [ -f $1.nc ];then mv $1.nc $1.nc_old ;fi if [ -f $1.out ];then mv $1.out $1.out_old ;fi if [ -f $1.gin ];then mv $1.geo $1.gin_old ;fi #if [ -f $1.geo ];then mv $1.geo $1.geo_old ;fi if [ -f $1.geo2 ];then mv $1.geo2 $1.geo2_old ;fi if [ -f $1.fields ];then mv $1.fields $1.fields_old ;fi if [ -f $1.dmix ];then mv $1.dmix $1.dmix_old ;fi if [ -f $1.ja ];then mv $1.ja $1.ja_old ;fi # # Keep geometry information for this run handy if [ -f eik.in ];then cp eik.in $1.gin ;fi if [ -f eik.out ];then cp eik.out $1.geo ;fi if [ -f eik2.out ];then cp eik2.out $1.geo2 ;fi # ja assign -F global f:$1.nc if [ $ncpus -eq 1 ] then echo 'Executing itgc' $gfbin/itgc $1 else echo 'Waiting to execute itgc' # T3E and C90 mpi commands:: # mpprun -n $ncpus $gfbin/itgc $1 mpirun -nt $ncpus $gfbin/itgc $1 fi ja -st > $1.ja echo 'itgc complete' /bin/rm $1.ins # # exit here if you want to skip the post-processor for now. exit if [ -f $1.post ];then mv $1.post $1.post_old ;fi if [ -f $1.freq ];then mv $1.freq $1.freq_old ;fi if [ -f $1.mov ];then mv $1.mov $1.mov_old ;fi if [ -f $1.m ];then mv $1.m $1.m_old ;fi # echo 'Executing postc' $gfbin/postc $1 /bin/rm $1.pins echo 'postc complete' #echo 'compressing output file...' #gzip $1.res