============================================================================
What you did was correct.
The "month_to_annual_weighted" erroneously assigned the
long_name and units attributes even if they were not present.
This is an error. It will be fixed in the next release.
The temporary fix is to delete the long_name and units attributes
upon return from the function.
Try the following script. It should work fine.
============================================================================
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
diri = "/fs/cgd/data0/shea/indices/"
fili = "pdo.dat"
x = asciiread(diri+fili,(/106,13/),"float")
xx = ndtooned(x(:,1:12))
yyyymm = yyyymm_time(1900, 2005, "integer")
pdo_ann = month_to_annual_weighted(yyyymm,xx,1)
delete(pdo_ann_at_long_name) ; erroneously assigned in a034
delete(pdo_ann_at_units) ; if they were not present.
printVarSummary(pdo_ann)
wks = gsn_open_wks("ps","pdo_ANN_Mantua")
res = True
res_at_tiMainString = "Annual PDO Obs Series (Mantua et al) "
;res_at_trYMinF = -2.0 ; min value on y-axis
;res_at_trYMaxF = 2.0 ; max value on y-axis
res_at_gsnYRefLine = 0.0 ; create a reference line
res_at_vpHeightF = 0.4 ; change aspect ratio of plot
res_at_vpWidthF = 0.8
res_at_vpXF = 0.1 ; start plot at x ndc coord
res_at_gsnAboveYRefLineColor = "red" ; above ref line fill red
res_at_gsnBelowYRefLineColor = "blue" ; below ref line fill blue
plot = gsn_csm_xy(wks,pdo_ann&year,pdo_ann,res)
end
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
On Mon, 15 Jan 2007, LEO_ARIES wrote:
> Hi, all
>
> I am using "month_to_annual_weighted" in the new version of NCL to calculate ann value from a monthly series.
> I met a problem and the error message was listed below :
>
> "fatal:_NclBuildArray: can not combine character or string types with numeric types, can't continue
> fatal:Execute: Error occurred at or near line 585 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl
>
> fatal:Execute: Error occurred at or near line 635 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl
>
> fatal:Execute: Error occurred at or near line 963 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl
>
> fatal:Execute: Error occurred at or near line 3023 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl
>
> fatal:Execute: Error occurred at or near line 8973 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl "
>
> Although my code is simple , I check it for several times and can not find a error in it. Is there anyone
> can give me a instruction? Thanks!
>
> Here below is my code:
[SNIP]
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jan 15 2007 - 09:11:11 MST
This archive was generated by hypermail 2.2.0 : Tue Jan 16 2007 - 14:49:45 MST