Dear NCL users
I was suggested a script to calculate unweighted seasonal means . But when I
try to run, appears some errors. Can anyone help me ?
Version of my NCL is 5.2.0
=========================================================================================
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
yrStrt = 1998
yrLast = 2004
nyrs = yrLast-yrStrt+1
klev = 17
nlat = 73
mlon = 144
ntim = 12*nyrs ; number of months
wMon = new ( (/ntim,klev,nlat,mlon/), "float", 1e20)
tMon = new ( ntim, "double", "No_FillValue")
diru = "/home/Vishali/Documents/dadosVentos/Speed/"
filu = systemfunc("cd "+diru+" ; ls wind*nc")
nfilu = dimsizes(filu)
; calculate monthly means from 6hrly
nmoStrt = 0
nmoLast = 11
do nf=0,nfilu-1
f = addfile(diru+filu(nf), "r")
w = f->WSpeed
wMon(nmoStrt:nmoLast,:,:,:) = calculate_monthly_values(w, "avg",0,
False)
nmoStrt = nmoStrt+12
nmoLast = nmoLast+12
delete(w) ; may change size next iteration (leap yr)
end do
delete(wMon&time)
printVarSummary(wMon) ; wMon(84,17,73,144)
time = yyyymm_time(yrStrt, yrLast, "integer")
wMon&time = time
wMon!1 = "level" ; minor bug in "calculate_monthly_values"
wMon&level = f->level
printVarSummary(wMon)
; unweighted seasonal means
wAllSea = wgt_runave_n_Wrap(wMon, 3, 0, 0)
printVarSummary(wAllSea)
wSea = wAllSea(::3,:,:,:) ; (28,14,73,144)
printVarSummary(wSea)
======================================================================
fatal:Undefined identifier: (calculate_monthly_values) is undefined, can't
continue
fatal:Execute: Error occurred at or near line 25 in file new file.ncl
fatal:(time) is not a named dimension in variable (wMon).
fatal:Execute: Error occurred at or near line 30 in file new file.ncl
Variable: wMon
Type: float
Total Size: 60044544 bytes
15011136 values
Number of Dimensions: 4
Dimensions and sizes: [84] x [17] x [73] x [144]
Coordinates:
Number Of Attributes: 1
_FillValue : 1e+20
fatal:(time) is not a named dimension in variable (wMon).
fatal:Execute: Error occurred at or near line 35 in file new file.ncl
Variable: wMon
Type: float
Total Size: 60044544 bytes
15011136 values
Number of Dimensions: 4
Dimensions and sizes: [84] x [level | 17] x [73] x [144]
Coordinates:
level: [1000..10]
Number Of Attributes: 1
_FillValue : 1e+20
fatal:Undefined identifier: (wgt_runave_n_Wrap) is undefined, can't continue
fatal:Execute: Error occurred at or near line 42 in file new file.ncl
fatal:Variable (wAllSea) is undefined
fatal:Execute: Error occurred at or near line 43 in file new file.ncl
fatal:Undefined identifier: (wAllSea) is undefined, can't continue
fatal:Execute: Error occurred at or near line 45 in file new file.ncl
fatal:Variable (wSea) is undefined
fatal:Execute: Error occurred at or near line 46 in file new file.ncl
=================================================================================
Thanks in advance
Vishali P.
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Oct 28 06:53:28 2010
This archive was generated by hypermail 2.1.8 : Fri Oct 29 2010 - 13:09:32 MDT