Skip to content

Commit

Permalink
Merge pull request #250 from EcoExtreML/issue248
Browse files Browse the repository at this point in the history
revise strings comparison in src/+parameters/loadParameters.m
  • Loading branch information
Crystal-szj committed Aug 22, 2024
2 parents 5d24628 + 5d3c93b commit dd4764b
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit dd4764b

Please sign in to comment.