#! /bin/csh -f

set OUTFILE = tn460nyf.giss.T62.050711.nc
set DOMFILE =  domain.T62.050711.nc

rm $OUTFILE

#cp         lwdn.1958.nc $OUTFILE
ncks -A -h -v lat,lon      lwdn.1958.nc  $OUTFILE
ncks -A -h -v area,mask    $DOMFILE      $OUTFILE
ncks -A -h -v time         lwdn.1958.nc  $OUTFILE

ncks -A -h -v lwdn lwdn.1958.nc $OUTFILE
ncks -A -h -v swdn swdn.1958.nc $OUTFILE
ncks -A -h -v swup swup.1958.nc $OUTFILE

ncatted -h -O -a       title,global,o,c,"GISS Normal Year monthly mean climatology" $OUTFILE
ncatted -h -O -a     history,global,a,c," \nReformatted by `whoami`, `date`"         $OUTFILE
ncatted -h -O -a     comment,global,o,c,"1984-2000 ensemble mean assigned to year=1" $OUTFILE
ncatted -h -O -a conventions,global,d,,                                              $OUTFILE

ncatted -h -O -a      units,time,o,c,"days since 0001-01-01 00:00:00" $OUTFILE
ncatted -h -O -a   calendar,time,o,c,"noleap"                         $OUTFILE

