<div dir="ltr"> ntim = 156<br> nens = 100<br> nlat = 2<br> mlon = 3<br> x = random_normal(0,10,(/ntim,nens,nlat,mlon/))<br> xMeanEns = dim_avg_n_Wrap(x,1)                          ; xMeanEns(156,2,3)   ... (ntim,nlat,mlon)<br><div> xStDevEns= dim_stddev_n_Wrap(x,1)</div><div><br></div><div> xMeanTime = dim_avg_n_Wrap(x,0)                          ; xMeanEns(100,2,3) .. (nens,nlat,mlon)<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 14, 2020 at 3:52 AM Sri nandini via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello ncl-users,<br>
<br>
My code for computing standard deviation over the time for each ensemble <br>
member gives all zero. I would appreciate if someone can look over my <br>
code for mistakes?<br>
<br>
;******************************************************************<br>
; Compute over time for each ensemble member<br>
; (a) Time Mean<br>
; (b) Interannual variability (std. deviation)<br>
;******************************************************************<br>
   hist_anom=[time|156,ens|100,lat,lon]<br>
<br>
    xEnsMonAvg = new((/nens,ntim,nlat,mlon/), typeof(hist_anom), <br>
hist_anom@_FillValue)<br>
    xEnsMonStd = new((/nens,ntim,nlat,mlon/), typeof(hist_anom), <br>
hist_anom@_FillValue)<br>
<br>
    do ne=0,nens-1                      ; loop over each ensemble member<br>
    do nt=0,ntim-1                      ; loop over each year for <br>
current member<br>
<br>
           work=hist_anom(nt::ntim,ne,:,:)              ; convenience <br>
and efficiency<br>
           ;printVarSummary(work)                       ; [Time|1,lat,lon]<br>
<br>
         xEnsMonAvg(ne,nt,:,:) = dim_avg_n(work,0)    ; ensemble avg<br>
         xEnsMonStd(ne,nt,:,:) = dim_stddev_n(work,0) ; ensemble std<br>
      end do<br>
    end do<br>
<br>
    printVarSummary(xEnsMonAvg)<br>
    printVarSummary(xEnsMonStd)<br>
<br>
Thanx<br>
<br>
Sri<br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>