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 = "vp_output.global_hires"
10 varnames = (/"psi","chi_u","t_u","rh","ps_u"/)
11 nvar = dimsizes(varnames)
13 setfileoption("bin","ReadByteOrder","BigEndian")
14 dims = fbinrecread(filename,0,3,"integer")
18 print("ni, nj, nk = "+ni+", "+nj+", "+nk)
20 vv = fbinrecread(filename,1,(/5,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 t = new((/nk, nj,ni/),double)
33 rh = new((/nk, nj,ni/),double)
34 ps = new((/nk, nj,ni/),double)
39 ; v1(k,j,i) = v(i,j,k,1)
40 ; v2(k,j,i) = v(i,j,k,2)
41 ; v3(k,j,i) = v(i,j,k,3)
42 ; v4(k,j,i) = v(i,j,k,4)
43 ; ;v5(k,j,i) = v(i,j,k,5)
48 u(:,:,:) = vv(0,:,:,:)
49 v(:,:,:) = vv(1,:,:,:)
50 t(:,:,:) = vv(2,:,:,:)
51 rh(:,:,:) = vv(3,:,:,:)
52 ps(:,:,:) = vv(4,:,:,:)
60 ;************************************************
61 ; end of reading be.dat data
62 ;************************************************