Re: overlay problem

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jan 09 2012 - 07:40:08 MST

I don't have enough information to go on here. There could be a problem with your lat/lon coordinates, there could be a problem with your vector levels, there could be a problem with the vector data itself, etc.

Can you provide the WRF data file? Please see

https://www.ncl.ucar.edu/report_bug.shtml

for ftp information.

Thanks,

--Mary

On Jan 9, 2012, at 3:52 AM, JinQ Liu wrote:

> hi,
> I want to overlay a vector figure on a contour figure, and the script can run without any warnings or errors,
> but the output picture is blank. where it goes wrong?
> Any suggestions will be appreciate.
>
> Thanks.
> JinQ
>
> --
> JinQ, M.S.
> Ocean University of China
> --
>
>
> scripts:
>
> 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"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
>
> begin
> ;
> ; The WRF ARW input file.
> ; This needs to have a ".nc" appended, so just do it.
> a = addfile("wrfout_d03_2010-09-09_12:00:00o.nc","r")
>
> type = "pdf"
> ; type = "eps"
>
> wks = gsn_open_wks(type,"sh")
>
> ; Set some basic resources
> res = True
>
> res@gsnMaximize=True
> res@gsnDraw = False ; let gsn_panel do plotting
> res@gsnFrame = False
> ;res@pmTickMarkDisplayMode="Always"
> res@tmXBTickSpacingF= 2
> res@tmYLTickSpacingF= 2
> res@tmXBLabelFontHeightF=0.025
> res@tmYLLabelFontHeightF=0.025
> res@tmXBMinorOn = False ; no lon minior tickmarks
> re s@tmYLMinorOn = False
>
> res@mpDataSetName = "Earth..4"
> res@mpDataBaseVersion = "MediumRes"
> res@mpOutlineSpecifiers = (/"China:states","India","Taiwan"/)
> res@mpLimitMode = "LatLon"
> res@mpMinLatF = 22
> res@mpMaxLatF = 28.1
> res@mpMinLonF = 115.7
> res@mpMaxLonF = 120.7
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> times = wrf_user_list_times(a) ; get times in the file
> ntimes = dimsizes(times) ; number of t imes in the file
>
> ; The specific pressure levels that we want the data interpolated to.
> pressure_levels = (/ 850., 200./) ; pressure levels to plot
> nlevels = dimsizes(pressure_levels) ; number of pressure levels
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> do it = 12,ntimes-36,12 ; TIME LOOP
> print("Working on time: " + times(it) )
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> tc = wrf_user_getvar(a,"tc",it) ; T in C
> u = wrf_user_getvar(a,"ua",it) ; u averaged to mass points
> v = wrf_user_getvar(a,"va",it) ; v avera ged to mass points
> p = wrf_user_getvar(a, "pressure",it) ; pressure is our vertical coordinate
> z = wrf_user_getvar(a, "z",it) ; grid point height
> rh = wrf_user_getvar(a,"rh",it) ; relative humidity
> mdbz = wrf_user_getvar(a,(/"mdbz","1","1"/),it)
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> pressure0 = pressure_levels(0)
> pressure1 = pressure_levels(1)
> tc_plane = wrf_user_intrp3d(tc,p,"h",pressure0,0.,False)
> ; z_plane = wrf_user_intrp3d( z,p,"h",pressure,0.,False)
> rh_plane0 = wrf_user_intrp3d(rh,p,"h",pressure0,0.,False)
> u_plane0 = wrf_user_intrp3d( u,p,"h",pressure0,0.,Fals e)
> v_plane0 = wrf_user_intrp3d( v,p,"h",pressure0,0.,False)
> rh_plane1 = wrf_user_intrp3d(rh,p,"h",pressure1,0.,False)
> u_plane1 = wrf_user_intrp3d( u,p,"h",pressure1,0.,False)
> v_plane1 = wrf_user_intrp3d( v,p,"h",pressure1,0.,False)
>
> rh_plane=rh_plane0
> u_plane=u_plane1-u_plane0
> v_plane=v_plane1-v_plane0
>
> u_plane = u_plane*1.94386 ; kts
> v_plane = v_plane*1.94386 ; kts
> u_plane@units = "kts"
> v_plane@units = "kts"
> wind=(/ ((u_plane)^2+(v_plane)^2)^0.5 /)
>
> lat2d=a->XLAT(0,:,:)
> lon2d=a->XLONG(0,:,:)
> u_plane@lat2d=lat2d
> u_plane@lon2d=lon2d
> v_plane@lat2d=lat2d
> v_plane@lon2d=lon2d
> rh_plane@lat2d=lat2d
> rh_plane@lon2d=lon2d
> tc_plane@lat2d=lat2d
> tc_plane@lon2d=lon2d
> mdbz@lat2d=lat2d
> mdbz@lon2d=lon2d
>
> ; Plotting options for dbz
> opts = res
> opts@cnFillOn = True
> opts@cnLinesOn= False
> opts@cnLevelSelectionMode = "ExplicitLevels"
> opts@cnLevels = (/ 10,15,20,25,30,35,40,45/)
> opts@cnFillColors = (/"White","DarkOliveGreen1", \
> &nb sp; "DarkOliveGreen3","Chartreuse", \
> "Chartreuse3","Green","ForestGreen", \
> "Yellow","Orange","Red","Violet"/)
> opts@lbTitleFontHeightF = 0.02
> opts@lbLabelFontHeightF = 0.015
> opts@lbTitleOffsetF = -0.5
> opts@lbLabelAutoStride ; = True
> contour_dbz = gsn_csm_contour_map(wks,mdbz,opts)
> delete(opts)
>
> ; Plotting options for Wind Vectors
> opts = res
> opts@vcGlyphStyle = "CurlyVector"
> opts@vcMinDistanceF =0.02
> opts@vcRefLengthF = 0.045
> opts@vcRefMagnitudeF = 20.0
> opts@vcRefAnnoOrthogonalPosF = -1.< /div>
>
> opts@vcLevelSelectionMode = "ManualLevels"
> opts@vcMinLevelValF = 8
> opts@vcMaxLevelValF = 50.0
> opts@vcLevelSpacingF = 10.0 ; 20.
>
> vector = gsn_csm_vector_scalar(wks,u_plane,v_plane,wind,opts)
> delete(opts)
> overlay(contour_dbz,vector)
> frame(wks)
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> end do ; END OF TIME LOOP
>
> 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 Mon Jan 9 07:40:18 2012

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