Skip to content

Commit

Permalink
Merge pull request #67 from EcoExtreML/nb_era5cli
Browse files Browse the repository at this point in the history
Fixes bugs in DoY and vegetation type processing
  • Loading branch information
BSchilperoort authored Jun 28, 2022
2 parents d7bf2c5 + 7e4e6ba commit ca9faf3
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/+io/load_timeseries.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
xyt.year = load([path_input,Dataset_dir,'/',year_file]);
t_ = xyt.t;

DOY_ = floor(t_);
time_ = 24*(t_-DOY_);
DOY_ = floor(t_)+1;
time_ = 24*(t_-floor(t_));

if ~isempty(tts_file)
V(51).Val = load([path_input,Dataset_dir,'/',tts_file]);
Expand Down
29 changes: 17 additions & 12 deletions src/Initial_root_biomass.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,33 @@
%rri=zeros(1,45);
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
if IGBP_veg_long(1:2)== ['P'; 'e'] %['Permanent Wetlands']
beta = 0.993; %% beta is a plant-dependent root distribution parameter adopted from Jackson et al. (1996), it is refered to CLM5.0 document.
elseif IGBP_veg_long(1:2)== ['E'; 'v'] %['Evergreen Broadleaf']
%% beta is a plant-dependent root distribution parameter adopted from
%% Jackson et al. (1996), it is refered to CLM5.0 document.
if strcmp(IGBP_veg_long(1:18), 'Permanent Wetlands')
beta = 0.993;
elseif IGBP_veg_long(1:2)== ['D'; 'e'] %['Deciduous Broadleaf']
elseif strcmp(IGBP_veg_long(1:19)', 'Evergreen Broadleaf')
beta = 0.993;
elseif IGBP_veg_long(1:2)== ['M'; 'i'] %['Mixed Forests']
elseif strcmp(IGBP_veg_long(1:19)', 'Deciduous Broadleaf')
beta = 0.993;
elseif IGBP_veg_long(11:12)== ['N'; 'e'] %['Evergreen Needleleaf']
elseif strcmp(IGBP_veg_long(1:13)', 'Mixed Forests')
beta = 0.993;
elseif strcmp(IGBP_veg_long(1:20)', 'Evergreen Needleleaf')
beta = 0.943;
elseif IGBP_veg_long(1:2)== ['C'; 'r'] %['Croplands']
elseif strcmp(IGBP_veg_long(1:9)', 'Croplands')
beta = 0.943;
elseif IGBP_veg_long(1:2)== ['O'; 'p'] %['Open Shrublands']
elseif strcmp(IGBP_veg_long(1:15)', 'Open Shrublands')
beta = 0.966;
elseif IGBP_veg_long(1:2)== ['C'; 'l'] %['Closed Shrublands']
elseif strcmp(IGBP_veg_long(1:17)', 'Closed Shrublands')
beta = 0.966;
elseif IGBP_veg_long(1:2)== ['S'; 'a'] %['Savannas']
elseif strcmp(IGBP_veg_long(1:9)', 'Savannas')
beta = 0.943;
elseif strcmp(IGBP_veg_long(1:14)', 'Woody Savannas')
beta = 0.943;
elseif IGBP_veg_long(1:2)== ['W'; 'o'] %['Woody Savannas']
elseif strcmp(IGBP_veg_long(1:10)', 'Grasslands')
beta = 0.943;
else %IGBP_veg_long(1)==['Grasslands']
else
beta = 0.943;
warning('IGBP vegetation name unknown, "%s" is not recognized. Falling back to default value for beta', IGBP_veg_long)
end

Rltot = RTB/R_C/root_den/(pi*(rroot^2)); %% %% root length index [m root / m^2 PFT]
Expand Down
29 changes: 18 additions & 11 deletions src/STEMMUS_SCOPE.m
Original file line number Diff line number Diff line change
Expand Up @@ -200,37 +200,37 @@
V(55).Val=mean(Ta_msr);
%Input T parameters for different vegetation type
sitename1=cellstr(sitename);
if IGBP_veg_long(1:2)== ['P'; 'e'] %['Permanent Wetlands']
if strcmp(IGBP_veg_long(1:18)', 'Permanent Wetlands')
V(14).Val= [0.2 0.3 288 313 328]; % These are five parameters specifying the temperature response.
V(9).Val= [120]; % Vcmax, maximum carboxylation capacity (at optimum temperature)
V(10).Val= [9]; % Ball-Berry stomatal conductance parameter
V(11).Val= [0]; % Photochemical pathway: 0=C3, 1=C4
V(28).Val= [0.05]; % leaf width
elseif IGBP_veg_long(1:2)== ['E'; 'v'] %['Evergreen Broadleaf']
elseif strcmp(IGBP_veg_long(1:19)', 'Evergreen Broadleaf')
V(14).Val= [0.2 0.3 283 311 328];
V(9).Val= [80];
V(10).Val= [9];
V(11).Val= [0];
V(28).Val= [0.05];
elseif IGBP_veg_long(1:2)== ['D'; 'e'] %['Deciduous Broadleaf']
elseif strcmp(IGBP_veg_long(1:19)', 'Deciduous Broadleaf')
V(14).Val= [0.2 0.3 283 311 328];
V(9).Val= [80];
V(10).Val= [9];
V(11).Val= [0];
V(28).Val= [0.05];
elseif IGBP_veg_long(1:2)== ['M'; 'i'] %['Mixed Forests']
elseif strcmp(IGBP_veg_long(1:13)', 'Mixed Forests')
V(14).Val= [0.2 0.3 281 307 328];
V(9).Val= [80];
V(10).Val= [9];
V(11).Val= [0];
V(28).Val= [0.04];
elseif IGBP_veg_long(11:12)== ['N'; 'e'] %['Evergreen Needleleaf']
elseif strcmp(IGBP_veg_long(1:20)', 'Evergreen Needleleaf')
V(14).Val= [0.2 0.3 278 303 328];
V(9).Val= [80];
V(10).Val= [9];
V(11).Val= [0];
V(28).Val= [0.01];
elseif IGBP_veg_long(1:2)== ['C'; 'r'] %['Croplands']
elseif strcmp(IGBP_veg_long(1:9)', 'Croplands')
if isequal(sitename1,{'ES-ES2'})||isequal(sitename1,{'FR-Gri'})||isequal(sitename1,{'US-ARM'})||isequal(sitename1,{'US-Ne1'})
V(14).Val= [0.2 0.3 278 303 328];
V(9).Val= [50];
Expand All @@ -245,31 +245,31 @@
V(11).Val= [0];
V(28).Val= [0.03];
end
elseif IGBP_veg_long(1:2)== ['O'; 'p'] %['Open Shrublands']
elseif strcmp(IGBP_veg_long(1:15)', 'Open Shrublands')
V(14).Val= [0.2 0.3 288 313 328];
V(9).Val= [120];
V(10).Val= [9];
V(11).Val= [0];
V(28).Val= [0.05];
elseif IGBP_veg_long(1:2)== ['C'; 'l'] %['Closed Shrublands']
elseif strcmp(IGBP_veg_long(1:17)', 'Closed Shrublands')
V(14).Val= [0.2 0.3 288 313 328];
V(9).Val= [80];
V(10).Val= [9];
V(11).Val= [0];
V(28).Val= [0.05];
elseif IGBP_veg_long(1:2)== ['S'; 'a'] %['Savannas']
elseif strcmp(IGBP_veg_long(1:8)', 'Savannas')
V(14).Val= [0.2 0.3 278 313 328];
V(9).Val= [120];
V(10).Val= [9];
V(11).Val= [0];
V(28).Val= [0.05];
elseif IGBP_veg_long(1:2)== ['W'; 'o'] %['Woody Savannas']
elseif strcmp(IGBP_veg_long(1:14)', 'Woody Savannas')
V(14).Val= [0.2 0.3 278 313 328];
V(9).Val= [120];
V(10).Val= [9];
V(11).Val= [0];
V(28).Val= [0.03];
else %IGBP_veg_long==['Grasslands']
elseif strcmp(IGBP_veg_long(1:10)', 'Grasslands')
V(14).Val= [0.2 0.3 288 303 328];
if isequal(sitename1,{'AR-SLu'})||isequal(sitename1,{'AU-Ync'})||isequal(sitename1,{'CH-Oe1'})||isequal(sitename1,{'DK-Lva'})||isequal(sitename1,{'US-AR1'})||isequal(sitename1,{'US-AR2'})||isequal(sitename1,{'US-Aud'})||isequal(sitename1,{'US-SRG'})
V(9).Val= [120];
Expand All @@ -282,6 +282,13 @@
V(11).Val= [0];
end
V(28).Val= [0.02];
else
V(14).Val= [0.2 0.3 288 313 328];
V(9).Val= [80];
V(10).Val= [9];
V(11).Val= [0];
V(28).Val= [0.05];
warning('IGBP vegetation name unknown, "%s" is not recognized. ', IGBP_veg_long)
end

TZ=fix(longitude/15);
Expand Down
2 changes: 1 addition & 1 deletion src/StartInit.m
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@
IRPT2=0;
NBCh=3; % Moisture Surface B.C.: 1 --> Specified matric head(BCh); 2 --> Specified flux(BCh); 3 --> Atmospheric forcing;
BCh=-20/3600;
if IGBP_veg_long(1:2)== ['C'; 'r'] %['Croplands']
if strcmp(IGBP_veg_long(1:9)', 'Croplands') %['Croplands']
NBChB=1; % Moisture Bottom B.C.: 1 --> Specified matric head (BChB); 2 --> Specified flux(BChB); 3 --> Zero matric head gradient (Gravitiy drainage);
else
NBChB=3; % Moisture Bottom B.C.: 1 --> Specified matric head (BChB); 2 --> Specified flux(BChB); 3 --> Zero matric head gradient (Gravitiy drainage);
Expand Down

0 comments on commit ca9faf3

Please sign in to comment.