Re: How to read a 3-d ascii grid data file ?

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Tue, 16 May 2006 14:25:53 -0600

Hi Lin,

NCL will have no problem reading in a 3D (or 4D in your case) ascii
file. It is just a matter of you parsing the data correctly once you
read it in. Instead of creating another ascii file from fortran to read
into NCL, it might be easier to just create a binary file in fortran and
then read it into NCL via fbinrecread or fbindirread. That way you can
bypass asciiread and the possible post-read in array set-up issues that
can arise when organizing complicated asciiread files.
See:
http://www.ncl.ucar.edu/Applications/r-binary.shtml

Adam

LEO_ARIES wrote:
> Hi,
>
> I have an ascii file (GHCN Grid Monthly PRCP) in the form of:
> 1 1951
> -32768 -32768 -32768 -32768 -32768 -32768 -32768 -32768 -32768 -32768
> -32768 -32768
> -32768 -32768 -32768 -32768 -32768 -32768 -32768 -32768 -32768 -32768
> -32768 -32768
> 1: month 1900: year -32788: missing value
> and I want to read them in NCL.
>
> Now I plan to use fortran to read these data and restore them in another
> format given below:
> " Lon lat data(lon,lat,month1,year1) data(lon,lat,month2,year1)
> ....... data(lon,lat,monthn,yearn)"
> and read those data into NCL.:(unfortunately I don't know how to write
> a netcdf file with fortran,so ..)
>
> As is shown in the example given at
> http://www.ncl.ucar.edu/Applications/ascii_grid.shtml ,
> Ncl can read a 2-d ascii gird data file.But I wonder if NCL can read a
> 3d grid data file. The above example is a grid data file on a fixed time
> point, But My grid data has s time span.After reading such file,I want
> to get such a data array as X(lon,lat,month,Year).
>
>
>
>
> Thanks!
>
>
> Lin
>
>
>
>
> ------------------------------------------------------------------------
> LEO_ARIES
> 2006-05-16
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue May 16 2006 - 14:25:53 MDT

This archive was generated by hypermail 2.2.0 : Wed May 17 2006 - 09:57:59 MDT