[ncl-talk] NCL plot, averaging error

Komal Shukla komalshukla1992 at gmail.com
Tue Dec 4 05:16:41 MST 2018


Hello,
I am using ncl for plotting contour. I am trying to average 18th hour
variable for a month time period. My each wrfout file has 24 (0,23) time
slabs in it. I wish to average 18th hour.

I wrote this

FILES = systemfunc ("ls ../wrfout_d02_2011-05-*") ; file paths
aa    = addfiles (FILES+".nc", "r")     ;add multiple files
ListSetType(aa,"join")
vars_to_avg = (/"eth"/)
nvars = dimsizes(vars_to_avg)
Mpan = aa[:]->$vars_to_avg(0)$
*Mpan_18 = Mpan(;,{18},0,:,:)    ; (ndays,18 is the absolute value of
time,nlevels,nlat,nlon)*
Mpan_avg_over_time =dim_avg_n_Wrap(Mpan_18,0)
Mpan_avg_over_time=o3_avg2D
o3_avg2D = o3_avg2D*1000
  o3_avg2D at lat2d = wrf_user_getvar(a,"XLAT",it)   ; latitude/longitude
  o3_avg2D at lon2d = wrf_user_getvar(a,"XLONG",it)  ; required for plotting
plotting options--
contour
------

The line *Mpan_18 = Mpan(;,{18},0,:,:)    ; (ndays,18 is the absolute value
of time,nlevels,nlat,nlon) is showing error, as* "Dimension (Time) of
(Mpan) does not have an associated coordinate variable".

How do I write to make it work?

kim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181204/cf96b417/attachment.html>


More information about the ncl-talk mailing list