Re: Re: Re: [ncl-talk] How to read a 3-d ascii grid data file ?

From: LEO_ARIES <Leo_Aries_at_nyahnyahspammersnyahnyah>
Date: Fri, 19 May 2006 15:22:07 +0800

HiŁ¬

;*********************************************************
begin
;=====================================================
filName = "GridPRCP.dat"
print(filName)
nrow = stringtointeger( \
       systemfunc("'wc' -l " + filName +" | awk '{print $1}'" ))
print("nrow"+nrow) ; ncl give a output "(0) nrow274752"

data = asciiread(filName,(/36*72*106,15/),"float") ; 36 lat grid,72 longitude grid,106 yrs
printVarSummary(data) ;Ncl give a output Variable: data
                                                                                                             Type: float
                                                                                                             Total Size: 16485120 bytes
                                                                                                             4121280 values
                                                                                                             Number of Dimensions: 2
                                                                                                             Dimensions and sizes: [274752] x [15]
                                                                                                             Coordinates:

filString = asciiread ( filName, -1, "string")
nrow = dimsizes(filString)
print("nrow"+nrow) ;Ncl can't give a output of nrow

nRow = numAsciiRow (filName)
print("nRow="+nRow) ; Ncl can't give a output of nRow

;==========================

In factŁ¬I can use "data = asciiread(filName,(/36*72*106,15/),"float")" to read data , But I can't tell
why the function of numAsciiRow don't work normally and if there is some possible error in my ascii data.
(Adam say that my ascii data file is a little large and may contain slight error.)

Someˇˇfiles have been upload to the incoming directory of ftp.cgd.ucar.edu/incoming
Grid_PRCP_1900-2005.dat.gz ; my ascii data file
grid_prcp_1900-2006.dat.gz ;origional data file
ReadGHCN.f90 ; My f90 program
GHCN.ncl

Also thanks to Saji, GHCN is a global 5degree*5 degree data. I think the grid is regular
but with missing value of -32768 at the ocean grid.


Lin

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri May 19 2006 - 01:22:07 MDT

This archive was generated by hypermail 2.2.0 : Fri May 19 2006 - 11:31:16 MDT