<div dir="ltr"><div>Your question is not clear.</div><div><br></div><div>printVarSummary(hist_anom) ==> (ntim,nens) ==> (0,1)<br></div><div><br></div><div>ntim = 240 <br></div><div> <br></div><div>nmos = 12</div><div>nyrs = ntim/nmos<br></div><div>---</div><div>?????</div><div>---<br></div><div><br></div><div> xstdens = new(nmos,typeof(hist_anom),....)</div><div> do nmo=0,nmos-1</div><div> work = hist_anom(nmo::nmos,0) ; nmo=0 -> all Januaries, nmo=1 ->all Feb; ...<br></div><div> xstdens(nmo) = dim_stddev_n(work)</div><div> ;;xstdens(nmo) = dim_stddev_n(hist_anom(nmo::nmos,0))<br>
end do</div><div> xstdens@long_name = "Monthly Ensemble Std. Deviation: "+nyr+" years"<br></div><div> xstdens@units = hist_anom@units</div><div>=====</div><div><br></div><div><br></div><div> ystdens = dim_stddev_n_Wrap(hist_anom, 1) ; at each time, average all ensemble members<br></div><div> printVarSummary(ystdens) ; (ntim)<br></div><div><br></div><div>=======</div><div><div> zstdens = dim_stddev_n_Wrap(hist_anom, 0) ; for each ensemble member , average all times<br></div><div> printVarSummary(zstdens) ; (nens)</div><div><br></div><div>========<br></div></div><div> ??????<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 19, 2021 at 9:53 AM Sri nandini via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">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 dear ncl users,<br>
<br>
I am trying to compute standard deviation over individual ensemble <br>
dimension of my data [time|240,ens|100,lat,lon] and than averaging the <br>
STDs over the ensemble members but have error on my code: <br>
fatal:Dimension size mismatch on subscript #2, left-hand and right-hand <br>
side dimensions do not match<br>
<br>
f = addfile ("Hist_monthly_corrected_pi_<a href="http://trend.nc" target="_blank">trend.nc</a>", "r")<br>
hist_anom = f->hist_trend(1632:1871,:,{40},{-60})<br>
printVarSummary(hist_anom)<br>
hist_anom =hist_anom*100<br>
dimx = dimsizes(hist_anom)<br>
ntim = dimx(0) ; 240<br>
nens = dimx(1) ; 100<br>
nlat = dimx(2)<br>
nlon = dimx(3)<br>
print("============")<br>
<br>
<br>
;Compute monthly standard deviations<br>
xEnsMonStd = new((/nens,ntim/), typeof(hist_anom), hist_anom@_FillValue)<br>
do ne=0,nens-1 ; loop over each ensemble member<br>
do n=0,ntim-1 ; loop over each month for <br>
current member<br>
work = hist_anom(n,ne) ; convenience and efficiency<br>
xEnsMonStd(ne,n) = dim_stddev_n(work,0) ; ensemble std<br>
end do<br>
end do<br>
<br>
The xEnsMonStd should be in the format of [time|240, ens|100]<br>
<br>
rcp45_ensavg=dim_avg_n(xEnsMonStd,0)<br>
printVarSummary(rcp45_ensavg)<br>
copy_VarCoords(hist_anom45(:,0), rcp45_ensavg)<br>
printVarSummary(rcp45_ensavg)<br>
<br>
Can someone help me out with this?<br>
<br>
Sri<br>
<br>
<br>
<br>
<br>
-- <br>
Sri, Nandini-Weiss<br>
Research Associate<br>
<br>
Universität Hamburg<br>
Center for Earth System Research and Sustainability (CEN)<br>
Cluster of Excellence 'Climate, Climatic Change, and Society' (CLICCS)<br>
<br>
Bundesstrasse 53, 20146 Hamburg<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>