Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,7 @@ dev-notes/
*.nc
*.mat
*.log

#short course development files
aeolis/examples/longterm_dune_growth/short_course_activity/
aeolis/examples/longterm_dune_growth/mod_conifg_file.py
8 changes: 8 additions & 0 deletions aeolis/aeolis_sed.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folders": [
{
"path": "../.."
}
],
"settings": {}
}
2 changes: 1 addition & 1 deletion aeolis/avalanching.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,4 @@ def avalanche_loop(zb, zne, ds, dn, nx, ny, E, max_iter_ava, tan_dyn):
# update bed level without non-erodible layer
zb += E * (q_in - q_out)

return zb, grad_h
return zb, grad_h
37 changes: 18 additions & 19 deletions aeolis/bed.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import aeolis.gridparams
from matplotlib import pyplot as plt
from numba import njit
import math

# package modules
from aeolis.utils import *
Expand Down Expand Up @@ -125,7 +126,7 @@ def initialize(s, p):
# initialize threshold
if p['threshold_file'] is not None:
s['uth'] = p['threshold_file'][:,:,np.newaxis].repeat(nf, axis=-1)

return s


Expand Down Expand Up @@ -197,14 +198,11 @@ def mixtoplayer(s, p):


s['mass'][ix] = mass[ix]

return s


def wet_bed_reset(s, p):
''' Reset wet bed to initial bed level if the total water level is above the bed level.


def wet_supply(s, p):
''' Increase elevation of beach topography. ELABORATE ON THIS

Parameters
----------
Expand All @@ -219,19 +217,21 @@ def wet_bed_reset(s, p):
Spatial grids

'''

if p['process_wet_bed_reset']:

Tbedreset = p['dt_opt'] / p['Tbedreset']

ix = s['TWL'] > (s['zb'])
s['zb'][ix] += (s['zb0'][ix] - s['zb'][ix]) * Tbedreset
# Original wet-bed-reset function; basic resetting of the bed when inundated
if p['process_wet_supply'] or p['process_wet_bed_reset']:
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The naming inconsistency between process flags is confusing. The constants file defines process_wet_supply (line 177), but the configuration file uses process_sediment_supply (line 49 in aeolis.txt). The function checks both p['process_wet_supply'] and p['process_wet_bed_reset'], but the configuration doesn't define process_wet_supply. This inconsistency will likely cause the feature not to work as expected. Use consistent naming throughout.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved in newest commit


if p['method_wet_supply'] == 'wet_bed_reset':
Tbedreset = p['dt_opt'] / p['Tbedreset'] # []s

return s
ix = s['TWL'] > (s['zb'])
s['zb'][ix] += (s['zb0'][ix] - s['zb'][ix]) * Tbedreset

return s
Comment on lines 204 to +230
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new sediment supply functionality lacks test coverage. The repository has a tests directory with test files for other modules. Consider adding unit tests for the wet_supply function to verify each of the four methods (wet_bed_reset, vertical_beach_growth, constant_SCR_constant_tanB, constant_SCR_variable_tanB) work correctly, especially edge cases like empty arrays, boundary conditions, and slope calculations.

Copilot uses AI. Check for mistakes.


def update(s, p):

'''Update bathymetry and bed composition

Update bed composition by moving sediment fractions between bed
Expand Down Expand Up @@ -346,7 +346,7 @@ def update(s, p):
s['zb'] += dz
if p['process_tide']:
s['zs'] += dz #???

return s


Expand Down Expand Up @@ -496,13 +496,12 @@ def average_change(l, s, p):
if p['_time'] < p['avg_time']:
s['dzbveg'] *= 0.


return s

@njit
def arrange_layers(m,dm,d,nl,ix_ero,ix_dep):
'''Arranges mass redistrubution between layers.
This function is called in the bed.update fucntion to speed up code using numba
'''Arranges mass redistribution between layers.
This function is called in the bed.update function to speed up code using numba



Expand All @@ -511,7 +510,7 @@ def arrange_layers(m,dm,d,nl,ix_ero,ix_dep):
m : array
mass in layers
dm : array
total mass exchanged between layers derrived from pickup
total mass exchanged between layers derived from pickup
d : array
normalized mass in layers
nl : int
Expand All @@ -535,5 +534,5 @@ def arrange_layers(m,dm,d,nl,ix_ero,ix_dep):
m[ix_dep,-1,:] -= dm[ix_dep,:] * d[ix_dep,-1,:]

return m


5 changes: 5 additions & 0 deletions aeolis/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
'process_moist' : False, # Enable the process of moist
'process_mixtoplayer' : False, # Enable the process of mixing
'process_wet_bed_reset' : False, # Enable the process of bed-reset in the intertidal zone
'process_wet_supply' : False, # Enable the process of beach sediment supply
'process_meteo' : False, # Enable the process of meteo
'process_salt' : False, # Enable the process of salt
'process_humidity' : False, # Enable the process of humidity
Expand Down Expand Up @@ -340,6 +341,10 @@
'rhoveg_max' : 0.5, #maximum vegetation density, only used in duran and moore 14 formulation
't_veg' : 3, #time scale of vegetation growth (days), only used in duran and moore 14 formulation
'v_gam' : 1, # only used in duran and moore 14 formulation
'method_wet_supply' :'wet_bed_reset', # Name of method to comput sediment supply (wet_bed_reset, vertical_beach_growth, constant_SCR_constant_tanB, constant_SCR_variable_tanB)
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter name method_wet_supply in constants.py (line 344) doesn't match method_sed_supply used in the configuration file (line 195 of aeolis.txt). This inconsistency will cause the method selection to fail. Ensure the parameter names match between the constants definition and the configuration file.

Suggested change
'method_wet_supply' :'wet_bed_reset', # Name of method to comput sediment supply (wet_bed_reset, vertical_beach_growth, constant_SCR_constant_tanB, constant_SCR_variable_tanB)
'method_sed_supply' :'wet_bed_reset', # Name of method to comput sediment supply (wet_bed_reset, vertical_beach_growth, constant_SCR_constant_tanB, constant_SCR_variable_tanB)

Copilot uses AI. Check for mistakes.
'shoreline_change_rate' : 0, # Elevation added to beach during process sed supply (shoreline change rate m/year)
'zshoreline' : 0, # Elevation where beach profile ends and shoreline change rate is applied
'xshoreline' : 0, # Cross-shore position where beach profile ends and shoreline change rate is applied }
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The closing brace is missing for the dictionary in constants.py. Line 347 has a closing brace in a comment (# ... }) which suggests it was accidentally commented out. This will cause a syntax error. Uncomment or add the proper closing brace.

Suggested change
'xshoreline' : 0, # Cross-shore position where beach profile ends and shoreline change rate is applied }
'xshoreline' : 0, # Cross-shore position where beach profile ends and shoreline change rate is applied

Copilot uses AI. Check for mistakes.
}

REQUIRED_CONFIG = ['nx', 'ny']
Expand Down
2 changes: 2 additions & 0 deletions aeolis/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ vanWesten2024/parabolic
<description>


longterm_dune_growth - 1D 27-year simulation from Long Beach Peninsula, Washington, USA (LBP)

The beach-dune system on LBP has been rapidly prograding over the past three decades. This example uses the newly process_sediment_supply function in AeoLiS to hindcast almost 3 decades of dune evolution.



Expand Down
Loading
Loading