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 = "vv_input.global"
9 filename = "vv_afterUvTransf"
11 varnames = (/"psi","chi_u","t_u","rh","ps_u"/)
12 nvar = dimsizes(varnames)
14 setfileoption("bin","ReadByteOrder","BigEndian")
15 dims = fbinrecread(filename,0,3,"integer")
19 print("ni, nj, nk = "+ni+", "+nj+", "+nk)
21 vv = fbinrecread(filename,1,(/5,nk,nj,ni/),"double")
23 system("/bin/rm -f "+filename+".nc") ; remove any pre-existing file
24 ncdf = addfile(filename+".nc" ,"c") ; open output netCDF file
26 ;===================================================================
27 ; make time an UNLIMITED dimension; recommended for most applications
28 ;===================================================================
29 ; filedimdef(ncdf,"time",-1,True)
31 u = new((/nk, nj,ni/),double)
32 v = new((/nk, nj,ni/),double)
33 t = new((/nk, nj,ni/),double)
34 rh = new((/nk, nj,ni/),double)
35 ps = new((/nk, nj,ni/),double)
40 ; v1(k,j,i) = v(i,j,k,1)
41 ; v2(k,j,i) = v(i,j,k,2)
42 ; v3(k,j,i) = v(i,j,k,3)
43 ; v4(k,j,i) = v(i,j,k,4)
44 ; ;v5(k,j,i) = v(i,j,k,5)
49 u(:,:,:) = vv(0,:,:,:)
50 v(:,:,:) = vv(1,:,:,:)
51 t(:,:,:) = vv(2,:,:,:)
52 rh(:,:,:) = vv(3,:,:,:)
53 ps(:,:,:) = vv(4,:,:,:)
61 ;************************************************
62 ; end of reading be.dat data
63 ;************************************************