1 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
2 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
3 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
8 filename = "analysis_increments"
10 varnames = (/"psi","chi_u","t_u","rh","ps_u"/)
11 nvar = dimsizes(varnames)
13 setfileoption("bin","ReadByteOrder","BigEndian")
14 dims = fbinrecread(filename,0,6,"integer")
18 print("ni, nj, nk = "+ni+", "+nj+", "+nk)
20 vv = fbinrecread(filename,1,(/4,nk,nj,ni/),"double")
22 system("/bin/rm -f "+filename+".nc") ; remove any pre-existing file
23 ncdf = addfile(filename+".nc" ,"c") ; open output netCDF file
25 ;===================================================================
26 ; make time an UNLIMITED dimension; recommended for most applications
27 ;===================================================================
28 ; filedimdef(ncdf,"time",-1,True)
30 u = new((/nk, nj,ni/),double)
31 v = new((/nk, nj,ni/),double)
32 ;w = new((/nk, nj,ni/),double)
33 ;p = new((/nk, nj,ni/),double)
34 t = new((/nk, nj,ni/),double)
35 q = new((/nk, nj,ni/),double)
36 ;z = new((/nk, nj,ni/),double)
38 u(:,:,:) = vv(0,:,:,:)
39 v(:,:,:) = vv(1,:,:,:)
40 ;w(:,:,:) = vv(2,:,:,:)
41 ;p(:,:,:) = vv(3,:,:,:)
42 t(:,:,:) = vv(2,:,:,:)
43 q(:,:,:) = vv(3,:,:,:)
44 ;z(:,:,:) = vv(6,:,:,:)