[ncl-talk] interpolating arrays linint1_n

Cathy Smith cathy.smith at noaa.gov
Tue Mar 31 09:49:44 MDT 2020


Thank you both. That was it :):)

Cathy

On 3/31/20 9:44 AM, Dave Allured - NOAA Affiliate wrote:
> 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 <mailto: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
>     <http://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
>
-- 
----------------------------------------------
NOAA/ESRL PSD and CU CIRES
303-497-6263
https://www.esrl.noaa.gov/psd/people/cathy.smith/

Emails about data/webpages may get quicker responses from emailing
esrl.psd.data at noaa.gov

Like many, we are not working on site so some issues may not be addressed immediately. Please have patience and stay well.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200331/9e25ba0f/attachment.html>


More information about the ncl-talk mailing list