<div dir="ltr"><div class="gmail_default" style="font-size:small">Christian,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You&#39;re right, it&#39;s still coming back with the 327680 points.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">This is because when you use an unstructured grid, a triangular mesh of your points is being generated, and this is what ends up being interpolated.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Let me think on this a bit and get back to you.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 14, 2017 at 11:54 AM, Hogrefe, Christian <span dir="ltr">&lt;<a href="mailto:Hogrefe.Christian@epa.gov" target="_blank">Hogrefe.Christian@epa.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div class="m_7795144909738855409WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">Mary,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">Thank you for these tests.
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">Just to confirm – in your tests, do you get 327680 or 163842 interpolated values, i.e what dimension size is reported in printVarSummary(var_regrid)?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">My script also runs o.k. on NCL6.2 and produces correct maps of interpolated emissions, but my issue is that these emissions are not at the desired 163842 target
 lat/lon points (MPAS center lat/lon) but rather the 327680 MPAS vertex lat/lon. <u></u>
<u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">Since my ultimate goal is to interpolate and then write out these interpolated emissions as input to MPAS, creating a map is not that important to me but obtaining
 the interpolated value at the right set of target lat/lon points is.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">I’m sorry if I did not describe this problem clearly in my initial email.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">Christian<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"> Mary Haley [mailto:<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>]
<br>
<b>Sent:</b> Friday, April 14, 2017 1:46 PM</span></p><div><div class="h5"><br>
<b>To:</b> Hogrefe, Christian &lt;<a href="mailto:Hogrefe.Christian@epa.gov" target="_blank">Hogrefe.Christian@epa.gov</a>&gt;<br>
<b>Cc:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
<b>Subject:</b> Re: [ncl-talk] Using ESMF_Regrid to Interpolate lat/lon to Unstructured MPAS<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">Hi Christian,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I was able to run your script with just some minor changes to the directory paths, and it works with NCL V6.3.0 and NCL V6.4.0. <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I believe if you upgrade NCL, you should be able to run this script without any changes. See the attached image.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Just for something different, I changed the contour levels and set cnFillPalette to a color map that starts with white:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">;;    res@cnLevelSelectionMode = &quot;ManualLevels&quot;       </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">;;    res@cnMinLevelValF       = 0.    </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">;;    res@cnMaxLevelValF       = 1E-10    </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">;;    res@cnLevelSpacingF      = 1E-11/2.                                                                                                              </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">    res@cnLevelSelectionMode  = &quot;ExplicitLevels&quot;</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">    res@cnLevels              = ispan(1,100,5) * 1.e-12</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">    res@cnFillPalette         = &quot;WhViBlGrYeOrRe&quot;        ; &quot;WhiteBlueGreenYellowRed&quot;    </span>  <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I attached the second image as well.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">--Mary<u></u><u></u></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Thu, Apr 13, 2017 at 8:31 AM, Hogrefe, Christian &lt;<a href="mailto:Hogrefe.Christian@epa.gov" target="_blank">Hogrefe.Christian@epa.gov</a>&gt; wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">Mary,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">Thank you very much for looking into this.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">I uploaded the two NetCDF file to the ftp server last weekend. The two files are “<a href="http://edgar_HTAP_NOx_emi_TRANSPORT_2010.0.1x0.1.nc" target="_blank">edgar_HTAP_NOx_emi_TRANSPORT_<wbr>2010.0.1x0.1.nc</a>”
 containing the data to be interpolated and the existing MPAS input file “<a href="http://static.90-25.usgs.nc" target="_blank">static.90-25.usgs.nc</a>” containing the DstGridLat and DstGridLon values. Please let me know if they are not there and I’ll upload
 them again.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">Thanks,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">Christian</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"> Mary Haley [mailto:<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>]
