The problem is in your calls to sprinti, you're doing:
sprinti("0.4n",n)
where it should be:
sprinti("%0.4i",n)
Where the 'i' stands for integer (the documentation at the NCL webpage uses 'i' for the variable name as well, which can lead to some confusion...)
This should work:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
do n=1961,2010
begin
fnam="/home/cohara/TempData/yearly_data/average/average_" + sprinti("%0.4i",n) + ".nc"
x=addfile(fnam,"r")
data=x->var61(0,0,:,:)
xwks=gsn_open_wks("ps","Average_" + sprinti("%0.4i",n)
resources=True
resources@tiMainString="Average Annual Temperature" + sprinti("%0.4i",n)
plot=gsn_csm_contour_map(xwks,data,resources)
end
end do