<div dir="ltr"><div class="gmail_default" style="font-size:small">Kerwyn,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">First of all, you need to be careful when regridding U,V vector data. You generally need to regrid them simultaneously.  See the &quot;miscellaneous&quot; comments on vector regridding here:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style=""><a href="https://climatedataguide.ucar.edu/climate-data-tools-and-analysis/regridding-overview">https://climatedataguide.ucar.edu/climate-data-tools-and-analysis/regridding-overview</a><br></div><div class="gmail_default" style=""><br></div><div class="gmail_default" style="">Meanwhile, the error you&#39;re getting I think is indicating that this resource is too large for the reference magnitude vector.</div><div class="gmail_default" style=""><br></div><div class="gmail_default" style=""><span style="font-size:12.8px">    res1@vcRefLengthF          = 0.018</span><br style="font-size:12.8px"></div><div class="gmail_default" style=""><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style=""><span style="font-size:12.8px">This resource will cause all vectors of a particular magnitude length to be rendered in 0.018 length. You set the reference magnitude to 10 with:</span></div><div class="gmail_default" style=""><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style=""><span style="font-size:12.8px">    res1@vcRefMagnitudeF       = 10</span><br style="font-size:12.8px"></div><div class="gmail_default" style=""><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style=""><span style="font-size:12.8px">What I suggest is commenting these two resources out initially, to let NCL pick the reference length and the magnitude vector.  You can then make a better decision about what size to use for the these two resources.  </span></div><div class="gmail_default" style=""><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style=""><span style="font-size:12.8px">I usually start by only changing the vcRefLengthF resource to see how it affects the plot. For example, try a value of 0.02. Depending on how the vectors look, you may want to increase or decrease this value slightly.</span></div><div class="gmail_default" style=""><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style=""><span style="font-size:12.8px">If this isn&#39;t helping much, then it may be time to try changing the vcRefMagnitudeF value.  The reference annotation box will tell you what default NCL chose, so you can use this value as a base for determining how much to change it.</span></div><div class="gmail_default" style=""><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style=""><span style="font-size:12.8px">--Mary</span></div><div class="gmail_default" style=""><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style=""><br></div><div class="gmail_default" style=""><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 26, 2016 at 11:52 AM, Kerwyn Texeira <span dir="ltr">&lt;<a href="mailto:ktish86@gmail.com" target="_blank">ktish86@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi ncl-talk,<br><br></div>I&#39;m having issues trying to plot ageostrophic winds cross section across a terrain.  I&#39;m using a 12km wrf data.  When I use 36km no terrain with the same script, I did not get any errors and I got very nice plots. <br><br></div><div>The 12km wrf data, to me, is very good because I was able to get other vertical cross sections across the terrain using Matlab.   <br><br></div><div>Whatever help anyone can give me would be greatly apreciated<br><br></div><div>Thanks in advance!<br></div><div><br></div><div>Error Message:<br><br></div>

<p class="MsoNormal">fatal:VectorPlotDraw: VVECTR - VECTOR NDC LENGTH TOO GREAT</p>

<p class="MsoNormal">fatal:VectorPlotDraw: error drawing vectors</p>

<p class="MsoNormal">fatal:VectorPlotDraw: draw error</p>

<p class="MsoNormal">fatal:PlotManagerDraw: error in plot draw</p>

<p class="MsoNormal">fatal:_NhlPlotManagerDraw: Draw error</p>

