Unidata / MetPy

MetPy is a collection of tools in Python for reading, visualizing and performing calculations with weather data.
https://unidata.github.io/MetPy/
BSD 3-Clause "New" or "Revised" License
1.26k stars 415 forks source link

Constants: dry air molecular weight #1468

Open IslandOfDreams opened 4 years ago

IslandOfDreams commented 4 years ago

IS (MetPy v12.2): constants.py, line 105: Md = dry_air_molecular_weight = units.Quantity(28.9644, 'g / mol')

SHOULD BE:

 WITHOUT accounting for changing concentration of CO2 (static concentration of 400 ppm assumed):
      Md = dry_air_molecular_weight = units.Quantity(28.96546, 'g / mol')

 WITH accounting for concentration of CO2:
      Md = dry_air_molecular_weight = [28.96546 + 12.011 · (xCO2 − 0.0004)] * units.('g / mol')

      with
           xCO2 being the mole fraction of carbon dioxide [ppm]
           e. g. from 'https://www.esrl.noaa.gov/gmd/ccgg/trends/global.html'

      'Md' ideally shoud be a function of the concentration of CO2.

 Reference:
      Picard, Davis, Glaeser, Fujii - Revised formula for the density of moist air (CIPM-2007)
dopplershift commented 4 years ago

Same as #1467 with regards to our on-going constants work. Thanks for this reference, I had not seen that before.

"Constants" that vary are something we haven't really worked out, but really need to in other contexts like latent heat of vaporization for water. The best solution I've come to is provide a good default value but also provide a function that can compute the adjusted value, for use broadly, including in our computations where the requisite information for adjustment is present.

Can you provide any additional insight on what led you to find our less robust value?