[ncl-talk] Dimension (nlon) of (var0) does not have an associated coordinate variable

Alan Brammer abrammer at albany.edu
Wed Feb 1 13:15:20 MST 2017


 If you were plotting a map, like Barry Lynn's similar question today also on ncl-talk, you would want to do:

var0 at lon2d = lon2d
var0 at lat2d = lat2d

The below lines are not needed. 
    ; LON2D  = lon2d(::1,::1)        ;; I don’t think (::1,::1) does anything,  it will take all values with an increment of 1, i.e. the whole array. 
    ; LAT2D  = lat2d(::1,::1)	   ;   so this is just redundant characters which aren’t needed. 
You don’t need to replicate a variable that already exists. 

To set coordinate variables named nlon and nlat, you want to use the & syntax not the @ syntax, but coordinate subscripting won’t work with 2d coordinates anyway. 

So instead get the index of the point you want using:
https://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml <https://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml>
e.g.

ll_ind = getind_latlon2d( lat2d, lon2d, 28,50)
…
… 
plot(0)   = gsn_csm_xy (wks, years, var0(:, ll_ind(0), ll_ind(1) ), res)



Good luck, 

Alan


##############################
Alan Brammer,
Post-Doc Researcher

Department of Atmospheric and Environmental Sciences,
University at Albany, State University of New York, Albany, NY, 12222
abrammer at albany.edu
##############################
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170201/ec2c718a/attachment.html 


More information about the ncl-talk mailing list