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" function make1_big(x,d1big) begin dimx = dimsizes(x) rankx= dimsizes(dimx) if (rankx.ne.1) then print("make_big: rankx="+rankx+": expecting rank=1") exit end if xnew = new ( (/d1big/),typeof(x), getFillValue(x)) xnew(0:dimx(0)-1) = (/ x /) xnew(3) = (/x(dimx(0)-1)+3/) ; will add 3 to the last time value in the original file return(xnew) end function make_big(x, d1big) begin dimx = dimsizes(x) rankx= dimsizes(dimx) if (rankx.ne.3) then print("make_big: rankx="+rankx+": expecting rank=3") exit end if xnew = new ( (/d1big, dimx(1),dimx(2)/), typeof(x), getFillValue(x)) xnew(0:dimx(0)-1,:,:) = (/ x /) xnew(3,:,:) = xnew(1,:,:) return(xnew) end begin print("reading the variables") a = addfile("cruncep_tairnew_2010_1x1_3h_2time.nc","w") y1=a->y TIME1=a->TIME print("variables read") time=make1_big(TIME1,4) time!0 = "time" time&time = time copy_VarAtts(TIME1,time) y2=make_big(y1,4) printVarSummary(y2) exit y2!0 = "time" y2!1 = "lat" y2!2 = "lon" y2&time = time y2&lat = y1&lat y2&lon = y1&lon fout=addfile("tair_2010_3h_4times_new.nc", "c") fout->y=y2 end