#!/bin/csh -f
set directs=`ls | grep -v ERS.ne120_g16.FC5.hopper.fvctl.3200.budget04ctl | grep -v ERS.ne120_g16.FC5.titan_pgi.clubb.3200.budget04 | grep -v rbn | grep -v cam5_3_66_reftra_5years | grep -v untar | grep -v clubb | grep -v deep_runs| grep -v slop_runs | grep -v Clubb_Ck10 | grep -v ice_super | grep -v run_diag_wrap | grep -v SB2001 | grep -v cesm2_zm `

set directs=`ls `
echo $directs
set directparnet=`pwd`

foreach d ($directs)
  if (-s  ${directparnet}/${d}/atm) then

  cd ${directparnet}/${d}/atm
  echo `pwd`
  set tarfiles=`ls -all *tar | grep hann`
  foreach f ($tarfiles)
     tar xvf $f
     rm -f $f
  end
  endif
end