<br></div>Varaible Outputs:<br><br>Variable: ua<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [bottom_top | 50] x [south_north | 118] x [west_east | 114]<br>Coordinates: <br>Number Of Attributes: 6<br>  FieldType :    104<br>  MemoryOrder :    XYZ<br>  description :    x-wind component<br>  units :    m s-1<br>  stagger :     <br>  coordinates :    XLONG XLAT<br><br>Variable: va<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [bottom_top | 50] x [south_north | 118] x [west_east | 114]<br>Coordinates: <br>Number Of Attributes: 6<br>  FieldType :    104<br>  MemoryOrder :    XYZ<br>  description :    y-wind component<br>  units :    m s-1<br>  stagger :     <br>  coordinates :    XLONG XLAT<br><br>Variable: z<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [bottom_top | 50] x [south_north | 118] x [west_east | 114]<br>Coordinates: <br>Number Of Attributes: 6<br>  FieldType :    104<br>  MemoryOrder :    XYZ<br>  description :    Height<br>  units :    m<br>  stagger :     <br>  coordinates :    XLONG XLAT<br><br>Variable: p<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [bottom_top | 50] x [south_north | 118] x [west_east | 114]<br>Coordinates: <br>Number Of Attributes: 6<br>  coordinates :    XLONG XLAT<br>  stagger :    <br>  units :    hPa<br>  description :    Pressure<br>  MemoryOrder :    XYZ<br>  FieldType :    104<br><br>Variable: ur<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [bottom_top | 50] x [lat | 118] x [lon | 114]<br>Coordinates: <br>            lat: [31.90399932861328..44.<wbr>84910202026367]<br>            lon: [-128.5808258056641..-111.<wbr>4191741943359]<br>Number Of Attributes: 8<br>  _FillValue :    9.96921e+36<br>  FieldType :    104<br>  MemoryOrder :    XYZ<br>  description :    x-wind component<br>  units :    m s-1<br>  stagger :     <br>  remap :    remapped via ESMF_regrid_with_weights: Bilinear remapping<br>  missing_value :    9.96921e+36<br><br>Variable: vr<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [bottom_top | 50] x [lat | 118] x [lon | 114]<br>Coordinates: <br>            lat: [31.90399932861328..44.<wbr>84910202026367]<br>            lon: [-128.5808258056641..-111.<wbr>4191741943359]<br>Number Of Attributes: 8<br>  _FillValue :    9.96921e+36<br>  FieldType :    104<br>  MemoryOrder :    XYZ<br>  description :    y-wind component<br>  units :    m s-1<br>  stagger :     <br>  remap :    remapped via ESMF_regrid_with_weights: Bilinear remapping<br>  missing_value :    9.96921e+36<br><br>Variable: zr<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [bottom_top | 50] x [lat | 118] x [lon | 114]<br>Coordinates: <br>            lat: [31.90399932861328..44.<wbr>84910202026367]<br>            lon: [-128.5808258056641..-111.<wbr>4191741943359]<br>Number Of Attributes: 8<br>  _FillValue :    9.96921e+36<br>  FieldType :    104<br>  MemoryOrder :    XYZ<br>  description :    Height<br>  units :    m<br>  stagger :     <br>  remap :    remapped via ESMF_regrid_with_weights: Bilinear remapping<br>  missing_value :    9.96921e+36<br><br>Variable: press<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [bottom_top | 50] x [lat | 118] x [lon | 114]<br>Coordinates: <br>            lat: [31.90399932861328..44.<wbr>84910202026367]<br>            lon: [-128.5808258056641..-111.<wbr>4191741943359]<br>Number Of Attributes: 8<br>  _FillValue :    9.96921e+36<br>  stagger :    <br>  units :    hPa<br>  description :    Pressure<br>  MemoryOrder :    XYZ<br>  FieldType :    104<br>  remap :    remapped via ESMF_regrid_with_weights: Bilinear remapping<br>  missing_value :    9.96921e+36<br><br>Variable: uv<br>Type: float<br>Total Size: 5380800 bytes<br>            1345200 values<br>Number of Dimensions: 4<br>Dimensions and sizes:    [2] x [50] x [118] x [114]<br>Coordinates: <br>Number Of Attributes: 1<br>  _FillValue :    9.96921e+36<br>(0)    uv: min=-6821.45   max=7810.25<br><br>Variable: u<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [50] x [118] x [114]<br>Coordinates: <br>Number Of Attributes: 1<br>  _FillValue :    9.96921e+36<br>(0)    u: min=-5291.31   max=5693.54<br><br>Variable: v<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [50] x [118] x [114]<br>Coordinates: <br>Number Of Attributes: 1<br>  _FillValue :    9.96921e+36<br>(0)    v:min=-6821.45    max=7810.25<br><br>Variable: uageo<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [50] x [118] x [114]<br>Coordinates: <br>Number Of Attributes: 1<br>  _FillValue :    9.96921e+36<br>(0)    uageo:min=-5693.41  max=5288.43<br><br>Variable: vageo<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [50] x [118] x [114]<br>Coordinates: <br>Number Of Attributes: 1<br>  _FillValue :    9.96921e+36<br>(0)    vageo:min=-7812.72  max=6823.08<br><br><br></div>My Script:<br><br>;=============================<wbr>==============================<wbr>===========<br>; ESMF_regrid.ncl<br><br>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/wrf/WRFUserARW.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/esmf/ESMF_<wbr>regridding.ncl&quot;<br><br>begin<br><br>;---Specify method to be used<br>    InterpMethod= &quot;patch&quot;<br><br>;---Input file<br>    srcDirName  = &quot;./&quot;<br>    srcFileName = &quot;<a href="http://wrfout_d01_2014-01-11_13_00_00.nc" target="_blank">wrfout_d01_2014-01-11_13_00_<wbr>00.nc</a>&quot;<br>    srcFilePath =  srcDirName + srcFileName<br>    <br>   pltres = True <br><br>;---Wgt File: WRF to Rectilinear<br>    wgtDirName  = &quot;./&quot;<br>    wgtFileName = &quot;WRF_to_Rect.WgtFile_&quot;+<wbr>InterpMethod+&quot;.nc&quot;<br>    wgtFilePath =  wgtDirName + wgtFileName<br><br><br>;---Retrieve either one level, or all levels. Use &#39;-1&#39; for all.<br>    sfile = addfile(srcFilePath,&quot;r&quot;)<br><br>    FirstTime = True<br>    FirstTimeMap = True<br>    times = wrf_user_getvar(sfile, &quot;times&quot;, -1)<br>    ntimes = dimsizes(times)<br><br>    mdims = getfilevardimsizes(sfile, &quot;P&quot;)<br>    nd = dimsizes(mdims)<br>   <br><br>    ua   = wrf_user_getvar(sfile,&quot;ua&quot;,0) <wbr>   ; On mass grid <br>    va   = wrf_user_getvar(sfile,&quot;va&quot;,0)<br>    z    = wrf_user_getvar(sfile,&quot;z&quot;, 0)<br>    p    = wrf_user_getvar(sfile,&quot;<wbr>pressure&quot;, 0)<br><br> <br>    printVarSummary(ua)           <wbr>           ; (Time,bottom_top,south_north,<wbr>west_east)<br>    printVarSummary(va)           <wbr>           ; (Time,bottom_top,south_north,<wbr>west_east)<br>    printVarSummary(z)<br>    printVarSummary(p)<br>   <br>   <br><br>;---Regrid the wind components to a rectilinear grid<br>    ur   = ESMF_regrid_with_weights(ua,<wbr>wgtFilePath,False)<br>    vr   = ESMF_regrid_with_weights(va,<wbr>wgtFilePath,False)<br>    zr   = ESMF_regrid_with_weights(z,<wbr>wgtFilePath, False)<br>    press = ESMF_regrid_with_weights(p,<wbr>wgtFilePath,False)<br>   <br><br>    printVarSummary(ur)<br>    printVarSummary(vr)<br>    printVarSummary(zr)<br>    printVarSummary(press)<br><br>;---Compute the geostrophic winds  on the rectilinear grid<br>    lat2d = sfile-&gt;XLAT(0,:,:)            <wbr>   ; (south_north,west_east)<br>    lon2d = sfile-&gt;XLONG(0,:,:)<br><br>;---Generate the same rectilinear grid used to generate the weight file<br>    dims  = dimsizes(lat2d)<br>    nlat  = dims(0)<br>    nlon  = dims(1)<br><br>    lat = fspan(min(lat2d), max(lat2d) ,nlat)<br>    lon = fspan(min(lon2d), max(lon2d) ,nlon)<br><br>;---Calculate the geostrophic winds on a rectilinear grid<br>    uv = z2geouv(zr, lat, lon, 1)<br>    printVarSummary(uv)<br>    print(&quot;uv: min=&quot;+min(uv)+&quot;   max=&quot;+max(uv))<br><br>;----Calculate the geostrophic u wind component on a rectilinear grid<br>    u = uv(0,:,:,:)<br>    printVarSummary(u)<br>    print(&quot;u: min=&quot;+min(u)+&quot;   max=&quot;+max(u))<br><br>;----Calculate the geostrophic v wind component on a rectinlinear grid<br>   v = uv(1,:,:,:) <br>   printVarSummary(v)<br>   print(&quot;v:min=&quot;+min(v)+&quot;    max=&quot;+max(v))          <br><br>;---Calculate the uageo component<br> uageo = ur - u<br>   printVarSummary(uageo)<br>   print(&quot;uageo:min=&quot;+min(uageo)+<wbr>&quot;  max=&quot;+max(uageo))<br><br>;---Calculate the vageo component<br>  vageo = vr - v<br>  printVarSummary(vageo)<br>  print(&quot;vageo:min=&quot;+min(vageo)+<wbr>&quot;  max=&quot;+max(vageo))<br>;-----------------------------<wbr>------------------------------<wbr>-----------<br>  opt = False<br>  plane = new(4, float)<br>  plane = (/  63,37  , 63,72   /)<br>  uageo_plane = wrf_user_intrp3d(uageo, p, &quot;v&quot;, plane, 0.0, opt)<br>  vageo_plane = wrf_user_intrp3d(vageo, p, &quot;v&quot;, plane, 0.0, opt)<br>  x_plane  = wrf_user_intrp2d(lat2d, plane, 0.0, opt)<br><br>;--Let&#39;s create nice labels - only have to do this one<br>   if ( FirstTime ) then<br>          zmax = 200.     ;  Place top at model top or close to zmax<br>          zz = wrf_user_intrp3d(p,p,&quot;v&quot;,<wbr>plane,0.,opt)<br>          z_ind = ind(.not.ismissing(zz(:,0)))<br>          zmin = zz(z_ind(0),0)<br>          delete(z_ind)<br>          nice_levs = floor((zmin-zmax)/50)*50<br>          zmax = zmin - nice_levs<br>          dims = dimsizes(zz)<br>          zmax_pos = dims(0)-1<br>          do imax = 1,dims(0)-1<br>            if ( .not.ismissing(zz(imax,0)) .and. zz(imax,0) .ge. zmax ) then<br>              zmax_pos = imax<br>            end if<br>          end do<br>          zspan = zmax_pos<br>          zmax = zz(zmax_pos,0)<br>          nz = floattoint((zmin-zmax)/50+1)<br>          FirstTime = False<br>        end if<br><br><br>;-- x-axis labeles<br>   dimsX = dimsizes(x_plane)<br>      xmin  = x_plane(0)<br>      xmax  = x_plane(dimsX(0)-1)<br>      xspan = dimsX(0)-1<br>      nx    = floattoint( (xmax-xmin)/0.5 + 1)<br><br><br>; create plots: Note some defaults chaanged in NCL v6.1.0<br>;*****************************<wbr>*******************<br>    wks_type = &quot;png&quot;<br>    wks_type@wkWidth = 2500<br>    wks_type@wkHeight = 2500  <br>   wks = gsn_open_wks(&quot;png&quot;,&quot;ESMF&quot;)<br>            <br>  gsn_define_colormap(wks,&quot;<wbr>matlab_jet&quot;)     ; this is the default v6.1.0 onward<br><br>   res = True<br>   res@tiXAxisString = &quot;Latitude&quot;<br>   res@tiYAxisString = &quot;Pressure (mb)&quot;<br>   res@tmXTOn        = False<br>   res@tmYROn        = False<br>   res@tmXBMode      = &quot;Explicit&quot;<br>   res@tmXBValues    = fspan(0, xspan, nx) <br>   res@tmXBLabels    = sprintf(&quot;%.1f&quot;,fspan(xmin,<wbr>xmax,nx))<br>   res@tmXBTickSpacingF = 1.0<br>   res@tmXBLabelFontHeightF  = 0.015<br>   res@tmYLMode      = &quot;Explicit&quot;<br>   res@tmYLValues    = fspan(0, zspan, nz)<br>   res@tmYLLabels    = sprintf(&quot;%.1f&quot;,fspan(zmin, zmax, nz))<br>   res@tiXAxisFontHeightF = 0.015<br>   res@tiYAxisFontHeightF = 0.015<br>   res@tmXBMajorLengthF   = 0.02<br>   res@tmYLMajorLengthF   = 0.02<br>   res@tmYLLabelFontHeightF = 0.015<br><br>    <br>    res1                      = res<br>    res1@gsnDraw              = False           ; don&#39;t draw<br>    res1@gsnFrame             = False           ; don&#39;t advance frame<br>   ; res1@gsnAddCyclic         = False           ; regional data<br>    res1@vcLineArrowThicknessF = 3.0<br>    res1@vcRefMagnitudeF       = 10<br>    res1@vcRefLengthF          = 0.018<br>   ; res1@gsnLeftString         = &quot;&quot;<br>   ; res1@gsnRightString         = &quot;&quot;<br>    res1@vcGlyphStyle          = &quot;LineArrow&quot;<br>    res1@vcMinDistanceF        = 0.05<br>    res1@vcRefAnnoOn           = True   <br>    res1@gsnMaximize           = True<br>    res1@tiMainString          = &quot;Ageostrophic Winds Cross Section on Jan 11 at 13UTC&quot;<br>    res1@tiMainFontHeightF     = 0.018<br>       <br>     <br>    <br>ageo = gsn_csm_vector(wks, uageo_plane(0:zmax_pos,:), vageo_plane(0:zmax_pos,:), res1)<br><br><br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;<br><br>draw(ageo)<br>frame(wks)<br> <br>end<br><br><br></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>