<div dir="ltr"><div class="gmail_default" style="font-size:small">Lijun,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">It&#39;s hard to tell what the problem is without looking at both the source and destination grids. I don&#39;t know what your original data looks like, or where the grid points fall. It would be easier if you could provide me with the two NetCDF files so I can run the script here.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">What I usually do is plot both the original data and the regridded data on separate plots, and then add the source grid and the destination grid as a series of points so I can see more clearly where they overlap. Depending on whether the data itself has missing values, this could also affect how it is regridded.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You can use gsn_coordinates to plot markers at locations where your original or regridded data is missing and/or non missing. This way you don&#39;t need to do all the &quot;ind&quot; calls yourself. See the fourth thumbnail image of example #7 here:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml#ex7">http://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml#ex7</a><br></div><div class="gmail_default"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">To use gsn_coordinates, replace this code:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">







<p class="gmail-p1"><font face="monospace, monospace"><span class="gmail-s1">  </span><span class="gmail-s2">; add polymarkers at missing value locations                </span></font></p></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">  co_regrid2D = CO_regrid(10,0,:,:)</font></div><div class="gmail_default"><font face="monospace, monospace">  indices     = ind_resolve(ind(ismissing(ndtooned(co_regrid2D))), dimsizes(co_regrid2D))</font></div><div class="gmail_default"><font face="monospace, monospace">  dims        = dimsizes(indices)</font></div><div class="gmail_default"><font face="monospace, monospace">  npts        = dims(0)</font></div><div class="gmail_default"><font face="monospace, monospace">  Lon_group   = new(npts,float)</font></div><div class="gmail_default"><font face="monospace, monospace">  Lat_group   = new(npts,float)</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">  do n = 0,npts-1</font></div><div class="gmail_default"><font face="monospace, monospace">    Lon_group(n) = lon2d_AIRS(indices(n,0),indices(n,1))</font></div><div class="gmail_default"><font face="monospace, monospace">    Lat_group(n) = lat2d_AIRS(indices(n,0),indices(n,1))</font></div><div class="gmail_default"><font face="monospace, monospace">  end do</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">  pmres                     = True</font></div><div class="gmail_default"><font face="monospace, monospace">  pmres@gsMarkerColor       = &quot;black&quot;</font></div><div class="gmail_default"><font face="monospace, monospace">  pmres@gsMarkerIndex       = 16</font></div><div class="gmail_default"><font face="monospace, monospace">  pmres@gsMarkerSizeF       = 0.02</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">  gsn_polymarker(wks, plot, Lon_group, Lat_group, pmres)</font></div><div class="gmail_default"><br></div><div class="gmail_default">with this code (UNTESTED):</div><div class="gmail_default">







<p class="gmail-p1"><font face="monospace, monospace"><span class="gmail-s1">  </span><span class="gmail-s2">; add polymarkers at missing value locations                    </span></font></p></div><div class="gmail_default"><div class="gmail_default"><span style="font-family:monospace,monospace">  mkres = True</span><br></div><div class="gmail_default"><font face="monospace, monospace">  mkres@gsMarkerIndex            = 16     ; filled dots</font></div><div class="gmail_default"><font face="monospace, monospace">  mkres@gsMarkerSizeF            = 3      ; you may need to adjust this</font></div><div class="gmail_default"><font face="monospace, monospace">  mkres@gsnCoordsNonMissingColor = &quot;black&quot;</font></div><div class="gmail_default"><font face="monospace, monospace">  mkres@gsnCoordsMissingColor    = &quot;red&quot;</font></div><div class="gmail_default"><font face="monospace, monospace">  gsn_coordinates(wks,plot,co_regrid(10,0,:,:),mkres)</font></div></div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Meanwhile, let me know if you can provide the data files. You can use our ftp site:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP">http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">Thanks,</div><div class="gmail_default"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 27, 2017 at 9:36 AM, Lijun Diao <span dir="ltr">&lt;<a href="mailto:ljdiao@gmail.com" target="_blank">ljdiao@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 lang="EN-US" link="#0563C1" vlink="#954F72"><div class="m_-5412150416015311334WordSection1"><p class="MsoNormal">Hi, NCL talk forum:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I am using ESMF_regrid to regrid my modeled CO (dimentioned Lev(15)*Row(299)*Col(459)) to AIRS L2 swath locations (dimentioned 45*30). I attached my code test.ncl for the  regridding and plotting. I found some of the regridded output are missing values. Then I plotted those missing value locations (black dots in the attached figure). The red dashed box defines my model domain. I understand when the satellite swath is  out of the model domain, the regridded CO will be missing values since no model grids will correspond to those locations. But as you can see, some black dots are actually inside my model domain, especially the upper right ones, which are relatively far away from the edges of the model domain. In another words, the esmf regrid program can not regrid accurately for some of the swath locations that are inside the model domain. It doesn’t make sense to me. What is the reason?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thanks,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">------------------------------<wbr>--------<u></u><u></u></p><p class="MsoNormal">Lijun Diao<u></u><u></u></p><p class="MsoNormal">University of Houston<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p></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>