[ncl-talk] weighted average error
Cathy Smith
cathy.smith at noaa.gov
Tue Nov 28 08:56:35 MST 2017
NCLers
I assume this is an error on my part but I'm stumped. I have stripped
the code down to this (using opendap so it will work for others though
file is large). It works if I don't subset the area. NCL is 6.4.
Error is
fatal:Dimension (0) of (clat) is not named and therefore doesn't have an
associated coordinate variable
fatal:["Execute.c":8638]:Execute: Error occurred at or near line 11
begin
; path = "/Datasets/noaa.ersst.v5/sst.mnmean.nc"
path =
"https://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/noaa.ersst.v5/sst.mnmean.nc"
rad = 4*atan(1.0)/180
sstdatafile = addfile(path,"r")
sstall = sstdatafile->sst ; all of data
lat=sstdatafile->lat
clat = cos(rad*lat)
printVarSummary(clat)
sstall at missing_value=sstall at _FillValue
T1=wgt_areaave_Wrap(sstall(:,{25:45},{140:145}),clat({25:45}),1.0,0)
end
clat is printed as
Variable: clat
Type: float
Total Size: 356 bytes
89 values
Number of Dimensions: 1
Dimensions and sizes: [89]
Coordinates:
Cathy
--
----------------------------------------------
NOAA/ESRL PSD and CU CIRES
303-497-6263
http://www.esrl.noaa.gov/psd/people/cathy.smith/
Emails about data/webpages may get quicker responses from emailing
esrl.psd.data at noaa.gov
More information about the ncl-talk
mailing list