[Thread Prev][Thread Next][Index]

Re: [ferret_users] Using xbox and zbox to find total transport



Hi James,

As you suggested I tried to rectify the following script.

use "Data/Test.nc"
LIST/precision=6 ZBOXLO[GZ=v],ZBOXHI[GZ=v],Z[GZ=v],ZBOX[GZ=v]
LET NEW_EDGES=ZCAT ({0}, zboxhi[gz=v])

I don't think this works.  Because ZBOXHI is provided by Ferret, which cannot know the positions of the correct edges!  Ferret makes some assumptions and computes ZBOXHI and ZBOXLO, which are usually wrong.

From the ncdump list you showed, it's clear that the edges information is missing.

Mathematically, the problem is this.  Let Z(0), Z(1), . . . , Z(N) be the edges of the gridcells and z(1), z(2), . . . , z(N) be the depths at which velocity is defined.  Usually (almost always),

     z(k) = [Z(k-1) + Z(k)]/2, for k = 1, 2, . . . , N

but we know only z(1), . . . , z(N).  That is, there are only N equations, which is not sufficient to determine the N+1 numbers Z(0), . . . , Z(N).

In addition, Ferret doesn't know the above equation (because there can be other relations between z's and Z's).  For this reason, Ferret doesn't bother to try to solve for Z's, makes some assumptions, and comes up with (usually incorrect) Z's.

But, usually (almost always), Z(0) = 0 for an OGCM.  With this additional constraint, you can solve the above set of equations to determine Z's. Those are the values you need to use to fix your vertical axis.

Instead of calculating Z's like this:  You or somebody else set up the numerical model whose output you are using. That person must know the positions of the edges.

Better still, I hope you can persuade the person who produced the netCDF file to include the edges information.  See the _bnds attribute defined in the CF convention.

Cheers,

Ryo


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement