[ncl-talk] Binning multilevel MODIS data using bin_sum

AJILESH PP ajileshparolla at gmail.com
Thu Apr 21 07:10:11 MDT 2016


Dear all
I want to bin MODIS level 2 products for a period of time. I modified an
example script given in ncl HDF examples and it is giving me only output of
a single level, where the desired output is for 20 levels. I tried to add a
level loop and level dimension also as shown in the script below.
--------------------------------------
  GBIN  = new ( (/nlev,nlat,mlon/), float )
  GKNT  = new ( (/nlev,nlat,mlon/), integer )

snip

 do nf=0,nfil-1
   do lev=0,nlev-1
     print(nf+"   "+fili(nf))
     f       = addfile(diri+fili(nf), "r")
                                            ; read data
     x          = short2flt_hdf( f->$vNam$ )
     lat2d1     = f->Latitude
     lon2d1     = f->Longitude
     lat2d      = conform(x,lat2d1,(/1,2/))
     lon2d      = conform(x,lon2d1,(/1,2/))
     level        =
(/1000,950,920,850,700,620,500,400,300,250,200,100,150,100,70,50,30,20,10,5/)
     x!0          = "level"
     x&level      = level
     nx           = product(dimsizes(x))
    bin_sum(GBIN(level,:,:),GKNT(level,:,:),lon,lat \
           ,ndtooned(lon2d),ndtooned(lat2d),ndtooned(x) )
printVarSummary(x)
---------------------------------------
but it is giving this error:
fatal:Subscript out of range, error in subscript #0
fatal:An error occurred reading GBIN

Can anybody help me to resolve this issue?
Please find my script and data as follows
Data:   MOD07_L2.A2012166.0*.hdf
Script:  bin.ncl

Any help would be appreciated
Thank You!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160421/e1f35957/attachment.html 


More information about the ncl-talk mailing list