Skip to content

Commit

Permalink
Added Duck storm distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
franklin1895 committed Apr 24, 2024
1 parent 4110e3a commit f8592c9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions barrier3d/barrier3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ def migrate_dunes(
0, :
] # First row of interior will now become new part of active dune field
newDuneHeight = newDuneElev - self._BermEl
newDuneHeight[newDuneHeight < self._DuneRestart_Orginal] = self._DuneRestart_Orginal
newDuneHeight[newDuneHeight < self._DuneRestart_TS[0][0][0]] = self._DuneRestart_TS[0][0][0]
self._InteriorDomain = np.delete(self._InteriorDomain, 0, axis=0)
if np.shape(self._InteriorDomain)[0] <= 0:
self._drown_break = 1
Expand Down Expand Up @@ -803,7 +803,6 @@ def __init__(self, **kwds):
Dstart = kwds.pop("Dstart")
self._DuneDomain = kwds.pop("DuneDomain")
self._DuneRestart = kwds.pop("DuneRestart")
self._DuneRestart_Orginal = copy.deepcopy(self._DuneRestart)
self._DuneWidth = kwds.pop("DuneWidth")
self._Female = kwds.pop("Female")
self._GermRate = kwds.pop("GermRate")
Expand Down Expand Up @@ -855,6 +854,7 @@ def __init__(self, **kwds):
) # if True, use seeded random number generator
# Convert
self._DuneRestart = [[self._DuneRestart]*self.BarrierLength]*self.DuneWidth
self._DuneRestart_TS = [copy.deepcopy(self._DuneRestart)]

if len(kwds) > 0:
raise ValueError(
Expand Down Expand Up @@ -978,12 +978,15 @@ def update(self):
DuneDomainCrest = self._DuneDomain[self._time_index, :, :].max(
axis=1
) # Maximum height of each row in DuneDomain
DuneDomainCrest[DuneDomainCrest < self._DuneRestart_Orginal] = self._DuneRestart_Orginal
DuneDomainCrest[DuneDomainCrest < self._DuneRestart_TS[0][0][0]] = self._DuneRestart_TS[0][0][0]

self._Hd_AverageTS.append(
np.mean(DuneDomainCrest)
) # Store average pre-storm dune-height for time step

# Record the Dune restart value
self._DuneRestart_TS.append(copy.deepcopy(self._DuneRestart))

# ###########################################
# ### Shrubs

Expand Down Expand Up @@ -1098,7 +1101,7 @@ def update(self):
self._DuneDomain = self.DiffuseDunes(
self._DuneDomain, self._time_index
)
self._DuneDomain[self._DuneDomain < self._SL] = self._DuneRestart_Orginal
self._DuneDomain[self._DuneDomain < self._SL] = self._DuneRestart_TS[0][0][0]

DuneLoss = np.sum(DuneChange) / self._BarrierLength
Hd_TSloss = (
Expand Down

0 comments on commit f8592c9

Please sign in to comment.