Project

General

Profile

Calculating global sum from "per area" variable

Added by Andreas Hilboll almost 11 years ago

Hi,

I have a variable with units of "m-2":

float emiss_ene(time, lat, lon) ;
        emiss_ene:standard_name = "tendency_of_atmosphere_mass_content_of_nox_expressed_as_nitrogen_monoxide_due_to_emission_from_energy_production_and_distribution" ;
        emiss_ene:long_name = "energy production and distribution emissions of nitric oxides (NOx as NO)" ;
        emiss_ene:units = "kg m-2 s-1" ;
        emiss_ene:code = 1 ;
        emiss_ene:molecular_weight = 30. ;
        emiss_ene:molecular_weight_units = "g mol-1" ;
        emiss_ene:source_categories = "1A1, 1B" ;

How can I use cdo to calculate the global sum of this variable, which then has units kg s-1 and takes into account the areas of the grid cells? I suppose I could use fldmean for this, but am unsure about how to specify/calculate the weights correctly.

Your help is greatly appreciated :)


Replies (2)

RE: Calculating global sum from "per area" variable - Added by Alexander Loew almost 11 years ago

HI,

operators like fldmean() or fldsum() perform already an area weighted calculation. You can even have a look on the weights using cdo cellarea.
Thus it sounds to me that there is actually nothing to do else than using the given operators in your case.

Alex

RE: Calculating global sum from "per area" variable - Added by Andreas Hilboll almost 11 years ago

Alex,

thanks for pointing me into the right direction. While fldmean() does do area weighting, fldsum() does not. I ended up doing this:

$ cdo fldsum -mul -timavg -mulc,365 -mulc,86400 \
                          -mulc,0.46667 -mulc,1000 input_grid.nc \
                  -gridarea input_grid.nc \
                  global_sum.nc
    (1-2/2)