[Thread Prev][Thread Next][Index]

Re: [ferret_users] How to divide a variable by area used in calculation



Sorry that was a typo. I meant comma there.

Anyway, Russ's solution seems better.
 
Jagadish


On Wednesday, October 30, 2013 10:39 PM, Star Physicist <couragetoknowgc@xxxxxxxxxxx> wrote:
Thanks a lot for your suggestion and it is giving single scalar value now. Actually I was setting z=1 before applying the previously stated mask commands for calculating area. I guess he was using "." sign like Area=mask[x=@din.y@din] for multiplication of latitude and longitude grids instead of using comma which might be the possible reason of multiple areas coming for each latitude.
Best,

Dogar


Date: Wed, 30 Oct 2013 09:14:18 +1100
From: russell.fiedler@xxxxxxxx
To: ferret_users@xxxxxxxx
Subject: Re: [ferret_users] How to divide a variable by area used in calculation

Hi,

A couple of issues here.

First, it looks like there was a typo resulting in an incorrect index for the mask in the reply. It should be the K index being set to 1 (i.e. the surface) not L (time).

so

let mask = if heat_anm_ctr1[K=1] then 1
let surface_area = mask[x=@din,y=@din]
let heat_flux = ohc/surface_area


Alternatively you could do the vertical integral first and then just average over the area

let heat_intz = heat[z=@din]*3990
let heat_flux = heat_intz[x=@ave,y=@ave]

Second, I think that you were getting multiple areas for each depth, not latitude due to the incorrct index unless you were overriding the region in your list command.

Russ

On 29/10/13 18:59, Star Physicist wrote:
Hi,

In stead of giving single scalar value this _expression_ gives me multiple areas for each latitude. 2ndly I doubts that integral for x and y counts grids along the boundaries twice. Any suggestion?

Thanks,

Dogar


Date: Mon, 28 Oct 2013 09:03:01 -0700
From: j_karmacharya@xxxxxxxxx
Subject: Re: [ferret_users] How to divide a variable by area used in calculation
To: couragetoknowgc@xxxxxxxxxxx; ferret_users@xxxxxxxx

Hi Dogar,

If your vaiable has lat-long information, I think this should work:

Create a variable with unitary value from the desired variable and use @din to compute area:
e.g.:
let mask=if heat_anm_ctr1[l=1] then 1
list mask[x=@din.y=@din]            ! give area in square m
 
Jagadish


On Monday, October 28, 2013 1:02 PM, Star Physicist <couragetoknowgc@xxxxxxxxxxx> wrote:
Dear Ferret users,

I am calculating Ocean Heat Content (OHC) as follows and wanted to divide it by area used in calculation. How can I do that:

set reg/x=-180:180/y=60S:60N
!Defining rho x temp
let heat=rho[d=1] *temp[d=1]

!Integrating over the entire volume
let OHC=heat_anm_ctr1[x=@din,y=@din,z=@din]*3990

Now I want to divide this OHC by corresponding area to get the unit as Joule/m^2. How to get the area used in above calculation.

Thanks,

Dogar


Date: Mon, 28 Oct 2013 06:23:11 +0530
Subject: [ferret_users] netcdf point datasets in ferret
From: ghanshamsangar@xxxxxxxxx
To: ferret_users@xxxxxxxx

Is it possible to open point datasets in netcdf format following CF conventions (see discrete sampling geometry in cf metedata conventions1.6 document available online). I could not find online documentation regarding same. I am usinfg ferret 6.84. The dataset is satellite derived wind vectors having relevant fields (ucomp,  vcomp, wind speed, Windows direction, latitude, longitude,  date/time of each observation).
Ghansham






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

Privacy Policy | Disclaimer | Accessibility Statement