[ncl-talk] interpolating arrays linint1_n
Cathy Smith
cathy.smith at noaa.gov
Tue Mar 31 09:27:48 MDT 2020
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
******************************************************
--
----------------------------------------------
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.
More information about the ncl-talk
mailing list