<div dir="ltr"><div class="gmail_default" style="font-size:small">Grace,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Bill is correct that you need to subtract one from the wrf_user_ll_to_ij result. You said "add 1" in your previous email, which is not correct.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You are calling wrf_user_ll_to_ij, but then hard-coding the values for x_start, x_end, y_start, y_end. This is dangerous. You should use the calculated values:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><font face="monospace, monospace"> loc1=wrf_user_ll_to_ij(a,105.0,32.0,tes)</font></div><div class="gmail_default"><font face="monospace, monospace"> ;print("X/Y location is: "+ loc1)</font></div><div class="gmail_default"><font face="monospace, monospace"> </font></div><div class="gmail_default"><font face="monospace, monospace"> loc2=wrf_user_ll_to_ij(a,112.0,38.0,tes)</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace"> loc1 = loc1 - 1 ; wrf_user_ll_to_ij returns 1..n, NCL</font></div><div class="gmail_default"><font face="monospace, monospace"> loc2 = loc2 - 1 ; needs 0 to n-1</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace"> ; print("X/Y location is: "+ loc2)</font></div><div class="gmail_default"><font face="monospace, monospace"><div class="gmail_default"> res@Xstart = loc1(0) ; Set the zoom in coordinates</div><div class="gmail_default"> res@Xend = loc1(1)</div><div class="gmail_default"> res@Ystart = loc2(0)</div><div class="gmail_default"> res@Yend = loc2(1)</div></font></div><div class="gmail_default"><font face="monospace, monospace">; x_start = 15</font></div><div class="gmail_default"><font face="monospace, monospace">; x_end = 227</font></div><div class="gmail_default"><font face="monospace, monospace">; y_start = 71</font></div><div class="gmail_default"><font face="monospace, monospace">; y_end = 274</font></div><div><br></div><div>--Mary</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 27, 2016 at 6:50 PM, grace <span dir="ltr"><<a href="mailto:313695096@qq.com" target="_blank">313695096@qq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div> I have add 1 to the i,j ,but the output data are not <span>correspond to the plots too.The distance between the location of output data and the location of the plot I already drawed is more than ten kilometers ,it is not just one or two grid.</span></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>