Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

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.
 
Top