Re: Fwd: change y axis from eta height to z (km) from wrf output

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Jan 12 2012 - 10:15:44 MST

Mark,

It is a simple matter to change the coordinate array of a variable to something else, especially if it is the same type (float, double, etc).

So, yes, if the current coordinate array is called "w&znw" and you want to replace these values with the variable "z":

(I'm assuming eta height is the leftmost dimension of w):

   w!0 = "z"
   w&z = z

--Mary

On Jan 11, 2012, at 2:43 PM, mark vogel wrote:

> Dear All
> I would like to change the y axis to be the level Height (z) values instead of eta height.
> Anyone know how can I do that. Do I need to use get wrf var (z) and then specific w&znw = z.
> How can I specify the y axis?
> Thanks
> Mark
>
> begin
> ;********************************************************
> ; open file
> ;********************************************************
> f = addfile ("/usr/rmt_share/eas-dniyogi/jam/LLJ/WRF_GEM/wrfout_d02_2002-06-04_06:00:00.nc", "r")
> ;********************************************************
> ; Read character variable Times
> ; Convert to type string for plotting purposes
> ;********************************************************
> times = chartostring(f->Times) ; built-in function
> ;********************************************************
> ; Read W at Time=6, south_north=0, convert to cm/sec
> ;********************************************************
> w = f->W(0,:,0,:) ; import data + meta info
> w = w*100. ; demo: convert to cm/s
> w@units = "cm/s" ; update units attribute
>
> dimw = dimsizes(w) ; get dimensions
> mx = dimw(1)
>
> ;********************************************************
> ; Associate vertical and horizontal coords to w
> ;********************************************************
> znw = f->ZNW(0,:) ; znw(bottom_top_stag)
> w!0 = "znw"
> w&znw = znw ; assign values to named dimensions
>
> dx = f@DX/1000. ; dx (km)
> west_east = ispan(0,mx-1,1)*dx ; calculate x values
> west_east@long_name = "west_east"
> west_east@units = "km"
> w&west_east = west_east ; associate "x" values with w
> printVarSummary (w)
>
> ;********************************************************
> ; create a bogus wind array with all values 0.0
> ;********************************************************
> u = w
> u = 0.0
> ;********************************************************
> ; create plots
> ;********************************************************
> wks = gsn_open_wks("ps" ,"WRF_2d_windgem") ; ps,pdf,x11,ncgm,eps
> gsn_define_colormap(wks,"BlWhRe") ; select color map
>
> res = True ; plot mods desired
> ;;res@gsnMaximize = True ; uncomment to maximize size
> res@trYReverse = True ; reverse to go bot[1.0 to top [0.0]
> res@tiMainString = times(0) ; main title
>
> res@vcRefMagnitudeF = 5. ; define vector ref mag
> res@vcRefLengthF = 0.01 ; define length of vec ref
> res@vcLineArrowHeadMaxSizeF = 0.05 ; default: 0.05 (LineArrow), 0.012 (CurlyVector)
> plot = gsn_csm_vector(wks,u(::2,::4),w(::2,::4),res)
>
> res@vcRefAnnoOrthogonalPosF = -0.18 ; move ref vector
> res@vcMinDistanceF = 0.02 ; larger means sparser
> plot = gsn_csm_vector(wks,u(::2,::4),w(::2,::4),res)
> end
>
>
> _______________________________________________
> 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 Thu Jan 12 10:15:56 2012

This archive was generated by hypermail 2.1.8 : Wed Jan 18 2012 - 09:21:55 MST