[ncl-talk] Standard deviation Compute over time for each ensemble member

Dennis Shea shea at ucar.edu
Fri Aug 14 12:07:01 MDT 2020


 ntim = 156
 nens = 100
 nlat = 2
 mlon = 3
 x = random_normal(0,10,(/ntim,nens,nlat,mlon/))
 xMeanEns = dim_avg_n_Wrap(x,1)                          ;
xMeanEns(156,2,3)   ... (ntim,nlat,mlon)
 xStDevEns= dim_stddev_n_Wrap(x,1)

 xMeanTime = dim_avg_n_Wrap(x,0)                          ;
xMeanEns(100,2,3) .. (nens,nlat,mlon)

On Fri, Aug 14, 2020 at 3:52 AM Sri nandini via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> Hello ncl-users,
>
> My code for computing standard deviation over the time for each ensemble
> member gives all zero. I would appreciate if someone can look over my
> code for mistakes?
>
> ;******************************************************************
> ; Compute over time for each ensemble member
> ; (a) Time Mean
> ; (b) Interannual variability (std. deviation)
> ;******************************************************************
>    hist_anom=[time|156,ens|100,lat,lon]
>
>     xEnsMonAvg = new((/nens,ntim,nlat,mlon/), typeof(hist_anom),
> hist_anom at _FillValue)
>     xEnsMonStd = new((/nens,ntim,nlat,mlon/), typeof(hist_anom),
> hist_anom at _FillValue)
>
>     do ne=0,nens-1                      ; loop over each ensemble member
>     do nt=0,ntim-1                      ; loop over each year for
> current member
>
>            work=hist_anom(nt::ntim,ne,:,:)              ; convenience
> and efficiency
>            ;printVarSummary(work)                       ; [Time|1,lat,lon]
>
>          xEnsMonAvg(ne,nt,:,:) = dim_avg_n(work,0)    ; ensemble avg
>          xEnsMonStd(ne,nt,:,:) = dim_stddev_n(work,0) ; ensemble std
>       end do
>     end do
>
>     printVarSummary(xEnsMonAvg)
>     printVarSummary(xEnsMonStd)
>
> Thanx
>
> Sri
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at mailman.ucar.edu
> List instructions, subscriber options, unsubscribe:
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200814/4de26cba/attachment.html>


More information about the ncl-talk mailing list