<div dir="ltr"><div>[1] <br>NCL uses a simple and fast version of bilinear interpolation. As noted in the documentation it is developed for rectilinear grids<br><br>There are various forms of bilinear interpolation. Two are here:<br><a href="http://www.ahinson.com/algorithms_general/Sections/InterpolationRegression/InterpolationBilinear.pdf" target="_blank">http://www.ahinson.com/<wbr>algorithms_general/Sections/<wbr>InterpolationRegression/<wbr>InterpolationBilinear.pdf</a><br><a href="http://www.ahinson.com/algorithms_general/Sections/InterpolationRegression/InterpolationIrregularBilinear.pdf" target="_blank">http://www.ahinson.com/<wbr>algorithms_general/Sections/<wbr>InterpolationRegression/<wbr>InterpolationIrregularBilinear<wbr>.pdf</a><br></div><div><br></div><div>I have no idea what is used by ESMF.<br></div><div><br>[2]<br>The following should not have been commented if you want netCDF-4. I did not. <br>NCL's default is classic netCDF-3<br><br><span> setfileoption("nc", "Format", "NetCDF4Classic") ; nc4<br><br></span></div><span></span><i>Advanced"</i> means NCL
will use a newer file structure with the capability of
handling <br>groups and more advanced data structures. You do not have the need for this.<br><span></span></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 25, 2018 at 8:09 AM, Ehsan Taghizadeh <span dir="ltr"><<a href="mailto:ehsantaghizadeh@yahoo.com" target="_blank">ehsantaghizadeh@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:bookman old style,new york,times,serif;font-size:16px"><div style="font-family:bookman old style,new york,times,serif;font-size:16px"><div></div>
<div>Thank you so much for your help.</div><div>The script works now, correctly.</div><div>1- However could I ask what the main reason(s) for the difference between "<span>linint2_points</span>" and "<span>bilinear</span>" in "<span>ESMF_regrid</span>"<span><span style="color:rgb(0,0,0);font-family:"bookman old style","new york",times,serif;font-size:16px"> is(are)</span></span>? I mean why the outputs of these two methods are different?</div><div>I took a glance on these pages: "<a href="http://www.ncl.ucar.edu/Applications/ESMF.shtml" rel="nofollow" target="_blank">http://www.ncl.ucar.edu/<wbr>Applications/ESMF.shtml</a>", "<a href="http://earthsystemmodeling.org/esmf_releases/non_public/ESMF_6_1_1/ESMF_refdoc/node5.html#SECTION05012600000000000000" rel="nofollow" target="_blank">http://earthsystemmodeling.<wbr>org/esmf_releases/non_public/<wbr>ESMF_6_1_1/ESMF_refdoc/node5.<wbr>html#<wbr>SECTION05012600000000000000</a>", "<a href="http://earthsystemmodeling.org/esmf_releases/non_public/ESMF_6_1_1/ESMF_refdoc/node5.html#SECTION05012600000000000000" rel="nofollow" target="_blank">http://earthsystemmodeling.<wbr>org/esmf_releases/non_public/<wbr>ESMF_6_1_1/ESMF_refdoc/node5.<wbr>html#<wbr>SECTION05012600000000000000</a>" and they help me a lot.</div><div><br></div><div>2- Beside that why the following two lines have to be commented?</div><div>"<span><div>; setfileoption("nc", "FileStructure", "Advanced")</div><div>; setfileoption("nc", "Format", "NetCDF4Classic")<br></div><div>"<br></div></span></div><div>Albeit there isn't setfileoption in examples like this "<a href="http://www.ncl.ucar.edu/Applications/Scripts/ESMF_regrid_13.ncl" rel="nofollow" target="_blank">http://www.ncl.ucar.edu/<wbr>Applications/Scripts/ESMF_<wbr>regrid_13.ncl</a>".</div><div><br></div><div>Sincerely</div><div>Ehsan</div>
</div><div id="m_8069739768421709930yahoo_quoted_3214971481" class="m_8069739768421709930yahoo_quoted">
<div style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;color:#26282a"><span class="">
<div>
On Tuesday, July 24, 2018, 4:27:49 AM GMT+4:30, Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>> wrote:
</div>
<div><br></div>
<div><br></div>
</span><div><div id="m_8069739768421709930yiv0242421613"><div><span class=""><div dir="ltr"><div><div>I modified your script.<br clear="none"><br clear="none"></div>Use only "bilinear" and/or "nearest neighbor' . <br clear="none"><br clear="none">"patch" is *NOT* appropriate. I was/is for highly accurate derivatives. as needed for say ocean curl.<br clear="none"><br clear="none"></div>Please read all ESMF documentation.<br clear="none"></div></span><div class="m_8069739768421709930yiv0242421613gmail_extra"><br clear="none"><div class="m_8069739768421709930yiv0242421613gmail_quote"><span class="">On Sat, Jul 21, 2018 at 5:43 AM, Ehsan Taghizadeh <span dir="ltr"><<a rel="nofollow" shape="rect" href="mailto:ehsantaghizadeh@yahoo.com" target="_blank">ehsantaghizadeh@yahoo.com</a>></span> wrote:<br clear="none"></span><blockquote class="m_8069739768421709930yiv0242421613gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_8069739768421709930yiv0242421613yqt8101412663" id="m_8069739768421709930yiv0242421613yqt97189"><div><div style="font-family:bookman old style,new york,times,serif;font-size:16px"><div style="font-family:bookman old style,new york,times,serif;font-size:16px"><span class=""><div></div>
<div>Thank you for your help.</div><div>I'd used ncl scrip which was written by ncl-talk group, to interpolate GPM data to station points, in ASCII format.</div><div>After finishing work, and sending paper to journal, referee wants to know the effect of other interpolating methods. So I decided to use some other methods to interpolate GPM data on station points.</div><div>I've tried <span><span>ESMF regridding library</span></span> as you suggested. However I faced the error:</div><div>"<span>ESMF_regrid_gen_weights: 'ESMF_RegridWeightGen' was not successful.</span>"</div><div>Beside that I have to write output file in ASCII format.</div></span><div>I've attached first script (<span>Interpolating_bilinear.ncl</span>) which works correctly via bilinear method, and second script (<span>Interpolating_ESMF.ncl</span>) which uses ESMF regridding. Also input data are attached (<span>GPM_IMERGV04DE_20160401_ 20170228 directory and <span>stations_NW.csv file which contains destination lat/lon</span></span>).</div><div><div class="h5"><div>Could I have your help to modify "<span><span style="color:rgb(0,0,0)">Interpolating_ESMF.ncl</span></span>" to use different interpolating methods (<span>bilinear", "neareststod", "patch"</span>)?</div><div>Also could I have your opinion to answer the referee about using different interpolating methods? Is it necessary to use different interpolating methods and comparing them?</div><div><br clear="none"></div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div><div>$ ncl -V</div><div> 6.5.0</div><div>$ uname -a</div><div><span> Linux localhost.localdomain 3.10.0-514.2.2.el7.x86_64 #1 SMP Tue Dec 6 23:06:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux</span></div><div><span>$ <span><span style="color:rgb(51,51,51);font-family:verdana,sans-serif;font-size:13.3333px">gcc --version</span></span></span></div><div><span><span><span style="color:rgb(51,51,51);font-family:verdana,sans-serif;font-size:13.3333px"> <span>gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)</span><br clear="none"></span></span></span></div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br clear="none"></div><div><br clear="none"></div><div>Sincerely</div><div>Ehsan</div><div><br clear="none"></div>
</div></div></div><div><div class="h5"><div class="m_8069739768421709930yiv0242421613m_8573083758030373642yahoo_quoted" id="m_8069739768421709930yiv0242421613m_8573083758030373642yahoo_quoted_2548715756">
<div style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;color:#26282a"><div><div class="m_8069739768421709930yiv0242421613h5">
<div>
On Thursday, July 19, 2018, 10:22:38 PM GMT+4:30, Dennis Shea <<a rel="nofollow" shape="rect" href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>> wrote:
</div>
<div><br clear="none"></div>
<div><br clear="none"></div>
</div></div><div><div id="m_8069739768421709930yiv0242421613m_8573083758030373642yiv8603990973"><div><div><div class="m_8069739768421709930yiv0242421613h5"><div dir="ltr">Without the printVarSummary() of your 'z' variable, it is hard to tell what the problem might be:<br clear="none"><br clear="none">function dspnt2 (<br clear="none"> x [*] : numeric, <br clear="none"> y [*] : numeric,<br clear="none"> z : numeric, <br clear="none"> xo [*] : numeric, <br clear="none"> yo [*] : numeric<br clear="none"> )<br clear="none"><div><br clear="none"></div><div>This assumes a cartesian grid. Still: lon[*] and lat[*] are commonly input to the function as x[*] and y[*]<br clear="none"><br clear="none"></div><div>=====<br clear="none">However, I am not evne going to deall with the 'dspnt2. Please use the ESMF regridding library.<br clear="none"><br clear="none"><br clear="none"> <a rel="nofollow" shape="rect" href="http://www.ncl.ucar.edu/Applications/ESMF.shtml" target="_blank">http://www.ncl.ucar.edu/ Applications/ESMF.shtml</a><br clear="none"><br clear="none"></div><div>Something like:<br clear="none"><br clear="none"></div><div> var = f->FOO <br clear="none"></div><div> printVarSummary(var)<br clear="none"></div><div> printMinMax(var,0)<br clear="none"></div><div><br clear="none"> interp_method = "bilinear" ; "neareststod", "patch"<br clear="none"> wgt_file_name = "wgt.ESHAN_"+interp_method+". nc" <pre> Opt = True
Opt@SrcGridLat = lat ; rectilinear lat[*]
Opt@SrcGridLon = lon ; " lon[*]<br clear="none">
Opt@DstGridLat = ulat ; unstructured latitudes
Opt@DstGridLon = ulon ; " longitudes<br clear="none"> <br clear="none"> Opt@InterpMethod = interp_method
<br clear="none"> Opt@WgtFileName = wgt_file_name<br clear="none"><br clear="none"> <br clear="none"> var_regrid = ESMF_regrid(var,Opt) ; Do the regridding</pre><div> printVarSummary(var_regrid))<br clear="none"></div> printMinMax(var_regrid,0)<br clear="none"><br clear="none"></div><div>PLEASE *CAREFULLY* READ the documentation and examples.<br clear="none"><br clear="none"></div></div></div></div><div class="m_8069739768421709930yiv0242421613m_8573083758030373642yiv8603990973gmail_extra"><br clear="none"><div class="m_8069739768421709930yiv0242421613m_8573083758030373642yiv8603990973gmail_quote"><div><div class="m_8069739768421709930yiv0242421613h5">On Thu, Jul 19, 2018 at 2:04 AM, Ehsan Taghizadeh <span dir="ltr"><<a rel="nofollow" shape="rect" href="mailto:ehsantaghizadeh@yahoo.com" target="_blank">ehsantaghizadeh@yahoo.com</a>></span> wrote:<br clear="none"></div></div><blockquote class="m_8069739768421709930yiv0242421613m_8573083758030373642yiv8603990973gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_8069739768421709930yiv0242421613m_8573083758030373642yiv8603990973yqt2701789277" id="m_8069739768421709930yiv0242421613m_8573083758030373642yiv8603990973yqt76609"><div><div style="font-family:bookman old style,new york,times,serif;font-size:16px"><div style="font-family:bookman old style,new york,times,serif;font-size:16px">Hi,</div><div style="font-family:bookman old style,new york,times,serif;font-size:16px">Is there any interpolation method from <span><span style="color:rgb(51,51,51);font-family:verdana,sans-serif;font-size:13.3333px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-color:initial;display:inline!important;float:none">rectilinear grid to an unstructured grid</span></span> other than <span><span style="color:rgb(51,51,51);font-family:verdana,sans-serif;font-size:13.3333px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-color:initial;display:inline!important;float:none">bilinear interpolation</span></span> in NCL, like kriging, nearest point, etc? However I found this link (<a rel="nofollow" shape="rect" href="https://www.ncl.ucar.edu/Support/talk_archives/2011/0595.html" target="_blank">https://www.ncl.ucar.edu/ Support/talk_archives/2011/ 0595.html</a>) which states "<span><span style="color:rgb(0,0,0)">There is no kriging interpolation function in NCL</span></span>".</div><span class="m_8069739768421709930yiv0242421613"></span><div style="font-family:bookman old style,new york,times,serif;font-size:16px">Beside that could "dspnt2" be used to interpolate <span>from <span><span style="color:rgb(51,51,51);font-family:verdana,sans-serif;font-size:13.3333px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-color:initial;display:inline!important;float:none">rectilinear grid to an unstructured grid</span></span></span>? However it seems it couldn't and following error is the subject "<span>fatal:dspnt2: the rightmost dimension of z must be the same as the dimension of x and y</span>".</div><div style="font-family:bookman old style,new york,times,serif;font-size:16px"><br clear="none"></div><div style="font-family:bookman old style,new york,times,serif;font-size:16px">I'll be thankful for any help.</div><div style="font-family:bookman old style,new york,times,serif;font-size:16px"><br clear="none"></div><div style="font-family:bookman old style,new york,times,serif;font-size:16px">Sincerely</div><span class="m_8069739768421709930yiv0242421613m_8573083758030373642yiv8603990973HOEnZb"><font color="#888888"></font></span><div style="font-family:bookman old style,new york,times,serif;font-size:16px">Ehsan<br clear="none"></div></div></div></div><span class="m_8069739768421709930yiv0242421613"><br clear="none">______________________________ _________________<br clear="none">
ncl-talk mailing list<br clear="none">
<a rel="nofollow" shape="rect" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br clear="none">
List instructions, subscriber options, unsubscribe:<br clear="none">
<a rel="nofollow" shape="rect" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/ mailman/listinfo/ncl-talk</a><br clear="none">
<br clear="none"></span></blockquote></div><br clear="none"></div></div></div></div>
</div>
</div></div></div></div></div></div><div><div class="h5"><br clear="none">______________________________ _________________<br clear="none">
ncl-talk mailing list<br clear="none">
<a rel="nofollow" shape="rect" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br clear="none">
List instructions, subscriber options, unsubscribe:<br clear="none">
<a rel="nofollow" shape="rect" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/ mailman/listinfo/ncl-talk</a><br clear="none">
<br clear="none"></div></div></blockquote></div><br clear="none"></div></div></div></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>