#! /bin/csh -f

set  INFILE = domain.T62.050609+.nc
set OUTFILE = domain.T62.050711.nc

cp  domain.T62.050609.nc $INFILE

ncatted -h -O -a conventions,global,d,,          $INFILE
ncatted -h -O -a Conventions,global,o,c,"CF-1.0" $INFILE
ncatted -h -O -a     comment,global,o,c,"Created for use by CCSM data models" $INFILE
ncatted -h -O -a     history,global,a,c," by kauff"  $INFILE

ncatted -h -O -a      units,xc,o,c,"degrees_east"  $INFILE
ncatted -h -O -a      units,xv,o,c,"degrees_east"  $INFILE
ncatted -h -O -a      units,yc,o,c,"degrees_north" $INFILE
ncatted -h -O -a      units,yv,o,c,"degrees_north" $INFILE

ncatted -h -O -a  long_name,area,o,c,"area of grid cell" $INFILE
ncatted -h -O -a      units,area,o,c,"radians**2"        $INFILE
ncatted -h -O -a      units,mask,d,,                     $INFILE
ncatted -h -O -a    comment,mask,o,c,"unitless, 0 <=> grid cell not in model domain" $INFILE

cp $INFILE $OUTFILE

ncrename -h -d ni,lon $OUTFILE
ncrename -h -d nj,lat $OUTFILE
ncatted  -h -O -a nco_openmp_thread_number,global,d,, $OUTFILE

