[ncl-talk] averaging of height levels

Dennis Shea shea at ucar.edu
Tue Oct 20 16:39:34 MDT 2020


It is ALWAYS best to include the output from printVarSummary when
submitting a question.

printVarSummary(zfull)
===
To me, what you have done is correct.

A statement like: "since the half height levels are strange"

does not tell people much. What is "strange" about the values?



On Mon, Oct 19, 2020 at 4:15 PM Gurer, Kemal at ARB via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> Hi ncl’ers,
>
>
>
> 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:
>
>
>
>     do i=0,nlevs-2
>
>        zhalf(:,:,i) = 0.5 * (zfull(:,:,i)+zfull(:,:,i+1))
>
>     end do
>
>
>
> or, the following code:
>
>
>
>    zhalf = 0.5*( zfull(:,:,0:nlevs-2) + zfull(:,:,1:nlevs-1) )
>
>
>
> 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?
>
>
>
> Thank you for your help.
>
>
> _______________________________________________
> 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/20201020/b6c1e323/attachment.html>


More information about the ncl-talk mailing list