<div dir="ltr"><div>It is ALWAYS best to include the output from printVarSummary when submitting a question.</div><div><br></div><div>printVarSummary(zfull)</div><div>===</div><div>To me, what you have done is correct.</div><div><br></div><div>A statement like: "since the half height levels are strange"</div><div><br></div><div>does not tell people much. What is "strange" about the values?</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 19, 2020 at 4:15 PM Gurer, Kemal@ARB 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">
<div lang="EN-US">
<div class="gmail-m_-3964979063414149391WordSection1">
<p class="MsoNormal">Hi ncl’ers,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I have a 3d array for the full model height levels, say, zfull(nlat,nlon,nlevs). I want to calculate the midpoints of the height levels of the full model heights and put it into a new array, say zhalf(nlat,nlon,nlevs-1). The following
code:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> do i=0,nlevs-2<u></u><u></u></p>
<p class="MsoNormal"> zhalf(:,:,i) = 0.5 * (zfull(:,:,i)+zfull(:,:,i+1))<u></u><u></u></p>
<p class="MsoNormal"> end do<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">or, the following code:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> zhalf = 0.5*( zfull(:,:,0:nlevs-2) + zfull(:,:,1:nlevs-1) )<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">generates some data, but I don’t know and think what I am doing is right since the half height levels are strange. How can I calculate the mid-points of height levels of a 3d array of height levels?
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thank you for your help.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
_______________________________________________<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>