Dear NCL users,
I am trying to do daily average from 12hrly data (5844,160,360). If I am
defining a new array x for daily average values using my old 12hry array x =
evap(::2,:,:) it is showing the folloing error
fatal:Assignment type mismatch, right hand side can't be coerced to type of
left hand side
but however instead if i am defining new array of same dimension
x=new((/2922,160,360/),float) and thereafter copy the attributes
copy_VarCoords (y,x) It is doing fine
the script is attatched herewith
could you please help me out
thanking in advance
;--------------------------------------------------------------
setfileoption("nc","SuppressClose",False) ; for reading large number of
files
fils = systemfunc ("ls -1
/data5/data/HOAPS/evaporation/daily/HOAPS3_DAILY_EVAP_???.nc") ; file paths
f = addfiles (fils, "r")
ListSetType (f, "cat")
evap = f[:]->evap
NTIM = dimx3(0) ; TOTAL number of time steps
ntJump = 2 ;two time steps per day (12 hrly files)
x = evap(::ntJump,:,:) ; create array with metadata
; y = evap(::ntJump,:,:) ; create array with metadata
ntStrt = 0
ntLast = ntJump-1
;x=new((/2922,160,360/),float)
do nt=0,NTIM-1,2
; x(nt/2,:,:) = (dim_avg_n_Wrap(evap(ntStrt:ntLast,:,:), 0))
x(nt/2,:,:) = (dim_avg_n(evap(ntStrt:ntLast,:,:), 0))
ntStrt = ntStrt + ntJump
ntLast = ntLast + ntJump
end do
; copy_VarCoords (y,x)
x@info_tag = "daily average"
x@units = "mm/day
system("/bin/rm -f daily_output.nc")
fout = addfile("daily_output.nc","c")
filedimdef(fout,"time",-1,True)
fout->evp = x
-- Samir Pokhrel Climate and Global Modelling Division Indian Institute of Tropical Meteorology NCL Post, Pashan Pune-411008 INDIA
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Apr 23 04:20:55 2010
This archive was generated by hypermail 2.1.8 : Fri Apr 23 2010 - 14:40:07 MDT