Skip to content

Commit

Permalink
fix issue #163
Browse files Browse the repository at this point in the history
  • Loading branch information
DanyangYu committed May 24, 2023
1 parent 783d500 commit 555cf2e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 35 deletions.
59 changes: 25 additions & 34 deletions src/Root_properties.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,27 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% REFERENCES
function [Rl] = Root_properties(Rl, Ac, rroot, frac, bbx, KT)
%%% INPUTS
global DeltZ sfactor LAI_msr
% BR = 10:1:650; %% [gC /m^2 PFT]
% rroot = 0.5*1e-3 ; % 3.3*1e-4 ;%% [0.5-6 *10^-3] [m] root radius
%%% OUTPUTS
if KT < 2880
fr = 0.3 * 3 * exp(-0.15 * LAI_msr(KT)) / (exp(-0.15 * LAI_msr(KT)) + 2 * sfactor);
if fr < 0.15
fr = 0.15;
end
else
fr = 0.001;
end
% if KT<3840
% fr=-0.091*LAI(KT)+0.40;
% else
% fr=0.001;
% end
% elseif KT<3200
% fr=0.05;
% else
% fr=0.02;
% end
%{
This function is used to calculate the dynamic growth of root
This part can refer to Wang et al. (2021) "Intergrated modelling of photosynthesis and transfer of energy, mass, and momentum in the SPAC system"
%}

function [Rl] = Root_properties(Rl, Ac, rroot, frac, bbx, KT, DeltZ, sfactor, LAI_msr)
% %%% INPUTS
% global DeltZ sfactor LAI_msr

fr = calculateRootfraction(KT);

DeltZ0 = DeltZ' / 100;
BR = Ac * fr * 1800 * 12 / 1000000;
root_den = 250 * 1000; %% [gDM / m^3] Root density Jackson et al., 1997
R_C = 0.488; %% [gC/gDM] Ratio Carbon-Dry Matter in root Jackson et al., 1997
nn = numel(Rl);

% This is used to simulate the root growth
if (~isnan(Ac)) || (Ac > 0)
Rl = Rl .* DeltZ0;
Delta_Rltot = BR / R_C / root_den / (pi * (rroot^2)); %% %% root length index [m root / m^2 PFT]
% for i=1:nn
% if Rl(i)>50000
% frac(i)=0;
% end
% end
if ~isnan(frac)
frac = frac / sum(sum(frac));
else
Expand All @@ -48,11 +32,18 @@
Delta_Rl = frac .* bbx * Delta_Rltot;
Rl = Rl + Delta_Rl;
Rl = Rl ./ DeltZ0;
end

end

function fr = calculateRootfraction(KT)
% this function is used to calculate the root fraction
if KT < 2880 %2880 means the time step when the root stops growing
fr = 0.3 * 3 * exp(-0.15 * LAI_msr(KT)) / (exp(-0.15 * LAI_msr(KT)) + 2 * sfactor);
if fr < 0.15
fr = 0.15;
end
else
fr = 0.001;
end
% for i=1:nn
% if Rl(i)>50000
% Rl(i)=50000;
% end
% end
end
2 changes: 1 addition & 1 deletion src/ebal.m
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@
Rntot_PAR = LAI * (Fc * Rnh_PAR + equations.meanleaf(canopy, Rnu_PAR, 'angles_and_layers', Ps)); % net PAR leaves
aPAR_Cab_eta = LAI * (Fc * (profiles.etah .* Rnh_PAR) + equations.meanleaf(canopy, profiles.etau .* Rnu_PAR, 'angles_and_layers', Ps));
% ... green ePAR * relative fluorescence emission efficiency
%%%%%%%%%%%%%%%%%%% [Delta_Rltot] = Root_properties(Actot,rroot);
%%%%%%%%%%%%%%%%%%% [Delta_Rltot] = Root_properties(Rl, Ac, rroot, frac, bbx, KT, DeltZ, sfactor, LAI_msr);
%%%%%%%%%%%%%%%%%%% Delta_Rl = fc*Delta_Rltot;
%%%%%%%%%%%%%%%%%%% Rl = Rl + Delta_Rl;
%%%%%%%%%%%%%%%%%%% Rltot = sum(sum(Rl));
Expand Down

0 comments on commit 555cf2e

Please sign in to comment.