Re: help

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Mar 08 2010 - 21:51:05 MST

[1]
Please make the Subject better reflect the problem.
Just "help" is *not* useful.

[2]

> Dear Ncl users, I want to plot pentad bases LH for the month of May.
> When I got the printVarSummary (u) it indicates only fist pentad but I
> don't know how to confirm the other pentad? Could anyone check my code
> where I did the mistake?

> u0 = short2flt(f->lhtfl(120:124,:,:))
> u1 = short2flt(f->lhtfl(125:129,:,:))
> u2 = short2flt(f->lhtfl(133:137,:,:))
> u3 = short2flt(f->lhtfl(138:142,:,:))
> u4 = short2flt(f->lhtfl(143:147,:,:))
> u5 = short2flt(f->lhtfl(148:152,:,:))

> u = u0
> u = (u0+u1+u2+u3+u4+u5)

This computes the average for days

(0) 120,125,133,138,143,148
(1) 121,126,134,139,144,149
  :
(5) 124,129,137,142,147,152

============

If you want the five separate pentad averages,
the following untested code should do it

  nlat = 94
  mlon = 192
  nPentad = 6
  u = new ( (/nPentad,nlat,mlon/), "float", "No_FillValue")

  nStrt = 120
  nLast = 124

  do n=0,nPentad-1
     x = short2flt(f->lhtfl(nStrt:nLast,:,:))
     u(n,:,:) = dim_avg_n(x, 0)
     nStrt = nStrt+5
     nLast = nLast+5
  end do

  u!0 = "time"
  u!1 = "lat"
  u!2 = "lon"
  u&time = f->time(122:150:5) ; middle time of each pentad
  u&lat = f->lat
  u&lon = f->lon

  printVarSummary(u)

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Mar 8 21:51:09 2010

This archive was generated by hypermail 2.1.8 : Thu Mar 11 2010 - 11:17:07 MST