#!/bin/csh
setenv Y 2000

foreach m (01 02 03 04 05 06 07 08 09 10 11 12 )

ncks -v dlwrf_avesfc  gefs.${Y}${m}.nc4 gefs.${Y}${m}_dlwrf.nc
echo "dlwrf"
ncks -v dswrf_avesfc  gefs.${Y}${m}.nc4 gefs.${Y}${m}_dswrf.nc
echo "dswrf"
ncks -v prateb_avesfc gefs.${Y}${m}.nc4 gefs.${Y}${m}_precip.nc
echo "precip"
ncks -v ugrd10m gefs.${Y}${m}.nc4 gefs.${Y}${m}_u10.nc
echo "u10"
ncks -v vgrd10m gefs.${Y}${m}.nc4 gefs.${Y}${m}_v10.nc
echo "v10"
ncks -v spfh2m gefs.${Y}${m}.nc4 gefs.${Y}${m}_q2m.nc
echo "q2m"
ncks -v tmp2m gefs.${Y}${m}.nc4 gefs.${Y}${m}_t2m.nc
echo "t2m"

echo ${m}
end


## MOnthly precip
foreach m ( 01 02 03 04 05 06 07 08 09 10 11 12)
ncra -v prateb_avesfc gefs.2000${m}.nc4 gefs.2000${m}_mon_precip.nc
echo ${m}
end
ncrcat gefs.2000??_mon_precip.nc  gefs.2000_mon_precip.nc
