-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modified particles to conserve tracers if pulling below zero
Now instead of allowing tracers to go below zero the model requires fallback properties of the particles to be defined where the deficite is taken from. For example, in the SLatissima model this is N (gN/dm^2) so we also require a "scale factor" which in this case is the A property and the unit conversion from mmolN to gN. Also updated tests.
- Loading branch information
Showing
4 changed files
with
89 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
include("test_particle_updating.jl") | ||
include("test_particle_updating.jl") | ||
include("test_light.jl") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9e70c50
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jagoosw , could you help me understand some unit conversions in src/Models/Macroalgae/SLatissima.jl?
j_NO₃_max = 10*0.5*24*14/(10^6), #Ahn 1998
The unit of j_NO₃_max is gN/dm^2/day, and the "0.5" in this expression is actually K_A[gdw/dm^2], is that right?
The comment in this following line confused me, from hr to second, which is inconsistent with the "24" in the expression.
j_NO₃ *= A_new / (60*60*24*14*0.001)#gN/dm^2/hr to mmol N/s
Is there also supposed to be a
paras.K_A
in the following?ν *= A_new*(N_new + params.N_struct) / (60*60*24*14*0.001)#1/hr to mmol N/s
Sorry, I don't know where to ask this question, so I ask under this commit.
Thanks,
Si
9e70c50
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9e70c50
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @jagoosw . Do we still need a
params.K_A
forν *= A_new*(N_new + params.N_struct) / (60*60*24*14*0.001)
on the RHS?9e70c50
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @syou83syou83,
Sorry I thought I'd sent two replies to this (one before) that would have said that no we don't need a K_A since nu is dm^2/dm^2, and N and N_struct are gN/dm^2, so ANnu is gN.
Jago
9e70c50
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jagoosw ,
ν
is day^-1,A_new
is dm^2,N
is gN/gdw, so we still need a gdw/dm^2 which is K_A, is that right?Si
9e70c50
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9e70c50
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9e70c50
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @jagoosw . If N is gN/dm^2 throughout the code, should we also remove K_A in line 41 and 42
dN = ((j_NO₃ + j_NH₄) / params.K_A - μ * (N + params.N_struct)) / (60*60*24) dC = ((p* (1 - e) - r) / params.K_A - μ * (C + params.C_struct)) / (60*60*24)
9e70c50
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9e70c50
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.