[ncl-talk] How to correctly read in the merged CMORPH data usig NCL

wen wenguanhuan at 163.com
Tue May 2 23:59:17 MDT 2017


Hi Barry,
 ny = 440,nx=700, which are "nlat" and "nlon" in the script of Yi Lu.





--

Best regards,
Guanhuan Wen

At 2017-05-03 13:17:32, "Barry Lynn" <barry.h.lynn at gmail.com> wrote:

Hi Wen:


What are nx,ny?  Are they suppose to be the same values in the data read in and the data plotted?


Are you sure about the little_endian definition?


On Wed, May 3, 2017 at 6:16 AM, wen <wenguanhuan at 163.com> wrote:

Hi. The following script is able to read the data. I hope it work for you. 
 


 setfileoption("bin","ReadByteOrder","littleEndian")
 mfile = "1.grd"
  rec = 0
  crain = fbindirread(mfile,rec,(/ny,nx/),"float")
  rec = 1
  gsamp = fbindirread(mfile,rec,(/ny,nx/),"float")





--

Best regards,
Guanhuan Wen

在 2017-04-30 12:07:44,"易路" <dg1225033 at smail.nju.edu.cn> 写道:

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号 

|
 




 


_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk







--

Barry H. Lynn, Ph.D
Senior Lecturer,
The Institute of the Earth Science, 
The Hebrew University of Jerusalem, 
Givat Ram, Jerusalem 91904, Israel 

Tel: 972 547 231 170
Fax: (972)-25662581


C.E.O, Weather It Is, LTD
Weather and Climate Focus
http://weather-it-is.com
Jerusalem, Israel
Local: 02 930 9525
Cell: 054 7 231 170
Int-IS: x972 2 930 9525
US 914 432 3108
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170503/f5a6d995/attachment.html 


More information about the ncl-talk mailing list