Skip to content

Commit d4353a5

Browse files
Merge branch 'main' into aeolis-dynarevdev
2 parents 60f8a34 + 1656bd3 commit d4353a5

File tree

283 files changed

+1745015
-474
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

283 files changed

+1745015
-474
lines changed

.devcontainer/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM continuumio/miniconda3
2+
3+
# Set the working directory
4+
5+
# WORKDIR /workspace
6+
7+
# Install Python
8+
RUN conda install python -y
9+
10+
# Copy the project files
11+
# COPY . .
12+
13+
# Install the necessary packages
14+
15+
# RUN pip install .
16+
17+
# Clean up
18+
RUN conda clean -afy
19+
20+
# Set the default command
21+
CMD ["bash"]

.devcontainer/devcontainer.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "AEOLIS Development Container",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": ".."
6+
}
7+
}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,7 @@ cython_debug/
105105
.vscode/
106106

107107
# Developer Notes
108-
dev-notes/
108+
dev-notes/
109+
*.nc
110+
*.mat
111+
*.log

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,5 @@ keywords:
6969
- sediment
7070
license: GPL-3.0
7171
commit: 0adaedfc8015f18b3b551bed1dda38d630cd8c95
72-
version: 3.0.0.rc1
73-
date-released: '2023-10-18'
72+
version: 3.0.1
73+
date-released: '2025-07-11'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) to know how you can help to
9191

9292
Please, cite this software as follows:
9393

94-
*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.rc1) [Computer software]. https://github.com/openearth/aeolis-python*
94+
*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*
9595

9696
## Acknowlegdements
9797

aeolis/avalanching.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ def avalanche(s, p):
184184

185185
s['zb'] += E * (q_in - q_out)
186186

187+
# Ensure water level is up-to-date with bed level
188+
s['zs'] = s['SWL'].copy()
189+
ix = (s['zb'] > s['zs'])
190+
s['zs'][ix] = s['zb'][ix]
187191
return s
188192

189193

aeolis/bed.py

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,12 @@ def initialize(s, p):
8383
if isinstance(p['grain_dist'], str):
8484
logger.log_and_raise('Grain size file not recognized as array, check file path and whether all values have been filled in.', exc=ValueError)
8585

86-
if p['bedcomp_file'] is None and p['grain_dist'].ndim == 1 and p['grain_dist'].dtype == 'float64' or p['grain_dist'].dtype == 'int':
86+
if p['bedcomp_file'] is not None and p['supply_file'] is not None :
87+
logger.log_and_raise('Conflict in input definition, cannot define supply_file and bedcomp_file simultaneously', exc=ValueError)
88+
89+
if p['supply_file'] is not None:
90+
s['mass'][:,:,:,:] = 0 #p['supply_file'].reshape(s['mass'].shape)
91+
elif p['bedcomp_file'] is None and p['grain_dist'].ndim == 1 and p['grain_dist'].dtype == 'float64' or p['grain_dist'].dtype == 'int':
8792
# Both float and int are included as options for the grain dist to make sure there is no error when grain_dist is filled in as 1 instead of 1.0.
8893
for i in range(nl):
8994
gs = makeiterable(p['grain_dist'])
@@ -100,8 +105,14 @@ def initialize(s, p):
100105
for j in range(nf):
101106
s['mass'][:,:,i,j] = p['rhog'] * (1. - p['porosity']) \
102107
* s['thlyr'][:,:,i] * gs[j]
103-
else:
104-
s['mass'][:,:,:,:] = p['bedcomp_file'].reshape(s['mass'].shape)
108+
else:
109+
# if a quasi 2D domain is used, the bedcomp_file is reshaped to fit the domain
110+
if s['mass'].shape[0] == 3:
111+
s['mass'][0,:,:,:] = p['bedcomp_file'].reshape(s['mass'].shape[1:])
112+
s['mass'][1,:,:,:] = p['bedcomp_file'].reshape(s['mass'].shape[1:])
113+
s['mass'][2,:,:,:] = p['bedcomp_file'].reshape(s['mass'].shape[1:])
114+
else:
115+
s['mass'][:,:,:,:] = p['bedcomp_file'].reshape(s['mass'].shape)
105116

