#! /bin/csh -f

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

rm $OUTFILE

#cp         lwdn.1958.nc $OUTFILE
ncks -A -h -v lat,lon      dn10.1995.nc  $OUTFILE
ncks -A -h -v area,mask    $DOMFILE      $OUTFILE
ncks -A -h -v time         dn10.1995.nc  $OUTFILE
ncks -A -h -v dn10 dn10.1995.nc $OUTFILE
ncks -A -h -v slp_ slp_.1995.nc $OUTFILE
ncks -A -h -v q_10 q_10.1995.nc $OUTFILE
ncks -A -h -v t_10 t_10.1995.nc $OUTFILE
ncks -A -h -v u_10 u_10.1995.nc $OUTFILE
ncks -A -h -v v_10 v_10.1995.nc $OUTFILE

ncatted -h -O -a       title,global,o,c,"NCEP Normal Year Forcing, 6 hour data"    $OUTFILE
ncatted -h -O -a     history,global,o,c,"Original data by yeager, reformatted by `whoami`, `date`" $OUTFILE
ncatted -h -O -a     comment,global,o,c,"Normal Year Forcing, assigned to year=1"  $OUTFILE
ncatted -h -O -a      source,global,o,c,"NCEP 1958-2000 data"                      $OUTFILE
ncatted -h -O -a conventions,global,d,,                                            $OUTFILE
ncatted -h -O -a        code,global,d,,                                            $OUTFILE
ncatted -h -O -a      method,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

ncatted -h -O -a    comment,dn10,o,c,"ensemble average of 1958-2000 NCEP time series" $OUTFILE
ncatted -h -O -a    comment,slp_,o,c,"ensemble average of 1958-2000 NCEP time series" $OUTFILE
ncatted -h -O -a    comment,q_10,o,c,"FFT of 1958-2000 NCEP time series"              $OUTFILE
ncatted -h -O -a    comment,t_10,o,c,"FFT of 1958-2000 NCEP time series"              $OUTFILE
ncatted -h -O -a    comment,u_10,o,c,"FFT of 1958-2000 NCEP time series"              $OUTFILE
ncatted -h -O -a    comment,v_10,o,c,"FFT of 1958-2000 NCEP time series"              $OUTFILE

ncatted -h -O -a       code,q_10,o,c,"/home/blackforest/yeager/DAVE/NCEPNY/fft_transform_2D_q10_bmethod.run"  $OUTFILE
ncatted -h -O -a     method,q_10,o,c,"uncorrected; no b-factor added" $OUTFILE
ncatted -h -O -a       code,t_10,o,c,"/home/blackforest/yeager/DAVE/NCEPNY/fft_transform_2D_t10_bmethod.run"  $OUTFILE
ncatted -h -O -a     method,t_10,o,c,"uncorrected; no b-factor added" $OUTFILE
ncatted -h -O -a       code,u_10,o,c,"/home/blackforest/yeager/DAVE/NCEPNY/fft_transform_2D_uv.run"  $OUTFILE
ncatted -h -O -a     method,u_10,o,c,"uncorrected" $OUTFILE
ncatted -h -O -a       code,v_10,o,c,"/home/blackforest/yeager/DAVE/NCEPNY/fft_transform_2D_uv.run"  $OUTFILE
ncatted -h -O -a     method,v_10,o,c,"uncorrected" $OUTFILE

#--- why is this attribute created? ---
ncatted -h -O -a nco_openmp_thread_number,global,d,, $OUTFILE

