>From: Cathryn Meyer <cathryn.meyer AT yale.edu>
>
>Hello,
>
>I am attempting to plot CAM3.0 output to compare it to a GOES-west loop.
> How do I get an image with a lat range of 10 to 60 and a lon range of
>-170 to -100? The bulk of the code I am using was taken from an example
>on the NCL website, cn05n.ncl, and here is the main chunk of it:
>
>-------------------------------------------------------------
> do i = 0, NFRAMES
>
> print("Plotting 3-hr Timestep " + (i+1))
> ; Read the next data field (next day).
> setvalues field1
> "sfDataArray" : RHavg(i,:,:,0)
> end setvalues
> d=i+1
> ; Increment day string.
> setvalues con1
> "lbTitleString": "Hour " + d * 3
> end setvalues
> ; draw another plot.
> draw(map)
> draw(lbarlo)
> draw(lbarhi)
> frame(wks)
> end do
>-----------------------------------------------------------
>
>I already tried replacing the colons with {10,60}, {-170, -100}, however
>I got this error message when I did that:
>
>fatal:syntax error: line 313 in file RH05nplay.ncl before or near ,
> "sfDataArray" : RHavg(i,{10,
>--------------------------------------------^
>
>
>fatal:Error in subscript, normal subscripting is being used, make sure
>named subscripting has not been used
>fatal:Syntax Error in block, block not executed
=============
Hi Cathy
I am not quite sure to which example you are referring.
Hopefully, the following helps a bit.
Since u r using geographical coordinates, I assume u want
to plot the CCSM data with a map background. There are numerous
variations. However, I'll make the assumption that u
want the CCSM data on a cylindrical equidistant map.
[1] http://www.cgd.ucar.edu/csm/support/
[2] Click Graphics
[3] Click Maps: Cylindrical Equidistant: ce_3
Click Contour-on-Contour: conOncon_2.ncl
[4] netCDF has the concept of "coordinate variables".
Many NCL graphical routines implicitly understand this concept.
[5] CAM data have longitude coordinate variables that start at the
GM [0] and are positive. To use ranges between -180 to 180
you can use a function in contributed.ncl. I'll also include
the graphics hogh level interfaces.
I will make the assumption the "t" [below] is (time,lev,lat,lon)
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
f = addfile("CAM.nc","r")
t = f->T
printVarSummary(t) ; note that long span 0->357.5 or whatever]
t = lonFlip(t) ; contributed.ncl function
; reorder longitude coordinate variable.
printVarSummary(t) ; note longitude coord variable
;************************************************
; create plot
;************************************************
wks = gsn_open_wks("ps" ,"ce") ; open a ps file
gsn_define_colormap(wks,"BlAqGrYeOrRe") ; choose colormap
res1 = True ; for "t"
res1@cnFillOn = True ; turn on color fill
res1@cnLinesOn = False ; turn of contour lines
res1@gsnSpreadColors = True ; use full range of color map
res1@mpCenterLonF = 180.
res1@mpMinLatF = 10 ; range to zoom in on
res1@mpMaxLatF = 60.
res1@mpMinLonF = -170.
res1@mpMaxLonF = -100.
res2 = True ; goes resources
nt = 0
kl = 7
plot = gsn_csm_contour_map_overlay(wks,t(nt,kl,:,:),\
goes(?),res1,res2)
end
_______________________________________________
ncl-talk mailing list
ncl-talk AT ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
This archive was generated by hypermail 2b29 : Wed Aug 25 2004 - 17:11:34 MDT