From 337e44d16a28fdb6c080a7911ad0bfd9498250d0 Mon Sep 17 00:00:00 2001 From: Sierd de Vries Date: Fri, 13 Jun 2025 14:38:35 +0200 Subject: [PATCH 01/14] fixed dependencies for python 3.13 (#236) --- aeolis/vegetation.py | 10 ---------- aeolis/wind.py | 13 ++----------- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/aeolis/vegetation.py b/aeolis/vegetation.py index 809c6a86..f8afd0f0 100644 --- a/aeolis/vegetation.py +++ b/aeolis/vegetation.py @@ -28,23 +28,13 @@ import logging from scipy import ndimage, misc import numpy as np -import math -#import matplotlib.pyplot as plt from aeolis.wind import * import aeolis.rotation # package modules import aeolis.wind -#from aeolis.utils import * import numpy as np -from scipy.integrate import quad -from scipy.integrate import romberg -from scipy.optimize import root_scalar -from scipy.signal import convolve -from scipy.special import sici -from scipy.special import erfi -import matplotlib.pyplot as plt # initialize logger logger = logging.getLogger(__name__) diff --git a/aeolis/wind.py b/aeolis/wind.py index 0ea51ffc..43ad78a2 100644 --- a/aeolis/wind.py +++ b/aeolis/wind.py @@ -28,18 +28,9 @@ import numpy as np import logging -import operator -#import scipy.special -#import scipy.interpolate -from scipy import ndimage, misc -import matplotlib.pyplot as plt -from scipy.integrate import quad -from scipy.integrate import romberg + +from scipy import ndimage from scipy.optimize import root_scalar -from scipy.signal import convolve -from scipy.special import sici -from scipy.special import erfi -from scipy.interpolate import griddata # package modules diff --git a/pyproject.toml b/pyproject.toml index 8e7782e4..4aa3a01c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ dependencies = [ "bmi-python", "netCDF4", "scipy", - "numpy<1.24,>=1.18", + "numpy", "matplotlib", "numba", ] From f55bd6fec2f613ac30b5f7d0ecdd06afac5bac53 Mon Sep 17 00:00:00 2001 From: Sierd Date: Mon, 7 Jul 2025 08:31:55 +0200 Subject: [PATCH 02/14] test with timing function --- .../vanWesten2024/blowout/blowout_short.txt | 155 +++++++++++++ run_with_timing.py | 213 ++++++++++++++++++ 2 files changed, 368 insertions(+) create mode 100644 aeolis/examples/vanWesten2024/blowout/blowout_short.txt create mode 100644 run_with_timing.py diff --git a/aeolis/examples/vanWesten2024/blowout/blowout_short.txt b/aeolis/examples/vanWesten2024/blowout/blowout_short.txt new file mode 100644 index 00000000..ef2131b7 --- /dev/null +++ b/aeolis/examples/vanWesten2024/blowout/blowout_short.txt @@ -0,0 +1,155 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% AeoLiS model configuration %% +%% Date: 2020-04-22 12:26:11 %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% -------------------- [Timing] ----------------------------- %% +dt = 3600.000 % [s] Timeinterval between timesteps +tstart = 36979200 % [s] Starting time of the simulation (03-04-2013) +tstop = 37000000 % 66674520 % [s] End time of the simulation +restart = None % [s] Interval for which to write restart files +refdate = 2012-01-01 00:00 % [-] Reference datetime in netCDF output + +%% -------------------- [Grid files *.grd] ------------------- %% +xgrid_file = x_NPZK.grd % Filename of ASCII file with x-coordinates of grid cells +ygrid_file = y_NPZK.grd % Filename of ASCII file with y-coordinates of grid cells +bed_file = z_NPZK.grd % Filename of ASCII file with bed level heights of grid cells +ne_file = zne_NPZK.grd % Filename of ASCII file with non-erodible layer +veg_file = veg_NPZK.grd % Filename of ASCII file with initial vegetation density +wave_mask = wave_mask_NPZK.grd % Filename of ASCII file with mask for wave height +tide_mask = tide_mask_NPZK.grd % Filename of ASCII file with mask for tidal elevation +vver_mask = vver_mask_NPZK.grd % Filename of ASCII file with mask for vertical growth (V_ver) + +%% -------------------- [Time series *.txt] ------------------ %% +tide_file = tide_hvh_2012_2022_ref20120101.txt % Filename of ASCII file with time series of water levels +wave_file = waves_euro_2012_2022_ref20120101.txt % Filename of ASCII file with time series of wave heights (and periods) +wind_file = wind_NPZK_2012_2023.txt % Filename of ASCII file with time series of wind velocity and direction + +%% -------------------- [Output] ----------------------------- %% +output_times = 604800.000 % [s] Timeinterval [s] between *.nc output file +output_vars = zb zs zne ustar ustarn ustars ustars_avg ustarn_avg u us un SWL TWL rhoveg moist_avg % [-] List of output variables for in *.nc output file +visualization = T + +%% -------------------- [Flags Processes] -------------------- %% +process_wind = T % [T/F] Enable the process of wind +process_shear = T % [T/F] Enable the process of wind shear +process_tide = T % [T/F] Enable the process of tides +process_wave = T % [T/F] Enable the process of waves +process_runup = T % [T/F] Enable the process of wave runup +process_moist = T % [T/F] Enable the process of moist +process_mixtoplayer = T % [T/F] Enable the process of mixing +process_threshold = T % [T/F] Enable the process of threshold +process_transport = T % [T/F] Enable the process of transport +process_bedupdate = T % [T/F] Enable the process of bed updating +process_avalanche = T % [T/F] Enable the process of avalanching +process_separation = F % [T/F] Enable the including of separation bubble +process_vegetation = T % [T/F] Enable the process of vegetation +process_wet_bed_reset = T + +%% -------------------- [Flags Threshold] -------------------- %% +th_grainsize = T % [T/F] Enable wind velocity threshold based on grainsize +th_bedslope = F % [T/F] Enable wind velocity threshold based on bedslope +th_moisture = T % [T/F] Enable wind velocity threshold based on moisture +th_sheltering = F % [T/F] Enable wind velocity threshold based on roughness +th_nelayer = T % [T/F] Enable wind velocity threshold based on a non-erodible layer + +%% -------------------- [General physics] -------------------- %% +g = 9.81 % [m/s^2] Gravitational constant +v = 0.000015 % [m^2/s] Air viscosity +rhoa = 1.225 % [kg/m^3] Air density +rhog = 2650.0 % [kg/m^3] Grain density +rhow = 1025.0 % [kg/m^3] Water density +porosity = 0.4 % [-] Sediment porosity +cpair = 0.0010035 % [MJ/kg/oC] Specific heat capacity air + +%% -------------------- [Sediment] --------------------------- %% +nlayers = 1 % [-] Number of bed layers +layer_thickness = 0.05000 % [m] Thickness of bed layers +nfractions = 1 % [-] Number of sediment fractions +grain_dist = 1.0 % [-] Initial distribution of sediment fractions +grain_size = 0.00025 % [m] Average grain size of each sediment fraction + +%% -------------------- [Wind and shear] --------------------- %% +wind_convention = nautical % [-] Convention used for the wind direction in the input files (cartesian or nautical) +alfa = 0 % [deg] Real-world grid cell orientation wrt the North (clockwise) +k = 0.003 % [m] Bed roughness +z = 10. % [m] Measurement height of wind velocity +kappa = 0.41 % [-] Von Kármán constant +h = None % [m] Representative height of saltation layer +L = 100. % [m] Typical length scale of dune feature (perturbation) +l = 1. % [m] Inner layer height (perturbation) +m = 1. % [-] Factor to account for difference between average and maximum shear stress + +%% -------------------- [Transport] -------------------------- %% +bi = 0.050000 % [-] Bed interaction factor +method_transport = bagnold % [-] Name of method to compute equilibrium sediment transport rate +method_grainspeed = duran_full % [-] Name of method to assume/compute grainspeed +Aa = 0.085 % [-] Constant in formulation for wind velocity threshold based on grain size +Cb = 1.5 % [-] Constant in bagnold formulation for equilibrium sediment concentration +Ck = 2.78 % [-] Constant in kawamura formulation for equilibrium sediment concentration +Cl = 6.7 % [-] Constant in lettau formulation for equilibrium sediment concentration +Cdk = 5. % [-] Constant in DK formulation for equilibrium sediment concentration + +%% -------------------- [Solver] ----------------------------- %% +T = 1. % [s] Adaptation time scale in advection equation +solver = steadystate % [-] Numerical solver of advection scheme +CFL = 1. % [-] CFL number to determine time step in explicit scheme +accfac = 1. % [-] Numerical acceleration factor +scheme = euler_backward % [-] Name of numerical scheme (euler_forward, euler_backward or crank_nicolson) +max_error = 0.000001 % [-] Maximum error at which to quit iterative solution in implicit numerical schemes +max_iter = 1000 % [-] Maximum number of iterations at which to quit iterative solution in implicit numerical schemes +% max_bedlevel_change = 0.01 % [m] Maximum bedlevel change after one timestep. Next timestep dt will be modified (use 999. if not used) + +%% -------------------- [Boundary conditions] ---------------- %% +boundary_onshore = constant % [-] Name of onshore boundary conditions (flux, constant, uniform, gradient) +boundary_lateral = circular % [-] Name of lateral boundary conditions (circular, constant ==noflux) +boundary_offshore = constant % [-] Name of offshore boundary conditions (flux, constant, uniform, gradient) +offshore_flux = 0. % [-] Factor to determine offshore boundary flux as a function of Q0 (= 1 for saturated flux , = 0 for noflux) +constant_offshore_flux = 0. % [kg/m/s] Constant input flux at offshore boundary +onshore_flux = 0. % [-] Factor to determine onshore boundary flux as a function of Q0 (= 1 for saturated flux , = 0 for noflux) +constant_onshore_flux = 0. % [kg/m/s] Constant input flux at offshore boundary +lateral_flux = 0. % [-] Factor to determine lateral boundary flux as a function of Q0 (= 1 for saturated flux , = 0 for noflux) +sedimentinput = 0. % [-] Constant boundary sediment influx (only used in solve_pieter) + +%% -------------------- [Rotating shear-grid] ---------------- %% +dx = 2.0 % [m] Size of dimension of the computational grid that is generated for a rotating shear computation in x-direction +dy = 2.0 % [m] Size of dimension of the computational grid that is generated for a rotating shear computation in x-direction +buffer_width = 5.0 % [m] Width of the bufferzone around the rotational grid for wind perturbation + +%% -------------------- [Vegetation] ------------------------- %% +sigma = 4.2 % [-] Ratio between basal area and frontal area of roughness elements +beta = 130.000000 % [-] Ratio between drag coefficient of roughness elements and bare surface +gamma_vegshear = 16. % [-] Roughness factor for the shear stress reduction by vegetation +avg_time = 86400. % [s] Indication of the time period over which the bed level change is averaged for vegetation growth +dzb_interval = 86400. % [s] Interval used for calcuation of vegetation growth +hveg_max = 1. % [m] Max height of vegetation +dzb_opt = 0. % [m/year] Sediment burial for optimal growth +V_ver = 3. % [m/year] Vertical growth +V_lat = 0. % [m/year] Lateral growth +germinate = 0. % [1/year] Possibility of germination per year +lateral = 0. % [1/year] Posibility of lateral expension per year +veg_gamma = 0.05 % [-] Constant on influence of sediment burial +veg_sigma = 0. % [-] Sigma in gaussian distrubtion of vegetation cover filter +vegshear_type = raupach % [-] Choose the Raupach grid based solver (1D or 2D) or the Okin approach (1D only) +veg_min_elevation = -10 + +%% -------------------- [Seperation] ------------------------- %% +c_b = 0.2 % [-] Slope at the leeside of the separation bubble # c = 0.2 according to Durán 2010 (Sauermann 2001: c = 0.25 for 14 degrees) +mu_b = 20. % [deg] Minimum required slope for the start of flow separation +sep_filter_iterations = 0 % [-] Number of filter iterations on the separation bubble (0 = no filtering) +zsep_y_filter = F % [T/F] Boolean for turning on/off the filtering of the separation bubble height in y-direction + +%% -------------------- [Soil moisture] ---------------------- %% +Tdry = 5400.000 % [s] Adaptation time scale for soil drying +eps = 0.2 % [m] Minimum water depth to consider a cell "flooded" +method_moist = belly_johnson % [-] Name of method to compute wind velocity threshold based on soil moisture content + +%% -------------------- [Waves] ------------------------------ %% +Tbedreset = 86400. % [s] Adaptation time for resetting morphology in the Swash-zone +xi = 0.3 % [-] Surf similarity parameter +facDOD = 0.5 % [-] Ratio between depth of disturbance and local wave height + +%% -------------------- [Avalanching] ------------------------ %% +theta_dyn = 44. % [degrees] Initial Dynamic angle of repose, critical dynamic slope for avalanching +theta_stat = 45. % [degrees] Initial Static angle of repose, critical static slope for avalanching +max_iter_ava = 100 % [-] Maximum number of iterations at which to quit iterative solution in avalanching calculation \ No newline at end of file diff --git a/run_with_timing.py b/run_with_timing.py new file mode 100644 index 00000000..07d30a27 --- /dev/null +++ b/run_with_timing.py @@ -0,0 +1,213 @@ +#!/usr/bin/env python3 +""" +Script to run AeoLiS model with timing analysis +""" + +import os +import time +import sys +import logging +from datetime import datetime, timedelta +import traceback +import cProfile +import pstats +import io + +# Try to import psutil for memory monitoring (optional) +try: + import psutil + HAS_PSUTIL = True +except ImportError: + HAS_PSUTIL = False + print("Note: psutil not available, memory monitoring will be skipped") + +# Add the aeolis package to the path +sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'aeolis')) + +try: + from aeolis.model import AeoLiSRunner + print("✓ AeoLiS imported successfully") +except ImportError as e: + print(f"✗ Error importing AeoLiS: {e}") + sys.exit(1) + +def format_time(seconds): + """Format seconds into readable time string""" + if seconds < 60: + return f"{seconds:.2f} seconds" + elif seconds < 3600: + return f"{seconds/60:.2f} minutes" + else: + return f"{seconds/3600:.2f} hours" + +def get_memory_usage(): + """Get current memory usage in MB""" + if HAS_PSUTIL: + process = psutil.Process(os.getpid()) + return process.memory_info().rss / 1024 / 1024 + else: + return 0.0 # Return 0 if psutil not available + +def run_aeolis_with_timing(config_file): + """Run AeoLiS model with detailed timing analysis using cProfile""" + + print("=" * 60) + print("AeoLiS Model Execution with cProfile Analysis") + print("=" * 60) + print(f"Configuration file: {config_file}") + print(f"Start time: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}") + if HAS_PSUTIL: + print(f"Initial memory usage: {get_memory_usage():.2f} MB") + print("=" * 60) + + # Change to the directory containing the configuration file + config_dir = os.path.dirname(os.path.abspath(config_file)) + original_dir = os.getcwd() + os.chdir(config_dir) + + try: + # Record start time + start_time = time.time() + + # Initialize model + print("\n📊 Initializing AeoLiS model...") + init_start = time.time() + model = AeoLiSRunner(configfile=os.path.basename(config_file)) + init_end = time.time() + print(f" ✓ Model initialization completed in {format_time(init_end - init_start)}") + if HAS_PSUTIL: + print(f" Memory usage after init: {get_memory_usage():.2f} MB") + + # Run model with cProfile + print("\n🚀 Running AeoLiS simulation with cProfile...") + run_start = time.time() + + # Create profiler + profiler = cProfile.Profile() + profiler.enable() + + # Run the model + model.run() + + # Stop profiling + profiler.disable() + run_end = time.time() + + # Calculate total time + total_time = run_end - start_time + + print("\n" + "=" * 60) + print("TIMING SUMMARY") + print("=" * 60) + print(f"Model initialization: {format_time(init_end - init_start)}") + print(f"Model execution: {format_time(run_end - run_start)}") + print(f"Total runtime: {format_time(total_time)}") + if HAS_PSUTIL: + print(f"Peak memory usage: {get_memory_usage():.2f} MB") + print(f"End time: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}") + print("=" * 60) + + # Performance metrics + print("\n📈 PERFORMANCE METRICS") + print("=" * 60) + if hasattr(model, 'p') and hasattr(model.p, 'tstop') and hasattr(model.p, 'tstart'): + sim_duration = model.p['tstop'] - model.p['tstart'] + if sim_duration > 0: + sim_speed = sim_duration / total_time + print(f"Simulation duration: {format_time(sim_duration)} (model time)") + print(f"Simulation speed: {sim_speed:.2f}x real-time") + print(f"Time step efficiency: {sim_duration/3600:.1f} model hours per wall-clock hour") + + # Generate profiling report + print("\n🔍 PROFILING REPORT") + print("=" * 60) + + # Save detailed profile to file + profile_file = "aeolis_profile.prof" + profiler.dump_stats(profile_file) + print(f"Detailed profile saved to: {profile_file}") + + # Create in-memory string buffer for profile output + s = io.StringIO() + ps = pstats.Stats(profiler, stream=s) + + # Sort by cumulative time and show top functions + ps.sort_stats('cumulative') + ps.print_stats(20) # Top 20 functions by cumulative time + + profile_output = s.getvalue() + print("\nTop 20 functions by cumulative time:") + print(profile_output) + + # Sort by internal time and show top functions + s = io.StringIO() + ps = pstats.Stats(profiler, stream=s) + ps.sort_stats('tottime') + ps.print_stats(20) # Top 20 functions by total time + + profile_output = s.getvalue() + print("\nTop 20 functions by total time:") + print(profile_output) + + # Save human-readable profile report + report_file = "aeolis_profile_report.txt" + with open(report_file, 'w') as f: + f.write("AeoLiS Model Profiling Report\n") + f.write("=" * 60 + "\n") + f.write(f"Generated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n") + f.write(f"Configuration: {config_file}\n") + f.write(f"Total runtime: {format_time(total_time)}\n\n") + + # Cumulative time report + f.write("TOP FUNCTIONS BY CUMULATIVE TIME:\n") + f.write("-" * 40 + "\n") + ps = pstats.Stats(profiler, stream=f) + ps.sort_stats('cumulative') + ps.print_stats(50) + + # Total time report + f.write("\n\nTOP FUNCTIONS BY TOTAL TIME:\n") + f.write("-" * 40 + "\n") + ps.sort_stats('tottime') + ps.print_stats(50) + + print(f"\nDetailed profile report saved to: {report_file}") + + return True + + except Exception as e: + print(f"\n❌ Error running model: {e}") + print(f"Error type: {type(e).__name__}") + print("\nFull traceback:") + traceback.print_exc() + return False + + finally: + # Return to original directory + os.chdir(original_dir) + +def main(): + """Main function""" + config_file = r"c:\Users\svries\Documents\GitHub\OE_aeolis-python\aeolis\examples\vanWesten2024\blowout\blowout_short.txt" + + if not os.path.exists(config_file): + print(f"❌ Configuration file not found: {config_file}") + return 1 + + # Setup logging + logging.basicConfig( + level=logging.INFO, + format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' + ) + + success = run_aeolis_with_timing(config_file) + + if success: + print("\n✅ Model execution completed successfully!") + return 0 + else: + print("\n❌ Model execution failed!") + return 1 + +if __name__ == "__main__": + sys.exit(main()) From 0c7c0b6ef4253f6622b68a6103ae1464a5396520 Mon Sep 17 00:00:00 2001 From: Sierd de Vries Date: Mon, 7 Jul 2025 08:37:20 +0200 Subject: [PATCH 03/14] Add devcontainer for use in codespaces (#240) * devcontainer added * Update Dockerfile * Update Dockerfile * Update devcontainer.json * Update Dockerfile * fixed dependencies for python 3.13 (#236) (#239) * Update Dockerfile * remove abundant stuff --- .devcontainer/Dockerfile | 19 +++++++++++++++++++ .devcontainer/devcontainer.json | 7 +++++++ 2 files changed, 26 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..4ee399ca --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,19 @@ +FROM continuumio/miniconda3 + +# Set the working directory +#WORKDIR /workspace + +# Install Python +RUN conda install python -y + +# Copy the project files +# COPY . . + +# Install the necessary packages +RUN pip install . + +# Clean up +RUN conda clean -afy + +# Set the default command +CMD ["bash"] diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..04ece7b0 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,7 @@ +{ + "name": "AEOLIS Development Container", + "build": { + "dockerfile": "Dockerfile", + "context": ".." + } +} From 0d54f7d9672ee3cdef0fb2ad2cd436ca32e8824d Mon Sep 17 00:00:00 2001 From: Sierd de Vries Date: Mon, 7 Jul 2025 08:38:57 +0200 Subject: [PATCH 04/14] Add devcontainer for use in codespaces (#240) (#242) * devcontainer added * Update Dockerfile * Update Dockerfile * Update devcontainer.json * Update Dockerfile * fixed dependencies for python 3.13 (#236) (#239) * Update Dockerfile * remove abundant stuff --- .devcontainer/Dockerfile | 19 +++++++++++++++++++ .devcontainer/devcontainer.json | 7 +++++++ 2 files changed, 26 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..4ee399ca --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,19 @@ +FROM continuumio/miniconda3 + +# Set the working directory +#WORKDIR /workspace + +# Install Python +RUN conda install python -y + +# Copy the project files +# COPY . . + +# Install the necessary packages +RUN pip install . + +# Clean up +RUN conda clean -afy + +# Set the default command +CMD ["bash"] diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..04ece7b0 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,7 @@ +{ + "name": "AEOLIS Development Container", + "build": { + "dockerfile": "Dockerfile", + "context": ".." + } +} From d91a74a4b5120cd951d049f742bcd878e793a94c Mon Sep 17 00:00:00 2001 From: Sierd de Vries Date: Mon, 7 Jul 2025 09:35:59 +0200 Subject: [PATCH 05/14] Update Dockerfile (#243) This patch updates the dockerfile for the codespace to be compatible with developer mode. You need to manual install python in dev model after the docker is created. --- .devcontainer/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 4ee399ca..692b31c4 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,7 +1,7 @@ FROM continuumio/miniconda3 # Set the working directory -#WORKDIR /workspace +# WORKDIR /workspace # Install Python RUN conda install python -y @@ -10,7 +10,7 @@ RUN conda install python -y # COPY . . # Install the necessary packages -RUN pip install . +# RUN pip install . # Clean up RUN conda clean -afy From 5357ce99ecd6a346da7904498e5eb4fb80dda75e Mon Sep 17 00:00:00 2001 From: Sierd de Vries Date: Mon, 7 Jul 2025 10:09:45 +0200 Subject: [PATCH 06/14] Cleanup main (#245) * delete abundant files * deleted: aeolis/examples/vanWesten2024/blowout/figure_grid_initialization.png deleted: aeolis/examples/vanWesten2024/blowout/figure_params_initialization.png deleted: aeolis/examples/vanWesten2024/blowout/figure_timeseries_initialization.png --- .../vanWesten2024/blowout/blowout_short.txt | 155 ------------- run_with_timing.py | 213 ------------------ 2 files changed, 368 deletions(-) delete mode 100644 aeolis/examples/vanWesten2024/blowout/blowout_short.txt delete mode 100644 run_with_timing.py diff --git a/aeolis/examples/vanWesten2024/blowout/blowout_short.txt b/aeolis/examples/vanWesten2024/blowout/blowout_short.txt deleted file mode 100644 index ef2131b7..00000000 --- a/aeolis/examples/vanWesten2024/blowout/blowout_short.txt +++ /dev/null @@ -1,155 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% AeoLiS model configuration %% -%% Date: 2020-04-22 12:26:11 %% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% -------------------- [Timing] ----------------------------- %% -dt = 3600.000 % [s] Timeinterval between timesteps -tstart = 36979200 % [s] Starting time of the simulation (03-04-2013) -tstop = 37000000 % 66674520 % [s] End time of the simulation -restart = None % [s] Interval for which to write restart files -refdate = 2012-01-01 00:00 % [-] Reference datetime in netCDF output - -%% -------------------- [Grid files *.grd] ------------------- %% -xgrid_file = x_NPZK.grd % Filename of ASCII file with x-coordinates of grid cells -ygrid_file = y_NPZK.grd % Filename of ASCII file with y-coordinates of grid cells -bed_file = z_NPZK.grd % Filename of ASCII file with bed level heights of grid cells -ne_file = zne_NPZK.grd % Filename of ASCII file with non-erodible layer -veg_file = veg_NPZK.grd % Filename of ASCII file with initial vegetation density -wave_mask = wave_mask_NPZK.grd % Filename of ASCII file with mask for wave height -tide_mask = tide_mask_NPZK.grd % Filename of ASCII file with mask for tidal elevation -vver_mask = vver_mask_NPZK.grd % Filename of ASCII file with mask for vertical growth (V_ver) - -%% -------------------- [Time series *.txt] ------------------ %% -tide_file = tide_hvh_2012_2022_ref20120101.txt % Filename of ASCII file with time series of water levels -wave_file = waves_euro_2012_2022_ref20120101.txt % Filename of ASCII file with time series of wave heights (and periods) -wind_file = wind_NPZK_2012_2023.txt % Filename of ASCII file with time series of wind velocity and direction - -%% -------------------- [Output] ----------------------------- %% -output_times = 604800.000 % [s] Timeinterval [s] between *.nc output file -output_vars = zb zs zne ustar ustarn ustars ustars_avg ustarn_avg u us un SWL TWL rhoveg moist_avg % [-] List of output variables for in *.nc output file -visualization = T - -%% -------------------- [Flags Processes] -------------------- %% -process_wind = T % [T/F] Enable the process of wind -process_shear = T % [T/F] Enable the process of wind shear -process_tide = T % [T/F] Enable the process of tides -process_wave = T % [T/F] Enable the process of waves -process_runup = T % [T/F] Enable the process of wave runup -process_moist = T % [T/F] Enable the process of moist -process_mixtoplayer = T % [T/F] Enable the process of mixing -process_threshold = T % [T/F] Enable the process of threshold -process_transport = T % [T/F] Enable the process of transport -process_bedupdate = T % [T/F] Enable the process of bed updating -process_avalanche = T % [T/F] Enable the process of avalanching -process_separation = F % [T/F] Enable the including of separation bubble -process_vegetation = T % [T/F] Enable the process of vegetation -process_wet_bed_reset = T - -%% -------------------- [Flags Threshold] -------------------- %% -th_grainsize = T % [T/F] Enable wind velocity threshold based on grainsize -th_bedslope = F % [T/F] Enable wind velocity threshold based on bedslope -th_moisture = T % [T/F] Enable wind velocity threshold based on moisture -th_sheltering = F % [T/F] Enable wind velocity threshold based on roughness -th_nelayer = T % [T/F] Enable wind velocity threshold based on a non-erodible layer - -%% -------------------- [General physics] -------------------- %% -g = 9.81 % [m/s^2] Gravitational constant -v = 0.000015 % [m^2/s] Air viscosity -rhoa = 1.225 % [kg/m^3] Air density -rhog = 2650.0 % [kg/m^3] Grain density -rhow = 1025.0 % [kg/m^3] Water density -porosity = 0.4 % [-] Sediment porosity -cpair = 0.0010035 % [MJ/kg/oC] Specific heat capacity air - -%% -------------------- [Sediment] --------------------------- %% -nlayers = 1 % [-] Number of bed layers -layer_thickness = 0.05000 % [m] Thickness of bed layers -nfractions = 1 % [-] Number of sediment fractions -grain_dist = 1.0 % [-] Initial distribution of sediment fractions -grain_size = 0.00025 % [m] Average grain size of each sediment fraction - -%% -------------------- [Wind and shear] --------------------- %% -wind_convention = nautical % [-] Convention used for the wind direction in the input files (cartesian or nautical) -alfa = 0 % [deg] Real-world grid cell orientation wrt the North (clockwise) -k = 0.003 % [m] Bed roughness -z = 10. % [m] Measurement height of wind velocity -kappa = 0.41 % [-] Von Kármán constant -h = None % [m] Representative height of saltation layer -L = 100. % [m] Typical length scale of dune feature (perturbation) -l = 1. % [m] Inner layer height (perturbation) -m = 1. % [-] Factor to account for difference between average and maximum shear stress - -%% -------------------- [Transport] -------------------------- %% -bi = 0.050000 % [-] Bed interaction factor -method_transport = bagnold % [-] Name of method to compute equilibrium sediment transport rate -method_grainspeed = duran_full % [-] Name of method to assume/compute grainspeed -Aa = 0.085 % [-] Constant in formulation for wind velocity threshold based on grain size -Cb = 1.5 % [-] Constant in bagnold formulation for equilibrium sediment concentration -Ck = 2.78 % [-] Constant in kawamura formulation for equilibrium sediment concentration -Cl = 6.7 % [-] Constant in lettau formulation for equilibrium sediment concentration -Cdk = 5. % [-] Constant in DK formulation for equilibrium sediment concentration - -%% -------------------- [Solver] ----------------------------- %% -T = 1. % [s] Adaptation time scale in advection equation -solver = steadystate % [-] Numerical solver of advection scheme -CFL = 1. % [-] CFL number to determine time step in explicit scheme -accfac = 1. % [-] Numerical acceleration factor -scheme = euler_backward % [-] Name of numerical scheme (euler_forward, euler_backward or crank_nicolson) -max_error = 0.000001 % [-] Maximum error at which to quit iterative solution in implicit numerical schemes -max_iter = 1000 % [-] Maximum number of iterations at which to quit iterative solution in implicit numerical schemes -% max_bedlevel_change = 0.01 % [m] Maximum bedlevel change after one timestep. Next timestep dt will be modified (use 999. if not used) - -%% -------------------- [Boundary conditions] ---------------- %% -boundary_onshore = constant % [-] Name of onshore boundary conditions (flux, constant, uniform, gradient) -boundary_lateral = circular % [-] Name of lateral boundary conditions (circular, constant ==noflux) -boundary_offshore = constant % [-] Name of offshore boundary conditions (flux, constant, uniform, gradient) -offshore_flux = 0. % [-] Factor to determine offshore boundary flux as a function of Q0 (= 1 for saturated flux , = 0 for noflux) -constant_offshore_flux = 0. % [kg/m/s] Constant input flux at offshore boundary -onshore_flux = 0. % [-] Factor to determine onshore boundary flux as a function of Q0 (= 1 for saturated flux , = 0 for noflux) -constant_onshore_flux = 0. % [kg/m/s] Constant input flux at offshore boundary -lateral_flux = 0. % [-] Factor to determine lateral boundary flux as a function of Q0 (= 1 for saturated flux , = 0 for noflux) -sedimentinput = 0. % [-] Constant boundary sediment influx (only used in solve_pieter) - -%% -------------------- [Rotating shear-grid] ---------------- %% -dx = 2.0 % [m] Size of dimension of the computational grid that is generated for a rotating shear computation in x-direction -dy = 2.0 % [m] Size of dimension of the computational grid that is generated for a rotating shear computation in x-direction -buffer_width = 5.0 % [m] Width of the bufferzone around the rotational grid for wind perturbation - -%% -------------------- [Vegetation] ------------------------- %% -sigma = 4.2 % [-] Ratio between basal area and frontal area of roughness elements -beta = 130.000000 % [-] Ratio between drag coefficient of roughness elements and bare surface -gamma_vegshear = 16. % [-] Roughness factor for the shear stress reduction by vegetation -avg_time = 86400. % [s] Indication of the time period over which the bed level change is averaged for vegetation growth -dzb_interval = 86400. % [s] Interval used for calcuation of vegetation growth -hveg_max = 1. % [m] Max height of vegetation -dzb_opt = 0. % [m/year] Sediment burial for optimal growth -V_ver = 3. % [m/year] Vertical growth -V_lat = 0. % [m/year] Lateral growth -germinate = 0. % [1/year] Possibility of germination per year -lateral = 0. % [1/year] Posibility of lateral expension per year -veg_gamma = 0.05 % [-] Constant on influence of sediment burial -veg_sigma = 0. % [-] Sigma in gaussian distrubtion of vegetation cover filter -vegshear_type = raupach % [-] Choose the Raupach grid based solver (1D or 2D) or the Okin approach (1D only) -veg_min_elevation = -10 - -%% -------------------- [Seperation] ------------------------- %% -c_b = 0.2 % [-] Slope at the leeside of the separation bubble # c = 0.2 according to Durán 2010 (Sauermann 2001: c = 0.25 for 14 degrees) -mu_b = 20. % [deg] Minimum required slope for the start of flow separation -sep_filter_iterations = 0 % [-] Number of filter iterations on the separation bubble (0 = no filtering) -zsep_y_filter = F % [T/F] Boolean for turning on/off the filtering of the separation bubble height in y-direction - -%% -------------------- [Soil moisture] ---------------------- %% -Tdry = 5400.000 % [s] Adaptation time scale for soil drying -eps = 0.2 % [m] Minimum water depth to consider a cell "flooded" -method_moist = belly_johnson % [-] Name of method to compute wind velocity threshold based on soil moisture content - -%% -------------------- [Waves] ------------------------------ %% -Tbedreset = 86400. % [s] Adaptation time for resetting morphology in the Swash-zone -xi = 0.3 % [-] Surf similarity parameter -facDOD = 0.5 % [-] Ratio between depth of disturbance and local wave height - -%% -------------------- [Avalanching] ------------------------ %% -theta_dyn = 44. % [degrees] Initial Dynamic angle of repose, critical dynamic slope for avalanching -theta_stat = 45. % [degrees] Initial Static angle of repose, critical static slope for avalanching -max_iter_ava = 100 % [-] Maximum number of iterations at which to quit iterative solution in avalanching calculation \ No newline at end of file diff --git a/run_with_timing.py b/run_with_timing.py deleted file mode 100644 index 07d30a27..00000000 --- a/run_with_timing.py +++ /dev/null @@ -1,213 +0,0 @@ -#!/usr/bin/env python3 -""" -Script to run AeoLiS model with timing analysis -""" - -import os -import time -import sys -import logging -from datetime import datetime, timedelta -import traceback -import cProfile -import pstats -import io - -# Try to import psutil for memory monitoring (optional) -try: - import psutil - HAS_PSUTIL = True -except ImportError: - HAS_PSUTIL = False - print("Note: psutil not available, memory monitoring will be skipped") - -# Add the aeolis package to the path -sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'aeolis')) - -try: - from aeolis.model import AeoLiSRunner - print("✓ AeoLiS imported successfully") -except ImportError as e: - print(f"✗ Error importing AeoLiS: {e}") - sys.exit(1) - -def format_time(seconds): - """Format seconds into readable time string""" - if seconds < 60: - return f"{seconds:.2f} seconds" - elif seconds < 3600: - return f"{seconds/60:.2f} minutes" - else: - return f"{seconds/3600:.2f} hours" - -def get_memory_usage(): - """Get current memory usage in MB""" - if HAS_PSUTIL: - process = psutil.Process(os.getpid()) - return process.memory_info().rss / 1024 / 1024 - else: - return 0.0 # Return 0 if psutil not available - -def run_aeolis_with_timing(config_file): - """Run AeoLiS model with detailed timing analysis using cProfile""" - - print("=" * 60) - print("AeoLiS Model Execution with cProfile Analysis") - print("=" * 60) - print(f"Configuration file: {config_file}") - print(f"Start time: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}") - if HAS_PSUTIL: - print(f"Initial memory usage: {get_memory_usage():.2f} MB") - print("=" * 60) - - # Change to the directory containing the configuration file - config_dir = os.path.dirname(os.path.abspath(config_file)) - original_dir = os.getcwd() - os.chdir(config_dir) - - try: - # Record start time - start_time = time.time() - - # Initialize model - print("\n📊 Initializing AeoLiS model...") - init_start = time.time() - model = AeoLiSRunner(configfile=os.path.basename(config_file)) - init_end = time.time() - print(f" ✓ Model initialization completed in {format_time(init_end - init_start)}") - if HAS_PSUTIL: - print(f" Memory usage after init: {get_memory_usage():.2f} MB") - - # Run model with cProfile - print("\n🚀 Running AeoLiS simulation with cProfile...") - run_start = time.time() - - # Create profiler - profiler = cProfile.Profile() - profiler.enable() - - # Run the model - model.run() - - # Stop profiling - profiler.disable() - run_end = time.time() - - # Calculate total time - total_time = run_end - start_time - - print("\n" + "=" * 60) - print("TIMING SUMMARY") - print("=" * 60) - print(f"Model initialization: {format_time(init_end - init_start)}") - print(f"Model execution: {format_time(run_end - run_start)}") - print(f"Total runtime: {format_time(total_time)}") - if HAS_PSUTIL: - print(f"Peak memory usage: {get_memory_usage():.2f} MB") - print(f"End time: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}") - print("=" * 60) - - # Performance metrics - print("\n📈 PERFORMANCE METRICS") - print("=" * 60) - if hasattr(model, 'p') and hasattr(model.p, 'tstop') and hasattr(model.p, 'tstart'): - sim_duration = model.p['tstop'] - model.p['tstart'] - if sim_duration > 0: - sim_speed = sim_duration / total_time - print(f"Simulation duration: {format_time(sim_duration)} (model time)") - print(f"Simulation speed: {sim_speed:.2f}x real-time") - print(f"Time step efficiency: {sim_duration/3600:.1f} model hours per wall-clock hour") - - # Generate profiling report - print("\n🔍 PROFILING REPORT") - print("=" * 60) - - # Save detailed profile to file - profile_file = "aeolis_profile.prof" - profiler.dump_stats(profile_file) - print(f"Detailed profile saved to: {profile_file}") - - # Create in-memory string buffer for profile output - s = io.StringIO() - ps = pstats.Stats(profiler, stream=s) - - # Sort by cumulative time and show top functions - ps.sort_stats('cumulative') - ps.print_stats(20) # Top 20 functions by cumulative time - - profile_output = s.getvalue() - print("\nTop 20 functions by cumulative time:") - print(profile_output) - - # Sort by internal time and show top functions - s = io.StringIO() - ps = pstats.Stats(profiler, stream=s) - ps.sort_stats('tottime') - ps.print_stats(20) # Top 20 functions by total time - - profile_output = s.getvalue() - print("\nTop 20 functions by total time:") - print(profile_output) - - # Save human-readable profile report - report_file = "aeolis_profile_report.txt" - with open(report_file, 'w') as f: - f.write("AeoLiS Model Profiling Report\n") - f.write("=" * 60 + "\n") - f.write(f"Generated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n") - f.write(f"Configuration: {config_file}\n") - f.write(f"Total runtime: {format_time(total_time)}\n\n") - - # Cumulative time report - f.write("TOP FUNCTIONS BY CUMULATIVE TIME:\n") - f.write("-" * 40 + "\n") - ps = pstats.Stats(profiler, stream=f) - ps.sort_stats('cumulative') - ps.print_stats(50) - - # Total time report - f.write("\n\nTOP FUNCTIONS BY TOTAL TIME:\n") - f.write("-" * 40 + "\n") - ps.sort_stats('tottime') - ps.print_stats(50) - - print(f"\nDetailed profile report saved to: {report_file}") - - return True - - except Exception as e: - print(f"\n❌ Error running model: {e}") - print(f"Error type: {type(e).__name__}") - print("\nFull traceback:") - traceback.print_exc() - return False - - finally: - # Return to original directory - os.chdir(original_dir) - -def main(): - """Main function""" - config_file = r"c:\Users\svries\Documents\GitHub\OE_aeolis-python\aeolis\examples\vanWesten2024\blowout\blowout_short.txt" - - if not os.path.exists(config_file): - print(f"❌ Configuration file not found: {config_file}") - return 1 - - # Setup logging - logging.basicConfig( - level=logging.INFO, - format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' - ) - - success = run_aeolis_with_timing(config_file) - - if success: - print("\n✅ Model execution completed successfully!") - return 0 - else: - print("\n❌ Model execution failed!") - return 1 - -if __name__ == "__main__": - sys.exit(main()) From 9757da6aab27a561015cfe96b5c8b5f7b069285f Mon Sep 17 00:00:00 2001 From: Sierd de Vries Date: Fri, 11 Jul 2025 16:27:45 +0200 Subject: [PATCH 07/14] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4aa3a01c..68edc9d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ exclude = [ [project] name = "aeolis" -version = "3.0.0.rc3" +version = "3.0.0" authors = [ { name="Sierd de Vries", email="sierd.devries@tudelft.nl" }, ] From e08665096cd4a32e19a7fded43825d858d3d6482 Mon Sep 17 00:00:00 2001 From: Sierd de Vries Date: Fri, 11 Jul 2025 16:28:39 +0200 Subject: [PATCH 08/14] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fef06dae..7f5da160 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) to know how you can help to Please, cite this software as follows: -*de Vries, S., Hallin, C., van IJzendoorn, C., van Westen, B., Cohn, N., Strypsteen, G., Skaden, J., Agrawal, N., & Garcia Alvarez, M. (2023). AeoLiS (Version 3.0.0.rc2) [Computer software]. https://github.com/openearth/aeolis-python* +*de Vries, S., Hallin, C., van IJzendoorn, C., van Westen, B., Cohn, N., Strypsteen, G., Skaden, J., Agrawal, N., & Garcia Alvarez, M. (2023). AeoLiS (Version 3.0.0) [Computer software]. https://github.com/openearth/aeolis-python* ## Acknowlegdements From 29a5664bac915c383613cf2c3505ae1aca4e8168 Mon Sep 17 00:00:00 2001 From: Sierd de Vries Date: Fri, 11 Jul 2025 16:29:40 +0200 Subject: [PATCH 09/14] Update CITATION.cff --- CITATION.cff | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 958be39f..f19704ee 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -69,5 +69,5 @@ keywords: - sediment license: GPL-3.0 commit: 0adaedfc8015f18b3b551bed1dda38d630cd8c95 -version: 3.0.0.rc3 -date-released: '2023-10-18' +version: 3.0.0 +date-released: '2025-07-11' From 1656bd353cda10a2a7209200abbf917406ef3f1f Mon Sep 17 00:00:00 2001 From: Sierd de Vries Date: Fri, 11 Jul 2025 16:35:15 +0200 Subject: [PATCH 10/14] Update release info (#246) * Update pyproject.toml * Update CITATION.cff * Update README.md --- CITATION.cff | 2 +- README.md | 2 +- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index f19704ee..7f77b222 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -69,5 +69,5 @@ keywords: - sediment license: GPL-3.0 commit: 0adaedfc8015f18b3b551bed1dda38d630cd8c95 -version: 3.0.0 +version: 3.0.1 date-released: '2025-07-11' diff --git a/README.md b/README.md index 7f5da160..f6d87982 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) to know how you can help to Please, cite this software as follows: -*de Vries, S., Hallin, C., van IJzendoorn, C., van Westen, B., Cohn, N., Strypsteen, G., Skaden, J., Agrawal, N., & Garcia Alvarez, M. (2023). AeoLiS (Version 3.0.0) [Computer software]. https://github.com/openearth/aeolis-python* +*de Vries, S., Hallin, C., van IJzendoorn, C., van Westen, B., Cohn, N., Strypsteen, G., Skaden, J., Agrawal, N., & Garcia Alvarez, M. (2023). AeoLiS (Version 3.0.1) [Computer software]. https://github.com/openearth/aeolis-python* ## Acknowlegdements diff --git a/pyproject.toml b/pyproject.toml index 68edc9d3..297f1c27 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ exclude = [ [project] name = "aeolis" -version = "3.0.0" +version = "3.0.1" authors = [ { name="Sierd de Vries", email="sierd.devries@tudelft.nl" }, ] From be8d746cce36161794c02d8ec4ef021edede6788 Mon Sep 17 00:00:00 2001 From: Sierd de Vries Date: Tue, 7 Oct 2025 09:55:43 +0200 Subject: [PATCH 11/14] Update Python version and dependencies in installation guide --- docs/user/installation.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/user/installation.rst b/docs/user/installation.rst index c12fe309..9d226ec6 100644 --- a/docs/user/installation.rst +++ b/docs/user/installation.rst @@ -8,18 +8,19 @@ AeoLiS is a Python package that can be installed from PyPI or from source. For t Requirements ------------ -- Python 3.8 or newer +- Python 3.9 or newer - pip 22.0 or newer - netCDF4 Dependencies """""""""""" -- docopt==0.6.1 +- docopt +- typer - bmi-python - netCDF4 - scipy -- numpy<1.24,>=1.18 +- numpy - matplotlib - numba @@ -59,8 +60,8 @@ Example from command line: .. code:: shell - aeolis params.txt + aeolis run params.txt .. note:: - Model parameters and other configuration is passed in a `params.txt`. See the :ref:`default settings` for more details. \ No newline at end of file + Model parameters and other configuration is passed in a `params.txt`. See the :ref:`default settings` for more details. From ee70873157d478e744fe9a8354843957c3abddf8 Mon Sep 17 00:00:00 2001 From: Sierd de Vries Date: Tue, 7 Oct 2025 16:41:19 +0200 Subject: [PATCH 12/14] Implement error message for missing ne_file Added error handling for missing 'ne_file' when using Avalanching. --- aeolis/inout.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/aeolis/inout.py b/aeolis/inout.py index 9331407c..a79cd3ad 100644 --- a/aeolis/inout.py +++ b/aeolis/inout.py @@ -117,6 +117,13 @@ def read_configfile(configfile, parse_files=True, load_defaults=True): # set default for nsavetimes, if not given if 'nsavetimes' in p and not p['nsavetimes']: p['nsavetimes'] = int(p['dzb_interval']/p['dt']) + + # catch some incompatible parameter combinations. + if (p['ne_file'] is None) and (p['process_avalanche'] == True): + print('Please provide a valid ne_file path in the configuration file when using Avalanching.') + print('Code does not proceed until this is provided.') + print('Hint: If you do not have a ne_file, you can create one with all zeros, with the same dimensions as your grid.') + exit("Exiting due to error") return p @@ -603,4 +610,4 @@ def output_sedtrails(s, p): savemat(os.path.join('sedtrails_output', str(int(time)).zfill(12) + '.mat'), mdic) else: mdic = {'us': us, 'un': un, 'dzb': dzb, 'pickup': pickup} - savemat(os.path.join('sedtrails_output', str(int(time)).zfill(12) + '.mat'), mdic) \ No newline at end of file + savemat(os.path.join('sedtrails_output', str(int(time)).zfill(12) + '.mat'), mdic) From d1b29662d2298f6506242ec236508f60691d05a2 Mon Sep 17 00:00:00 2001 From: Sierd de Vries Date: Tue, 7 Oct 2025 16:44:45 +0200 Subject: [PATCH 13/14] Print message for aeolis installation in Dockerfile Add message indicating manual installation of aeolis --- .devcontainer/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 6461ac3b..25a75d79 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -19,3 +19,7 @@ RUN conda clean -afy # Set the default command CMD ["bash"] + +# print a message to indicate that the container is ready +RUN echo "The container is ready to use but you need to install aeolis manualy. You can run 'pip instal . -e' to run in editable mode." + From 4dca6eea84fdf6f2068ea05f9ebd451f502bba89 Mon Sep 17 00:00:00 2001 From: Sierd de Vries Date: Thu, 23 Oct 2025 12:18:05 +0200 Subject: [PATCH 14/14] Update vegetation parameters in constants.py (#250) * Update vegetation parameters in constants.py Removes unused V_Lat parameter solves #120 Changes default for veg_min_elevation to -10 to avoid unwanted use of this functionality. * Update aeolis/constants.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- aeolis/constants.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/aeolis/constants.py b/aeolis/constants.py index 137f64be..4f8a7b62 100644 --- a/aeolis/constants.py +++ b/aeolis/constants.py @@ -300,7 +300,6 @@ 'hveg_max' : 1., # [m] Max height of vegetation 'dzb_opt' : 0., # [m/year] Sediment burial for optimal growth 'V_ver' : 0., # [m/year] Vertical growth potential - 'V_lat' : 0., # [m/year] Lateral growth 'germinate' : 0., # [1/year] Possibility of germination per year 'lateral' : 0., # [1/year] Posibility of lateral expension per year 'veg_gamma' : 1., # [-] Constant on influence of sediment burial @@ -332,7 +331,7 @@ 'alfa' : 0, # [deg] Real-world grid cell orientation wrt the North (clockwise) 'dune_toe_elevation' : 3, # Choose dune toe elevation, only used in the PH12 dune erosion solver 'beach_slope' : 0.1, # Define the beach slope, only used in the PH12 dune erosion solver - 'veg_min_elevation' : 3, # Choose the minimum elevation where vegetation can grow + 'veg_min_elevation' : -10., # Minimum elevation (m) where vegetation can grow; default -10 disables restriction (allows vegetation everywhere). Set to a higher value to enforce a minimum elevation for vegetation growth. 'vegshear_type' : 'raupach', # Choose the Raupach grid based solver (1D or 2D) or the Okin approach (1D only) 'okin_c1_veg' : 0.48, #x/h spatial reduction factor in Okin model for use with vegetation 'okin_c1_fence' : 0.48, #x/h spatial reduction factor in Okin model for use with sand fence module