[ncl-talk] Error in lininit2points

jagan TNAU jagan at tnau.ac.in
Sat Aug 17 11:06:39 MDT 2019


Dear Users,

I was trying to interpolate gridded data to some station locations
using linint2_points function with the following script.
;----------------------------------------------------------------------
; lin2points.ncl
;----------------------------------------------------------------------
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

begin
;************************************************
; read ascii input file
;************************************************
  values = asciiread("/Users/Jag/Desktop/cdz-regrid/var.txt",-1,"float")
  nvals = dimsizes(values)
  ncols = 8
  nrows = ncols/nvals
  lat  = values(0::ncols)
  lon  = values(1::ncols)
  srad = values(2::ncols)
  tmax = values(3::ncols)
  tmin = values(4::ncols)
  rain = values(5::ncols)
  wind = values(6::ncols)
  rhum = values(7::ncols)
;************************************************

; Lat*lon array 11*11 = 121 rows read from the files
; lat = (/10.0, 10.2, 10.4, 10.6, 10.8, 11.0, 11.2, 11.4, 11.6, 11.8, 12.0/)
; lon = (/78.0, 78.2, 78.4, 78.6, 78.8, 79.0, 79.2, 79.4, 79.6, 79.8, 80.0/)

; points for which interpolation required totally 30
  nlat=(/10.38, 10.40/)
  nlon=(/79.85, 79.49/)

  ntmax = linint2_points(lat,lon,tmax,False,nlat,nlon,0)

; Print only tmax as a sample
 print(ntmax)

; nsrad = linint2_points(lat,lon,srad,False,nlat,nlon,0)
; ntmin = linint2_points(lat,lon,tmin,False,nlat,nlon,0)
; nrain = linint2_points(lat,lon,rain,False,nlat,nlon,0)
; nwind = linint2_points(lat,lon,wind,False,nlat,nlon,0)
; nrhum = linint2_points(lat,lon,rhum,False,nlat,nlon,0)

;  alist   = [/nsrad,ntmax,ntmin,nrain,nwind,nrhum/]
;  write_table("tmp11.txt", "w", alist, "%6.1f%6.1f%6.1f%7.1f%6.1f%6.1f")

end
-----------------------------------------------
But I encountered the following error

fatal:linint2_points: The rightmost dimensions of fi must be nyi x nxi,
where nyi and nxi are the lengths of yi and xi respectively

fatal:["Execute.c":8637]:Execute: Error occurred at or near line 32 in file
lin2points.ncl


Will you please help me to solve the problem. Sample file attached


-- 
With regards

Dr.R.Jagannathan
Professor & Former Dean
Tamil Nadu Agricultural University
Coimbatore - 641 003 India

PHONE:  Mob: +91 94438 89891

