forked from HydroComplexity/MLCan2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLOAD_SITE_INFO.m
1752 lines (1548 loc) · 69.2 KB
/
LOAD_SITE_INFO.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%************************** Number of Species ****************************%
load './Temps/temp_variable.mat'...
'num_species' 'Sim_species' 'Sim_species_con'
% num_species : Number of species
% Sim_species = 1: Multi species
% Sim_species_con: Which species you would like to run
if Sim_species == 1
kspecies = num_species;
else % for the case you would like to simulate a selected species
kspecies = 5;
end
%***************************** Set Years *********************************%
load './Temps/temp_variable.mat'...
'working_forcings'
load(working_forcings,...
'year_crop');
Each_year = unique(year_crop)';
%************************ Set Initial Condition **************************%
load './Temps/temp_variable.mat'...
'root_init' 'root_init_litter'
Tsinit=root_init(:,3); % Initial soil temperature ['C]
Tslint=root_init_litter(1,3); % Initial litter temperature ['C]
volliqinit=root_init(:,2); % Initial soil moisture [-]
volliqliinit=root_init_litter(1,2); % Initial litter moisture [-]
%************ Site Independent Constant and Fixed Values *****************%
% CONVERSION FACTORS
CONSTANTS.umoltoWm2 = (2.17*10^5) / 10^6; % Radiation conversion
CONSTANTS.Wm2toumol = 1/CONSTANTS.umoltoWm2; % Radiation conversion
CONSTANTS.mmH2OtoMPa = 9.8066e-06; % Pressure conversion
% PHYSICAL CONSTANTS
CONSTANTS.R = 8.314; % [J mol^-1 K^-1]
CONSTANTS.R_kJ = CONSTANTS.R/1000; % [kJ mol^-1 K^-1]
CONSTANTS.Lv = 44000; % latent heat of vaporization [J/mol]
CONSTANTS.Lv_kg = 2260*1000; % Lv in [J / kg]
CONSTANTS.Lf = 6000; % latent heat of vaporization [J/mol]
CONSTANTS.Lf_kg = 3.337e5; % Lf in [J / kg]
CONSTANTS.cp_mol = 29.3; % specific heat of air at constant pressure [J/mol/K]
CONSTANTS.cp_JkgK = 1012; % [J/kg/K]
CONSTANTS.boltz = 5.6697 * 10^-8; % Stefan-Boltzmann constant [W/m^2/K^4]
CONSTANTS.vonk = 0.41; % von Karman constant
% The K?m? constant is often used in turbulence modeling,
% for instance in boundary-layer meteorology to calculate fluxes
% of momentum, heat and moisture from the atmosphere to the land surface.
% It is considered to be a universal (? = 0.41).
CONSTANTS.rho_dry_air = 1.2923; % [kg / m^3]
CONSTANTS.grav = 9.8; % [m / s^2]
CONSTANTS.Vw = 18; % Mols to kg conversion
CONSTANTS.cpl_JkgK = 1800; % specific heat capacity of leaves[J/kg/K]
CONSTANTS.rho_leaf = 600; % Density of Leaves [kg / m^3]
CONSTANTS.fPAR = 0.5; % [-] fraction incoming shortwave as PAR
load './Temps/temp_variable.mat'...
'days_step' 'mins_step' 'hours_step'
CONSTANTS.timestep = days_step*24*60+hours_step*60+mins_step; % [minutes]
CONSTANTS.dtime = CONSTANTS.timestep*60; % [s]
% ROOT CUT INFORMATION
% wilting point
CONSTANTS.wilpoint = -1.5; % Wilting Point 1.5 MPa
% embolism
CONSTANTS.PLCa = 2.146; % Parameter a embolism equation
CONSTANTS.PLCb = -1.238; % Parameter b embolism equation
% Layer to cut
load './Temps/temp_variable.mat'...
'set_para_root1'
CONSTANTS.nlc = set_para_root1{4,2}; % Number of layer to cut
VARIABLES.comroot = 0; % Initialize to zero the cut of roots
%*************************************************************************%
%********************** Site Specific Parameters *************************%
%*************************************************************************%
load './Temps/temp_variable.mat'...
'num_LAD1'
if isstr(num_LAD1) == 1
PARAMS.CanStruc.nl_can=str2num(num_LAD1); % # canopy layers
else
PARAMS.CanStruc.nl_can=(num_LAD1); % # canopy layers
end
%*************************************************************************%
% Canopy %
%*************************************************************************%
%********************* Independent of vegetation *************************%
% CANOPY STRUCTURE
load './Temps/temp_variable.mat'...
'para_canopy_crop_fixed'
if isempty(cell2mat(para_canopy_crop_fixed(3,2)))
PARAMS.CanStruc.hcan = cell2mat(para_canopy_crop_fixed(3,3)); % canopy height [m]
else
PARAMS.CanStruc.hcan = cell2mat(para_canopy_crop_fixed(3,2));
end
if isempty(cell2mat(para_canopy_crop_fixed(4,2)))
PARAMS.CanStruc.hobs = cell2mat(para_canopy_crop_fixed(4,3)); % observation height [m]
else
PARAMS.CanStruc.hobs = cell2mat(para_canopy_crop_fixed(4,2));
end
if isempty(cell2mat(para_canopy_crop_fixed(5,2)))
PARAMS.CanStruc.z0 = cell2mat(para_canopy_crop_fixed(5,3)); % canopy roughness length [m]
else
PARAMS.CanStruc.z0 = cell2mat(para_canopy_crop_fixed(5,2));
end
PARAMS.CanStruc.d0 = 2/3 * PARAMS.CanStruc.hcan; % canopy displacement height [m]
PARAMS.CanStruc.VAratio = 3/1000; % Ratio of volume to area [m]
% RADIATION
load './Temps/temp_variable.mat'...
'para_radiation'
if isempty(cell2mat(para_radiation(1,2)))
PARAMS.Rad.transmiss = cell2mat(para_radiation(1,3)); % atmospheric transmissivity
else
PARAMS.Rad.transmiss = cell2mat(para_radiation(1,2));
end
if isempty(cell2mat(para_radiation(2,2)))
PARAMS.Rad.epsv = cell2mat(para_radiation(2,3)); % vegetation emissivity
else
PARAMS.Rad.epsv = cell2mat(para_radiation(2,2));
end
if isempty(cell2mat(para_radiation(3,2)))
PARAMS.Rad.epss = cell2mat(para_radiation(3,3)); % soil emissivity
else
PARAMS.Rad.epss = cell2mat(para_radiation(3,2));
end
if isempty(cell2mat(para_radiation(4,2)))
PARAMS.Rad.epsa = cell2mat(para_radiation(4,3)); % atmospheric emissivity
else
PARAMS.Rad.epsa = cell2mat(para_radiation(4,2));
end
if isempty(cell2mat(para_radiation(5,2)))
PARAMS.Rad.xx = cell2mat(para_radiation(5,3)); % leaf angle dist param (Spherical is a good assumption (Shade and Golstein 2002)
else
PARAMS.Rad.xx = cell2mat(para_radiation(5,2));
end
if isempty(cell2mat(para_radiation(6,2)))
PARAMS.Rad.clump = cell2mat(para_radiation(6,3)); % leaf clumping parameter
else
PARAMS.Rad.clump = cell2mat(para_radiation(6,2));
end
if isempty(cell2mat(para_radiation(7,2)))
PARAMS.Rad.Kdf = cell2mat(para_radiation(7,3)); % extinction coeff for diffuse around 0.7 according to figure 15.2 (Campbell and Norman 1998)
else
PARAMS.Rad.Kdf = cell2mat(para_radiation(7,2));
end
if isempty(cell2mat(para_radiation(8,2)))
PARAMS.Rad.absorp_PAR = cell2mat(para_radiation(8,3)); % leaf absorptivity to PAR
else
PARAMS.Rad.absorp_PAR = cell2mat(para_radiation(8,2));
end
if isempty(cell2mat(para_radiation(9,2)))
PARAMS.Rad.absorp_NIR = cell2mat(para_radiation(9,3)); % leaf absorptivity to NIR
else
PARAMS.Rad.absorp_NIR = cell2mat(para_radiation(9,2));
end
if isempty(cell2mat(para_radiation(10,2)))
PARAMS.Rad.refl_PAR = cell2mat(para_radiation(10,3)); % PAR reflection coeff
else
PARAMS.Rad.refl_PAR = cell2mat(para_radiation(10,2));
end
if isempty(cell2mat(para_radiation(11,2)))
PARAMS.Rad.refl_NIR = cell2mat(para_radiation(11,3)); % NIR reflection coeff
else
PARAMS.Rad.refl_NIR = cell2mat(para_radiation(11,2));
end
if isempty(cell2mat(para_radiation(12,2)))
PARAMS.Rad.refl_soil = cell2mat(para_radiation(12,3)); % soil reflection coeff
else
PARAMS.Rad.refl_soil = cell2mat(para_radiation(12,2));
end
PARAMS.Rad.trans_PAR = 1 - PARAMS.Rad.absorp_PAR - PARAMS.Rad.refl_PAR;
PARAMS.Rad.trans_NIR = 1 - PARAMS.Rad.absorp_NIR - PARAMS.Rad.refl_NIR;
if isempty(cell2mat(para_radiation(13,2)))
PARAMS.Rad.refl_snow = cell2mat(para_radiation(13,3)); % Reflectivity of new snow.
else
PARAMS.Rad.refl_snow = cell2mat(para_radiation(13,2));
end
if isempty(cell2mat(para_radiation(14,2)))
PARAMS.Rad.refl_snow_old = cell2mat(para_radiation(14,3)); % How much reflectivity of snow decreases with age (per 12 days)
else
PARAMS.Rad.refl_snow_old = cell2mat(para_radiation(14,2));
end
PARAMS.LWmethod = 0; % Method to compute in LW_ATTENUATION FUNCITON LW 0. Initial Darren. 1. Corrected
PARAMS.retainLW = 0; % Factor to compute LW, what proportion of LW radiation emmited by a canopy
% layer, remains there instead of leaving. Only if LWmethod =1
PARAMS.LWcom = 3; % Computation of longwave incoming 1.DATA 2.Boltzman 3.Boltzman Corrected
% RESPIRATION
load './Temps/temp_variable.mat'...
'para_respiration' 'para_microenvironment'
if isempty(cell2mat(para_respiration(1,2)))
PARAMS.Resp.Ro = cell2mat(para_respiration(1,3)); % [umol / m^2 / s]
else
PARAMS.Resp.Ro = cell2mat(para_respiration(1,2));
end
if isempty(cell2mat(para_respiration(2,2)))
PARAMS.Resp.Q10 = cell2mat(para_respiration(2,3));
else
PARAMS.Resp.Q10 = cell2mat(para_respiration(2,2));
end
% Turbulence
if isempty(cell2mat(para_microenvironment(1,2)))
PARAMS.MicroEnv.Cd = cell2mat(para_microenvironment(1,3)); % Drag coefficient [-]
else
PARAMS.MicroEnv.Cd = cell2mat(para_microenvironment(1,2));
end
PARAMS.MicroEnv.alph = CONSTANTS.vonk/3; % mixing length parameter [-] / Katul et al (BLM, 2004, p. 84)
load './Temps/temp_variable.mat'...
'para_photosynthesisC3_crop1'
if isempty(cell2mat(para_photosynthesisC3_crop1(5,2)))
PARAMS.Photosyn.kn_canopy(1) = cell2mat(para_photosynthesisC3_crop1(5,3)); % Vertical Distribution of Photosynthetic Capacity
else
PARAMS.Photosyn.kn_canopy(1) = cell2mat(para_photosynthesisC3_crop1(5,2));
end
%*************************************************************************%
% SOIL %
%*************************************************************************%
load './Temps/temp_variable.mat'...
'num_root1' 'set_root_func' 'para_soil'
if isstr(num_root1) == 1
PARAMS.nl_soil=str2num(num_root1);
else
PARAMS.nl_soil=num_root1;
end
PARAMS.Soil.scaleza = cell2mat(set_root_func(1,2));
PARAMS.Soil.scalezb = cell2mat(set_root_func(2,2));
% SOIL PROPERTIES
if isempty(cell2mat(para_soil(1,2)))
VERTSTRUC.sand = cell2mat(para_soil(1,3));
else
VERTSTRUC.sand = cell2mat(para_soil(1,2));
end
if isempty(cell2mat(para_soil(2,2)))
VERTSTRUC.clay = cell2mat(para_soil(2,3));
else
VERTSTRUC.clay = cell2mat(para_soil(2,2));
end
if isempty(cell2mat(para_soil(3,2)))
PARAMS.Soil.Cd_soil = cell2mat(para_soil(3,3)); % soil drag coefficient [-]
else
PARAMS.Soil.Cd_soil = cell2mat(para_soil(3,2));
end
if isempty(cell2mat(para_soil(4,2)))
PARAMS.Soil.z0 = cell2mat(para_soil(4,3)); % soil surface roughness length [m]
else
PARAMS.Soil.z0 = cell2mat(para_soil(4,2));
end
PARAMS.Soil.alphCN=0.5; % Cranck Nicholson for Heat Solution
% CONSTANTS
PARAMS.Soil.smpmin = -1.e8; % restriction for min of soil poten. [mm]
PARAMS.Soil.wimp = 0.05; % water impremeable if porosity less than wimp [-]
PARAMS.Soil.scalek = 0.5; % length scale for the exponential decrease in Ksat [m]
% HEAT CAPACITIES [J / kg / K)]
% Dry Air
PARAMS.Soil.HC_air = 1.00464 * 10^3;
% Water
PARAMS.Soil.HC_liq = 4.188 * 10^3;
% Ice
PARAMS.Soil.HC_ice = 2.11727 * 10^3;
% DENSITIES [kg / m^3]
PARAMS.Soil.rho_liq = 1000;
PARAMS.Soil.rho_ice = 917;
% THERMAL CONDUCTIVITIES [W / m / K]
PARAMS.Soil.TK_liq = 0.6;
PARAMS.Soil.TK_ice = 2.29;
PARAMS.Soil.TK_air = 0.023;
% FREEZING TEMP OF FRESH WATER [K]
PARAMS.Soil.Tf = 273.16;
% FOR LITTER SNOW
PARAMS.Tcr_atm = 273; % Atmospheric temperature above which snow
PARAMS.Soil.HC_snow = 0.1; % Snow holding capacity of liquid water
PARAMS.Soil.rhosn_min = 50; % Snow compaction parameter [kg/m3]
PARAMS.Soil.fcomp = 0.6; %
PARAMS.Soil.rhod = 150.00; % Snow compaction parameter [kg/m3]
PARAMS.Soil.c1 = -1.4e4;
PARAMS.Soil.thetals = 0.9; % value of soil moisture litter at saturation
PARAMS.Soil.thetafc = 0.025; % Value of litter soil moisture at field capacity
PARAMS.Soil.thetatr = 0.18; % Value of soil moisture after which
% rl becomes negligible
PARAMS.Soil.psill = 35.3; % parameter to compute psi litter
PARAMS.Soil.bl = 2.42; % parameter to compute psi litter
PARAMS.Soil.bdl = 42.5; % Bulk density of litter [kg/m3]
PARAMS.Soil.rhowater = 1000; % Density of liquid water [1000 kg/m3]
PARAMS.Soil.TK_litter = 0.15; % Litter Thermal Conductivity [W/m/k] or [J/s/m/k]
PARAMS.Soil.TD_litter = 5.7*10^(-7); % Litter thermal diffusivity [m/s]
PARAMS.Soil.slfactor = 0.1; % Percentage above which is considered as snow for energy balance
PARAMS.Soil.VHC_litter = 0.3*10^(6); % Volumetric Heat Capacity of Litter [J/m3/K]
PARAMS.Soil.km = 0.0001;%0.00004; % parameter to compute drainage from litter
PARAMS.Soil.bm = 0.1;%2.3; % parameter to compute drainage from litter
PARAMS.Soil.thetamin = 0.0001; % value of soil moisture at which evaporation becomes negligible
PARAMS.Soil.ldif = 3.1*10^(-8);
PARAMS.Soil.sdif = 2.12*10^(-5);
PARAMS.Soil.kklitter = 1000; % [1/cm] Radiation attenuation
PARAMS.Soil.kksnow = 0.8; % [1/cm] Radiation attenuation
load './Temps/temp_variable.mat'...
'litter_depth'
if SWITCHES.litter
VARIABLES.SOIL.dzlit_m = litter_depth; % Litter thickness in [m]
else
VARIABLES.SOIL.dzlit_m = 0.; % Litter thickness in [m]
end
% ENTROPY COMPUTATION.
PARAMS.Entropy.c2 = 2.336;
PARAMS.Entropy.c3 = 0.26;
%*************************************************************************%
%********************* DEPENDENT OF VEGETATION TYPE **********************%
%*************************************************************************%
% kspecies = 1. Species 1
% kspecies = 2. Species 1+2
% kspecies = 3. Species 1+2+3
% kspecies = 4. Species 1+2+3+4
% kspecies = 5. Defined species
if (kspecies == 1 || kspecies == 5)
PARAMS.CanStruc.nspecies = 1; % Number of species
nspecies = 1;
elseif (kspecies == 2)
PARAMS.CanStruc.nspecies = 2; % Number of species
nspecies = 2;
elseif (kspecies == 3)
PARAMS.CanStruc.nspecies = 3; % Number of species
nspecies = 3;
elseif (kspecies == 4 )
PARAMS.CanStruc.nspecies = 4; % Number of species
nspecies = 4;
end
%**************************** Species 1 **********************************%
ii=0;
if (kspecies == 1 || kspecies == 2 || kspecies == 3 || kspecies == 4 || (kspecies == 5 && Sim_species_con == 1 ))
ii = 1;
elseif ((kspecies == 5 && Sim_species_con == 2) || (kspecies == 5 && Sim_species_con == 3) || (kspecies == 5 && Sim_species_con == 4))
ii = 0;
end
if ii ~= 0
load './Temps/temp_variable.mat'...
'para_leaf_crop1'
if isempty(cell2mat(para_leaf_crop1(1,2)))
PARAMS.CanStruc.LEfact(ii) = cell2mat(para_leaf_crop1(1,3)); % multiplicative factor for Fc and LE
% calculations (1 = fluxes from only
% one side of leaf, 2 = fluxes from
% both sides)
else
if isstr(cell2mat(para_leaf_crop1(1,2))) == 1
PARAMS.CanStruc.LEfact(ii) = str2num(cell2mat(para_leaf_crop1(1,2)));
else
PARAMS.CanStruc.LEfact(ii) = cell2mat(para_leaf_crop1(1,2));
end
end
if isempty(cell2mat(para_leaf_crop1(2,2)))
PARAMS.CanStruc.Hfact(ii) = cell2mat(para_leaf_crop1(2,3)); % multiplicative factor for H and LW
% calculations (1 = fluxes from only
% one side of leaf, 2 = fluxes from
% both sides)
else
if isstr(cell2mat(para_leaf_crop1(2,2))) == 1
PARAMS.CanStruc.Hfact(ii) = str2num(cell2mat(para_leaf_crop1(2,2)));
else
PARAMS.CanStruc.Hfact(ii) = cell2mat(para_leaf_crop1(2,2));
end
end
if isempty(cell2mat(para_leaf_crop1(3,2)))
PARAMS.CanStruc.LWfact(ii) = cell2mat(para_leaf_crop1(3,3));
else
if isstr(cell2mat(para_leaf_crop1(3,2))) == 1
PARAMS.CanStruc.LWfact(ii) = str2num(cell2mat(para_leaf_crop1(3,2)));
else
PARAMS.CanStruc.LWfact(ii) = cell2mat(para_leaf_crop1(3,2));
end
end
% CANOPY STRUCTURE
if isempty(cell2mat(para_leaf_crop1(4,2)))
PARAMS.CanStruc.leaftype(ii) = cell2mat(para_leaf_crop1(4,3)); % 1 = broad leaves, 2 = needles
else
if isstr(cell2mat(para_leaf_crop1(4,2))) == 1
PARAMS.CanStruc.leaftype(ii) = str2num(cell2mat(para_leaf_crop1(4,2)));
else
PARAMS.CanStruc.leaftype(ii) = cell2mat(para_leaf_crop1(4,2));
end
end
load './Temps/temp_variable.mat'...
'para_canopy_crop1' 'para_leaf_crop11'
if isempty(cell2mat(para_canopy_crop1(1,2)))
PARAMS.CanStruc.ld(ii) = cell2mat(para_canopy_crop1(1,3)); % leaf width or needle diameter [m]
else
PARAMS.CanStruc.ld(ii) = cell2mat(para_canopy_crop1(1,2));
end
if isempty(cell2mat(para_canopy_crop1(2,2)))
PARAMS.CanStruc.lw(ii) = cell2mat(para_canopy_crop1(2,3)); % shoot diameter for conifers
% leaf width for broadleaved vegetation (= ld)
else
PARAMS.CanStruc.lw(ii) = cell2mat(para_canopy_crop1(2,2));
end
% PARAMS WEIBULL / Dongkook: You can ignore below - Just keep here
PARAMS.CanStruc.beta(ii) = 6.6533;%2.1681;
PARAMS.CanStruc.alpha(ii) = 0.8017;%0.5831;
% Smax = maximum h2o storage capacity for foliage [mm/LAI unit]
if isempty(cell2mat(para_leaf_crop11(1,2)))
PARAMS.CanStruc.Smax = cell2mat(para_leaf_crop11(1,3));
else
PARAMS.CanStruc.Smax = cell2mat(para_leaf_crop11(1,2));
end
load './Temps/temp_variable.mat'...
'para_canopy_crop_fixed'
if isempty(cell2mat(para_canopy_crop_fixed(1,2)))
PARAMS.CanStruc.Ffact = cell2mat(para_canopy_crop_fixed(1,3)); % max fraction of canopy that can be wet
else
PARAMS.CanStruc.Ffact = cell2mat(para_canopy_crop_fixed(1,2));
end
if isempty(cell2mat(para_canopy_crop_fixed(2,2)))
PARAMS.CanStruc.pptintfact = cell2mat(para_canopy_crop_fixed(2,3)); % precip extinction coefficient
else
PARAMS.CanStruc.pptintfact = cell2mat(para_canopy_crop_fixed(2,2));
end
% PHOTOSYNTHESIS
load './Temps/temp_variable.mat'...
'fullpath_forcings' 'para_canopy_crop1' 'para_photosynthesisC3_crop1' 'para_photosynthesisC4_crop1' 'ph_type1'
load (fullpath_forcings)
PARAMS.Photosyn.ph_type(ii) = ph_type1;
if PARAMS.Photosyn.ph_type(ii) == 1
% C3 Photosynthesis Parameters
if isempty(cell2mat(para_photosynthesisC3_crop1(1,2)))
PARAMS.Photosyn.beta_ph_C3(ii) = cell2mat(para_photosynthesisC3_crop1(1,3));
else
PARAMS.Photosyn.beta_ph_C3(ii) = cell2mat(para_photosynthesisC3_crop1(1,2));
end
if isempty(cell2mat(para_photosynthesisC3_crop1(2,2)))
PARAMS.Photosyn.Vcmax25_C3{ii} = cell2mat(para_photosynthesisC3_crop1(2,3))*ones(1,size(Ta_crop,1)); % [umol / m^2 / s]
else
PARAMS.Photosyn.Vcmax25_C3{ii} = cell2mat(para_photosynthesisC3_crop1(2,2))*ones(1,size(Ta_crop,1));
end
if isempty(cell2mat(para_photosynthesisC3_crop1(3,2)))
PARAMS.Photosyn.Jmax25_C3{ii} = cell2mat(para_photosynthesisC3_crop1(3,3))*ones(1,size(Ta_crop,1)); % [umol / m^2 / s]
else
PARAMS.Photosyn.Jmax25_C3{ii} = cell2mat(para_photosynthesisC3_crop1(3,2))*ones(1,size(Ta_crop,1));
end
if isempty(cell2mat(para_photosynthesisC3_crop1(4,2)))
PARAMS.Photosyn.Rd25{ii} = cell2mat(para_photosynthesisC3_crop1(4,3))*ones(1,size(Ta_crop,1)); % [umol / m^2 / s]
else
PARAMS.Photosyn.Rd25{ii} = cell2mat(para_photosynthesisC3_crop1(4,2))*ones(1,size(Ta_crop,1));
end
if isempty(cell2mat(para_photosynthesisC3_crop1(5,2)))
PARAMS.Photosyn.kn_canopy(1) = cell2mat(para_photosynthesisC3_crop1(5,3)); % Vertical Distribution of Photosynthetic Capacity
else
PARAMS.Photosyn.kn_canopy(1) = cell2mat(para_photosynthesisC3_crop1(5,2));
end
% C4 Photosynthesis Parameters
PARAMS.Photosyn.Vmax_C4(ii) = NaN;
PARAMS.Photosyn.Rd_C4(ii) = NaN;
PARAMS.Photosyn.Q10_C4(ii) = NaN;
PARAMS.Photosyn.kk_C4(ii) = NaN;
PARAMS.Photosyn.theta_C4(ii) = NaN;
PARAMS.Photosyn.beta_C4(ii) = NaN;
PARAMS.Photosyn.al_C4(ii) = NaN;
else
% C3 Photosynthesis Parameters
PARAMS.Photosyn.beta_ph_C3(ii) = NaN;
PARAMS.Photosyn.Vcmax25_C3{ii} = NaN;
PARAMS.Photosyn.Jmax25_C3{ii} = NaN;
PARAMS.Photosyn.Rd25{ii} = NaN;
% C4 Photosynthesis Parameters
if isempty(cell2mat(para_photosynthesisC4_crop1(1,2)))
PARAMS.Photosyn.Vmax_C4(ii) = cell2mat(para_photosynthesisC4_crop1(1,3));
else
PARAMS.Photosyn.Vmax_C4(ii) = cell2mat(para_photosynthesisC4_crop1(1,2));
end
if isempty(cell2mat(para_photosynthesisC4_crop1(2,2)))
PARAMS.Photosyn.Rd_C4(ii) = cell2mat(para_photosynthesisC4_crop1(2,3));
else
PARAMS.Photosyn.Rd_C4(ii) = cell2mat(para_photosynthesisC4_crop1(2,2));
end
if isempty(cell2mat(para_photosynthesisC4_crop1(3,2)))
PARAMS.Photosyn.Q10_C4(ii) = cell2mat(para_photosynthesisC4_crop1(3,3));
else
PARAMS.Photosyn.Q10_C4(ii) = cell2mat(para_photosynthesisC4_crop1(3,2));
end
if isempty(cell2mat(para_photosynthesisC4_crop1(4,2)))
PARAMS.Photosyn.kk_C4(ii) = cell2mat(para_photosynthesisC4_crop1(4,3));
else
PARAMS.Photosyn.kk_C4(ii) = cell2mat(para_photosynthesisC4_crop1(4,2));
end
if isempty(cell2mat(para_photosynthesisC4_crop1(5,2)))
PARAMS.Photosyn.theta_C4(ii) = cell2mat(para_photosynthesisC4_crop1(5,3));
else
PARAMS.Photosyn.theta_C4(ii) = cell2mat(para_photosynthesisC4_crop1(5,2));
end
if isempty(cell2mat(para_photosynthesisC4_crop1(6,2)))
PARAMS.Photosyn.beta_C4(ii) = cell2mat(para_photosynthesisC4_crop1(6,3));
else
PARAMS.Photosyn.beta_C4(ii) = cell2mat(para_photosynthesisC4_crop1(6,2));
end
if isempty(cell2mat(para_photosynthesisC4_crop1(7,2)))
PARAMS.Photosyn.al_C4(ii) = cell2mat(para_photosynthesisC4_crop1(7,3));
else
PARAMS.Photosyn.al_C4(ii) = cell2mat(para_photosynthesisC4_crop1(7,2));
end
if isempty(cell2mat(para_photosynthesisC4_crop1(8,2)))
PARAMS.Photosyn.kn_canopy(1) = cell2mat(para_photosynthesisC4_crop1(8,3)); % Vertical Distribution of Photosynthetic Capacity
else
PARAMS.Photosyn.kn_canopy(1) = cell2mat(para_photosynthesisC4_crop1(8,2));
end
end
PARAMS.Photosyn.Oi(ii) = 210; % Intercellular oxygen concentration [mmol / mol]
% STOMATAL CONDUCTANCE
load './Temps/temp_variable.mat'...
'para_conductance_crop1'
% Ball-Berry
if isempty(cell2mat(para_conductance_crop1(1,2)))
PARAMS.StomCond.mslope(ii) = cell2mat(para_conductance_crop1(1,3)); % slope parameter in BB model [-] (Leakey: m=10.6 (ambient); m=10.9 (elevated))
else
PARAMS.StomCond.mslope(ii) = cell2mat(para_conductance_crop1(1,2));
end
if isempty(cell2mat(para_conductance_crop1(2,2)))
PARAMS.StomCond.bint(ii) = cell2mat(para_conductance_crop1(2,3)); % intercept parameter in BB model [mol/m^2/s] (Leakey: b=0.008 (ambient); b=0.007 (elevated))
else
PARAMS.StomCond.bint(ii) = cell2mat(para_conductance_crop1(2,2));
end
% (Tuzet et al, PCE 2003)
if isempty(cell2mat(para_conductance_crop1(3,2)))
PARAMS.StomCond.sfm(ii) = cell2mat(para_conductance_crop1(3,3)); % sensitivity parameter for initial decrease in leaf potential [-]
else
PARAMS.StomCond.sfm(ii) = cell2mat(para_conductance_crop1(3,2));
end
if isempty(cell2mat(para_conductance_crop1(4,2)))
PARAMS.StomCond.psifm(ii) = cell2mat(para_conductance_crop1(4,3)); % leaf potential at which half of the hydraulic conductance is lost [MPa]
else
PARAMS.StomCond.psifm(ii) = cell2mat(para_conductance_crop1(4,2));
end
% Conductivities
if isempty(cell2mat(para_conductance_crop1(5,2)))
PARAMS.Soil.K_rad(ii) = cell2mat(para_conductance_crop1(5,3)); % radial conductivity of the root system [s^-1]
else
PARAMS.Soil.K_rad(ii) = cell2mat(para_conductance_crop1(5,2));
end
if isempty(cell2mat(para_conductance_crop1(6,2)))
PARAMS.Soil.K_axs(ii) = cell2mat(para_conductance_crop1(6,3)); % axial specific conductivity of the root system [mm/s]
else
PARAMS.Soil.K_axs(ii) = cell2mat(para_conductance_crop1(6,2));
end
if isempty(cell2mat(para_conductance_crop1(7,2)))
PARAMS.Soil.kpar_ax(ii) = cell2mat(para_conductance_crop1(7,3));
else
PARAMS.Soil.kpar_ax(ii) = cell2mat(para_conductance_crop1(7,2));
end
if isempty(cell2mat(para_conductance_crop1(8,2)))
PARAMS.StomCond.Rp(ii) = cell2mat(para_conductance_crop1(8,3));
else
PARAMS.StomCond.Rp(ii) = cell2mat(para_conductance_crop1(8,2));
end
% ROOT SOIL
% HR
load './Temps/temp_variable.mat'...
'HR'
SWITCHES.HR_on(ii) = HR; % Hydraulic Redistribution 1. Yes, 0. No
% root structure
load './Temps/temp_variable.mat'...
'set_para_root1'
PARAMS.Soil.z50f(ii) = cell2mat(set_para_root1(2,2)); % From Ameriflux site description
PARAMS.Soil.z95f(ii) = cell2mat(set_para_root1(3,2)); % From Ameriflux site description
PARAMS.Soil.z50t(ii) = cell2mat(set_para_root1(2,2));
PARAMS.Soil.z95t(ii) = cell2mat(set_para_root1(3,2));
PARAMS.Soil.maxrootdepth(ii) = cell2mat(set_para_root1(1,2));
end
%**************************** Species 2 **********************************%
ii=0;
if (kspecies == 5 && Sim_species_con == 2)
ii = 1;
elseif (kspecies == 2 || kspecies == 3 || kspecies == 4)
ii = 2;
elseif ((kspecies == 5 && Sim_species_con == 1) || (kspecies == 5 && Sim_species_con == 3) || (kspecies == 5 && Sim_species_con == 4))
ii = 0;
end
if ii~= 0
load './Temps/temp_variable.mat'...
'para_leaf_crop2'
if isempty(cell2mat(para_leaf_crop2(1,2)))
PARAMS.CanStruc.LEfact(ii) = cell2mat(para_leaf_crop2(1,3)); % multiplicative factor for Fc and LE
% calculations (1 = fluxes from only
% one side of leaf, 2 = fluxes from
% both sides)
else
if isstr(cell2mat(para_leaf_crop2(1,2))) == 1
PARAMS.CanStruc.LEfact(ii) = str2num(cell2mat(para_leaf_crop2(1,2)));
else
PARAMS.CanStruc.LEfact(ii) = cell2mat(para_leaf_crop2(1,2));
end
end
if isempty(cell2mat(para_leaf_crop2(2,2)))
PARAMS.CanStruc.Hfact(ii) = cell2mat(para_leaf_crop2(2,3)); % multiplicative factor for H and LW
% calculations (1 = fluxes from only
% one side of leaf, 2 = fluxes from
% both sides)
else
if isstr(cell2mat(para_leaf_crop2(2,2))) == 1
PARAMS.CanStruc.Hfact(ii) = str2num(cell2mat(para_leaf_crop2(2,2)));
else
PARAMS.CanStruc.Hfact(ii) = cell2mat(para_leaf_crop2(2,2));
end
end
if isempty(cell2mat(para_leaf_crop2(3,2)))
PARAMS.CanStruc.LWfact(ii) = cell2mat(para_leaf_crop2(3,3));
else
if isstr(cell2mat(para_leaf_crop2(3,2))) == 1
PARAMS.CanStruc.LWfact(ii) = str2num(cell2mat(para_leaf_crop2(3,2)));
else
PARAMS.CanStruc.LWfact(ii) = cell2mat(para_leaf_crop2(3,2));
end
end
% CANOPY STRUCTURE
if isempty(cell2mat(para_leaf_crop2(4,2)))
PARAMS.CanStruc.leaftype(ii) = cell2mat(para_leaf_crop2(4,3)); % 1 = broad leaves, 2 = needles
else
if isstr(cell2mat(para_leaf_crop2(4,2))) == 1
PARAMS.CanStruc.leaftype(ii) = str2num(cell2mat(para_leaf_crop2(4,2)));
else
PARAMS.CanStruc.leaftype(ii) = cell2mat(para_leaf_crop2(4,2));
end
end
load './Temps/temp_variable.mat'...
'para_canopy_crop2' 'para_leaf_crop22'
if isempty(cell2mat(para_canopy_crop2(1,2)))
PARAMS.CanStruc.ld(ii) = cell2mat(para_canopy_crop2(1,3)); % leaf width or needle diameter [m]
else
PARAMS.CanStruc.ld(ii) = cell2mat(para_canopy_crop2(1,2));
end
if isempty(cell2mat(para_canopy_crop2(2,2)))
PARAMS.CanStruc.lw(ii) = cell2mat(para_canopy_crop2(2,3)); % shoot diameter for conifers
% leaf width for broadleaved vegetation (= ld)
else
PARAMS.CanStruc.lw(ii) = cell2mat(para_canopy_crop2(2,2));
end
% PARAMS WEIBULL / Dongkook: You can ignore below - Just keep here
PARAMS.CanStruc.beta(ii) = 2.1681;%2.1681;
PARAMS.CanStruc.alpha(ii) = 0.5831;
% Smax = maximum h2o storage capacity for foliage [mm/LAI unit]
if isempty(cell2mat(para_leaf_crop22(1,2)))
PARAMS.CanStruc.Smax = cell2mat(para_leaf_crop22(1,3));
else
PARAMS.CanStruc.Smax = cell2mat(para_leaf_crop22(1,2));
end
load './Temps/temp_variable.mat'...
'para_canopy_crop_fixed'
if isempty(cell2mat(para_canopy_crop_fixed(1,2)))
PARAMS.CanStruc.Ffact = cell2mat(para_canopy_crop_fixed(1,3)); % max fraction of canopy that can be wet
else
PARAMS.CanStruc.Ffact = cell2mat(para_canopy_crop_fixed(1,2));
end
if isempty(cell2mat(para_canopy_crop_fixed(2,2)))
PARAMS.CanStruc.pptintfact = cell2mat(para_canopy_crop_fixed(2,3)); % precip extinction coefficient
else
PARAMS.CanStruc.pptintfact = cell2mat(para_canopy_crop_fixed(2,2));
end
% PHOTOSYNTHESIS
load './Temps/temp_variable.mat'...
'fullpath_forcings' 'para_canopy_crop2' 'para_photosynthesisC3_crop2' 'para_photosynthesisC4_crop2' 'ph_type2'
load (fullpath_forcings)
PARAMS.Photosyn.ph_type(ii) = ph_type2;
if PARAMS.Photosyn.ph_type(ii) == 1
% C3 Photosynthesis Parameters
if isempty(cell2mat(para_photosynthesisC3_crop2(1,2)))
PARAMS.Photosyn.beta_ph_C3(ii) = cell2mat(para_photosynthesisC3_crop2(1,3));
else
PARAMS.Photosyn.beta_ph_C3(ii) = cell2mat(para_photosynthesisC3_crop2(1,2));
end
if isempty(cell2mat(para_photosynthesisC3_crop2(2,2)))
PARAMS.Photosyn.Vcmax25_C3{ii} = cell2mat(para_photosynthesisC3_crop2(2,3))*ones(1,size(Ta_crop,1)); % [umol / m^2 / s]
else
PARAMS.Photosyn.Vcmax25_C3{ii} = cell2mat(para_photosynthesisC3_crop2(2,2))*ones(1,size(Ta_crop,1));
end
if isempty(cell2mat(para_photosynthesisC3_crop2(3,2)))
PARAMS.Photosyn.Jmax25_C3{ii} = cell2mat(para_photosynthesisC3_crop2(3,3))*ones(1,size(Ta_crop,1)); % [umol / m^2 / s]
else
PARAMS.Photosyn.Jmax25_C3{ii} = cell2mat(para_photosynthesisC3_crop2(3,2))*ones(1,size(Ta_crop,1));
end
if isempty(cell2mat(para_photosynthesisC3_crop2(4,2)))
PARAMS.Photosyn.Rd25{ii} = cell2mat(para_photosynthesisC3_crop2(4,3))*ones(1,size(Ta_crop,1)); % [umol / m^2 / s]
else
PARAMS.Photosyn.Rd25{ii} = cell2mat(para_photosynthesisC3_crop2(4,2))*ones(1,size(Ta_crop,1));
end
% C4 Photosynthesis Parameters
PARAMS.Photosyn.Vmax_C4(ii) = NaN;
PARAMS.Photosyn.Rd_C4(ii) = NaN;
PARAMS.Photosyn.Q10_C4(ii) = NaN;
PARAMS.Photosyn.kk_C4(ii) = NaN;
PARAMS.Photosyn.theta_C4(ii) = NaN;
PARAMS.Photosyn.beta_C4(ii) = NaN;
PARAMS.Photosyn.al_C4(ii) = NaN;
else
% C3 Photosynthesis Parameters
PARAMS.Photosyn.beta_ph_C3(ii) = NaN;
PARAMS.Photosyn.Vcmax25_C3{ii} = NaN;
PARAMS.Photosyn.Jmax25_C3{ii} = NaN;
PARAMS.Photosyn.Rd25{ii} = NaN;
% C4 Photosynthesis Parameters
if isempty(cell2mat(para_photosynthesisC4_crop2(1,2)))
PARAMS.Photosyn.Vmax_C4(ii) = cell2mat(para_photosynthesisC4_crop2(1,3));
else
PARAMS.Photosyn.Vmax_C4(ii) = cell2mat(para_photosynthesisC4_crop2(1,2));
end
if isempty(cell2mat(para_photosynthesisC4_crop2(2,2)))
PARAMS.Photosyn.Rd_C4(ii) = cell2mat(para_photosynthesisC4_crop2(2,3));
else
PARAMS.Photosyn.Rd_C4(ii) = cell2mat(para_photosynthesisC4_crop2(2,2));
end
if isempty(cell2mat(para_photosynthesisC4_crop2(3,2)))
PARAMS.Photosyn.Q10_C4(ii) = cell2mat(para_photosynthesisC4_crop2(3,3));
else
PARAMS.Photosyn.Q10_C4(ii) = cell2mat(para_photosynthesisC4_crop2(3,2));
end
if isempty(cell2mat(para_photosynthesisC4_crop2(4,2)))
PARAMS.Photosyn.kk_C4(ii) = cell2mat(para_photosynthesisC4_crop2(4,3));
else
PARAMS.Photosyn.kk_C4(ii) = cell2mat(para_photosynthesisC4_crop2(4,2));
end
if isempty(cell2mat(para_photosynthesisC4_crop2(5,2)))
PARAMS.Photosyn.theta_C4(ii) = cell2mat(para_photosynthesisC4_crop2(5,3));
else
PARAMS.Photosyn.theta_C4(ii) = cell2mat(para_photosynthesisC4_crop2(5,2));
end
if isempty(cell2mat(para_photosynthesisC4_crop2(6,2)))
PARAMS.Photosyn.beta_C4(ii) = cell2mat(para_photosynthesisC4_crop2(6,3));
else
PARAMS.Photosyn.beta_C4(ii) = cell2mat(para_photosynthesisC4_crop2(6,2));
end
if isempty(cell2mat(para_photosynthesisC4_crop2(7,2)))
PARAMS.Photosyn.al_C4(ii) = cell2mat(para_photosynthesisC4_crop2(7,3));
else
PARAMS.Photosyn.al_C4(ii) = cell2mat(para_photosynthesisC4_crop2(7,2));
end
end
PARAMS.Photosyn.Oi(ii) = 210; % Intercellular oxygen concentration [mmol / mol]
% STOMATAL CONDUCTANCE
load './Temps/temp_variable.mat'...
'para_conductance_crop2'
% Ball-Berry
if isempty(cell2mat(para_conductance_crop2(1,2)))
PARAMS.StomCond.mslope(ii) = cell2mat(para_conductance_crop2(1,3)); % slope parameter in BB model [-] (Leakey: m=10.6 (ambient); m=10.9 (elevated))
else
PARAMS.StomCond.mslope(ii) = cell2mat(para_conductance_crop2(1,2));
end
if isempty(cell2mat(para_conductance_crop2(2,2)))
PARAMS.StomCond.bint(ii) = cell2mat(para_conductance_crop2(2,3)); % intercept parameter in BB model [mol/m^2/s] (Leakey: b=0.008 (ambient); b=0.007 (elevated))
else
PARAMS.StomCond.bint(ii) = cell2mat(para_conductance_crop2(2,2));
end
% (Tuzet et al, PCE 2003)
if isempty(cell2mat(para_conductance_crop2(3,2)))
PARAMS.StomCond.sfm(ii) = cell2mat(para_conductance_crop2(3,3)); % sensitivity parameter for initial decrease in leaf potential [-]
else
PARAMS.StomCond.sfm(ii) = cell2mat(para_conductance_crop2(3,2));
end
if isempty(cell2mat(para_conductance_crop2(4,2)))
PARAMS.StomCond.psifm(ii) = cell2mat(para_conductance_crop2(4,3)); % leaf potential at which half of the hydraulic conductance is lost [MPa]
else
PARAMS.StomCond.psifm(ii) = cell2mat(para_conductance_crop2(4,2));
end
% Conductivities
if isempty(cell2mat(para_conductance_crop2(5,2)))
PARAMS.Soil.K_rad(ii) = cell2mat(para_conductance_crop2(5,3)); % radial conductivity of the root system [s^-1]
else
PARAMS.Soil.K_rad(ii) = cell2mat(para_conductance_crop2(5,2));
end
if isempty(cell2mat(para_conductance_crop2(6,2)))
PARAMS.Soil.K_axs(ii) = cell2mat(para_conductance_crop2(6,3)); % axial specific conductivity of the root system [mm/s]
else
PARAMS.Soil.K_axs(ii) = cell2mat(para_conductance_crop2(6,2));
end
if isempty(cell2mat(para_conductance_crop2(7,2)))
PARAMS.Soil.kpar_ax(ii) = cell2mat(para_conductance_crop2(7,3));
else
PARAMS.Soil.kpar_ax(ii) = cell2mat(para_conductance_crop2(7,2));
end
if isempty(cell2mat(para_conductance_crop2(8,2)))
PARAMS.StomCond.Rp(ii) = cell2mat(para_conductance_crop2(8,3));
else
PARAMS.StomCond.Rp(ii) = cell2mat(para_conductance_crop2(8,2));
end
% ROOT SOIL
% HR
load './Temps/temp_variable.mat'...
'HR'
SWITCHES.HR_on(ii) = HR; % Hydraulic Redistribution 1. Yes, 0. No
% root structure
load './Temps/temp_variable.mat'...
'set_para_root2'
PARAMS.Soil.z50f(ii) = cell2mat(set_para_root2(2,2)); % From Ameriflux site description
PARAMS.Soil.z95f(ii) = cell2mat(set_para_root2(3,2)); % From Ameriflux site description
PARAMS.Soil.z50t(ii) = cell2mat(set_para_root2(2,2));
PARAMS.Soil.z95t(ii) = cell2mat(set_para_root2(3,2));
PARAMS.Soil.maxrootdepth(ii) = cell2mat(set_para_root2(1,2));
end
%**************************** Species 3 **********************************%
ii=0;
if (kspecies == 5 && Sim_species_con == 3)
ii = 1;
elseif (kspecies == 3 || kspecies == 4)
ii = 3;
elseif ((kspecies == 5 && Sim_species_con == 1) || (kspecies == 5 && Sim_species_con == 2) || (kspecies == 5 && Sim_species_con == 4))
ii = 0;
end
if ii~=0
load './Temps/temp_variable.mat'...
'para_leaf_crop3'
if isempty(cell2mat(para_leaf_crop3(1,2)))
PARAMS.CanStruc.LEfact(ii) = cell2mat(para_leaf_crop3(1,3)); % multiplicative factor for Fc and LE
% calculations (1 = fluxes from only
% one side of leaf, 2 = fluxes from
% both sides)
else
if isstr(cell2mat(para_leaf_crop3(1,2))) == 1
PARAMS.CanStruc.LEfact(ii) = str2num(cell2mat(para_leaf_crop3(1,2)));
else
PARAMS.CanStruc.LEfact(ii) = cell2mat(para_leaf_crop3(1,2));
end
end
if isempty(cell2mat(para_leaf_crop3(2,2)))
PARAMS.CanStruc.Hfact(ii) = cell2mat(para_leaf_crop3(2,3)); % multiplicative factor for H and LW
% calculations (1 = fluxes from only
% one side of leaf, 2 = fluxes from
% both sides)
else
if isstr(cell2mat(para_leaf_crop3(2,2))) == 1
PARAMS.CanStruc.Hfact(ii) = str2num(cell2mat(para_leaf_crop3(2,2)));
else
PARAMS.CanStruc.Hfact(ii) = cell2mat(para_leaf_crop3(2,2));
end
end
if isempty(cell2mat(para_leaf_crop3(3,2)))
PARAMS.CanStruc.LWfact(ii) = cell2mat(para_leaf_crop3(3,3));
else
if isstr(cell2mat(para_leaf_crop3(3,2))) == 1
PARAMS.CanStruc.LWfact(ii) = str2num(cell2mat(para_leaf_crop3(3,2)));
else
PARAMS.CanStruc.LWfact(ii) = cell2mat(para_leaf_crop3(3,2));
end
end
% CANOPY STRUCTURE
if isempty(cell2mat(para_leaf_crop3(4,2)))
PARAMS.CanStruc.leaftype(ii) = cell2mat(para_leaf_crop3(4,3)); % 1 = broad leaves, 2 = needles
else
if isstr(cell2mat(para_leaf_crop3(4,2))) == 1
PARAMS.CanStruc.leaftype(ii) = str2num(cell2mat(para_leaf_crop3(4,2)));
else
PARAMS.CanStruc.leaftype(ii) = cell2mat(para_leaf_crop3(4,2));
end
end
load './Temps/temp_variable.mat'...
'para_canopy_crop3' 'para_leaf_crop33'
if isempty(cell2mat(para_canopy_crop3(1,2)))
PARAMS.CanStruc.ld(ii) = cell2mat(para_canopy_crop3(1,3)); % leaf width or needle diameter [m]
else
PARAMS.CanStruc.ld(ii) = cell2mat(para_canopy_crop3(1,2));
end
if isempty(cell2mat(para_canopy_crop3(2,2)))
PARAMS.CanStruc.lw(ii) = cell2mat(para_canopy_crop3(2,3)); % shoot diameter for conifers
% leaf width for broadleaved vegetation (= ld)
else
PARAMS.CanStruc.lw(ii) = cell2mat(para_canopy_crop3(2,2));
end
% PARAMS WEIBULL / Dongkook: You can ignore below - Just keep here
PARAMS.CanStruc.beta(ii) = 2.1681;
PARAMS.CanStruc.alpha(ii) = 0.5831;
% Smax = maximum h2o storage capacity for foliage [mm/LAI unit]
if isempty(cell2mat(para_leaf_crop33(1,2)))
PARAMS.CanStruc.Smax = cell2mat(para_leaf_crop33(1,3));
else
PARAMS.CanStruc.Smax = cell2mat(para_leaf_crop33(1,2));
end
load './Temps/temp_variable.mat'...
'para_canopy_crop_fixed'
if isempty(cell2mat(para_canopy_crop_fixed(1,2)))
PARAMS.CanStruc.Ffact = cell2mat(para_canopy_crop_fixed(1,3)); % max fraction of canopy that can be wet
else
PARAMS.CanStruc.Ffact = cell2mat(para_canopy_crop_fixed(1,2));
end
if isempty(cell2mat(para_canopy_crop_fixed(2,2)))
PARAMS.CanStruc.pptintfact = cell2mat(para_canopy_crop_fixed(2,3)); % precip extinction coefficient
else
PARAMS.CanStruc.pptintfact = cell2mat(para_canopy_crop_fixed(2,2));
end
% PHOTOSYNTHESIS
load './Temps/temp_variable.mat'...
'fullpath_forcings' 'para_canopy_crop3' 'para_photosynthesisC3_crop3' 'para_photosynthesisC4_crop3' 'ph_type3'
load (fullpath_forcings)
PARAMS.Photosyn.ph_type(ii) = ph_type3;
if PARAMS.Photosyn.ph_type(ii) == 1
% C3 Photosynthesis Parameters
if isempty(cell2mat(para_photosynthesisC3_crop3(1,2)))
PARAMS.Photosyn.beta_ph_C3(ii) = cell2mat(para_photosynthesisC3_crop3(1,3));
else
PARAMS.Photosyn.beta_ph_C3(ii) = cell2mat(para_photosynthesisC3_crop3(1,2));
end
if isempty(cell2mat(para_photosynthesisC3_crop3(2,2)))
PARAMS.Photosyn.Vcmax25_C3{ii} = cell2mat(para_photosynthesisC3_crop3(2,3))*ones(1,size(Ta_crop,1)); % [umol / m^2 / s]