[ncl-talk] Error in lininit2points

Barry Lynn barry.h.lynn at gmail.com
Sat Aug 17 13:15:21 MDT 2019


Hi Jagan:

Do you understand the error message, but are not sure why you are getting
it?

The message means that the parameters within your interpolation line are
not dimensionally consistent.  If you look at the page that describes the
function, you might be able to figure out which of your variables does not
conform dimensionally.

If you've already gone past this point of trying to understand the error,
then please write back.

Barry

On Sat, Aug 17, 2019 at 8:06 PM jagan TNAU via ncl-talk <ncl-talk at ucar.edu>
wrote:

> 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.
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk



-- 
Barry H. Lynn, Ph.D
Senior Associate Scientist, Lecturer,
The Institute of the Earth Science,
The Hebrew University of Jerusalem,
Givat Ram, Jerusalem 91904, Israel
Tel: 972 547 231 170
Fax: (972)-25662581

C.E.O, Weather It Is, LTD
Weather and Climate Focus
http://weather-it-is.com
Jerusalem, Israel
Local: 02 930 9525
Cell: 054 7 231 170
Int-IS: x972 2 930 9525
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190817/550e129a/attachment.html>


More information about the ncl-talk mailing list