Writing an irregular native grid to netCDF output

From: David E. Atkinson (datkinson AT iarc.uaf.edu)
Date: Mon Oct 17 2005 - 13:29:46 MDT


Hi,
I'd like to write a native grid to netCDF output. I've
tried various combinations of attaching attributes
etc, to little avail. The file has been read in correctly;
ultimately the question is can I attach an array to
a coordinate variable?

Below is the fragment for attaching proper coords to
what was read in. lat2d and lon2d are both separate
arrays of 11000 unique lat and lon values
(native grid over the pole).

(This is from Dennis Shea's response to my
earlier question about getting the lat/lon
attached properly to the grid - it worked fine;
thank you Dennis).

Generic appraoch

Say: x(lat,lon)

       nlat = 100
       mlon = 110
       npts = nlat*mlon
                            ; assuming 2 col lat lon
       ltln = asciiread("foo.LatLon", (/npts,2/), "float")
       
       lat2d = onedtond(ltln(:,0), (/nlat,mlon/))
       lat2d@units = "degrees_north"
       
       lon2d = onedtond(ltln(:,1), (/nlat,mlon/))
       lon2d@units = "degrees_east"
       
       x@lat2d = lat2d
       x@lon2d = lon2d
---------------------------------------------------------
Any ideas? Perhaps it can't be done and I'll have
to have a separate lat/lon file, as the original data
were provided.

Regards,
Dave Atkinson.
_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



This archive was generated by hypermail 2b29 : Mon Oct 17 2005 - 22:14:25 MDT