<div dir="ltr"><div> <br></div><div><br></div><div> dimx = <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/dimsizes.shtml"><b>dimsizes</b></a>(xAnom1)</div> ntim = dimx(0) ; 240<br> nens = dimx(1) ; 100<br> nlat = dimx(2) ; 45<br> mlon = dimx(3) ; 90<br><br> nmos = 12<br> nyrs = ntim/nmos ; 20<br><br> xClmMonEns = new((/nmos,nlat,mlon/), typeof(xAnom1), xAnom1@_FillValue)<br> xStdMonEns = new((/nmos,nlat,mlon/), typeof(xAnom1), xAnom1@_FillValue)<br> xSkwMonEns = new((/nmos,nlat,mlon/), typeof(xAnom1), xAnom1@_FillValue)<br><div> xKurMonEns = new((/nmos,nlat,mlon/), typeof(xAnom1), xAnom1@_FillValue)</div><div><br></div> do nmo=0,nmos-1<br><div> work := <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/reshape.shtml"><b>reshape</b></a>(xAnom1(<b>nmo::nmos</b>,:,:,:) ,(/nyrs*nens,nlat,mlon/)) <br></div><div> if (nmo.eq.0) then</div><div> printVarSummary(work) ; (2400,45,90)<br></div><div> end if<br></div> xStat =<b> <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_stat4_n.shtml">dim_stat4_n</a></b>(work,0 ) <span style="color:rgb(0,0,255)"><b>; (4,nlat,mlon)</b></span><br> xClmMonEns(nmo,:,:) = xStat(0,:,:)<br> xStdMonEns(nmo,:,:) = xStat(1,:,:)<br> xSkwMonEns(nmo,:,:) = xStat(2,:,:)<br> xKurMonEns(nmo,:,:) = xStat(3,:,:)<br> end do<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 12, 2019 at 4:57 AM Sri.durgesh Nandini-Weiss via ncl-talk <<a href="mailto:ncl-talk@ucar.edu">ncl-talk@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 all,<br>
<br>
I am trying to ; Compute first four moments (average, variance, <br>
skewness, and kurtosis) based on SSH anomalies<br>
<br>
which are in this format: [time | 240] x [ens | 100] x [lat | 45] x [lon <br>
| 90].<br>
<br>
I am successful in computing and plotting it using this code:<br>
<br>
xStat = dim_stat4_n(xAnom1,1) ; computing on ens <br>
dimension, without looping (4,ntim,nlat,mlon)<br>
printVarSummary(xStat)<br>
printMinMax(xStat,0)<br>
<br>
xClmMonEns = xStat(0,:,:,:)<br>
xStdMonEns = xStat(1,:,:,:)<br>
xSkwMonEns = xStat(2,:,:,:)<br>
xKurMonEns = xStat(3,:,:,:)<br>
<br>
copy_VarCoords(x(:,0,:,:), xClmMonEns)<br>
copy_VarCoords(x(:,0,:,:), xStdMonEns)<br>
copy_VarCoords(x(:,0,:,:), xSkwMonEns)<br>
copy_VarCoords(x(:,0,:,:), xKurMonEns)<br>
<br>
The output is (4,ntim,nlat,mlon) because i used xStat = <br>
dim_stat4_n(xAnom1,1) ,<br>
<br>
if i used xStat = dim_stat4_n(xAnom1,0) than it (4,ens,nlat,mlon).<br>
<br>
What i want is xStat = dim_stat4_n(xAnom1,(/0,1/)) to only get <br>
(4,nlat,mlon), but this does not seem possible and i get the following <br>
error:<br>
<br>
warning:dim_stat4_n: 975 rightmost sections of the input array contained <br>
all missing values.<br>
Output values set to missing in these sections<br>
<br>
and the xStat is [4] x [45] x [90] x [49]<br>
<br>
Can someone please help me with this?<br>
<br>
Thanx<br>
<br>
Sri<br>
<br>
<br>
<br>
<br>
<br>
-- <br>
Sri Nandini-Weiß<br>
Research Scientist<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>
Tel: +49 (0) 40 42838 7472<br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>