Hi,
I am trying to use month_to_seasonN. When I run it, I get the following
errors:
fatal:Assignment type mismatch, right hand side can't be coerced to type
of left hand side
fatal:Execute: Error occurred at or near line 4359 in file contributed.ncl
fatal:Execute: Error occurred at or near line 4446 in file contributed.ncl
fatal:Execute: Error occurred at or near line 12
My script could not be more simple - it is pasted below. I suspect the
error is occurring because time is a double (see netCDF header below).
Is there any way to fix this, other than reading in the data to a new
variable and defining a new time variable? Any help would be appreciated.
thanks!
sara
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
;************************************************
; read in data
;************************************************
data = addfile("CRU.1960_1964.nc","r")
out = addfile("CRU.1960_1964.seas.nc","c")
xpre = month_to_seasonN (data->PRE, (/"DJF","MAM","JJA","SON"/))
xtmp = month_to_seasonN (data->TMP, (/"DJF","MAM","JJA","SON"/))
out->pre = xpre
out->tmp = xtmp
end
My netCDF header looks like this
netcdf CRU.1960_1964 {
dimensions:
lon = 190 ;
lat = 206 ;
time = UNLIMITED ; // (60 currently)
variables:
float lon(lon) ;
lon:long_name = "Longitude" ;
lon:units = "degrees_east" ;
lon:actual_range = -19.10874f, 45.41437f ;
float lat(lat) ;
lat:long_name = "Latitude" ;
lat:units = "degrees_north" ;
lat:actual_range = 26.59317f, 72.71117f ;
double time(time) ;
time:long_name = "Time" ;
time:units = "hours since 1900-1-1 00:00:0.0" ;
time:actual_range = 526272., 534312. ;
short PRE(time, lat, lon) ;
PRE:long_name = "" ;
PRE:units = "mm/day" ;
PRE:missing_value = -32767s ;
PRE:add_offset = 95.f ;
PRE:scale_factor = 0.003204395f ;
short TMP(time, lat, lon) ;
TMP:long_name = "" ;
TMP:units = "degC" ;
TMP:missing_value = -32767s ;
TMP:add_offset = 0.f ;
TMP:scale_factor = 0.003051804f ;
// global attributes:
:domxmin = -19.10874f ;
:domxmax = 45.41437f ;
:domymin = 26.59317f ;
:domymax = 72.71117f ;
:domzmin = 1050.f ;
:domzmax = 1050.f ;
:history = "Tue Jul 25 15:13:21 2006: ncks -v TMP
TMP.1960_1964.nc PRE.1960_1964.nc\n",
"Tue Jul 25 15:12:41 2006: ncrcat -n 5,4,1 TMP1960.nc
TMP.1960_1964.nc" ;
data:
time = 526272, 527016, 527712, 528456, 529176, 529920, 530640, 531384,
532128, 532848, 533592, 534312, 535056, 535800, 536472, 537216, 537936,
538680, 539400, 540144, 540888, 541608, 542352, 543072, 543816, 544560,
545232, 545976, 546696, 547440, 548160, 548904, 549648, 550368, 551112,
551832, 552576, 553320, 553992, 554736, 555456, 556200, 556920, 557664,
558408, 559128, 559872, 560592, 561336, 562080, 562776, 563520, 564240,
564984, 565704, 566448, 567192, 567912, 568656, 569376 ;
}
-- Dr. Sara A. Rauscher Earth System Physics Section The Abdus Salam International Centre for Theoretical Physics Strada Costiera 11 34014 Trieste ITALY ph: +39 040 2240 225 fax: +39 040 2240 449 email: srausche_at_ictp.it _______________________________________________ ncl-talk mailing list ncl-talk_at_ucar.edu http://mailman.ucar.edu/mailman/listinfo/ncl-talkReceived on Tue Jul 25 2006 - 07:52:50 MDT
This archive was generated by hypermail 2.2.0 : Tue Jul 25 2006 - 08:57:03 MDT