[ncl-talk] How to correctly read in the merged CMORPH data usig NCL
易路
dg1225033 at smail.nju.edu.cn
Sat Apr 29 22:07:44 MDT 2017
Hi all,
I downloaed the merged CMORPH data from China Meteorological Administration to get the hourly precipitation imformation, the suffix of the data file is grd which is a standard format of the tool GrADS. According to the associated ctl file of the grd file, I tried to write the NCL script to read it but can't get the right data, and I couldn't find out the prolbems...
So would you please help me to find out the problems ? Thanks very mcuh for your precious time and kindness!
Sincerely
Yi Lu
;;;;;;;;;;; the part of NCL script to read in the precipitation ;;;;;;;;;;
tim = "1.grd"
setfileoption("bin","ReadByteOrder","LittleEndian")
rain = fbindirread(tim,0,(/nlat,nlon/),"double")
nlat = 440
nlon = 700
r=new((/nlat,nlon/),"double")
k=0
do i = 0, nlat-1
do j = 0, nlon-1
r(i,j) = rain(nlat-1-i,j)
k = k+1
end do
end do
lon = fspan(70.05,139.95,nlon)
lon!0 = "lon"
lon at units = "degrees_east"
lon at long_name = "longitude"
lat = fspan(15.05,58.95,nlat)
lat!0 = "lat"
lat at long_name = "latitude"
lat at units = "degrees_north"
r!0 = "lat"
r!1 = "lon"
r&lat = lat
r&lon = lon
r at units = "mm/hour"
r at long_name = "merged CMORPH data "
r at _FillValue = -999.00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
易路
南大邮件系统/学生/博士生/12级博士生
南京市汉口路22号
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170430/e1e0b12b/attachment.html
More information about the ncl-talk
mailing list