Re: plotting stageIV precipitaton data

From: Evelyn Grell <Evelyn.Grell_at_nyahnyahspammersnyahnyah>
Date: Thu Dec 10 2009 - 10:26:44 MST

Prabhakar,
I am attaching a simple script that I have used for plotting Stage IV data.
Hope it helps you,
Evelyn

p s wrote:
> Hi
> Could someone help me with plotting the stageIV precipitation data
> which is in polar stereographic projection as it suggests.
> When using gsn_csm_contour_map_polar, I get warning message saying :
> (0) get_polar_type: Warning: No polar projection has been
> selected. Defaulting to northern hemisphere.
> (0) check_for_y_lat_coord: Warning: Data either does not contain a
> valid latitude coordinate array or doesn't contain one at all.
> (0) A valid latitude coordinate array should have a 'units'
> attribute equal to one of the following values:
> (0) 'degrees_north' 'degrees-north' 'degree_north' 'degrees
> north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN'
> 'deg north'
> (0) check_for_lon_coord: Warning: Data either does not contain a
> valid longitude coordinate array or doesn't contain one at all.
> (0) A valid longitude coordinate array should have a 'units'
> attribute equal to one of the following values:
> (0) 'degrees_east' 'degrees-east' 'degree_east' 'degrees east'
> 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'
> fatal:syntax error: line 47 in file stageIV.ncl before or near end
> end
> Cheers
> prabhakar
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin

  idate = 2007060306
  fil = addfile("ST4."+idate+".06h.grb","r")
  lat2d = fil->g5_lat_0
  lon2d = fil->g5_lon_1
  pcp = fil->A_PCP_GDS5_SFC_acc6h
; pcp@lat2d = lat2d
; pcp@lon2d = lon2d

  dimll = dimsizes(lat2d)
  nlat = dimll(0)
  nlon = dimll(1)

  wks = gsn_open_wks("x11","stage4")
  colors = (/"white","black","white","green","palegreen","yellowgreen",\
             "greenyellow","yellow","goldenrod","orange","orangered","red","deeppink",\
             "violet","darkviolet","blueviolet","blue"/)
  gsn_define_colormap(wks,colors)

  res = True
  res@gsnMaximize = True
  res@gsnAddCyclic = False
  res@cnFillOn = True ; turn on color fill
  res@cnLinesOn = False ; turn off contour lines
  res@cnFillMode = "RasterFill"
  res@gsnSpreadColors = True ; use full range of color map
  res@tfDoNDCOverlay = True
  res@cnLevelSelectionMode = "ExplicitLevels"
  res@cnLevels = (/0.1,1,5,10,15,20,25,30,40,50,75,100,125,150/)

  res@mpProjection = "Stereographic"
  res@mpLimitMode = "Corners"
  res@mpLeftCornerLatF = lat2d@corners(0)
  res@mpLeftCornerLonF = lon2d@corners(0)
  res@mpRightCornerLatF = lat2d@corners(2)
  res@mpRightCornerLonF = lon2d@corners(2)

  res@mpCenterLonF = lat2d@Lov
  res@mpCenterLatF = 90.

  res@mpPerimOn = False
  res@mpOutlineBoundarySets = "GeophysicalAndUSStates"
  res@mpFillOn = False

  res@tiMainString = "Stage IV 6h accum "+idate

  plot = gsn_csm_contour_map(wks,pcp,res)

end

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Dec 10 10:26:49 2009

This archive was generated by hypermail 2.1.8 : Thu Dec 17 2009 - 17:15:52 MST