Skip to content

Commit

Permalink
fix #163 writing style
Browse files Browse the repository at this point in the history
  • Loading branch information
DanyangYu committed May 24, 2023
1 parent 555cf2e commit fe41d5f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
11 changes: 5 additions & 6 deletions src/Root_properties.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
%}

function [Rl] = Root_properties(Rl, Ac, rroot, frac, bbx, KT, DeltZ, sfactor, LAI_msr)
% %%% INPUTS
% global 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
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
Expand All @@ -33,12 +33,11 @@
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
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;
Expand Down
10 changes: 5 additions & 5 deletions src/ebal.m
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,11 @@
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(Rl, Ac, rroot, frac, bbx, KT, DeltZ, sfactor, LAI_msr);
%%%%%%%%%%%%%%%%%%% Delta_Rl = fc*Delta_Rltot;
%%%%%%%%%%%%%%%%%%% Rl = Rl + Delta_Rl;
%%%%%%%%%%%%%%%%%%% Rltot = sum(sum(Rl));
%%%%%%%%%%%%%%%%%%% fc = Rl./Rltot;
% [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));
% fc = Rl./Rltot;
% sum of soil fluxes and average temperature
% (note that averaging temperature is physically not correct...)
Rnstot = Fs * Rns; % Net radiation soil
Expand Down

0 comments on commit fe41d5f

Please sign in to comment.