<div dir="ltr"><div><div>The following is not the approach to use for reversing a grid's order.<br>The following only changes the (local) variable 'lat'.  <br><br>It has *no* effect on the variable data structure. <br></div><br>fi=addfile("<a href="http://wind.nc">wind.nc</a>","r")<br>lat=fi->lat<br>lon=fi->lon<br>lat=lat(::-1)                ; latitude only<br>printVarSummary(lat)<br><br></div>Assuming your input grids are ordered North->South, change to:<br><div><br>fi=addfile("<a href="http://wind.nc">wind.nc</a>","r"))<br>uwnd=month_to_season(fi->uwnd(276:635,30,:,:),"DJF")<br>vwnd=month_to_season(fi->vwnd(276:635,30,:,:),"DJF")<br>uwnd=uwnd(:,::-1,:)<br>vwnd=vwnd(:,::-1,:)<br>printVarSummary(uwnd)  ; ordered South to North<br>printVarSummary(vwnd)<br><br></div><div>Same for <a href="http://rainfall.nc">rainfall.nc</a>, if ordered North->South<br><br>====<br>uwnd_ave=dim_avg_n_Wrap(uwnd,0)<br>vwnd_ave=dim_avg_n_Wrap(vwnd,0)<br></div><div>printVarSummary(uwnd_ave)            ; look at coordinates<br></div><div><br></div><div>The <b>*only</b>* reason for the South->North ordering is that linint2_Wrap requires that order.<br><br></div><div>The following explicitly illustrates using the lat & lon associated with the variable's data structure.<br></div><div><br>uwnd_jra=linint2_Wrap (uwnd_ave&lon, uwnd_ave&lat, uwnd_ave, True, lon0,lat0, 0)<br>vwnd_jra=linint2_Wrap (vwnd_ave&lon, vwnd_ave&lat,  vwnd_ave, True, lon0,lat0, 0)<br>printVarSummary(uwnd_jra)            ; look at coordinates<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 3, 2018 at 2:48 PM, 刘振 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>Dear all,</div><div><br></div><div>  I am using ncl to plot 850hPa-wind. But after I interpolate the original wind to another resolution. It seems to me the latitude reversed (attached the 1st and 2nd plot[The wind from original file is right]). I try to use ::-1 for latitude to reverse the plot but failed (attached 3rd plot). Could you please help me to solve the problem? Thanks.</div><div><br></div><div>Best regards,</div><div>zhen </div><div><br></div><div><div style="color:#909090;font-family:Arial Narrow;font-size:12px">------------------</div><div style="font-size:14px;font-family:Verdana;color:#000"><div>刘振</div>
<div>中山大学<br>环境科学与工程学院<br>大气科学系<br>Phone: <a href="tel:+86%20150%201324%206049" value="+8615013246049" target="_blank">+86-15013246049</a></div>
<div>Liu  Zhen</div>
<div>Department of Atmospheric Science<br>School of Environmental Science and Engineering</div>
<div>Sun Yat-sen University<br>Email address: <font color="#7f7f7f"><a href="mailto:liuzhen9@mail2.sysu.edu.cn" target="_blank">liuzhen9@mail2.sysu.edu.cn</a></font> </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>