Appendix A Sec35.
ZAXREPLACE_AVG
ZAXREPLACE_AVG(V,ZVALS,ZAX)
Use weighted averaging to convert between alternative monotonic Zaxes. The weighting is done according to the portion of the source box that lies within the destination grid cell.
The mapping between the source and destination Z axes is a function of X,Y, and or T. Typical applications in the field of oceanography include converting from a Z axis of layer number to a Z axis in units of depth (e.g., for sigma coordinate fields) and converting from a Z axes of depth to one of density (for a stably stratified fluid).
Argument 1, V, is the field of data values, say temperature on the "source" Z-axis, say, layer number. The second argument, ZVALS, contains values in units of the desired destination Z axis (ZAX) on the same Z axis as V‚ for example, depth values associated with each vertical layer. The third argument, ZAX, is any variable defined on the destination Z axis, often "Z[gz=zaxis_name]" is used. For an example of the ZAXREPLACE family of functions see ZAXREPLACE.
Note:
ZAXREPLACE_AVE is a "grid-changing" function; its output grid is different from the input arguments. Therefore it is best to use explicit limits on the arguments rather than a SET REGION command. See the discussion of grid-changing functions. In addition, because it is implemented as an external function, the arguments are loaded in their entirety when the function is called, even when the result is requested only on a portion of the grid in directions other than Z. The subset in all directions should be specified within square brackets in the expression, e.g.,
let var_den = zaxreplace_ave(salt[x=140:190,y=-10:10,L=5], sigma[x=140:190,y=-10:10,L=5], z[gz=axden])
Arguments: |
V |
A function of depth and perhaps, x, y, and time. |
ZVALS |
Destination Z axis values as a fcn of source Z axis |
|
ZAX |
Variable with desired z (depth) axis points |
|
Result Axes: |
X |
Inherited from V |
Y |
Inherited from V |
|
Z |
Inherited from ZAX |
|
T |
Inherited from V |