For Programmers: Free Programming Magazines  


Home > Archive > Fortran > September 2005 > Partial derivatives of gridded data









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Partial derivatives of gridded data
weathergirl1234@yahoo.com.au

2005-09-08, 3:57 am

Hi

I have no idea about programming at all. I have a gridded data set of
temperature over the globe and i need to calculate (del T/del x) and
(del T/del y) at every grid point.

Any suggestions??????

Thanks

Gareth Owen

2005-09-08, 3:57 am

weathergirl1234@yahoo.com.au writes:

> Hi
>
> I have no idea about programming at all. I have a gridded data set of
> temperature over the globe and i need to calculate (del T/del x) and
> (del T/del y) at every grid point.


The question I'd ask is if you really want the derivatives at the grid
points or on the boundaries. In geophysical applications, the latter
is common (I'll resist the temptation to say "standard"). The most
common set up is called a C-grid (or an Arakawa C-grid).

col col
k k+1
---------
row | | |
j | T + T |
| | |
--*------
row | | |
j+1 | T | T |
| | |
---------

The zonal derivative (evaluated at the boundary point +)
is given by
dt/dx =~ (T(j,k+1)-T(j,k))/dx

The meridional derivative (evaluated at the boundary point *)
is given by
dt/dy =~ (T(j,k)-T(j+1,k))/dy

(assuming that your X and Y increase
in the easterly and northerly directions)

weathergirl1234@yahoo.com.au

2005-09-08, 6:59 pm

Yes it is on the boundary......sorry. But how do i calculate each one,
can i use a do loop or something similar???

Gareth Owen wrote:
> weathergirl1234@yahoo.com.au writes:
>
>
> The question I'd ask is if you really want the derivatives at the grid
> points or on the boundaries. In geophysical applications, the latter
> is common (I'll resist the temptation to say "standard"). The most
> common set up is called a C-grid (or an Arakawa C-grid).
>
> col col
> k k+1
> ---------
> row | | |
> j | T + T |
> | | |
> --*------
> row | | |
> j+1 | T | T |
> | | |
> ---------
>
> The zonal derivative (evaluated at the boundary point +)
> is given by
> dt/dx =~ (T(j,k+1)-T(j,k))/dx
>
> The meridional derivative (evaluated at the boundary point *)
> is given by
> dt/dy =~ (T(j,k)-T(j+1,k))/dy
>
> (assuming that your X and Y increase
> in the easterly and northerly directions)


glen herrmannsfeldt

2005-09-08, 6:59 pm

weathergirl1234@yahoo.com.au wrote:

> Yes it is on the boundary......sorry. But how do i calculate each one,
> can i use a do loop or something similar???


I believe Numerical Recipes has a good explanation of partial
differential equation solvers, including the difference equations
(differential equations on a mesh) used with them.

-- glen

Glyn Edwards

2005-09-09, 7:56 am

On Thu, 08 Sep 2005 16:24:10 -0700, glen herrmannsfeldt wrote:


> I believe Numerical Recipes has a good explanation of partial
> differential equation solvers, including the difference equations
> (differential equations on a mesh) used with them.

And for someone who does not know what Numerical Recipes is
http://www.library.cornell.edu/nr/

The Fortran 77 is this one you want to read first.

Glyn



p.kinsler@ic.ac.uk

2005-09-09, 6:59 pm

Gareth Owen <usenet@gwowen.freeserve.co.uk> wrote:
> weathergirl1234@yahoo.com.au writes:
[color=darkred]
> The question I'd ask is if you really want the derivatives at the grid
> points or on the boundaries.


Also you might want to try pseudospectral derivatives; where
you use a fourier transform to compute the derivative in
frequency space (since d/dx T(x) <--> -ik T(k) ) before
transforming back.

Of course the simple methods are easier to program; especially
if you have a spherical coordinate system.


--
---------------------------------+---------------------------------
Dr. Paul Kinsler
Blackett Laboratory (QOLS) (ph) +44-20-759-47520 (fax) 47714
Imperial College London, Dr.Paul.Kinsler@physics.org
SW7 2BW, United Kingdom. http://www.qols.ph.ic.ac.uk/~kinsle/


beliavsky@aol.com

2005-09-09, 6:59 pm

weathergirl1234@yahoo.com.au wrote:
> I have no idea about programming at all. I have a gridded data set of
> temperature over the globe and i need to calculate (del T/del x) and
> (del T/del y) at every grid point.


Since your question is not specific to Fortran, the best newsgroup for
it is sci.math.num-analysis.

Jim

2005-09-09, 6:59 pm


<weathergirl1234@yahoo.com.au> wrote in message
news:1126148436.865818.307950@z14g2000cwz.googlegroups.com...
> Hi
>
> I have no idea about programming at all. I have a gridded data set of
> temperature over the globe and i need to calculate (del T/del x) and
> (del T/del y) at every grid point.
>
> Any suggestions??????
>
> Thanks
>

Use the finite difference equations to compute the approximations to these
values. You don't need a computer, but it certainly does take a bit of time
to do this by hand.
Jim


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com