<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Thank you Adam<div><br></div><div>I am trying to do regredding the data using the function linint2_Wrap.&nbsp;</div><div>I got warning&nbsp;</div><div><b>"warning:linint2: xi, yi, xo, and yo must be monotonically increasing”</b></div><div>therefore I think it is due to LON values.&nbsp;</div><div>How I can remove the warning?&nbsp;</div><div><br></div><div><br></div><div><div>&nbsp; diri &nbsp; &nbsp;= "/Users/spark/vertical/00_DATA/"</div><div>&nbsp; fili &nbsp; &nbsp;= "precipmonmean.nc"</div><div>&nbsp; f &nbsp; &nbsp; &nbsp; = addfile (diri+fili+".nc", "r")</div><div>&nbsp; varname = "precip"</div><div>&nbsp; data = f-&gt;$varname$</div><div><br></div><div>&nbsp; LON &nbsp; &nbsp; = f-&gt;lon ({0:360}) &nbsp;;</div><div>&nbsp; LAT &nbsp; &nbsp; = f-&gt;lat ;({-90:90}) &nbsp;;</div><div>; &nbsp;LON &nbsp; &nbsp; = lonFlip(LON1)</div><div><br></div><div>&nbsp; printVarSummary(data)</div><div>&nbsp; data1 = lonFlip(data)</div><div>&nbsp; printVarSummary(data1)</div><div><br></div><div>&nbsp; lat = fspan(-85,85,85)</div><div>&nbsp; lon = fspan(-180,180,72)</div><div>&nbsp; lat@units = "degrees_east"</div><div>&nbsp; lon@units = "degrees_north"</div><div>&nbsp; precipreg = linint2_Wrap(LON,LAT,data1,True,lon,lat,0)</div><div>printVarSummary(precipreg)</div></div><div><br><div><div>On Feb 20, 2015, at 7:17 AM, Adam Phillips &lt;<a href="mailto:asphilli@ucar.edu">asphilli@ucar.edu</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hi Sunmin,<div>lonFlip flips the attached longitude <i>coordinate variable,</i> and not the array itself. Try:</div><div>printVarSummary(data)</div><div>data = lonFlip(data)&nbsp;</div><div>printVarSummary(data)</div><div>If you have any further questions please respond to ncl-talk.</div><div>Adam</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 20, 2015 at 8:04 AM, Sunmin Park <span dir="ltr">&lt;<a href="mailto:mireiyue@gmail.com" target="_blank">mireiyue@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">Dear NCL users<br>
<br>
I am trying to change longitude 0,360 to -180,180. I used the function lonFlip to change longitude but it has wrong values. When I use printVarSummary the coordinate looks fine but when I print it out (print) it doesn’t change LON (the file that I am using is GPCP monthly mean precipitation from NCAR) How can I get correct LON (-180,180)?<br>
<br>
Thank you in advance,<br>
Sun-<br>
<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br>
<br>
begin<br>
<br>
;==============================================================<br>
; Open the file:<br>
;================================================================<br>
<br>
&nbsp; diri&nbsp; &nbsp; = "/Users/spark/vertical/00_DATA/"<br>
&nbsp; fili&nbsp; &nbsp; = "<a href="http://precipmonmean.nc/" target="_blank">precipmonmean.nc</a>"<br>
&nbsp; f&nbsp; &nbsp; &nbsp; &nbsp;= addfile (diri+fili+".nc", "r")<br>
&nbsp; varname = "precip"<br>
&nbsp; data = f-&gt;$varname$<br>
<br>
&nbsp; LON1&nbsp; &nbsp; &nbsp;= f-&gt;lon ;({-180:180})&nbsp; ;<br>
&nbsp; LAT&nbsp; &nbsp; &nbsp;= f-&gt;lat ;({-90:90})&nbsp; ;<br>
&nbsp; LON&nbsp; &nbsp; &nbsp;= lonFlip(LON1)<br>
<br>
&nbsp; printVarSummary(data)<br>
&nbsp; printVarSummary(LON)<br>
&nbsp; print(LON)<br>
return<br>
<br>
<br>
Variable: LON<br>
Type: float<br>
Total Size: 576 bytes<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 144 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes:&nbsp; &nbsp;[lon | 144]<br>
Coordinates:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lon: [-178.75..178.75]<br>
Number Of Attributes: 6<br>
&nbsp; units :&nbsp; &nbsp; &nbsp; &nbsp;degrees_east<br>
&nbsp; long_name :&nbsp; &nbsp;Longitude<br>
&nbsp; actual_range :&nbsp; &nbsp; &nbsp; &nbsp; ( 1.25, 358.75 )<br>
&nbsp; standard_name :&nbsp; &nbsp; &nbsp; &nbsp;longitude<br>
&nbsp; axis :&nbsp; &nbsp; &nbsp; &nbsp; X<br>
&nbsp; lonFlip :&nbsp; &nbsp; &nbsp;longitude coordinate variable has been reordered via lonFlip<br>
<br>
(0)&nbsp; &nbsp; &nbsp;181.25<br>
(1)&nbsp; &nbsp; &nbsp;183.75<br>
(2)&nbsp; &nbsp; &nbsp;186.25<br>
(3)&nbsp; &nbsp; &nbsp;188.75<br>
(4)&nbsp; &nbsp; &nbsp;191.25<br>
(5)&nbsp; &nbsp; &nbsp;193.75<br>
(6)&nbsp; &nbsp; &nbsp;196.25<br>
(7)&nbsp; &nbsp; &nbsp;198.75<br>
(8)&nbsp; &nbsp; &nbsp;201.25<br>
(9)&nbsp; &nbsp; &nbsp;203.75<br>
(10)&nbsp; &nbsp; 206.25<br>
.<br>
.<br>
.<br>
(135)&nbsp; &nbsp;158.75<br>
(136)&nbsp; &nbsp;161.25<br>
(137)&nbsp; &nbsp;163.75<br>
(138)&nbsp; &nbsp;166.25<br>
(139)&nbsp; &nbsp;168.75<br>
(140)&nbsp; &nbsp;171.25<br>
(141)&nbsp; &nbsp;173.75<br>
(142)&nbsp; &nbsp;176.25<br>
(143)&nbsp; &nbsp;178.75<br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist,&nbsp; </font></span><span><font color="#888888">Climate and Global Dynamics Division, NCAR<br></font></span></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a>&nbsp;&nbsp; </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div>
</div>
</blockquote></div><br></div></body></html>