<div dir="ltr"><div><div>Hello All,<br><br></div>I have gridded satellite estimated 
rainfall and a file of precipitation measurements from gauges. I would 
like to Interpolate the gridded data to the gauge locations for 
comparison. I figured the function linint2_points might work for this 
process, but thus far I&#39;ve had no luck. I get no error message but the 
return value is just an array of missing values  (-999). My best guess 
is that my &quot;rain&quot; array isn&#39;t set up correctly for the function when it 
is read in from binary.<br><br></div><div>The 2 files have been placed on the FTP<br></div><div><br></div><div>I am running ncl version 6.0.0<br><br></div><div>thanks,<br></div><div>Steven Fuhrman<br><br></div>CODE:<br><br>begin<br><br>  load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl&quot; <br><br>;*****************************<wbr>******************************<br>; read in station data file <br>;*****************************<wbr>****************************** <br>  filename = &quot;guatamala_mon_rain.txt&quot;<br>  rows = numAsciiRow(filename)<br>  colls = numAsciiCol(filename)<br>  f = asciiread(filename,(/rows,<wbr>colls/),&quot;float&quot;)<br><br>;*****************************<wbr>******************************<br>; read in gridded estimated precip file <br>;*****************************<wbr>****************************** <br>  <br>  diri  = &quot;/cpc/fews/production/ARC/<wbr>MONTHLY/&quot;   ; input directory<br>  fili  = &quot;arc2_monthly_200010&quot;     ; DSET<br>  fName = diri+fili                     <wbr>  ; path<br><br>  nlat  = 801                           <wbr>  ; YDEF<br>  nlon  = 751                            ; XDEF<br>  nvars = 1                             <wbr>  ; vars<br><br>  year  = 2000                          <wbr>  ; TDEF<br>  ntim  = 1                             ; time steps<br>  nmos  = 1<br>   <br>                              <wbr>            ;create an array to contain data<br>  UNDEF = -999.0                        <wbr>  ; UNDEF<br>  rain     = new ( (/ntim,nlat,nlon/), float, UNDEF)   ;switched!<br><br>  rain@long_name = &quot;precipitation&quot;              ; VARS<br>  rain@units     = &quot;mm&quot;       <br>                               <br>                              <wbr>           <br>  do nt=0,ntim-1                   <wbr>       ; read each record: store in x<br>     rain(nt,:,:) = fbindirread(fName, nt, (/nlat,nlon/), &quot;float&quot;)  <br>  end do<br><br>  rain!0 = &quot;time&quot;<br>  rain!1 = &quot;lat&quot;<br>  rain!2 = &quot;lon&quot;<br>  printVarSummary(rain)<br>  print (&quot;min(rain)=&quot;+min(rain))<br>  print (&quot;max(rain)=&quot;+max(rain))<br><br>;*****************************<wbr>******************************<wbr>*<br>; Generate lat/lon that pairs with gridded data<br>;*****************************<wbr>******************************<wbr>*<br>  lon = fspan(-20,55,751)<br>  lon!0 = &quot;lon&quot;<br>  lon@long_name = &quot;longitude&quot;<br>  lon@units     = &quot;degrees_east&quot;<br><br>  lat = fspan(-40,40,801)<br>  lat!0 = &quot;lat&quot;<br>  lat@long_name = &quot;latitude&quot;<br>  lat@units     = &quot;degrees_north&quot;<br> <br>;*****************************<wbr>******************************<wbr>*<br>; count number of stations<br>;*****************************<wbr>******************************<wbr>*<br>count = 0<br>previous = f(0,0)<br>do i=1,rows-2<br>  if(f(i,0) .ne. previous)<br>    count = count + 1<br>;    print(f(i,0)+&quot; i am counting!&quot;+i)<br>  end if<br>  previous = f(i,0) <br>end do<br>print(&quot;count = &quot;+count)  <br><br>;*****************************<wbr>******************************<wbr>*<br>; make subset -an array with only a single date (year/month) for each station. <br>;*****************************<wbr>******************************<wbr>*<br>subset =new((/count,colls/),float,-<wbr>999)   <br>year = 2000<br>month = 1<br>line = 0<br>  do i=0,rows-1<br>    if ((f(i,1) .eq. year) .and. (f(i,2) .eq. month))<br>      subset(line,0) = f(i,0)<br>      subset(line,1) = f(i,1)<br>      subset(line,2) = f(i,2)<br>      subset(line,3) = f(i,3)<br>      subset(line,4) = f(i,4)<br>      subset(line,5) = f(i,5)<br>      line = line + 1<br>    end if<br>  end do<br><br>;*****************************<wbr>******************************<br>; perform interpolation with subset<br>;*****************************<wbr>******************************<br>interpolation = linint2_points(lon,lat,rain,<wbr>False,subset(:,4),subset(:,5),<wbr>0)   ; subset was formally x<br><br>print (interpolation)<br>end<br clear="all"><br>-- <br>
</div>