foreach f (latlon*nc)
foreach v (lat lon)
echo $f $v
ncks -v $v $f | fgrep $v'[' | sed 's/=/ /g;s/[^0-9. ]*//g' | cut -f 1,3,6 -d \  > text-latlon/`basename $f`.$v.txt
end
end

/usr/bin/rename _ . text-latlon/*
/usr/bin/rename .nc. . text-latlon/*

/usr/bin/rename latlon. '' text-latlon/*

rm text-latlon/WRF.* text-latlon/WRFP.* text-latlon/HRM3.l*

/usr/bin/rename .fixed. . text-latlon/*


foreach v (lat lon)
foreach f (text-latlon/*.$v.txt)
echo "yc\txc\t$v" > text-latlon/temp
sed 's/ /\t/g' $f >> text-latlon/temp
mv text-latlon/temp $f
echo $f
end
end



zip -r text-latlon text-latlon
