Re: warning:onedtond

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Mar 15 2010 - 21:38:27 MDT

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

  f = addfile(" ","r")
  x = short2flt(f->lhtfl(0:140,:,:))
  xZon = dim_avg_Wrap(x(:,:,{30:120})) ; xZon(time,lat)

or [v 5.1.1]

  xZon = dim_avg_n_Wrap(x(:,:,{30:120}), 2) ) ; xZon(time,lat)

  printVarSummary(xZon)
====

If you are new to NCL, please read the "Mini-Language Manual"
        http://www.ncl.ucar.edu/Document/Manuals/

Good Luck

wei huang wrote:
> Dear All,
> I'm interested to calculate the lon average ({30:120}) as I mentioned in
> the code.Could anyone to fix this problem?
> thanks,
> H wei
>
> ===============
> ===============
>
> f = addfile(" ","r")
>
> x = short2flt(f->lhtfl(0:140,:,:))
>
> printVarSummary(x)
>
> shov = x({lon|30:120},lat|:,time|:)
>
> dims = dimsizes(shov )
>
> sdemo = onedtond(ndtooned(shov), (/dims(1),dims(2)/))
>
> sdemo!0 = "lat"
>
> sdemo!1 = "time"
>
> sdemo&lat = x&lat
>
> sdemo&time =x&time
>
> sdemo@long_name = ""
>
> sdemo@units = ""
>
> sdemo = smooth92d (sdemo,0.5, 0.25) ; 2D smoother
>
> time = x&time
>
> utc = ut_calendar(time,0) ; yr, mo, dy, hr, mn, sc
>
> mons = floattoint(utc(:, 1)) ; Values from 1 to 12
>
> days = floattoint(utc(:, 2)) ; Values from 1 to 31
>
> ====================
>
> =====================
>
> plot = gsn_csm_lat_time(wks, sdemo({10:50},:), res)
>
> end
>
> =============
>
> Error
>
> warning:onedtond : output dimension sizes have fewer elements than input, some data not copied
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Mar 15 21:38:32 2010

This archive was generated by hypermail 2.1.8 : Wed Mar 17 2010 - 13:00:16 MDT