Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strings comparison #249

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/+io/getModelSettings.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%{
%}

ModelSettings.R_depth = 350;
ModelSettings.R_depth = 30;

% Indicator denotes the index of soil type for choosing soil physical parameters
ModelSettings.J = 1;
Expand Down Expand Up @@ -51,7 +51,7 @@
ModelSettings.rroot = 1.5 * 1e-3;
ModelSettings.SFCC = 1;

ModelSettings.Tot_Depth = 500; % Unit is cm. it should be usually bigger than 0.5m. Otherwise,
ModelSettings.Tot_Depth = 100; % Unit is cm. it should be usually bigger than 0.5m. Otherwise,
ModelSettings.Eqlspace = 0; % Indicator for deciding is the space step equal or not; % the DeltZ would be reset in 50cm by hand;

ModelSettings.NS = 1; % Number of soil types;
Expand All @@ -61,7 +61,7 @@
ModelSettings.KT = 0; % Number of time steps;

% Determination of NL, the number of elments
ModelSettings.NL = 100;
ModelSettings.NL = 29;
if ~ModelSettings.Eqlspace
[DeltZ, DeltZ_R, NL, ML] = Dtrmn_Z(ModelSettings.NL, ModelSettings.Tot_Depth);
else
Expand Down
10 changes: 5 additions & 5 deletions src/+parameters/loadParameters.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@
cond = sum(~isnan(scopeInput(j, :))) < 1;
end
if isempty(j) || cond
if name == 'Cab'
if strcmp(name,'Cab')
warning('warning: input "', name, '" not provided in input spreadsheet...', ...
'I will use 0.25*Cab instead');
Options.Cca_function_of_Cab = 1;
elseif ~(Options.simulation == 1) && (name == 'Rin' || name == 'Rli')
elseif ~(Options.simulation == 1) && (strcmp(name, 'Rin') || strcmp(name, 'Rli'))
warning('warning: input "', name, '" not provided in input spreadsheet...', ...
'I will use the MODTRAN spectrum as it is');
elseif Options.simulation == 1 || (Options.simulation ~= 1 && (i < 46 || i > 50))
warning('warning: input "', name, '" not provided in input spreadsheet');
if Options.simulation == 1 && (name == 'Cab' || name == 'Vcmo' || name == 'LAI' || name == 'hc' || name == 'SMC' || (i > 29 && i < 37))
if Options.simulation == 1 && (strcmp(name, 'Cab') || strcmp(name, 'Vcmo') || strcmp(name, 'LAI') || strcmp(name, 'hc') || strcmp(name, 'SMC') || (i > 29 && i < 37))
fprintf(1, '%s %s %s\n', 'I will look for the values in Dataset Directory "', char(ForcingData(5).FileName), '"');
elseif name == 'zo' || name == 'd'
elseif strcmp(name, 'zo') || strcmp(name, 'd')
fprintf(1, '%s %s %s\n', 'will estimate it from LAI, CR, CD1, Psicor, and CSSOIL');
Options.calc_zo = 1;
elseif i > 38 && i < 44
fprintf(1, '%s %s %s\n', 'will use the provided zo and d');
oOptions.calc_zo = 0;
elseif ~(Options.simulation == 1 && (name == 'Rin' || name == 'Rli'))
elseif ~(Options.simulation == 1 && (strcmp(name, 'Rin') || strcmp(name, 'Rli')))
fprintf(1, '%s \n', 'this input is required: SCOPE ends');
return
else
Expand Down
108 changes: 66 additions & 42 deletions src/Dtrmn_Z.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,75 @@
The determination of the element length
%}
Elmn_Lnth = 0;
sitename = 'CH-HTC';
if strcmp(sitename,'CH-HTC')
for ML=1:6
DeltZ_R(ML)=1;%4
end
% DeltZ_R(6)=1;%4
for ML=7:13
DeltZ_R(ML)=2;%5
end
for ML=14:21
DeltZ_R(ML)=2.5;%5
end
for ML=22:25
DeltZ_R(ML)=5;
end
for ML=26:29
DeltZ_R(ML)=10;
end
NL= ML;
for ML=1:NL
MML=NL-ML+1;
DeltZ(ML)=DeltZ_R(MML);
end
else
for ML = 1:3
DeltZ_R(ML) = 1; % 4
end
DeltZ_R(4) = 2; % 4
for ML = 5:14
DeltZ_R(ML) = 2; % 5
end
for ML = 15:18
DeltZ_R(ML) = 2.5; % 5
end
for ML = 19:23
DeltZ_R(ML) = 5;
end
for ML = 24:31
DeltZ_R(ML) = 10;
end
for ML = 32:40
DeltZ_R(ML) = 10;
end
for ML = 41:42
DeltZ_R(ML) = 15; % 5
end
% Sum of element lengths and compared to the total lenght, so that judge
% can be made to determine the length of rest elements.

for ML = 1:3
DeltZ_R(ML) = 1; % 4
end
DeltZ_R(4) = 2; % 4
for ML = 5:14
DeltZ_R(ML) = 2; % 5
end
for ML = 15:18
DeltZ_R(ML) = 2.5; % 5
end
for ML = 19:23
DeltZ_R(ML) = 5;
end
for ML = 24:31
DeltZ_R(ML) = 10;
end
for ML = 32:40
DeltZ_R(ML) = 10;
end
for ML = 41:42
DeltZ_R(ML) = 15; % 5
end
% Sum of element lengths and compared to the total lenght, so that judge
% can be made to determine the length of rest elements.

for ML = 1:42
Elmn_Lnth = Elmn_Lnth + DeltZ_R(ML);
end
for ML = 1:42
Elmn_Lnth = Elmn_Lnth + DeltZ_R(ML);
end

% If the total sum of element lenth is over the predefined depth, stop the
% for loop, make the ML, at which the element lenth sumtion is over defined
% depth, to be new NL.
DeltZ = [];
for ML = 43:NL
DeltZ_R(ML) = 20;
Elmn_Lnth = Elmn_Lnth + DeltZ_R(ML);
if Elmn_Lnth >= Tot_Depth
DeltZ_R(ML) = Tot_Depth - Elmn_Lnth + DeltZ_R(ML);
NL = ML;
for ML = 1:NL
MML = NL - ML + 1;
DeltZ(ML) = DeltZ_R(MML);
% If the total sum of element lenth is over the predefined depth, stop the
% for loop, make the ML, at which the element lenth sumtion is over defined
% depth, to be new NL.
DeltZ = [];
for ML = 43:NL
DeltZ_R(ML) = 20;
Elmn_Lnth = Elmn_Lnth + DeltZ_R(ML);
if Elmn_Lnth >= Tot_Depth
DeltZ_R(ML) = Tot_Depth - Elmn_Lnth + DeltZ_R(ML);
NL = ML;
for ML = 1:NL
MML = NL - ML + 1;
DeltZ(ML) = DeltZ_R(MML);
end
return
end
return
end
end
end
Loading