<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>;******************************************************<br>;;;;CFS begins;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>a1    = addfile("/import/c1/NCARCCM/h/marchforecast/<a href="http://psa_mask_cfsv2.nc">psa_mask_cfsv2.nc</a>","r")<br>;print(a1)<br>mas1=a1->mask<br><br>;;;;;;;;;;;;0----LAnd only--1-20 PSA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>mas1=where(mas1.ge.2,1,mas1@_FillValue)<br><br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>f1    = addfile("/import/c1/NCARCCM/h/marchforecast/mar1982-2010/<a href="http://simpleWunit.2005031212.nc">simpleWunit.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>;****************************************************<br>;;;;;;ERA BEGINS;;;;;;;;;;;;;;;;;;<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>a    = addfile("<a href="http://psa_wrf.nc">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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>mas=where(mas.ge.2,1,mas@_FillValue)<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>  iz = addfile("<a href="http://landsea2_wrf.nc">landsea2_wrf.nc</a>","r")<br>  lat2d = iz->lat<br>  lon2d = iz->lon<br> ;mas2=iz->mask<br>;;;;;;;;;;;;;;;;;;;;;;;;;;year selection;;;;;;;;;;;;;;;;;;;;;;;;;<br>   diri = "/import/c1/NCARCCM/h/era/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>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<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,:,0))<br>printVarSummary(lon2d)<br>printVarSummary(lat2d)<br>printMinMax(lon2d(0,:),0)<br>printMinMax(lat2d(:,0),0)<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>;;;;;;Interpolation Step;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>newsst = linint2(lon2d(:,0),lat2d(0,:),zAvgTime,True,lonnew,latnew,0)<br>return<br></div>end<br></div>