[Thread Prev][Thread Next][Index]

Re: [ferret_users] Save grid area [nlon,nlat] to file?



Isn't that what XBOX and YBOX do?

I guess you'd have to scale by cos(latitude) if your grid is in degrees.

let pi=4*atan(1)
let cell_area = xbox[g=gridname]*ybox[g=gridname]*cos(pi*y[gy=gridname]/180)

BK

On Sep 13, 2011, at 2:52 PM, Paul Young wrote:

Hi all,

I've seen that there are several entries in the archives about saving the area for a particular region (using @din; e.g. http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2004/msg00026.html) , but is there a simple way to return a variable that is dimensioned (nlon, nlat) and has the the grid cell areas for each cell? Else, do I need to step through and do the geometry myself?

I'm looping through a bunch of different models (perhaps some on spectral grids) and I'd like to have a generic script. I'm envisaging something like:

use "var_for_model_X.nc" !Load in any variable on the model grid (e.g. surface pressure: lon, lat, time) let cell_areas = { something clever in one/two lines! } ! Calculate areas [lon,lat] save/file="cell_areas_for_model_X.nc" cell_areas !Save them to netcdf

I bet the solution is very simple and staring me in the face, but - as I can't see it - please forgive me for crowd-sourcing from the help list.

Cheers,

Paul







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

Privacy Policy | Disclaimer | Accessibility Statement