[Thread Prev][Thread Next][Index]

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



Hi James,

I was trying to calculate the transport using v[x=@din,z=@din], and i compared these values with v*xbox*zbox followed by x=@sum,z=@sum]. The results I am getting is not at all comparable. I understood from the forum that depth axis with irregular dz can cause wrong result.

Will cause wrong results. I have to guess, but from your listing of ZBOX, it seems that the axis isn't properly set.  For example, the first depth is 5 m. Isn't the dz of the first level 10 m? Your ZBOX says it's 10.1m.

The key is that ZBOX should be identical to the correct dz for each depth level.

Conversely, if ZBOX values are identical to the correct dz's, you are fine.  (It seems you need more precision when LISTing.)  An easier method to check this, is to use the ncdump command on your command line.  Then, you will immediately know whether the depth axis has the correct dz information.
 
Then which way I should follow?.

Both ways will give you wrong results.

The "correct" way is to fix your vertical axis, if it's not properly set.

    yes? define axis/z/depth/units=meters/from_data/edges zax = 
        {0, 10, 20, 300, . . . . , 6000}
     yes? let v_fixed = v[gz=zax@ASN]

where {0, 10, 20, . . . , 6000} are the edges of the vertical grid cells. Don't use these numbers; I've just made them up. When there are N cells in the vertical, there are N+1 edges. The above DEFINE AXIS command constructs a vertical axis that consists of N points which are midpoints between the edges and adds the positions of the edges as a piece of auxiliary information to the axis. Note the EDGES qualifier.

By the way, if your goal is an integration, you don't need to compute v * xbox * zbox as an intermediate variable.  The operator @DIN uses the xbox and zbox information correctly. But, a caveat is that you need to use the correct upper and lower bounds for the integration: In

   yes? v_din = v[z=0:6000@DIN] ! if the total depth is 6000m.
   yes? v_box = v * zbox
   yes? v_box_sum = v_box[k=1:N@SUM]

v_din and v_box_sum should be the same (I think. I'm not familiar with @SUM).

Cheers,

Ryo

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

Privacy Policy | Disclaimer | Accessibility Statement