#!/bin/tcsh

echo "Begin: untar GFS grib2 files."

set Publicdir=/Datasets.other/climo/reforecast

set outdir=/Datasets.other/climo/reforecast
chdir $outdir

set analdate=20060101
while ($analdate <= 20061231)

    if(-s $Publicdir/${analdate}00_c00_0-192hrs.grib2.tar) then
      echo ${analdate}00_c00_0-192hrs.grib2.tar found, beginning untar
      tar xvf $Publicdir/${analdate}00_c00_0-192hrs.grib2.tar
      /bin/rm -f $Publicdir/${analdate}00_c00_0-192hrs.grib2.tar
    else
      echo ${analdate}00_c00_0-192hrs.grib2.tar not found
    endif
    set analdate=`/Datasets.other/climo/incdateday $analdate 1`

end

