pro readnet
; IDL/DDSCAR postprocessing code
; Version corresponding to DDSCAT 5a5 stamp
; reads DDSCAT NetCDF 
; History:
; 96.11.15      (PJF) First version
;end history
;Copyright (C) 1996 B.T. Draine and P.J. Flatau
;This code is covered by the GNU General Public License.
idnc=ncdf_open('dd.cdf')

;not all variables are defined (but readbin.pro and readnet.pro )
;common blocks should be the same

common ddcom1,  iorth, nx, ny, nz,$
      nat0, nat, nat3, nscat, ncomp,$
      nori, nwav, nrad, ntheta, nphi, nbeta, ntimers
common ddcom2, mxnx, mxny, mxnz, mxcomp, mxsca
common ddcom3,  BETMID, BETMXD, THTMID, THTMXD, PHIMID, PHIMXD
common ddcom4, phin, thetan
common ddcom5, ICTHM, IPHIM, TOL
common ddcom6, wavea, aeffa, theta, beta, phi, a1, a2, icomp, ix0, iy0, iz0
common ddcom7, qext_all, qext_abs, g_all, cxrfr_all
common ddcom8, sm11a, sm22a

;get dimensions
ncdf_diminq,idnc,'nx',name,nx
ncdf_diminq,idnc,'ny',name,ny
ncdf_diminq,idnc,'nz',name,nz
ncdf_diminq,idnc,'nat0',name,nat0
ncdf_diminq,idnc,'nat',name,nat
ncdf_diminq,idnc,'nat3',name,nat3
ncdf_diminq,idnc,'nscat',name,nscat
ncdf_diminq,idnc,'ncomp',name,ncomp
ncdf_diminq,idnc,'nori',name,nori
ncdf_diminq,idnc,'nwav',name,nwav
ncdf_diminq,idnc,'nrad',name,nrad
ncdf_diminq,idnc,'ntheta',name,ntheta
ncdf_diminq,idnc,'nphi',name,nphi
ncdf_diminq,idnc,'nbeta',name,nbeta
ncdf_diminq,idnc,'ntimers',name,ntimers
help, nx, ny, nz, nat0, nat, nat3, nscat, ncomp, nori, nwav, nrad, $
      ntheta, nphi, nbeta, ntimers
;variables
;read variables
ncdf_varget,idnc,'wavea',wavea
ncdf_varget,idnc,'aeffa',aeffa
ncdf_varget,idnc,'theta',theta
ncdf_varget,idnc,'beta',beta
ncdf_varget,idnc,'phi',phi
ncdf_varget,idnc,'a1',a1
ncdf_varget,idnc,'a2',a2
ncdf_varget,idnc,'icomp',icomp
ncdf_varget,idnc,'ix0',ix0
ncdf_varget,idnc,'iy0',iy0
ncdf_varget,idnc,'iz0',ix0
ncdf_varget,idnc,'phin',phin
ncdf_varget,idnc,'thetan',thetan
ncdf_varget,idnc,'qext',qext
ncdf_varget,idnc,'qabs',qabs
ncdf_varget,idnc,'qscat',qscat
ncdf_varget,idnc,'g',g
ncdf_varget,idnc,'qbksca',qbksca
ncdf_varget,idnc,'qav',qav
ncdf_varget,idnc,'qtrqab',qtrqab
ncdf_varget,idnc,'qtrqsc',qtrqsc
ncdf_varget,idnc,'sm11',sm11
ncdf_varget,idnc,'sm12',sm12
ncdf_varget,idnc,'sm13',sm13
ncdf_varget,idnc,'sm14',sm14
ncdf_varget,idnc,'sm21',sm21
ncdf_varget,idnc,'sm22',sm22
ncdf_varget,idnc,'sm23',sm23
ncdf_varget,idnc,'sm24',sm24
ncdf_varget,idnc,'sm31',sm31
ncdf_varget,idnc,'sm32',sm32
ncdf_varget,idnc,'sm33',sm33
ncdf_varget,idnc,'sm34',sm34
ncdf_varget,idnc,'sm41',sm41
ncdf_varget,idnc,'sm42',sm42
ncdf_varget,idnc,'sm43',sm43
ncdf_varget,idnc,'sm44',sm44

help, wavea, aeffa,sm11
stop
end
