<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello,</p>
<p>My question indeed was not clear.</p>
<p>My question is: how can i make a standard deviation plot from my
data by averaging all the STDs over the ensemble members. So i
want to get a 100 standard deviations because i have a 100
members. <br>
</p>
<p>e.g. my data is in the format of x=time|240, ensemble|100, lat,
lon]</p>
<p>x=(1632:1871,:,{40},{-20}) ===>x=[240,100]<br>
</p>
<div class="moz-cite-prefix">ntim = 240 ==>months<br>
</div>
<div class="moz-cite-prefix">nens=100 ===>ensemble members<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"> ;Compute monthly standard deviations
on invidividual ensemble members<br>
<br>
</div>
<div class="moz-cite-prefix"> do n=0, nens-1<br>
histanom1(:n)=dim_stddev_n_Wrap(x(:,n),1)<br>
end do</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"> printVarSummary(hist_anom1) ==>
should be in [240,100]</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"> How can i modify this loop to compute
100 standard deviation from the ensemble members?<br>
</div>
<div class="moz-cite-prefix"> and than average this?</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"> std_ensavg=dim_avg_n(histanom1,1)</div>
<div class="moz-cite-prefix"> printVarSummary(std_ensavg) ==>
should result in [240]</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">On 19.03.21 19:44, Dennis Shea wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAOF1d_5FkHjmWhrhR2zz_CFNCC8cgjUHAbTTPkKMUMb1=T0Nyg@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<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"
moz-do-not-send="true">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"
moz-do-not-send="true">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"
moz-do-not-send="true">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" moz-do-not-send="true">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote>
</div>
</blockquote>
<pre class="moz-signature" cols="72">--
Sri, Nandini-Weiss
Research Associate
Universität Hamburg
Center for Earth System Research and Sustainability (CEN)
Cluster of Excellence 'Climate, Climatic Change, and Society' (CLICCS)
Bundesstrasse 53, 20146 Hamburg</pre>
</body>
</html>