Skip to content

Commit

Permalink
Update vegetation.py (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sierd committed Mar 11, 2024
1 parent 1785374 commit 2f85b2d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aeolis/vegetation.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ def germinate(s,p):
# Germination
p_germinate_year = p['germinate']
p_germinate_dt = 1-(1-p_germinate_year)**(1./n)
germination = np.random.random((s['germinate'].shape))
random_prob = np.random.random((s['germinate'].shape))

# Germinate new cells
germinate_new = (s['dzbveg'] >= 0.) * (germination <= p_germinate_dt)
germinate_new = (s['dzbveg'] >= 0.) * (random_prob <= p_germinate_dt)
s['germinate'] += germinate_new.astype(float)
s['germinate'] = np.minimum(s['germinate'], 1.)

Expand All @@ -125,7 +125,7 @@ def germinate(s,p):

p_lateral = p_lateral_cell * s['drhoveg']

s['lateral'] += (germination <= p_lateral)
s['lateral'] += (random_prob <= p_lateral)
s['lateral'] = np.minimum(s['lateral'], 1.)

return s
Expand Down

0 comments on commit 2f85b2d

Please sign in to comment.