[gradsusr] Computing grid space area as a function of latitude and longitude in GrADS

jimbo32886 at gmail.com jimbo32886 at gmail.com
Thu Jun 2 10:58:32 EDT 2011


Hello,

    I have data for a regular one degree grid spanning the entire Earth.  I
was hoping to calculate the grid space area for each grid and then multiply
this value by my data value for each individual grid point.  The grid point
surface area function is:
SA = (Radius of
Earth)^2(longitude(2)-longitude(1))(sin(latitude(2))-sin(latitude(1)) where
longitude is in radians and latitude is in degrees.  Is there a way to do
this calculation without having the script create very large arrays.  The
data is only on the surface.  The script I was hoping I'd be able to use
would be something like this:

'open dummy.ctl'
'set lat -90 90'
'set lon 0 360'
'set t 1'
'set fwrite dummytwo'
'set gxout fwrite'

count = 1
while (count <= 100)
dummyvar2 =
6371*6371(((lon+1)*(3.141592653589/180))-(lon*(3.141592653589/180)))*(sin(lat+1)-sin(lat))*dummyvar
count = count + 1
'd dummyvar2'
'set t 'count
endwhile
disable fwrite

I am just uncertain how lat and lon would be treated in the above equation.
Any insight on how to do this would be greatly appreciated.

Thanks,
Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110602/f2e481b8/attachment-0003.html 


More information about the gradsusr mailing list