<br>
<b>Sent:</b> Thursday, April 13, 2017 10:28 AM<br>
<b>To:</b> Hogrefe, Christian &lt;<a href="mailto:Hogrefe.Christian@epa.gov" target="_blank">Hogrefe.Christian@epa.gov</a>&gt;<br>
<b>Cc:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
<b>Subject:</b> Re: [ncl-talk] Using ESMF_Regrid to Interpolate lat/lon to Unstructured MPAS</span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Christian,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Sorry for the delay. I think the issue you are having might have been fixed in a later release of NCL.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">I could try to verify this for you if you provide me with the two NetCDF files?  We have an ftp you can use, as long as the files are not too large.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP" target="_blank">http://www.ncl.ucar.edu/<wbr>report_bug.shtml#HowToFTP</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">--Mary<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">On Sat, Apr 8, 2017 at 7:35 PM, Hogrefe, Christian &lt;<a href="mailto:Hogrefe.Christian@epa.gov" target="_blank">Hogrefe.Christian@epa.gov</a>&gt; wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div id="m_7795144909738855409m_-2004168925409012095m_-7381292007470150456divtagdefaultwrapper">
<p style="margin-bottom:12.0pt"><span style="font-size:10.0pt;color:black">Using NCL version 6.2.1, I am trying to use ESMF_regrid to interpolate data from a regular lat/lon (0.1 x 0.1 degree) grid to an unstructured MPAS grid. I am working off of the ESMF_rect_to_unstruct.ncl
 template.</span><u></u><u></u></p>
<p style="margin-bottom:12.0pt"><span style="font-size:10.0pt;color:black">I am providing the DstGridLat and DstGridLon values from an existing MPAS input file. This MPAS mesh has nCells = 163842 cells and I am passing the double latCell(nCells) and double
 lonCell(nCells) variables to DstGridLat and DstGridLon.</span><u></u><u></u></p>
<p style="margin-bottom:12.0pt"><span style="font-size:10.0pt;color:black">Once the script starts processing the destination grid, the following screen output appears:</span><u></u><u></u></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;color:black">(0)           get_dst_grid_info: destination lat dims = (163842)</span><u></u><u></u></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;color:black">(0)           get_dst_grid_info: destination lon dims = (163842)</span><u></u><u></u></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;color:black">(0)           unstructured_to_ESMF: triangulating the data ... this can be slow</span><u></u><u></u></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;color:black">(0)           min/max ElementVertices = 0/163841</span><u></u><u></u></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;color:black">(0)           unstructured_to_ESMF: total number of elements created: 327680</span><u></u><u></u></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;color:black"> </span><u></u><u></u></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;color:black">After that, the weights are being generated and the input data is interpolated . However, the dimension of that interpolated output is 327680 (i.e. the number of “elements”),
 not 163842 (i.e. the number of destination lat/lon points specified). When I write out the interpolated data, it has 327680 values. That number of  “elements” matches the number of “Vertices” in my existing MPAS input file from which the DstGridLat and DstGridLon
 values were pulled.</span><u></u><u></u></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;color:black"> </span><u></u><u></u></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;color:black">I am sure I am missing something very basic, but I am stuck figuring out why the interpolated data has more elements than I am expecting.</span><u></u><u></u></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;color:black"> </span><u></u><u></u></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;color:black">I am attaching the script, screen output, header of the destination lat/lon grid description file provided to the script, and the headers of the SrcFileName, DstFileName,
 and ncf file containing the interpolated data that are created by the script.</span><u></u><u></u></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;color:black"> </span><u></u><u></u></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;color:black">I have also uploaded the files required to run the script (i.e. the
<a href="http://edgar_HTAP_NOx_emi_TRANSPORT_2010.0.1x0.1.nc" target="_blank">edgar_HTAP_NOx_emi_TRANSPORT_<wbr>2010.0.1x0.1.nc</a> file containing the data to be interpolated and the existing MPAS input file
<a href="http://static.90-25.usgs.nc" target="_blank">static.90-25.usgs.nc</a> containing the DstGridLat and DstGridLon values) to the anonymous ftp server.</span><u></u><u></u></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;color:black"> </span><u></u><u></u></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;color:black">Thank you very much for your help,</span><u></u><u></u></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;color:#888888"> </span><u></u><u></u></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;color:#888888">Christian</span><u></u><u></u></p>
<p><span style="font-family:&quot;Calibri&quot;,sans-serif;color:#888888"> </span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</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>