<div dir="ltr"><div class="gmail_default" style="font-size:small">I was unable to reproduce the error message using cssgrid. I think this routine may not be the best one to use for regridding random data to a rectilinear grid.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I suggest looking at ESMF_regrid, which allows you to specify different interpolation methods, or dsgrid2, which takes similar arguments as cssgrid.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">One thing of note is that you have very few points, yet you are trying to regrid them to a 60 x 70 grid.  Also, you have some stray points that are separated from a cluster of points in the southeast, which also makes regridding tricky.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">See the attached scripts, which use ESMF_regrid and dsgrid2, so you can compare. I plotted the results so you can see what's going on with the original points, compared to the original points.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">For more ESMF regridding examples, go to:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/ESMF.shtml">http://www.ncl.ucar.edu/Applications/ESMF.shtml</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">I think the ESMF patch method might give the best results in this case, but you'll need to decide for yourself.</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><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 19, 2018 at 8:07 AM, 黄倩倩 via ncl-talk <span dir="ltr"><<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div style="font-family:宋体,arial,Verdana,sans-serif">Hi,</div><div style="font-family:宋体,arial,Verdana,sans-serif">I have a problem when I try to use cssgrid_Wrap. Could you please help me solve it?</div><div style="font-family:宋体,arial,Verdana,sans-serif">Thank you.</div><div style="font-family:宋体,arial,Verdana,sans-serif"><br></div><div style="font-family:宋体,arial,Verdana,sans-serif">----------Problem:------------<wbr>---</div><div style="font-family:宋体,arial,Verdana,sans-serif"><div>CSSGRID - error  -121, coordinates   121 and M coincide for some M  >   121 >= 1 (coordinate numbering starting at 1).</div><div>Error number -121 returned from c_cssgridd</div><div>fatal:cssgrid: Error number -121.</div><div>fatal:["Execute.c":8578]:<wbr>Execute: Error occurred at or near line 5137 in file $NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.ncl</div><div><br></div><div>fatal:["Execute.c":8578]:<wbr>Execute: Error occurred at or near line 45 in file 4-ave_10m_plot.ncl</div></div><div style="font-family:宋体,arial,Verdana,sans-serif"><br></div><div style="font-family:宋体,arial,Verdana,sans-serif">--------ncl script---------</div><div style="font-family:宋体,arial,Verdana,sans-serif"><div>;draw isolines of annual mean air stagnation days</div><div><br></div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl"</div><div><br></div><div>begin</div><div><br></div><div>fname="/home/hqq/decouple/<wbr>top10/USsounding/stat_<wbr>dispersion/annual_mean_w10.<wbr>txt"</div><div>lines = asciiread(fname,-1,"string")</div><div><br></div><div>xlat0=stringtofloat(str_get_<wbr>field(lines(1:),2,","))</div><div>xlon0=stringtofloat(str_get_<wbr>field(lines(1:),3,","))</div><div>xnum0=stringtofloat(str_get_<wbr>field(lines(1:),5,","))</div><div>xnum0@_FillValue=-999.</div><div><br></div><div>a = ind(.not.ismissing(xnum0))</div><div>xlat = xlat0(a)</div><div>xlon=xlon0(a)</div><div>xnum=xnum0(a)</div><div>delete(a)</div><div><br></div><div><br></div><div>ilat=new(60,float)</div><div>ilon=new(70,float)</div><div>ilat=fspan(24.,50.,60)</div><div>ilon=fspan(-125.,-66.,70)</div></div><div style="font-family:宋体,arial,Verdana,sans-serif"><br></div><div style="font-family:宋体,arial,Verdana,sans-serif"><div>     ilon!0          = "lon"</div><div>     ilon@long_name  = "lon"</div><div>     ilon@units      = "degrees_east"</div><div>     ilat!0          = "lat"</div><div>     ilat@long_name  = "lat"</div><div>     ilat@units      = "degrees_north"</div></div><div style="font-family:宋体,arial,Verdana,sans-serif"><br></div><div style="font-family:宋体,arial,Verdana,sans-serif"><div>inter_num=cssgrid_Wrap(xlat,<wbr>xlon,xnum,ilat,ilon)</div><div>inter_num!0="lat"</div><div>inter_num!1="lon"</div><div>inter_num&lat=ilat</div><div>inter_num&lon=ilon</div></div><div style="font-family:宋体,arial,Verdana,sans-serif"><br></div><div style="font-family:宋体,arial,Verdana,sans-serif">----------annual_mean_w10.txt data-------</div><div style="font-family:宋体,arial,Verdana,sans-serif"><div>stn, lat, lon, ele, mean_w10</div><div>722010, 24.555000, -81.751999, 1.200000, 4.537894</div><div>722011, 28.290001, -81.436996, 25.000000, 3.302681</div><div>722012, 28.950001, -81.967003, 27.100000, 2.288134</div><div>722014, 28.474001, -82.454002, 23.500000, 2.497054</div><div>722015, 24.583000, -81.682999, 1.800000, 4.192316</div><div>722016, 24.726000, -81.052002, 2.400000, 3.525501</div><div>722017, 28.062000, -81.753998, 44.500000, 3.171314</div><div>722020, 25.788000, -80.317001, 8.800000, 3.824239</div><div>722021, 28.014000, -82.345001, 6.700000, 1.680814</div><div>722022, 26.378000, -80.108002, 4.000000, 4.132401</div><div>722024, 25.907000, -80.279999, 3.100000, 3.905527</div><div>722025, 26.072001, -80.153999, 3.400000, 4.092026</div><div>722026, 25.483000, -80.383003, 1.500000, 3.033066</div><div>722029, 25.648001, -80.432999, 3.100000, 3.654286</div><div>722060, 30.495001, -81.694000, 7.900000, 2.995290</div><div>722061, 39.466999, -106.150002, 3680.199951, 6.043694</div><div>722062, 31.476999, -82.861000, 78.300003, 1.999084</div><div>722065, 30.233000, -81.667000, 6.100000, 3.490778</div><div>722066, 30.400000, -81.417000, 4.900000, 3.516346</div><div>722067, 30.219000, -81.875999, 24.700001, 2.496306</div><div>722068, 30.336000, -81.514999, 12.500000, 3.205291</div><div>722069, 30.400000, -86.472000, 6.700000, 3.017413</div><div>722080, 32.898998, -80.041000, 12.200000, 3.542918</div><div>722081, 39.417000, -77.383003, 92.400002, 2.066125</div><div>722082, 42.245998, -89.582001, 261.799988, 3.683097</div></div></div><br><br><span title="neteasefooter"><p> </p></span><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>