DO NOT PRINT THIS E-MAIL UNLESS NECESSARY. THE ENVIRONMENT CONCERNS US ALL.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190817/95c75cdf/attachment.html>
-------------- next part --------------
10.0   78.0	  12.3   28.4   15.1     0.4   29.3   78.2
10.0   78.2	  16.9   29.5   15.3     0.1   30.2   81.0
10.0   78.4	  16.0   29.7   15.6     0.4   30.4   87.6
10.0   78.6	  15.5   30.0   16.2     0.4   28.9   89.3
10.0   78.8	  16.4   30.5   17.1     0.6   27.3   89.8
10.0   79.0	  17.8   30.8   18.1     0.6   27.0   91.2
10.0   79.2	  18.6   30.8   19.5     0.2   27.9   90.6
10.0   79.4	  18.9   30.6   21.0     0.2   29.2   86.7
10.0   79.6	  18.9   30.4   21.5     0.2   30.1   85.3
10.0   79.8	  19.5   29.4   21.7     0.2   32.8   85.5
10.0   80.0	  20.0   28.7   21.9     0.2   34.5   85.5
10.2   78.0	  12.5   27.9   13.9     0.3   25.7   84.7
10.2   78.2	  15.3   28.9   14.2     0.2   27.1   82.9
10.2   78.4	  15.3   29.6   14.9     0.4   27.5   83.4
10.2   78.6	  15.1   29.9   15.6     0.6   27.0   83.2
10.2   78.8	  16.0   30.3   16.5     0.6   26.3   84.3
10.2   79.0	  17.6   30.7   17.6     0.5   26.0   88.3
10.2   79.2	  18.3   30.9   18.5     0.2   26.0   92.8
10.2   79.4	  18.8   30.8   20.0     0.2   26.6   89.3
10.2   79.6	  19.4   30.5   21.5     0.2   28.5   85.1
10.2   79.8	  18.9   30.3   21.5     0.2   29.8   85.0
10.2   80.0	  19.4   29.4   21.7     0.2   32.1   85.2
10.4   78.0	  12.3   27.6   13.7     0.2   19.3   87.6
10.4   78.2	  13.8   28.6   13.9     0.1   21.1   85.8
10.4   78.4	  14.4   29.3   14.5     0.4   22.0   83.1
10.4   78.6	  14.8   29.8   15.2     0.6   22.8   82.1
10.4   78.8	  15.6   30.3   16.1     0.5   23.9   83.1
10.4   79.0	  16.5   30.8   17.0     0.3   25.0   86.1
10.4   79.2	  17.3   31.1   17.6     0.2   25.2   90.5
10.4   79.4	  17.9   31.2   19.0     0.3   23.7   91.0
10.4   79.6	  18.9   30.9   20.5     0.2   24.1   89.0
10.4   79.8	  19.8   30.5   21.9     0.1   28.0   83.4
10.4   80.0	  18.9   30.1   21.5     0.2   29.5   84.8
10.6   78.0	  14.0   28.7   14.2     0.2   14.4   85.9
10.6   78.2	  13.5   29.1   14.1     0.4   15.9   83.9
10.6   78.4	  14.1   29.5   14.1     0.5   16.8   81.3
10.6   78.6	  14.4   29.8   14.7     0.4   18.5   81.1
10.6   78.8	  14.9   30.2   15.7     0.4   21.3   82.2
10.6   79.0	  15.7   30.7   16.7     0.3   23.9   83.9
10.6   79.2	  16.8   31.3   17.4     0.3   24.8   86.5
10.6   79.4	  17.1   31.4   18.4     0.2   23.1   87.9
10.6   79.6	  17.9   31.1   19.9     0.2   20.2   90.3
10.6   79.8	  19.1   30.7   21.5     0.2   25.3   84.3
10.6   80.0	  19.7   30.3   22.0     0.1   28.0   83.1
10.8   78.0	  16.3   29.8   14.8     0.3   12.4   84.3
10.8   78.2	  14.7   29.8   14.4     0.6   13.3   81.7
10.8   78.4	  14.7   29.9   14.0     0.4   14.2   79.6
10.8   78.6	  14.4   29.8   14.4     0.3   16.7   80.5
10.8   78.8	  14.0   29.9   15.5     0.3   20.2   81.6
10.8   79.0	  14.3   30.4   16.6     0.3   23.3   82.1
10.8   79.2	  15.6   31.3   17.3     0.3   24.4   83.5
10.8   79.4	  16.5   31.6   18.1     0.2   22.4   84.7
10.8   79.6	  17.4   31.3   19.7     0.2   18.7   89.4
10.8   79.8	  18.3   30.8   21.2     0.3   24.7   84.4
10.8   80.0	  19.8   30.4   21.9     0.1   27.2   82.9
11.0   78.0	  17.9   30.6   15.1     0.3   12.7   83.6
11.0   78.2	  17.0   30.4   14.6     0.5   13.7   80.7
11.0   78.4	  16.7   30.1   13.9     0.3   15.4   79.6
11.0   78.6	  15.5   29.7   14.2     0.2   18.4   80.5
11.0   78.8	  13.5   29.5   15.3     0.4   21.4   81.1
11.0   79.0	  12.4   30.0   16.5     0.6   23.6   80.8
11.0   79.2	  13.5   31.0   17.2     0.7   24.4   80.9
11.0   79.4	  14.8   31.4   17.9     0.6   22.5   81.7
11.0   79.6	  16.3   31.5   19.5     0.6   18.7   87.1
11.0   79.8	  17.6   30.8   20.8     0.4   24.1   84.7
11.0   80.0	  19.4   30.4   21.7     0.1   26.5   83.5
11.2   78.0	  18.9   31.1   15.1     0.2   14.5   82.1
11.2   78.2	  19.2   30.6   14.4     0.4   16.9   79.8
11.2   78.4	  19.0   30.1   13.5     0.2   19.6   81.1
11.2   78.6	  17.6   29.5   14.0     0.1   22.2   81.2
11.2   78.8	  14.3   29.2   15.2     0.4   23.6   80.6
11.2   79.0	  11.4   29.6   16.4     1.0   24.2   79.5
11.2   79.2	  11.8   30.5   17.1     1.4   24.8   77.7
11.2   79.4	  12.2   30.9   17.7     1.4   23.6   79.0
11.2   79.6	  14.3   31.2   19.4     1.3   19.9   84.4
11.2   79.8	  16.9   30.8   20.5     0.5   23.5   84.9
11.2   80.0	  19.1   30.4   21.5     0.1   25.8   84.0
11.4   78.0	  19.9   30.7   14.8     0.1   17.4   80.6
11.4   78.2	  19.8   29.8   13.9     0.0   22.3   80.2
11.4   78.4	  19.5   29.7   13.0     0.2   24.8   84.1
11.4   78.6	  18.7   29.4   13.8     0.3   25.6   83.9
11.4   78.8	  16.2   29.3   15.1     0.4   25.2   81.6
11.4   79.0	  13.1   29.7   16.3     0.8   24.7   78.4
11.4   79.2	  12.0   30.3   17.0     1.5   25.0   74.8
11.4   79.4	  11.6   30.5   17.8     2.1   24.2   76.9
11.4   79.6	  13.0   30.6   19.4     1.6   22.2   83.8
11.4   79.8	  16.3   30.8   20.2     0.5   23.2   85.1
11.4   80.0	  18.7   30.4   21.3     0.1   25.0   84.5
11.6   78.0	  20.2   29.8   14.6     0.0   20.6   78.7
11.6   78.2	  18.8   27.9   13.5     0.2   27.4   81.1
11.6   78.4	  17.1   27.6   12.7     0.4   29.6   83.4
11.6   78.6	  15.9   28.1   13.2     0.5   28.9   84.1
11.6   78.8	  15.4   29.0   14.6     0.4   26.6   82.5
11.6   79.0	  15.2   29.8   16.2     0.3   24.9   78.3
11.6   79.2	  14.8   30.3   17.1     0.3   25.1   73.5
11.6   79.4	  14.0   30.6   17.7     0.4   24.4   76.3
11.6   79.6	  14.2   30.5   19.1     0.3   23.7   80.9
11.6   79.8	  15.6   30.8   19.8     0.5   22.9   85.3
11.6   80.0	  18.4   30.4   21.0     0.2   24.2   85.0
11.8   78.0	  17.8   28.9   14.0     0.1   23.8   80.5
11.8   78.2	  17.2   27.6   12.8     0.5   28.3   83.8
11.8   78.4	  15.8   27.1   12.2     1.1   28.5   84.8
11.8   78.6	  14.6   27.5   12.7     1.1   26.9   86.2
11.8   78.8	  13.8   28.3   14.0     0.9   24.8   84.8
11.8   79.0	  13.8   29.2   15.6     0.7   23.8   79.1
11.8   79.2	  14.2   30.3   16.9     0.3   24.6   73.0
11.8   79.4	  14.0   30.8   17.7     0.3   24.4   76.4
11.8   79.6	  14.6   30.8   18.4     0.2   23.6   79.9
11.8   79.8	  15.0   30.9   19.4     0.4   22.7   85.6
11.8   80.0	  18.1   30.5   20.7     0.2   23.3   85.7
12.0   78.0	  15.7   27.9   13.6     0.3   23.9   83.9
12.0   78.2	  15.2   27.6   12.7     0.6   25.6   87.1
12.0   78.4	  14.5   27.5   12.4     0.8   24.0   86.1
12.0   78.6	  14.2   27.9   12.6     0.6   22.0   86.9
12.0   78.8	  13.7   28.5   13.7     0.6   21.2   84.9
12.0   79.0	  13.1   29.2   15.0     0.7   22.1   78.3
12.0   79.2	  13.4   30.1   15.9     0.4   24.0   72.2
12.0   79.4	  13.9   30.6   17.7     0.3   24.4   75.4
12.0   79.6	  14.7   30.9   17.8     0.3   22.8   78.3
12.0   79.8	  14.8   31.0   18.9     0.2   22.6   85.1
12.0   80.0	  17.7   30.6   20.3     0.1   22.4   86.3


More information about the ncl-talk mailing list