[ncl-talk] Using ESMF_Regrid to Interpolate lat/lon to Unstructured MPAS

Mary Haley haley at ucar.edu
Fri Apr 14 12:54:01 MDT 2017


Christian,

You're right, it's still coming back with the 327680 points.

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.

Let me think on this a bit and get back to you.

--Mary


On Fri, Apr 14, 2017 at 11:54 AM, Hogrefe, Christian <
Hogrefe.Christian at epa.gov> wrote:

> Mary,
>
>
>
> Thank you for these tests.
>
>
>
> 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)?
>
>
>
> 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.
>
>
>
> 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.
>
>
>
> I’m sorry if I did not describe this problem clearly in my initial email.
>
>
>
> Christian
>
>
>
>
>
> *From:* Mary Haley [mailto:haley at ucar.edu]
> *Sent:* Friday, April 14, 2017 1:46 PM
>
> *To:* Hogrefe, Christian <Hogrefe.Christian at epa.gov>
> *Cc:* ncl-talk at ucar.edu
> *Subject:* Re: [ncl-talk] Using ESMF_Regrid to Interpolate lat/lon to
> Unstructured MPAS
>
>
>
> Hi Christian,
>
>
>
> 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.
>
>
>
> I believe if you upgrade NCL, you should be able to run this script
> without any changes. See the attached image.
>
>
>
> Just for something different, I changed the contour levels and set
> cnFillPalette to a color map that starts with white:
>
>
>
> ;;    res at cnLevelSelectionMode = "ManualLevels"
>
> ;;    res at cnMinLevelValF       = 0.
>
> ;;    res at cnMaxLevelValF       = 1E-10
>
> ;;    res at cnLevelSpacingF      = 1E-11/2.
>
>
>
>
>
>     res at cnLevelSelectionMode  = "ExplicitLevels"
>
>     res at cnLevels              = ispan(1,100,5) * 1.e-12
>
>     res at cnFillPalette         = "WhViBlGrYeOrRe"        ;
> "WhiteBlueGreenYellowRed"
>
>
>
> I attached the second image as well.
>
>
>
> --Mary
>
>
>
> On Thu, Apr 13, 2017 at 8:31 AM, Hogrefe, Christian <
> Hogrefe.Christian at epa.gov> wrote:
>
> Mary,
>
>
>
> Thank you very much for looking into this.
>
>
>
> I uploaded the two NetCDF file to the ftp server last weekend. The two
> files are “edgar_HTAP_NOx_emi_TRANSPORT_2010.0.1x0.1.nc” containing the
> data to be interpolated and the existing MPAS input file “
> static.90-25.usgs.nc” containing the DstGridLat and DstGridLon values.
> Please let me know if they are not there and I’ll upload them again.
>
>
>
> Thanks,
>
>
>
> Christian
>
>
>
> *From:* Mary Haley [mailto:haley at ucar.edu]
> *Sent:* Thursday, April 13, 2017 10:28 AM
> *To:* Hogrefe, Christian <Hogrefe.Christian at epa.gov>
> *Cc:* ncl-talk at ucar.edu
> *Subject:* Re: [ncl-talk] Using ESMF_Regrid to Interpolate lat/lon to
> Unstructured MPAS
>
>
>
> Christian,
>
>
>
> Sorry for the delay. I think the issue you are having might have been
> fixed in a later release of NCL.
>
>
>
> 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.
>
>
>
> http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP
>
>
>
> Thanks
>
>
>
> --Mary
>
>
>
>
>
>
>
> On Sat, Apr 8, 2017 at 7:35 PM, Hogrefe, Christian <
> Hogrefe.Christian at epa.gov> wrote:
>
> 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.
>
> 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.
>
> Once the script starts processing the destination grid, the following
> screen output appears:
>
> (0)           get_dst_grid_info: destination lat dims = (163842)
>
> (0)           get_dst_grid_info: destination lon dims = (163842)
>
> (0)           unstructured_to_ESMF: triangulating the data ... this can be
> slow
>
> (0)           min/max ElementVertices = 0/163841
>
> (0)           unstructured_to_ESMF: total number of elements created:
> 327680
>
>
>
> 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.
>
>
>
> 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.
>
>
>
> 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.
>
>
>
> I have also uploaded the files required to run the script (i.e. the
> edgar_HTAP_NOx_emi_TRANSPORT_2010.0.1x0.1.nc file containing the data to
> be interpolated and the existing MPAS input file static.90-25.usgs.nc
> containing the DstGridLat and DstGridLon values) to the anonymous ftp
> server.
>
>
>
> Thank you very much for your help,
>
>
>
> Christian
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170414/0e570c57/attachment.html 


More information about the ncl-talk mailing list