Re: how to plot tripolar grid

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Mon Nov 14 2011 - 09:20:33 MST

Drawing the lat/lon grid is not going to show the actual mesh. You could try following the example "orca_2.ncl" (frame 2) at http://www.ncl.ucar.edu/Applications/orca.shtml.
Otherwise you will need to use polylines to trace around each cell. You could get some hints for this by studying the ICON model example 2. Hope this helps.
 -dave

On Nov 14, 2011, at 5:56 AM, 储敏 wrote:

> Dear all,
>
> I want to plot the mesh of tripolar grid. This is a kind of non-uniform grid, its coordinates (latitude and longitude) are all 2-dimension arrays. I tried to use following scripts, but result is not as goog as I expect.
>
> 1 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> 2 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> 3 ; ================================================;
> 4 begin
> 5 f = addfile("o2d.nc","r")
> 6
> 7 lat2d = f->yc_o
> 8 lon2d = f->xc_o
> 9 ;=================================================;
> 10 ; Create plot
> 11 ;=================================================;
> 12 wks = gsn_open_wks("x11","grid") ; open a ps file
> 13
> 14 ores = True ; plots mods desired
> 15 ores@gsnDraw = False ; don't draw yet
> 16 ores@gsnFrame = False ; don't advance frame yet
> 17
> 18 ores@cnInfoLabelOn = False ; turn off info label
> 19 ores@tiMainString = "The Grid" ; add title
> 20
> 21 ores@gsnMajorLatSpacing =10
> 22 ores@gsnMajorLonSpacing =10
> 23
> 24 latplot = gsn_contour(wks,lat2d,ores) ; create lat contours
> 25 lonplot = gsn_contour(wks,lon2d,ores) ; create lon contours
> 26 overlay(latplot,lonplot) ; overlay on map
> 27
> 28 draw(latplot)
> 29 frame(wks)
> 30 end
>
> When running the script, NCL gives some warnings, "gsnMajorLatSpacing is not a valid resource in grid_contour at this time". Then how to change the lat and lon spacing? Thank you!
>
>
> Kearney
> 2011.11.14
>
> _______________________________________________
> 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 Mon Nov 14 09:20:43 2011

This archive was generated by hypermail 2.1.8 : Mon Nov 14 2011 - 10:41:55 MST