106117
# initialize masks
107118
for k, v in p.items():
@@ -200,7 +211,7 @@ def mixtoplayer(s, p):
200211

201212

202213
def wet_bed_reset(s, p):
203-
''' Text
214+
''' Reset wet bed to initial bed level if the total water level is above the bed level.
204215
205216
206217
@@ -222,7 +233,7 @@ def wet_bed_reset(s, p):
222233

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

225-
ix = s['zs'] > (s['zb'] + 0.01)
236+
ix = s['TWL'] > (s['zb'])
226237
s['zb'][ix] += (s['zb0'][ix] - s['zb'][ix]) * Tbedreset
227238

228239
return s
@@ -257,6 +268,16 @@ def update(s, p):
257268
Spatial grids
258269
259270
'''
271+
# this is where a supply file is used, this in only for simple cases.
272+
if type(p['supply_file']) == np.ndarray:
273+
# in descrete supply limited conditions the bed bed layer operations are not valid.
274+
s['mass'][:,:,0,0] -= s['pickup'][:,:,0]
275+
s['mass'][:,:,0,0] += p['supply_file']*p['dt_opt']
276+
# reset supply under water if process tide is active
277+
if p['process_tide']:
278+
s['mass'][(s['zb']< s['zs']),0,0]=0
279+
return s
280+
260281

261282
nx = p['nx']
262283
ny = p['ny']
@@ -274,7 +295,8 @@ def update(s, p):
274295
ix_dep = dm[:,0] > 0.
275296

276297
# reshape mass matrix
277-
m = s['mass'].reshape((-1,nl,nf))
298+
m = s['mass'].reshape((-1,nl,nf)).copy()
299+
278300

279301
# negative mass may occur in case of deposition due to numerics,
280302
# which should be prevented
@@ -298,8 +320,11 @@ def update(s, p):
298320
if p['grain_dist'].ndim == 2:
299321
m[ix_ero,-1,:] -= dm[ix_ero,:] * normalize(p['grain_dist'][-1,:])[np.newaxis,:].repeat(np.sum(ix_ero), axis=0)
300322
elif type(p['bedcomp_file']) == np.ndarray:
301-
gs = p['bedcomp_file'].reshape((-1,nl,nf))
302-
m[ix_ero,-1,:] -= dm[ix_ero,:] * normalize(gs[ix_ero,-1, :], axis=1)
323+
gs = np.zeros(s['mass'].shape)
324+
gs[0,:,:,:] = p['bedcomp_file'].reshape((-1,nl,nf))
325+
gs[1,:,:,:] = p['bedcomp_file'].reshape((-1,nl,nf))
326+
gs[2,:,:,:] = p['bedcomp_file'].reshape((-1,nl,nf))
327+
m[ix_ero,-1,:] -= dm[ix_ero,:] * normalize(gs.reshape((-1,nl,nf))[ix_ero,-1, :], axis=1)
303328
else:
304329
m[ix_ero,-1,:] -= dm[ix_ero,:] * normalize(p['grain_dist'])[np.newaxis,:].repeat(np.sum(ix_ero), axis=0)
305330
# remove tiny negatives
@@ -316,6 +341,9 @@ def update(s, p):
316341
# reshape mass matrix
317342
s['mass'] = m.reshape((ny+1,nx+1,nl,nf))
318343

344+
# Store toplayer of 'mass' variable (ilayer = 0)
345+
s['masstop'][:,:,:] = s['mass'][:,:,0,:].copy()
346+
319347
# update bathy
320348
if p['process_bedupdate']:
321349

@@ -475,8 +503,11 @@ def average_change(l, s, p):
475503
s['dzbavg'] = n*s['dzbyear']+(1-n)*l['dzbavg']
476504

477505
# Calculate average bed level change as input for vegetation growth [m/year]
478-
# s['dzbveg'] = s['dzbavg'].copy()
479-
s['dzbveg'] = s['dzbyear'].copy()
506+
s['dzbveg'] = s['dzbavg'].copy()
507+
# s['dzbveg'] = s['dzbyear'].copy()
508+
509+
if p['_time'] < p['avg_time']:
510+
s['dzbveg'] *= 0.
480511

481512

482513
return s

0 commit comments

Comments
 (0)