├── Data set.xlsx ├── YEAR 1 & 2 DATA FOR ANALYSIS updates.xlsx ├── updated2025 ├── Atmospheric climate modeling.py ├── update ├── updated └── README.md /Data set.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otutu11/Atmospheric--Climate-Modeling/main/Data set.xlsx -------------------------------------------------------------------------------- /YEAR 1 & 2 DATA FOR ANALYSIS updates.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otutu11/Atmospheric--Climate-Modeling/main/YEAR 1 & 2 DATA FOR ANALYSIS updates.xlsx -------------------------------------------------------------------------------- /updated2025: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import matplotlib.pyplot as plt 3 | import numpy as np 4 | 5 | # Constants 6 | CLIMATE_SENSITIVITY = 3.0 # °C per doubling of CO2 7 | CO2_PREINDUSTRIAL = 280 # ppm 8 | BASELINE_TEMP = 14.0 # °C, assumed pre-industrial average temperature 9 | 10 | def read_co2_data(file_path): 11 | return pd.read_csv(file_path) 12 | 13 | def calculate_radiative_forcing(co2_ppm): 14 | """Radiative forcing (W/m²) = 5.35 * ln(C/C0)""" 15 | return 5.35 * np.log(co2_ppm / CO2_PREINDUSTRIAL) 16 | 17 | def temperature_change(radiative_forcing): 18 | """ΔT = λ * ΔF, where λ = climate sensitivity per unit forcing""" 19 | lambda_eff = CLIMATE_SENSITIVITY / (5.35 * np.log(2)) # Sensitivity per W/m² 20 | return lambda_eff * radiative_forcing 21 | 22 | def run_model(data): 23 | data['Radiative_Forcing'] = calculate_radiative_forcing(data['CO2_ppm']) 24 | data['Temperature_Change'] = temperature_change(data['Radiative_Forcing']) 25 | data['Global_Temp'] = BASELINE_TEMP + data['Temperature_Change'] 26 | return data 27 | 28 | def plot_results(data): 29 | plt.figure(figsize=(10, 6)) 30 | plt.plot(data['Year'], data['Global_Temp'], marker='o', label='Simulated Global Temp') 31 | plt.xlabel('Year') 32 | plt.ylabel('Global Avg Temperature (°C)') 33 | plt.title('Simulated Global Temperature vs CO₂ Concentration') 34 | plt.grid(True) 35 | plt.legend() 36 | plt.tight_layout() 37 | plt.show() 38 | 39 | # Main 40 | if __name__ == "__main__": 41 | data = read_co2_data('co2_data.csv') 42 | results = run_model(data) 43 | plot_results(results) 44 | print(results) 45 | -------------------------------------------------------------------------------- /Atmospheric climate modeling.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | from scipy.integrate import solve_ivp 4 | 5 | # Constants 6 | dt = 0.01 # Time step (years) 7 | total_time = 100 # Total simulation time (years) 8 | num_steps = int(total_time / dt) 9 | 10 | # Atmospheric parameters 11 | solar_constant = 1361 # W/m^2 12 | albedo = 0.3 # Reflection coefficient 13 | stefan_boltzmann = 5.67e-8 # Stefan-Boltzmann constant (W/m^2K^4) 14 | 15 | def energy_balance_model(t, T, greenhouse_factor=1.2): 16 | """ 17 | Simplified energy balance model for Earth's atmosphere. 18 | :param t: Time (years) 19 | :param T: Temperature (Kelvin) 20 | :param greenhouse_factor: Multiplicative factor for greenhouse gas effect 21 | """ 22 | absorbed_radiation = (1 - albedo) * solar_constant / 4 23 | emitted_radiation = greenhouse_factor * stefan_boltzmann * (T ** 4) 24 | dT_dt = (absorbed_radiation - emitted_radiation) / (4.2e9) # Heat capacity factor 25 | return dT_dt 26 | 27 | # Initial temperature (Kelvin) 28 | T0 = 288 # Approximate global average temperature 29 | 30 | # Solve using numerical integration 31 | solution = solve_ivp(energy_balance_model, [0, total_time], [T0], t_eval=np.linspace(0, total_time, num_steps)) 32 | 33 | # Plot results 34 | plt.figure(figsize=(10, 5)) 35 | plt.plot(solution.t, solution.y[0], label="Global Temperature", color='b') 36 | plt.xlabel("Time (years)") 37 | plt.ylabel("Temperature (K)") 38 | plt.title("Simplified Atmospheric-Climate Model") 39 | plt.legend() 40 | plt.grid() 41 | plt.show() 42 | 43 | print("Final Temperature after {} years: {:.2f} K".format(total_time, solution.y[0][-1])) 44 | -------------------------------------------------------------------------------- /update: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | from matplotlib.animation import FuncAnimation 4 | 5 | # Simulation parameters 6 | nx, ny = 100, 50 # Grid size 7 | dx, dy = 1.0, 1.0 # Spatial resolution (km) 8 | dt = 0.1 # Time step (days) 9 | steps = 500 # Total number of time steps 10 | 11 | # Physical constants 12 | solar_constant = 1361 # W/m^2 13 | albedo = 0.3 # Reflectivity of Earth's surface 14 | greenhouse_factor = 0.6 # Portion of heat retained by atmosphere 15 | heat_capacity = 1005 # J/kg·K (air) 16 | air_density = 1.225 # kg/m^3 17 | diffusivity = 0.1 # Thermal diffusivity (simplified) 18 | 19 | # Convert radiation to temperature units 20 | solar_input = (1 - albedo) * solar_constant * dt * 86400 / (air_density * heat_capacity) 21 | 22 | # Initialize temperature grid (Kelvin) 23 | T = np.full((ny, nx), 288.0) # 15°C 24 | 25 | # Add poles and equator temperature variation 26 | for j in range(ny): 27 | lat_factor = np.cos(np.pi * (j - ny/2) / ny) 28 | T[j, :] += 10 * lat_factor 29 | 30 | # For animation 31 | fig, ax = plt.subplots() 32 | img = ax.imshow(T, cmap='coolwarm', vmin=250, vmax=310) 33 | plt.colorbar(img, label='Temperature (K)') 34 | plt.title('Atmospheric Climate Model') 35 | 36 | def update(frame): 37 | global T 38 | T_new = T.copy() 39 | 40 | # Heat diffusion (2D Laplacian) 41 | T_new[1:-1, 1:-1] += diffusivity * dt * ( 42 | (T[2:, 1:-1] - 2*T[1:-1, 1:-1] + T[:-2, 1:-1]) / dy**2 + 43 | (T[1:-1, 2:] - 2*T[1:-1, 1:-1] + T[1:-1, :-2]) / dx**2 44 | ) 45 | 46 | # Solar input + greenhouse effect 47 | lat_radians = np.linspace(-np.pi/2, np.pi/2, ny) 48 | solar_distribution = np.cos(lat_radians)**2 49 | for j in range(ny): 50 | T_new[j, :] += solar_input * solar_distribution[j] * (1 + greenhouse_factor) 51 | 52 | T = T_new 53 | img.set_data(T) 54 | return [img] 55 | 56 | ani = FuncAnimation(fig, update, frames=steps, interval=50, blit=True) 57 | plt.show() 58 | -------------------------------------------------------------------------------- /updated: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | from matplotlib.animation import FuncAnimation 4 | 5 | # Simulation parameters 6 | nx, ny = 100, 50 # Grid size 7 | dx, dy = 1.0, 1.0 # Spatial resolution (km) 8 | dt = 0.1 # Time step (days) 9 | steps = 500 # Total number of time steps 10 | 11 | # Physical constants 12 | solar_constant = 1361 # W/m^2 13 | albedo = 0.3 # Reflectivity of Earth's surface 14 | greenhouse_factor = 0.6 # Portion of heat retained by atmosphere 15 | heat_capacity = 1005 # J/kg·K (air) 16 | air_density = 1.225 # kg/m^3 17 | diffusivity = 0.1 # Thermal diffusivity (simplified) 18 | 19 | # Convert radiation to temperature units 20 | solar_input = (1 - albedo) * solar_constant * dt * 86400 / (air_density * heat_capacity) 21 | 22 | # Initialize temperature grid (Kelvin) 23 | T = np.full((ny, nx), 288.0) # 15°C 24 | 25 | # Add poles and equator temperature variation 26 | for j in range(ny): 27 | lat_factor = np.cos(np.pi * (j - ny/2) / ny) 28 | T[j, :] += 10 * lat_factor 29 | 30 | # For animation 31 | fig, ax = plt.subplots() 32 | img = ax.imshow(T, cmap='coolwarm', vmin=250, vmax=310) 33 | plt.colorbar(img, label='Temperature (K)') 34 | plt.title('Atmospheric Climate Model') 35 | 36 | def update(frame): 37 | global T 38 | T_new = T.copy() 39 | 40 | # Heat diffusion (2D Laplacian) 41 | T_new[1:-1, 1:-1] += diffusivity * dt * ( 42 | (T[2:, 1:-1] - 2*T[1:-1, 1:-1] + T[:-2, 1:-1]) / dy**2 + 43 | (T[1:-1, 2:] - 2*T[1:-1, 1:-1] + T[1:-1, :-2]) / dx**2 44 | ) 45 | 46 | # Solar input + greenhouse effect 47 | lat_radians = np.linspace(-np.pi/2, np.pi/2, ny) 48 | solar_distribution = np.cos(lat_radians)**2 49 | for j in range(ny): 50 | T_new[j, :] += solar_input * solar_distribution[j] * (1 + greenhouse_factor) 51 | 52 | T = T_new 53 | img.set_data(T) 54 | return [img] 55 | 56 | ani = FuncAnimation(fig, update, frames=steps, interval=50, blit=True) 57 | plt.show() 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Atmospheric Climate Modeling 2 | 3 | ## Overview 4 | This project focuses on atmospheric and climate modeling using Python. It includes simulations for greenhouse gas (GHG) emissions, climate variability, and weather forecasting. The model integrates data analysis, numerical modeling, and visualization techniques to study the impact of atmospheric changes on climate. 5 | 6 | ## Features 7 | - Greenhouse gas (GHG) emission simulations 8 | - Climate change impact analysis 9 | - Atmospheric physics and fluid dynamics modeling 10 | - Weather forecasting modules 11 | - Data assimilation from satellite and observational sources 12 | 13 | ## Requirements 14 | To run this project, install the following dependencies: 15 | 16 | ```bash 17 | pip install numpy scipy pandas xarray netCDF4 matplotlib cartopy 18 | ``` 19 | 20 | Additionally, install `geopandas` and `shapely` for geographical data processing: 21 | 22 | ```bash 23 | pip install geopandas shapely 24 | ``` 25 | 26 | ## Installation 27 | Clone this repository and navigate to the project directory: 28 | 29 | ```bash 30 | git clone https://github.com/yourusername/atmospheric-climate-modeling.git 31 | cd atmospheric-climate-modeling 32 | 33 | 34 | ## Usage 35 | 1. **Data Preprocessing:** Load climate datasets (e.g., NetCDF files) using `xarray`. 36 | 2. **Model Execution:** Run numerical simulations using predefined scripts. 37 | 3. **Visualization:** Generate climate maps and time-series plots with `matplotlib` and `cartopy`. 38 | 39 | Example usage: 40 | 41 | ```python 42 | from model import ClimateModel 43 | 44 | # Initialize model 45 | climate_model = ClimateModel() 46 | 47 | # Run simulation 48 | climate_model.run_simulation() 49 | 50 | # Visualize results 51 | climate_model.plot_results() 52 | ``` 53 | 54 | ## Data Sources 55 | - NASA Earth Observations (NEO) 56 | - NOAA Climate Data 57 | - IPCC Climate Reports 58 | - Copernicus Climate Change Service (C3S) 59 | 60 | ## Contributing 61 | Contributions are welcome! Please submit a pull request or open an issue for discussions. 62 | 63 | ## License 64 | This project is licensed under the MIT License. 65 | 66 | ## Contact 67 | For inquiries or contributions, contact: [akajiakuflowz@gmail.com](mailto:akajiakuflowz@gmail.com). 68 | 69 | --------------------------------------------------------------------------------