[Thread Prev][Thread Next][Index]

Re: [ferret_users] regarding ocean area



Hi Saurabh,

 suppose i want to calculate total heat content of global ocean in joules (a line plot) so how to get the global ocean area only such that
let OHC=heat[z=0:700@ave,x=@ave,y=@ave]  !! units are j/m^2
let TOHC=OHC*(global ocean area)                   !! units are j, TOHC=total OHC

That's a very roundabout approach. You first compute the area average and then multiply the area.  But why?  Look at the definition of area average:

    (area average) = (area integral) / (area)

Ferret does this when you ask for area average. Now, you say you want to compute (area average) * (area), which is the area integral! which you can directly compute with

   x=<xrange>@DIN, y=<yreange>@DIN

If you really, really want to compute the area, you can use this trick:

   (area) = integral dx dy
              = integral 1 dx dy

That is, you first define a function which is 1 in ocean and undefined on land:

    let mask = ifv somevariable then 1
    let area = mask[x=<xrange>@DIN, y=<yrange>@DIN]

Read the manual about @DIN and IFV .


Ryo

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

Privacy Policy | Disclaimer | Accessibility Statement