Re: WRF Zoom

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Sat, 22 Aug 2009 17:21:14 -0600 (MDT)

Dear JF,

The resources ZoomIn, Ystart, and Xstart are special resources
recognized only by the wrf_map function. You are using an older
routine (WRF_map_c) that was created before the
wrf_map/wrf_overlay/etc functions were available.

If you want to use wrf_xxxx functions to do your plotting,
then you don't want to use WRF_map_c or gsn_csm_xxx
functions.

Instead, please see:

http://www.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/NCL_examples.htm

for some examples of using the wrf_xxxx plotting scripts.

In particular, go to this URL for some zooming examples:

http://www.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/SPECIAL/wrf_Zoom.htm

--Mary

On Fri, 21 Aug 2009, MeteoStrategy wrote:

> Hi to all,
>
> I am trying to run an NCL script to plot data and zoom in (or draw a
> subregion).
>
> My NCL version is 5.1.0 and I am using WRF-ARW version.
>
> My script is :
> load "$NCARG_ROOT/share/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/share/ncarg/nclscripts/wrf/WRF_contributed.ncl"
> load "$NCARG_ROOT/share/ncarg/nclscripts/wrf/WRFUserARW.ncl"
> ;***************************************
> begin
> zoom_wrf_x = 1 ; Zoom pour génération de cartes WRF
> zoom_wrf_y = 1 ; Zoom pour génération de cartes WRF
> xlat= 51.00 ; Latitude (90,-90)(Positif nord)
> xlong= 5.00 ; Longitude (180,-180)(postif est)
>
>
> ibegin = 1
> ifin= 72
> inc = 1
>
> ncdf_file="./wrf/wrfout_t06z_d01.nc"
> file_in = addfile(ncdf_file,"r")
>
> temp = file_in->T2 - 273.15
> times = chartostring(file_in->Times)
> lat2d = file_in->XLAT(0,:,:)
> lon2d = file_in->XLONG(0,:,:)
> dimvar = dimsizes(temp)
>
>
> temp!0 = "lat"
> temp!1 = "lon"
>
> jlat = dimvar(1)
> ilon = dimvar(2)
> ntime = dimvar(0)
>
> res = True
>
> ; This tells NCL to zoom in on the regional domain
>
>
> lats = (/ xlat-zoom_wrf_x, xlat+zoom_wrf_x /)
> lons = (/ xlong-zoom_wrf_y, xlong+zoom_wrf_y /)
> loc = wrf_user_ll_to_ij(file_in, lons, lats, True)
>
> x_start = loc(0,0) - 1
> x_end = loc(0,1) - 1
> y_start = loc(1,0) - 1
> y_end = loc(1,1) - 1
> res_at_ZoomIn = True ; set up map info for zoomed area
> res_at_Xstart = x_start
> res_at_Ystart = y_start
> res_at_Xend = x_end
> res_at_Yend = y_end
>
> temp_zoom = temp(:,y_start:y_end,x_start:x_end)
>
>
>
> res_at_cnFillOn= True ; color fill
> res_at_cnLinesOn = False ; no contour lines
> res_at_cnLineLabelsOn= False ; no contour labels
> res_at_gsnSpreadColors = True ; use total colormap
>
> res_at_tiMainFontHeightF= 0.015 ; smaller title
>
> res_at_gsnAddCyclic = False ; regional data
>
> WRF_map_c (file_in, res, 0)
>
> res_at_tfDoNDCOverlay = True
>
> res_at_mpPerimOn = True
> res_at_mpFillOn = False
> res_at_mpGeophysicalLineThicknessF = 2 ; epaisseur de la ligne de
> cote
> res_at_mpDataBaseVersion = "MediumRes"
>
> res_at_lbLabelStride= 2
> res_at_lbOrientation ="vertical"
>
> res_at_cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
> res_at_cnMinLevelValF = -10. ; set min contour level
> res_at_cnMaxLevelValF = 25. ; set max contour level
> res_at_cnLevelSpacingF= 1. ; set contour spacing
>
> res_at_gsnDraw= False
> res_at_gsnFrame = False
>
> ;*********************************
> ; ajout des contours de temperature
> ;********************************
>
> res2 = True
> res2_at_gsnDraw= False
> res2_at_gsnFrame = False
> res2_at_gsnAddCyclic = False
>
> res2_at_cnLevelSelectionMode = "ManualLevels"
>
> res2_at_cnMinLevelValF = -10. ; minimum
> res2_at_cnMaxLevelValF = 25. ; maximum
> res2_at_cnLevelSpacingF= 2. ; increment
> res2_at_cnLineThicknessF = 0.5 ; epaisseur des contours
> res2_at_cnInfoLabelOn= False
> res2_at_tfDoNDCOverlay = True
>
> do i=ibegin,ifin,inc
>
> res_at_tiMainFuncCode= "~"
> res_at_tiMainString = " WRF - Temperature "+times(i)+ "gmt"
>
> if( ( (i-ibegin).lt.10) ) then
> filename = "wrft2m_0"+(i-ibegin)
> end if
>
> if( ( (i-ibegin).ge.10) ) then
> filename = "wrft2m_"+(i-ibegin)
> end if
>
> wks = gsn_open_wks ("eps", filename)
> gsn_define_colormap(wks,"BlAqGrYeOrReVi200")
>
> plot = gsn_csm_contour_map(wks,temp_zoom(i,:,:),res)
> cplot = gsn_csm_contour(wks,temp_zoom(i,:,:),res2)
> overlay(plot,cplot)
>
> draw(plot)
> frame(wks)
>
> end do
> ;
> end
>
> and I have this message in result :
> warning:ZoomIn is not a valid resource in wrft2m_08_contour at this time
> warning:Ystart is not a valid resource in wrft2m_08_contour at this time
> warning:Xstart is not a valid resource in wrft2m_08_contour at this time
>
> The result of this is that my data are zoomed but not the geographical data
> (borders...)
>
> Thanks for your help
>
> JF
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Aug 22 2009 - 17:21:14 MDT

This archive was generated by hypermail 2.2.0 : Mon Aug 24 2009 - 11:15:23 MDT