<p><b>duda</b> 2009-08-12 16:56:04 -0600 (Wed, 12 Aug 2009)</p><p>Update ncl/cells.ncl script to permit ke and vorticity to be plotted<br>
by uncommenting the appropriate line at the top of the file.<br>
<br>
Note: Currently, ke, vorticity, and other diagnostic fields in the<br>
output.nc file have bogus values.<br>
<br>
M    cells.ncl<br>
</p><hr noshade><pre><font color="gray">Modified: trunk/swmodel/ncl/cells.ncl
===================================================================
--- trunk/swmodel/ncl/cells.ncl        2009-08-12 21:40:03 UTC (rev 28)
+++ trunk/swmodel/ncl/cells.ncl        2009-08-12 22:56:04 UTC (rev 29)
@@ -4,11 +4,11 @@
 begin
 
   ;
-  ; Whether to do color-filled plot (filled=True) or
-  ;   to plot contours of height field (filled=False)
+  ; Which field to plot
   ;
-;  filled   = True
-  filled   = False
+  plotfield = &quot;h&quot;
+;  plotfield = &quot;ke&quot;
+;  plotfield = &quot;vorticity&quot;
 
   ;
   ; Whether to plot wind vectors
@@ -17,6 +17,13 @@
   winds    = False
 
   ;
+  ; Whether to do color-filled plot (filled=True) or
+  ;   to plot contours of height field (filled=False)
+  ;
+;  filled   = True
+  filled   = False
+
+  ;
   ; The (lat,lon) the plot is to be centered over
   ;
   cenLat   = 0.0
@@ -25,8 +32,8 @@
   ;
   ; Projection to use for plot
   ;
-  projection = &quot;Orthographic&quot;
-;  projection = &quot;CylindricalEquidistant&quot;
+;  projection = &quot;Orthographic&quot;
+  projection = &quot;CylindricalEquidistant&quot;
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -41,8 +48,8 @@
 
   f = addfile(&quot;output.nc&quot;,&quot;r&quot;)
 
-  x   = f-&gt;lonCell(:) * r2d
-  y   = f-&gt;latCell(:) * r2d
+  lonCell   = f-&gt;lonCell(:) * r2d
+  latCell   = f-&gt;latCell(:) * r2d
   lonVertex = f-&gt;lonVertex(:) * r2d
   latVertex = f-&gt;latVertex(:) * r2d
   lonEdge = f-&gt;lonEdge(:) * r2d
@@ -50,28 +57,20 @@
   verticesOnCell = f-&gt;verticesOnCell(:,:)
   alpha = f-&gt;angleEdge(:)
 
-  sizes = dimsizes(verticesOnCell)
-
-  cx = new((/sizes(0),maxedges/),double)
-  cy = new((/sizes(0),maxedges/),double)
-
-  do j=0,sizes(0)-1
-  do i=0,maxedges-2
-     cy(j,i) = latVertex(verticesOnCell(j,i)-1)
-     cx(j,i) = lonVertex(verticesOnCell(j,i)-1)
-  end do
-  cx(j,maxedges-1) = cx(j,0)
-  cy(j,maxedges-1) = cy(j,0)
-  end do
-
   res                      = True
   res@gsnMaximize          = True
   res@gsnSpreadColors      = True
 
-  res@sfXArray             = x
-  res@sfYArray             = y
+  if (plotfield .eq. &quot;h&quot; .or. plotfield .eq. &quot;ke&quot;) then
+     res@sfXArray             = lonCell
+     res@sfYArray             = latCell
+  end if
+  if (plotfield .eq. &quot;vorticity&quot;) then
+     res@sfXArray             = lonVertex
+     res@sfYArray             = latVertex
+  end if
 
-  res@cnFillMode           = &quot;RasterFill&quot;
+  res@cnFillMode           = &quot;AreaFill&quot;
 
   if (filled) then
      res@cnFillOn             = True
@@ -83,9 +82,7 @@
      res@cnLineLabelsOn       = True
   end if
 
-;  res@cnMinLevelValF       = -50.
-;  res@cnMaxLevelValF       = 1000.
-  res@cnLevelSpacingF      =  50.
+  res@cnLevelSpacingF      =  50.0
   res@cnInfoLabelOn        = True
 
   res@lbLabelAutoStride    = True
@@ -104,11 +101,19 @@
   res@gsnFrame          = False
 
   t = stringtointeger(getenv(&quot;T&quot;))
-  h   = f-&gt;h(t,:,0)
-  hs  = f-&gt;h_s(:)
-  h(:) = h(:) + hs(:)
+  if (plotfield .eq. &quot;h&quot;) then
+     h   = f-&gt;h(t,:,0)
+     hs  = f-&gt;h_s(:)
+     fld = h + hs
+  end if
+  if (plotfield .eq. &quot;ke&quot;) then
+     fld = f-&gt;ke(t,:,0)
+  end if
+  if (plotfield .eq. &quot;vorticity&quot;) then
+     fld = f-&gt;vorticity(t,:,0)
+  end if
   res@cnLineDashPattern = 0
-  map = gsn_csm_contour_map(wks,h,res)
+  map = gsn_csm_contour_map(wks,fld,res)
 
   if (winds) then
      u   = f-&gt;u(t,:,0)

</font>
</pre>