Hi
I want to calculate the annual mean from 12 months hdf files, and then make a contour, below is what I did.
There is a fatal error as below
---------------------------------------------------------------------------------------------
fatal:Coordinate variables must be the same dimension as their dimension
fatal:Execute: Error occurred at or near line 43 in file
-------------------------------------------------------------------------------------------
line 43 is " var&lat = ispan(-42,42,1)*dlat "
Also the values of var is not correct. can anyone help to fix the problem?
Thanks,
Xiaoyan
================================
nlat = 85
nlon = 72
ntim = 12
do nt=0,ntim-1
fname = m+sprinti("%0.2i", nt+1)+".hdf"
print(fname)
in = addfiles(fname, "r") ;; load all the files
var0 = in[:]->variable_name
end do
var = dim_avg_n(var0, 0)
dlat = 170./nlat
dlon = 360./nlon
var!0 = "lat"
var&lat = ispan(-42,42,1)*dlat
var&lat@units = "degrees_north"
var!1 = "lon"
var&lon = ispan(-36,35,1)*dlon
var&lon@units = "degrees_east"
...
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Feb 7 13:45:36 2012