[Thread Prev][Thread Next][Index]

[ferret_users] Re: [ferret_users] @SUM or @DIN which one I need to use‏




On 6/16/2014 2:30 PM, mokaish pholi wrote:
Dear FERRET Users,

I am new to FERRET. I have an output from my model for advective term of Ocean heat transport which is vertical depth integrated and I need only to do simple sum over vertical layers. Should I need to apply @sum or @din. How should I write If I want to do it over  top 1000m of the ocean only?


For a simple sum, you should use @SUM.

=====

Here's an approach to Ferret that will allow you to always know what calculation the program is doing:  think of and perform a quick experiment.  For example, construct a new variable, whose values are so simple that you can compute the answer in your head.  Apply @DIN and @SUM to that variable and see which one has the behavior that you want:
say your variable is named "myvar" then

yes? LET _one_ = 0*myvar + 1                           ! same grid as myvar, but always  equal to 1
yes? SET REGION/X=<a point>/Y=<a point>   ! a single point in your grid
yes? LIST one[Z=0:1000@SUM]
yes? LIST one[Z=0:1000@DIN]



The Ferret Users Guide is also a detailed and easy to use resource.  Look in the index:
    http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/index-1/index/
@SUM
http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/variables-xpressions/XPRESSIONS#_VPINDEXENTRY_503

@SUM—unweighted sum

The transformation @SUM computes the unweighted sum (arithmetic sum) of the variable with respect to the indicated axis. This transformation is most appropriate for regions specified by subscript. If the region is specified in world coordinates, the edge points are not weighted—they are wholly included in or excluded from the calculation, depending on the location of the grid points with respect to the specified limits. See theGeneral Information on transformations for important details about this transformation.

@DIN

http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/variables-xpressions/XPRESSIONS#_VPINDEXENTRY_429

    @DIN—definite integral

The transformation @DIN computes the definite integral—a single value that is the integral between two points along an axis (compare with @IIN). It is obtained as the sum of the grid_box*variable product at each grid point. Grid points at the ends of the indicated range are weighted by the fraction of the grid box that falls within the integration interval.

If @DIN is specified simultaneously on multiple axes the calculation will be performed as a multiple integration rather than as sequential single integrations. The output will document this fact by indicating a transformation of "@IN4" or "XY integ." See the General Information on transformations for important details about this transformation.   (In particular note that when the limits are given in index values, the transformation includes the entire interval of both endpoints; if it is given in world coordinates, it uses partial grid cells out to those world limits.)

Example:

yes? CONTOUR/X=160E:160W/Y=5S:5N u[Z=0:50@DIN]

In a latitude/longitude coordinate system X=@DIN is sensitive to the COS(latitude) correction.

Integration over complex regions in space may be achieved by masking the multi-dimensional variable in question and using the multi-dimensional form of @DIN. For example

yes? LET salinity_where_temp_gt_15 = IF temp GT 15 THEN salt
yes? LIST salinity_where_temp_gt_15[X=@DIN,Y=@DIN,Z=@DIN]






Thanks,

Mokaish
IIT India


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

Privacy Policy | Disclaimer | Accessibility Statement