Hi dear,
I try to plot a vertical profile in an special point.
I use gsn_contour function
but its need too set sfXArrey and sfYArrey resources
I don't know how set them
i try to plot th on vertical levels in point(44,55)
help me
unfortunately I cant attached the script file because Im from Iran, then i copy
it here:
Thanks
Sima.
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/wrf/WRFUserARW.ncl"
begin
a = addfile("/media/disk/wrfout/wrfout_d03_2009-05-05_10:00:00.nc","r")
wks = gsn_open_wks("ps","vertical")
; Set some basic resources
res = True
res@MainTitle = "REAL-TIME WRF"
res@Footer = False
pltres = True
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
times = wrf_user_list_times(a) ; get times in the file
ntimes = dimsizes(times) ; number of times in the file
FirstTime = True
mdims = getfilevardimsizes(a,"P") ; get some dimension sizes for the file
nd = dimsizes(mdims)
;---------------------------------------------------------------
do it = 61, 61 ; TIME LOOP
print("Working on time: " + times(it) )
res@TimeLabel = times(it) ; Set Valid time to use on plots
th = wrf_user_getvar(a,"th",it) ; T in C
rh = wrf_user_getvar(a,"rh",it) ; relative humidity
z = wrf_user_getvar(a, "z",it) ; grid point height
; max(z) = 3000
if ( FirstTime ) then ; get height info for labels
zmin = 0.
zmax = max(z)
nz = floattoint(zmax/2 + 1)
FirstTime = False
end if
;---------------------------------------------------------------
angle = 0
plane = new(2,float)
plane = (/ 44,55/) ; pivot point is center of domain (x,y)
opts = False ; start and end points not
specified
rh_plane = wrf_user_intrp3d(rh,z,"v",plane,angle,opts)
th_plane = wrf_user_intrp3d(th,z,"v",plane,angle,opts)
printVarSummary(th_plane)
dim = dimsizes(th_plane) ; Find the data span - for
use in labels
zspan = dim(0)
; Options for XY Plots
opts_xy = res
opts_xy@tiYAxisString = "Height (m)"
opts_xy@cnMissingValPerimOn = True
opts_xy@cnMissingValFillColor = 0
opts_xy@cnMissingValFillPattern = 11
opts_xy@tmYLMode = "Explicit"
opts_xy@tmYLValues = fspan(0,zspan,nz) ;
Create tick marks
opts_xy@tmYLLabels = sprintf("%.1f",fspan(zmin,zmax,nz)) ;
Create labels
opts_xy@tiXAxisFontHeightF = 0.020
opts_xy@tiYAxisFontHeightF = 0.020
opts_xy@tmXBMajorLengthF = 0.02
opts_xy@tmYLMajorLengthF = 0.02
opts_xy@tmYLLabelFontHeightF = 0.015
opts_xy@PlotOrientation = th_plane@Orientation
; Plotting options for RH
opts_rh = opts_xy
; Plotting options for Temperature
opts_th = opts_xy
; Get the contour info for the rh and temp
contour_th = wrf_contour(a,wks,th_plane,opts_th)
contour_rh = wrf_contour(a,wks,rh_plane,opts_rh)
printVarSummary(contour_th)
; MAKE PLOTS
; plot = wrf_overlays(a,wks,(/contour_rh,contour_tc/),pltres)
plot = gsn_csm_y(wks,th_plane(:,44),opts_xy)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
end do ; END OF TIME LOOP
end
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Feb 24 15:46:53 2011
This archive was generated by hypermail 2.1.8 : Fri Feb 25 2011 - 08:50:46 MST