<div dir="ltr"><div><div><div>NCL has no explicit function to create the 32km lat/lon locations.<br></div>However, if this is  &quot;test input file&quot; maybe you could create test set via<br></div><div>the following which was extracted from an example<br></div><div><br></div>  aDataDir       = &quot;./&quot;<br>  aFileName      = &quot;wrfout_d01_2003-07-15_00:00:<a href="http://00.nc" target="_blank">00.nc</a>&quot;<br>  aFile          = aDataDir+aFileName<br>  a = addfile(aFile,&quot;r&quot;)                            ; a is the wrf output with the format of rcm<br><br>  xlat   = a-&gt;XLAT(0,:,:)<br>  xlon   = a-&gt;XLONG(0,:,:)<br></div>  dat   = a-&gt;<span style="font-size:11pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:rgb(31,73,125)">TOT_PRCP      <br></span><div><br>  dimll  = dimsizes(xlat)<br>  nlat   = dimll(0)<br>  mlon   = dimll(1)<br><br>  NLAT   = 2*nlat-1                                 ; make large array<br>  MLON   = 2*mlon-1<br>  XLAT   = new( (/NLAT,MLON/), typeof(xlat))<br>  XLON   = new( (/NLAT,MLON/), typeof(xlat))<br></div><div>  DAT    = new( (/NLAT,MLON/), typeof(xlat))</div><div><br>  XLAT(0:NLAT-1:2,0:MLON-1:2) = xlat                ; populate with every<br>  XLON(0:NLAT-1:2,0:MLON-1:2) = xlon                ; other value<br>  poisson_grid_fill(XLAT, False, 1, 1500, 1e-2, 0.6, 0)<br>  poisson_grid_fill(XLON, False, 1, 1500, 1e-2, 0.6, 0)<br>  poisson_grid_fill(DAT   , False, 1, 1500, 1e-2, 0.6, 0)  ; &lt;== could be slow<br><br>  copy_VarMeta(xlat,XLAT)<br>  copy_VarMeta(xlon,XLON)<br><br>  printVarSummary(XLAT)<br>  printVarSummary(XLAT)<br> ;print(&quot;XLAT: &quot;+XLAT(:,0) +&quot;  &quot;+XLAT(:,MLON/2) +&quot;  &quot;+ XLAT(:,MLON-1))<br> ;print(&quot;XLON: &quot;+XLON(0,:) +&quot;  &quot;+XLON(NLAT/2,:) +&quot;  &quot;+ XLON(NLAT-1,:))<br><br>  wks  = gsn_open_wks(&quot;x11&quot;,&quot;tstgrid&quot;)<br> ;gsn_define_colormap(wks,&quot;BlAqGrYeOrRe&quot;)<br><br>  latlonres  = True<br>  latlonres@gsnDraw    = False<br>  latlonres@gsnFrame   = False<br>  latlonres@cnLineThicknessF   = 2<br>  latlonres@tiMainString = &quot;Original Grid&quot;<br><br>  latlonres@cnLineColor   = &quot;red&quot;<br>  plotLat = gsn_contour(wks,xlat,latlonres)<br>  latlonres@cnLineColor   = &quot;blue&quot;<br>  plotLon = gsn_contour(wks,xlon,latlonres)<br>  overlay(plotLat,plotLon)                           ; overlay on map<br>  draw(plotLat)<br>  frame(wks)<br><br>  latlonres@tiMainString = &quot;Destination  Grid&quot;<br>  latlonres@cnLineColor   = &quot;red&quot;<br>  plotLAT = gsn_contour(wks,XLAT,latlonres)<br>  latlonres@cnLineColor   = &quot;blue&quot;<br>  plotLON = gsn_contour(wks,XLON,latlonres)<br>  overlay(plotLAT,plotLON)                           ; overlay on map<br>  draw(plotLAT)<br>  frame(wks)<br><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 21, 2014 at 12:36 PM, Marcella, Marc <span dir="ltr">&lt;<a href="mailto:MMarcella@air-worldwide.com" target="_blank">MMarcella@air-worldwide.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 link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Hi Dennis,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><br>
Is there a way to do this if I in fact I don’t have a destination grid file like example 20 has?  I am looking to create said destination grid file.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> Dennis Shea [mailto:<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>]
<br><span class="">
<b>Sent:</b> Friday, November 21, 2014 12:02 PM<br>
<b>To:</b> Marcella, Marc<br>
</span><b>Cc:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a></span></p><div><div class="h5"><br>
<b>Subject:</b> Re: [ncl-talk] regrid from 64km to 32km<u></u><u></u></div></div><p></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">Based on the printVarSummary which shows the named dimensions as<br>
  <span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">
