[ncl-talk] interpolating arrays linint1_n

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Tue Mar 31 09:44:38 MDT 2020


The last two arguments of the function call should be 0, 1; not 1, 0.


On Tue, Mar 31, 2020 at 9:28 AM Cathy Smith via ncl-talk <ncl-talk at ucar.edu>
wrote:

> Hi
>
> I was hoping someone could show me the error of my ways vis a vis NCL. I
> have this code below which ideally interpolates the original godas data
> to different vertical coordinates for one year, all lats/lons. I get the
> error below on the 'dim-th dimension'. I do print out the arrays
> metadata and they appear to me to be correct. I am using the same
> variable names as the NCL example. I assume I have a conceptual error.
> Any ideas? Thanks!
>
> Cathy Smith
>
> Code:
>
> xo = (/5.,10., 20., 30., 50., 75., 100., 125., 150., 175, 200, 250.,
> 300., 400., 500., 750., 1000., 1500./)  ;
>
> ;a = addfile("/Datasets/godas/pottmp.1980.nc","r")
> a =
> addfile("
> http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/godas/pottmp.1980.nc
> ","r")
>
> xi = a->level
>
> fi=short2flt(a->pottmp)
> printVarSummary(xi)
> printVarSummary(xo)
> printVarSummary(xi)
>
> xo   = linint1_n (xi, fi, False, xo, 1, 0)
>
> **********************
>
> slightly editted output.
>
> Variable: xi
> Type: float
> Dimensions and sizes:    [level | 40]
>
> Variable: xo
> Type: float
> Number of Dimensions: 1
> Dimensions and sizes:    [18]
>
> Variable: fi
> Type: float
> Number of Dimensions: 4
> Dimensions and sizes:    [time | 12] x [level | 40] x [lat | 418] x [lon
> | 360]
>
> fatal:linint1_n: The dim-th dimension of fi must be the same length as xi
> fatal:["Execute.c":8635]:Execute: Error occurred at or near line 12
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200331/8f9049a6/attachment.html>


More information about the ncl-talk mailing list