Caculating spatial average of LENS2 output data

inagler

Ina Nagler
New Member
Hello! I want to calculate the weighted mean of some tracer variable over the 3 spatial dimensions. The idea is to weigh the mean with the volume of each grid cell, so I need information on the dimensions of each grid cell. To be consistent I want to incorporate the changed volume of partially filled bottom cells. Is there a file that provides longitude and latitude-dependent dz? Or what is the most common approach to this? Many thanks in advance!
 

mrocha

Maurício Rocha
New Member
Hi, I think you can compute the cell volume as follows: ds['cell_volume']=ds.dz * ds.DXT * ds.DYT, where ds is your data set. You can also use xgcm (please see Using xgcm with POP output) to track the variables in t and u coordinates.
 
Back
Top