[Thread Prev][Thread Next][Index]

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




Hi James,

I think the version of SODA you are using is based on POP and grid cell centres are at the middle of the cell. So let Z(k) be the centre of cell k and ZB(k) be the base of the cell. We have all the Z(k) and set ZB(0) to zero

ZB(0) = 0
Z(k)=0.5*(ZB(k-1)+ZB(k))

=> ZB(k) = 2*Z(k)-ZB(k-1)  for k=1...

Note there may be partial cells involved which complicates transport calculations. There's also the free surface to consider. Also I think the results are interpolated from a mercator grid to evenly spaced in latitude so beware. I'd suggest contacting the original providers for further info.

Russ

On 14/08/17 16:05, James wang wrote:
Hi Ryo,

As you suggested, I tried to understand the bound/edges attribute from the documentation.
Now, as a test case i tried to create a new axis with the following script



let bounds={0.5,1.5, 1.5,2.5, 2.5,3.5, 3.5,4.5, 4.5,5.5, 5.5,6.5, 6.5,7.5, 7.5,8.5, 8.5,9.5, 9.5,11}
let zaxlev= {1,2,3,4,5,6,7,8,9,10}
DEFINE AXIS/Z/UNITS=meters/DEPTH/BOUNDS zaxis = zaxlev,bounds
LIST/PRECISION=6 ZBOXLO[GZ=zaxis],ZBOXHI[GZ=zaxis],Z[GZ=zaxis],zbox[gz=zaxis]



             DEPTH (m): 0.5 to 11
 Column  1: ZBOXLO is ZBOXLO (axis ZAXIS)
 Column  2: ZBOXHI is ZBOXHI (axis ZAXIS)
 Column  3: Z is Z (axis ZAXIS)
 Column  4: ZBOX is ZBOX (axis ZAXIS)
             ZBOXLO   ZBOXHI      Z      ZBOX
1     /  1:  0.50000   1.5000   1.0000  1.00000
2     /  2:  1.50000   2.5000   2.0000  1.00000
3     /  3:  2.50000   3.5000   3.0000  1.00000
4     /  4:  3.50000   4.5000   4.0000  1.00000
5     /  5:  4.50000   5.5000   5.0000  1.00000
6     /  6:  5.50000   6.5000   6.0000  1.00000
7     /  7:  6.50000   7.5000   7.0000  1.00000
8     /  8:  7.50000   8.5000   8.0000  1.00000
9     /  9:  8.50000   9.5000   9.0000  1.00000
10    / 10:  9.50000  11.0000  10.0000  1.50000


The earlier file was downloaded SODA reanalysis model output and so there was no way to get the bounds information. This depth axis I want to use for regridding the sigma coordinate model output to Z-Axis the model has more sigma levels in the upper few meter. Am I trying in the correct way ? I would be grateful for any suggestions.



On Fri, Aug 11, 2017 at 3:32 PM, Ryo Furue <furue@xxxxxxxxxx> wrote:
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