<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">Hi Dale,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">From your script "</font><span style="font-family:arial,sans-serif;font-size:12.800000190734863px;color:rgb(34,34,34)"> lat2d = <span class="" id=":xc.10" tabindex="-1" style="">iz</span>->lat </span><span style="font-family:arial,sans-serif;font-size:12.800000190734863px;color:rgb(34,34,34)">lon2d = <span class="" id=":xc.11" tabindex="-1" style="">iz</span>-><span class="" id=":xc.12" tabindex="-1" style="">lon</span>", it looks like to me the lat <span class="" id=":xc.13" tabindex="-1" style="">lon</span> variables are 2D, and the linint2 function only works on 1D lat <span class="" id=":xc.14" tabindex="-1" style="">lon</span>, therefore you got the error saying they are not monotonically increasing</span><span style="font-size:12.800000190734863px;color:rgb(34,34,34)">. Is the grid <span class="" id=":xc.15" tabindex="-1" style="">curvelinear</span>? If so, you could check<font face="arial, helvetica, sans-serif"> </font></span><span style="font-size:13.333333015441895px;margin:0px;padding:0px"><font face="arial, helvetica, sans-serif">rcm2rgrid </font></span><span style="margin:0px;padding:0px"><font face="arial, helvetica, sans-serif">function which works on <span class="" id=":xc.16" tabindex="-1" style="">curvelinear</span> lat <span class="" id=":xc.17" tabindex="-1" style="">lon</span> (2D).</font></span></div><div class="gmail_default" style="color:rgb(0,0,0)"><span style="margin:0px;padding:0px"><font face="arial, helvetica, sans-serif"><br></font></span></div><div class="gmail_default" style="color:rgb(0,0,0)"><span style="margin:0px;padding:0px"><font face="arial, helvetica, sans-serif">Best,</font></span></div><div class="gmail_default" style="color:rgb(0,0,0)"><span style="margin:0px;padding:0px"><font face="arial, helvetica, sans-serif"><span class="" id=":xc.18" tabindex="-1" style="">Meina</span></font></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 15, 2017 at 4:15 PM, dale zuri <span dir="ltr"><<a href="mailto:dalezuri@gmail.com" target="_blank">dalezuri@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi <br></div>I need help to regrid irregular two dimensional grid to regular. Could someone help me to fix this issue? <br></div>I am getting this warning message <br><br>warning:linint2: xi, yi, xo, and yo must be monotonically increasing<br>I would appreciate any help and suggestions. <br><br>Thanks<br><br>begin<br>yr="2015"<br>;*****************************<wbr>*************************<br>;;;;CFS begins;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;<br>a1 = addfile("/import/c1/NCARCCM/h/<wbr>marchforecast/<a href="http://psa_mask_cfsv2.nc" target="_blank">psa_mask_cfsv2.<wbr>nc</a>","r")<br>;print(a1)<br>mas1=a1->mask<br><br>;;;;;;;;;;;;0----LAnd only--1-20 PSA;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;<br>mas1=where(mas1.ge.2,1,mas1@_<wbr>FillValue)<br><br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;<br>f1 = addfile("/import/c1/NCARCCM/h/<wbr>marchforecast/mar1982-2010/<a href="http://simpleWunit.2005031212.nc" target="_blank">sim<wbr>pleWunit.2005031212.nc</a>", "r") ; note the "s" of addfile<br>T1 = f1->precSum ; read T from all files<br>printVarSummary (T1)<br>latnew=f1->lat_0<br>lonnew=f1->lon_0<br>;---Mask the "ts" variable across all time steps and copy metadata.<br> T_mask1 = mask(T1,mas1,1)<br> copy_VarMeta(T1,T_mask1)<br>printVarSummary(T_mask1)<br>zAvgTime1=T_mask1<br>printVarSummary(zAvgTime1)<br>;*****************************<wbr>***********************<br>;;;;;;ERA BEGINS;;;;;;;;;;;;;;;;;;<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;<br>a = addfile("<a href="http://psa_wrf.nc" target="_blank">psa_wrf.nc</a>","r")<br>print(a)<br>mas=a->mask<br>printVarSummary(mas)<br>printMinMax(mas,0)<br>;;;;;;;;;;;;0----LAnd only--1-20 PSA;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;<br>mas=where(mas.ge.2,1,mas@_<wbr>FillValue)<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;<br> iz = addfile("<a href="http://landsea2_wrf.nc" target="_blank">landsea2_wrf.nc</a>","r")<br> lat2d = iz->lat<br> lon2d = iz->lon<br> ;mas2=iz->mask<br>;;;;;;;;;;;;;;;;;;;;;;;;;;year selection;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;<br> diri = "/import/c1/NCARCCM/h/era/<wbr>yearsnotuse/" ; input directory<br> fils = systemfunc ("ls "+diri+"era-down_"+yr+"*.nc") ; file paths<br> f = addfiles (fils, "r") ; note the "s" of addfile<br> ListSetType (f, "cat") <br> T = f[:]->p ; read T from all files<br> printVarSummary (T)<br> T!1="lon2d"<br> T!2="lat2d"<br> T@lon2d = lon2d<br> T@lat2d = lat2d<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;<br>;---Mask the "ts" variable across all time steps and copy metadata.<br> T_mask = mask(T,mas,1)<br> copy_VarMeta(T,T_mask)<br>printVarSummary(T_mask)<br>zAvgTime=T_mask<br>zAvgTime_FillValue = -999<br>printVarSummary(zAvgTime)<br>printVarSummary(zAvgTime(0,:,<wbr>0))<br>printVarSummary(lon2d)<br>printVarSummary(lat2d)<br>printMinMax(lon2d(0,:),0)<br>printMinMax(lat2d(:,0),0)<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;;<br>;;;;;;Interpolation Step;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;<br>newsst = linint2(lon2d(:,0),lat2d(0,:),<wbr>zAvgTime,True,lonnew,latnew,0)<br>return<br></div>end<br></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><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><font size="2" color="#000000" style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif">Meina Wang</font><div><font size="2" color="#000000" style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif">PhD candidate in Atmospheric Science</font></div><div><font size="2" color="#000000" style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif">Department of Land, Air and Water Resources</font></div><div><font size="2" color="#000000" style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif">University of California, Davis</font></div><div><font size="2" color="#000000" style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif">Davis, CA 95616</font></div></div></div></div></div>
</div>