The important source of aerosols in
the stratosphere is the formation of carbonyl sulfide (COS)
droplets. These droplets are more dangerous than carbon dioxide.
Although volcanism injects millions
of tons of SO2 into the atmosphere every few
years, scientists have found that during other
times, COS is by far the biggest source of
sulfur compounds in the stratosphere,
leading to the production of sulphuric acid
aerosols.
NASA has tabulated the sources and sinks of COS. At present, the sinks outnumber the sources.
From this table, we created a python dictionary with sources names as keys and tuples with rate and type as values. We then created lists of sources, sinks, types using comprehension. We also calculated the number of molecules of COS using avagadro number and volume of atmosphetre. For formatting we used the length of longest name.
# Constants for Atmospheric Calculations
AVOGADRO = 6.023e23 # molecules/mole
MOL_WT_COS = 60 # g/mole
VOL_ATM_KM3 = 4.23e09 # Atmospheric volume in km^3
MT_TO_GRAMS = 1e12 # 1 Million Ton = 10^12 grams
KM3_TO_M3 = 1e09 # 1 km^3 = 10^9 m^3
# Data structure: {Source Name: (Rate in Mt/yr, Type)}
carbonyl_sulfide = {
"Open ocean": (0.10, "Natural"),
"Coastal ocean, salt marshes": (0.20, "Natural"),
"Anoxic soils": (0.02, "Natural"),
"Wetlands": (0.03, "Natural"),
"Volcanism": (0.05, "Natural"),
"Natural CS2 oxidation": (0.21, "Natural"),
"Oxic soils": (-0.92, "Natural"),
"Vegetation": (-0.56, "Natural"),
"Anthropogenic CS2 oxidation": (0.21, "Human"),
"Biomass burning": (0.07, "Human"),
"Anthropogenic production": (0.12, "Human"),
"Precipitation": (0.13, "Other"),
"DMS oxidation": (0.17, "Other"),
"Reactions with OH": (-0.24, "Other"),
"Reactions with oxygen": (-0.02, "Other"),
"Photodissociation": (-0.05, "Other"),
}
# 1. Calculate dynamic padding for clean table formatting
source_names = list(carbonyl_sulfide.keys())
max_str_len = len(max(source_names, key=len)) + 2
# 2. Categorise into Sources and Sinks
sources = {k: v for k, (v, t) in carbonyl_sulfide.items() if v > 0}
sinks = {k: v for k, (v, t) in carbonyl_sulfide.items() if v < 0}
# 3. Print Sources Table
print(f"{'**** Sources of COS ****':^{max_str_len + 10}}")
print(f"{'Source Name':<{max_str_len}} {'Mt/yr':>8}")
print("-" * (max_str_len + 10))
for name, val in sources.items():
print(f"{name:<{max_str_len}} {val:>8.2f}")
# 4. Calculate Net Flux (Mass Balance)
sum_sources = sum(sources.values())
sum_sinks = sum(sinks.values())
net_diff = sum_sources + sum_sinks # Result is in Mt/yr
# 5. Molecule Calculations
# Convert Net Difference (Mt) to Grams, then to Molecules
diff_grams = abs(net_diff) * MT_TO_GRAMS
total_molecules = (diff_grams / MOL_WT_COS) * AVOGADRO
# Convert Atmospheric Volume to m^3
vol_atm_m3 = VOL_ATM_KM3 * KM3_TO_M3
molecules_per_m3 = total_molecules / vol_atm_m3
# 6. Human Impact Analysis
human_sources = {k: v for k, (v, t) in carbonyl_sulfide.items() if t == "Human" and v > 0}
sum_human = sum(human_sources.values())
pct_human_contribution = (sum_human / sum_sources) * 100
# 7. Final Output Results
print("\n" + "="*40)
print(f"{'ATMOSPHERIC ANALYSIS':^40}")
print("="*40)
print(f"Total Annual Sources: {sum_sources:>6.2f} Mt/yr")
print(f"Total Annual Sinks: {abs(sum_sinks):>6.2f} Mt/yr")
print(f"Net Flux: {net_diff:>6.2f} Mt/yr")
if net_diff > 0:
print("\nRESULT: COS production exceeds reduction.")
else:
print("\nRESULT: COS reduction exceeds production.")
print(f"Concentration Change: {molecules_per_m3:.2e} molecules/m3 per year")
print(f"Human Contribution: {pct_human_contribution:.1f}% of total sources")
print("="*40)
No comments:
Post a Comment