[Time | 8760] x [south_north | 106] x [west_east | 123]</span><u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">You hacv a WRF grid (curvilinear) grid.<br>
<br>
</span><u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
<a href="http://www.ncl.ucar.edu/Applications/ESMF.shtml" target="_blank">http://www.ncl.ucar.edu/Applications/ESMF.shtml</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Example 20  (also, Example 16)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">This is going from high resolution to low resolution but you could just use your 64km res file as input and<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">specify the &#39;destination&#39; 32 km grid.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Note: you are interpolating precipitation. Since it is a test, bilinear would be fine. However, the conserve method may be better for some applications.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Good luck <u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Fri, Nov 21, 2014 at 9:44 AM, Marcella, Marc &lt;<a href="mailto:MMarcella@air-worldwide.com" target="_blank">MMarcella@air-worldwide.com</a>&gt; wrote:<u></u><u></u></p>
<div>
<div>
<p><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">1)</span><span style="font-size:7.0pt;color:#1f497d">     
</span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Yes, I meant it would be a misrepresentation of resolution since it will be at 32km physically but in reality it is 64km information.</span><u></u><u></u></p>
<p><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">2)</span><span style="font-size:7.0pt;color:#1f497d">     
</span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">I have a 64km resolution dataset that I want to slice up into 32 km resolution for example going from say a 50x50 grid to 100x100 grid (4x total points) I attached an illustration
 if this makes it clearer. </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.25in">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">The original data is curvilinear (output from WRF data) but this data itself is plucked out of the wrfout files and placed onto a grid that knows nothing about the lat/lon and I
 am fine keeping it in a rectilinear grid as seen here by the printVarSummary:    </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.25in">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Variable: TOT_PRCP</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.25in">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Type: float</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.25in">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Total Size: 456851520 bytes</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.25in">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">114212880 values</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.25in">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Number of Dimensions: 3</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.25in">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Dimensions and sizes:   [Time | 8760] x [south_north | 106] x [west_east | 123]</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.25in">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Coordinates:
</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.25in">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Number Of Attributes: 3</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.25in">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">_FillValue :  9.96921e+36</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.25in">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">units :       mm/hr</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.25in">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">description : Total hourly precipitation accumulation
</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Thank you for your help with this!</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Marc</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> Dennis Shea [mailto:<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>]
<br>
<b>Sent:</b> Friday, November 21, 2014 11:27 AM<br>
<b>To:</b> Marcella, Marc; <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
<b>Subject:</b> Re: [ncl-talk] regrid from 64km to 32km</span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">I think you have to provide more information.
<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">[1] Not sure what you mean by &quot;this  would be an incorrect regridding format/procedure&quot;. Do you mean going from low -resolution to high-resolution? There is nothing &quot;incorrect&quot; about
 that. The issue is that the *effective resolution* would stll be 64km but the data are rendered on a 32km grid.<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">[2] The rest of the question is obscure.<u></u><u></u></p>
</div>
<p class="MsoNormal">[3] *ALWAYS* include a printVarsummary of the source variable.<u></u><u></u></p>
</div>
<p class="MsoNormal">     (a) Is the source grid rectilinear or curvilinear? If curvilinear, then linint2 is not the function to use.<u></u><u></u></p>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">On Fri, Nov 21, 2014 at 7:58 AM, Marcella, Marc &lt;<a href="mailto:MMarcella@air-worldwide.com" target="_blank">MMarcella@air-worldwide.com</a>&gt; wrote:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Hi NCL’ers,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I would like to take a current dataset that is 64 km, say at dimensions j=106 x i=123 and “regrid” it such that the gridcells are just sliced up into 32km resolution grid cells,
 ie the final product would have dimensions of 212x246.  I do recognize that this  would be an incorrect regridding format/procedure but I just need the grid for a test input file. I tried the linint2 regridding but this kept the first (lower left) 106x123
 gridcells the original values and all the additional/new gridcells outside this box were FillValues.  Is there an easy way to do this with a regrid or NCL function?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Thanks for any help in advance!<u></u><u></u></p>
<p class="MsoNormal"><span style="color:#888888"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#888888">Marc</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#888888"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#888888"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#888888"> </span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><u></u><u></u></p>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>

</blockquote></div><br></div>