From f72653a9e3735aae54b620e84d4d1a338e4b1494 Mon Sep 17 00:00:00 2001 From: carl-drews Date: Tue, 15 Oct 2024 12:20:30 -0600 Subject: [PATCH] Added N2, O2, and Argon caculated for WACCM temperature and pressure. --- src/acom_music_box/tools/waccmToMusicBox.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/acom_music_box/tools/waccmToMusicBox.py b/src/acom_music_box/tools/waccmToMusicBox.py index d0f4b162..d0c6d37b 100644 --- a/src/acom_music_box/tools/waccmToMusicBox.py +++ b/src/acom_music_box/tools/waccmToMusicBox.py @@ -220,6 +220,17 @@ def readWACCM(waccmMusicaDict, latitude, longitude, return (musicaDict) +# Add molecular Nitrogen, Oxygen, and Argon to dictionary. +# varValues = already read from WACCM, contains (name, concentration, units) +# return varValues with N2, O2, and Ar added +def addStandardGases(varValues): + varValues["N2"] = ("N2", 0.78084, "mol/mol") # standard fraction by volume + varValues["O2"] = ("O2", 0.20946, "mol/mol") + varValues["Ar"] = ("Ar", 0.00934, "mol/mol") + + return(varValues) + + # set up indexes for the tuple musicaIndex = 0 valueIndex = 1 @@ -433,6 +444,9 @@ def main(): lat, lon, when, waccmDir, waccmFilename) logger.info(f"Original WACCM varValues = {varValues}") + # add molecular Nitrogen, Oxygen, and Argon + varValues = addStandardGases(varValues) + # Perform any conversions needed, or derive variables. varValues = convertWaccm(varValues) logger.info(f"Converted WACCM varValues = {varValues}")