Re: Help on coordinate variable

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Wed Feb 08 2012 - 16:58:40 MST

The coordinate variable syntax only works for 1D coordinate variables. The correct approach is to write lat2d and lon2d as separate variables into your file.
For CF-compliance you would then add the "coordinates" attribute to your data array.
znt@coordinates = "time lat2d lon2d" (assuming that is what you name the variables in the file).
The actual x and y dimensions of znt should be called something else, e.g.:
znt!1 = "y"
znt!2 = "x"
Or whatever names make sense to you.
 -dave

On Feb 8, 2012, at 4:33 PM, Xin Xi wrote:

> Hi there,
> I am trying to create a netcdf file with a variable that is regrided to a wrf domain. I have problems in assigning the coordinate variables. I got the error below:
>
> fatal:Coordinate variables must be the same dimension as their dimension
> fatal:No coordinate variable exists for dimension (lat2d) in variable (znt)
>
> And here is the ncl script:
>
> lat2d=wrf_file->XLAT
> lon2d=wrf_file->XLONG
> tmp = rgrid2rcm(lat1d, lon1d, p_znt, lat2d(0,:,:), lon2d(0,:,:))
>
> dimll=dimsizes(lat2d)
> nlat=dimll(1)
> nlon=dim(2)
> znt=new(/1,nlat,nlon/,double)
> znt(0,:,:)=tmp
>
> znt!0="time"
> znt!1="lat2d"
> znt!2="lon2d"
>
> znt&time=0
> znt&lat2d=lat2d(0,:,:)
> znt&lon2d=lon2d(0,:,:)
> ....
>
> Thanks!
> --
> Xin Xi
> School of Earth and Atmospheric Sciences
> Georgia Institute of Technology
> 311 Ferst Drive, Atlanta, GA 30332-0340
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Feb 8 16:58:50 2012

This archive was generated by hypermail 2.1.8 : Thu Feb 09 2012 - 13:33:26 MST