forked from HydroComplexity/MLCan2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_MLCan.m
999 lines (854 loc) · 57.8 KB
/
main_MLCan.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
function varargout = main_MLCan(varargin)
%:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::%
%% MAIN INTERFACE PROGRAM %%
%% Canopy-Root-Soil-Atmosphere Exchange Model %%
%:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::%
%-------------------------------------------------------------------------%
% This interface is used to connect and facilitate the MLCan matlab code %
% written by Darren Drewry. See Drewry et al, 2010. %
% GUI is developed based on MLCan_v01 code written by Phong Le. %
% See Le 2012. %
% %
% This interface include the following components: %
% + Model Setup : Used for setting up model information %
% + Option : Used for choosing sub-models %
% + Forcings / Initial conditions %
% : Used for creating/choosing forcings and initital %
% conditions for sub-models %
% + Parameters : Used for entering parameters values %
% + Results : Showing plot and results from files %
%-------------------------------------------------------------------------%
% MAIN_MLCAN M-file for main_MLCan.fig %
%-------------------------------------------------------------------------%
% Created by : Dongkook Woo %
% Date : May 20, 2012 %
% Last Modified : June 23, 2016 %
%:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::%
%-------------------------------------------------------------------------%
%% Begin initialization code - DO NOT EDIT %%
%-------------------------------------------------------------------------%
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @main_MLCan_OpeningFcn, ...
'gui_OutputFcn', @main_MLCan_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
%-------------------------------------------------------------------------%
%% End initialization code - DO NOT EDIT %%
%-------------------------------------------------------------------------%
% --- Executes just before main_MLCan is made visible.
function main_MLCan_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to main_MLCan (see VARARGIN)
% Choose default command line output for main_MLCan
% Add Users directory to call sub-interface
addpath('./users/');
workpath = pwd;
setappdata(0,'workpath',workpath);
handles.output = hObject;
set(handles.mnu_model,'Enable','off');
set(handles.mnu_result,'Enable','off');
set(handles.mnu_save,'Enable','off');
set(handles.mnu_saveas,'Enable','off');
set(handles.toolbar_save,'Enable','off');
set(handles.pan_start_screen,'Visible','on');
set(handles.button_setup_model,'Visible','off');
set(handles.pan_layer,'Visible','off');
set(handles.txt_model_mlcan,'Visible','off');
set(handles.txt_model_full_name,'Visible','off');
set(handles.Main,'Color',[0.502 0.502 0.502]);
% Update handles structure
guidata(hObject, handles);
%-------------------------------------------------------------------------%
% UIWAIT makes main_MLCan wait for user response (see UIRESUME) %
% uiwait(handles.Main); %
%-------------------------------------------------------------------------%
% --- Outputs from this function are returned to the command line.
function varargout = main_MLCan_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --------------------------------------------------------------------
function mnu_file_Callback(hObject, eventdata, handles)
% hObject handle to mnu_file (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function mnu_edit_Callback(hObject, eventdata, handles)
% hObject handle to mnu_edit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function mnu_model_Callback(hObject, eventdata, handles)
% hObject handle to mnu_model (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function mnu_result_Callback(hObject, eventdata, handles)
% hObject handle to mnu_result (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function mnu_help_sub_Callback(hObject, eventdata, handles)
% hObject handle to mnu_help_sub (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
model_help()
% --------------------------------------------------------------------
function mnu_undo_Callback(hObject, eventdata, handles)
% hObject handle to mnu_undo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function mnu_redo_Callback(hObject, eventdata, handles)
% hObject handle to mnu_redo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function mnu_copy_Callback(hObject, eventdata, handles)
% hObject handle to mnu_copy (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function mnu_cut_Callback(hObject, eventdata, handles)
% hObject handle to mnu_cut (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function mnu_paste_Callback(hObject, eventdata, handles)
%-------------------------------------------------------------------------%
% New in menu editor connected to "New function" %
%-------------------------------------------------------------------------%
function mnu_new_Callback(hObject, eventdata, handles)
button_new_main_Callback(hObject, eventdata, handles)
%-------------------------------------------------------------------------%
% Open in menu editor connected to "Open function" %
%-------------------------------------------------------------------------%
function mnu_open_Callback(hObject, eventdata, handles)
button_open_main_Callback(hObject, eventdata, handles)
%-------------------------------------------------------------------------%
% "Save function" - Save all variables to the current working files %
%-------------------------------------------------------------------------%
function mnu_save_Callback(hObject, eventdata, handles)
load './Temps/temporary.mat' 'working_name';
copyfile('./Temps/temp_variable.mat', working_name,'f');
%-------------------------------------------------------------------------%
% "Save as function" - Save all variables to the other files %
%-------------------------------------------------------------------------%
function mnu_saveas_Callback(hObject, eventdata, handles)
[filename,pathname] = uiputfile('*.mat','Save your files');
if pathname == 0 %if the user pressed cancelled, then we exit this callback
return
end
fullpath_filename = [pathname, filename];
workpath = getappdata(0,'workpath');
rem_path = strrep(fullpath_filename,workpath,'');
if strcmp(rem_path,fullpath_filename) == 1
Msgbox('Do NOT save files outside the working folder, please save the file again','MLCan Error');
return
else
working_name = ['.',rem_path];
hgsave(working_name);
copyfile('./Temps/temp_variable.mat', fullpath_filename,'f');
end
%-------------------------------------------------------------------------%
% "Exit function" - Close the program and exit %
%-------------------------------------------------------------------------%
function mnu_exit_Callback(hObject, eventdata, handles)
close
% -------------------------------------------------------------------------
function mnu_print_Callback(hObject, eventdata, handles)
%-------------------------------------------------------------------------%
% "Run function" - Connect and run Darren Drewry model %
%-------------------------------------------------------------------------%
function mnu_run_Callback(hObject, eventdata, handles)
load './Temps/temp_variable.mat' 'working_forcings' 'root_init' 'root_init_litter';
try
load(working_forcings)
catch exception
msgbox('Please load forcings - go back to FORCINGS & INITIAL CONDITIONS','MLCan Error','Error');
return
end
DRIVER_CROP_2_0;
% -------------------------------------------------------------------------
function mnu_forcings_condition_Callback(hObject, eventdata, handles)
button_group_condition_Callback(hObject, eventdata, handles)
%-------------------------------------------------------------------------%
% Call parameter interface and connect the model %
%-------------------------------------------------------------------------%
function mnu_parameters_Callback(hObject, eventdata, handles)
model_parameters();
% -------------------------------------------------------------------------
function Context_test_Callback(hObject, eventdata, handles)
% -------------------------------------------------------------------------
function toolbar_print_ClickedCallback(hObject, eventdata, handles)
% -------------------------------------------------------------------------
function toolbar_open_ClickedCallback(hObject, eventdata, handles)
button_open_main_Callback(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.
function axe_start_screen_CreateFcn(hObject, eventdata, handles)
background = imread('./users/background.jpg');
image(background);
axis off
%imshow('./users/background.jpg'); % Load image background in axes
%-------------------------------------------------------------------------%
% NEW BUTTON ON START SCREEN TO CREATE NEW FILES... %
%-------------------------------------------------------------------------%
function button_new_main_Callback(hObject, eventdata, handles)
[filename, pathname] = uiputfile('*.mat', 'Create new files');
if pathname == 0 %if the user pressed cancelled, then we exit this callback
return
else
fullpath_filename = [pathname, filename];
workpath = getappdata(0,'workpath');
rem_path = strrep(fullpath_filename,workpath,'');
if strcmp(rem_path,fullpath_filename) == 1
Msgbox('Do NOT creat project files outside the working folder','MLCan Error');
return
else
working_name = ['.',rem_path];
set(handles.pan_start_screen,'Visible','off');
set(handles.Main,'Color',[0.941 0.941 0.941]);
set(handles.pan_layer,'Visible','on');
main_menu_enable(hObject, eventdata, handles);
save './Temps/temporary.mat' 'working_name';
% Empty information used for model setup form.
num_species = '';
lat_face = '';
long_face = '';
elev_face = '';
LAImin_face = '';
DOY_start = '';
DOY_end = '';
crop_name1 = '';
crop_name2 = '';
crop_name3 = '';
crop_name4 = '';
ph_type1 = 1;
ph_type2 = 1;
ph_type3 = 1;
ph_type4 = 1;
num_LAD1 = '';
num_LAD2 = '';
num_LAD3 = '';
num_LAD4 = '';
num_root1 = '';
num_root2 = '';
num_root3 = '';
num_root4 = '';
opt_root1 = 1;
opt_root2 = 1;
opt_root3 = 1;
opt_root4 = 1;
dat_LAD1 = zeros(3,2);
dat_LAD2 = zeros(3,2);
dat_LAD3 = zeros(3,2);
dat_LAD4 = zeros(3,2);
dat_root1 = zeros(3,2);
dat_root2 = zeros(3,2);
dat_root3 = zeros(3,2);
dat_root4 = zeros(3,2);
dat_decom = zeros(3,4);
dat_decom_litter = zeros(1,4);
set_para_root1 = {...
' Maximum depth' , 1 , ; ...
' z50' , 0.07 , ; ...
' z95' , 0.4 , ; ...
' # layer to cut root' , 1 ....
};
set_para_root2 = {...
' Maximum depth' , 4 , ; ...
' z50' , 0.24 , ; ...
' z95' , 1.5 ...
};
set_para_root3 = {...
' Maximum depth' , 12 , ; ...
' z50' , 0.65 , ; ...
' z95' , 4.0 ...
};
set_para_root4 = {...
' Maximum depth' , 12 , ; ...
' z50' , 0.65 , ; ...
' z95' , 4.0 ...
};
set_root_func = {...
' a' , 0.032 , ; ...
' b' , 0.5 ...
};
litter_depth = 0.03; % [m]
%Empty information used for option.
Sim_species = 1;
Sim_species_con = 1;
vanGen = 1;
RHC = 1;
CO2_Ambient = 400;
CO2_Elev = 0;
CO2_Elev_con = 550;
Temp_Elev = 0;
Temp_Elev_con = 1;
Soil_nutrient = 0;
Soil_heat = 0;
Turbulence = 0;
HR = 0;
Soil_C_pool1 = 1;
N_Uptake_RB = 1;
N_Fix = 0;
N_Remo = 0;
N_denit = 0;
N_Adepo = 0;
N_Adepo_amm = 0.31;
N_Adepo_nit = 0.25;
N_Fert = 0;
N_Fert_DOY = 130;
N_Fert_amm = 4.2;
N_Fert_nit = 4.2;
N_Fert_urea = 8.4;
opt_root_para = {...
' diam' , 0.25, 0.3, 0.35, 0.45, ; ...
' dist' , 0.5, 0.24, 0.13, 0.13, ; ...
' SRL' , 22, 28, 38, 20, ...
};
%Empty information used for initial conditions
root_init = zeros(3,3);
root_name = {'Depth', 'Moisture', 'Temperature'};
nutrient_int = zeros(3,3);
nutrient_name1 = {'Depth', 'Organic Carbon', 'Microbial Carbon', 'Ammonium-N'...
'Nitrate-N', 'Organic C:N' };
nutrient_name2 = {'Depth', 'Litter Carbon', 'Humus Carbon', 'Microbial Carbon', 'Ammonium-N'...
'Nitrate-N', 'Litter C:N' };
root_init_litter = zeros(3,3);
nutrient_int_litter = zeros(3,3);
%Empty information used for parameters.
fullpath_forcings = '';
working_forcings = '';
%Empty information used for parameters.
emp_cell = zeros(-1);
% Site specific parameter
para_radiation = {...
' Atmospheric transmissivity' , emp_cell , 0.65 , ' unitless';...
' Vegetation emissivity' , emp_cell , 0.97 , ' unitless';...
' Soil emissivity' , emp_cell , 0.95 , ' unitless';...
' Atmospheric emissivity' , emp_cell , 0.80 , ' unitless';...
' Leaf angle distribution parameter' , emp_cell , 1.0 , ' unitless';...
' Leaf clumping parameter' , emp_cell , 0.9 , ' unitless';...
' Extinction coefficient for diffuse' , emp_cell , 0.7 , ' unitless';...
' Leaf absorptivity to Photosynthetically Active Radiation (PAR)' , emp_cell , 0.85 , ' unitless';...
' Leaf absorptivity to Near Infrared Radiation (NIR)' , emp_cell , 0.45 , ' unitless';...
' PAR reflection coefficient' , emp_cell , 0.05 , ' unitless';...
' NIR reflection coefficient' , emp_cell , 0.2 , ' unitless';...
' Soil reflection coefficient' , emp_cell , 0.17 , ' unitless';...
' New snow reflection coefficient' , emp_cell , 0.8 , ' unitless';...
' How much reflectivity of snow decreases with age (per 12 days)' , emp_cell , 0.1 , ' unitless';...
};
para_microenvironment = {...
' Drag coefficient, Cd' , emp_cell , 0.2 , ' unitless'; ...
};
para_soil = {...
' Percent of sand' , emp_cell , 10 , ' unitless';...
' Percent of clay' , emp_cell , 80 , ' unitless';...
' Soil drag coefficient' , emp_cell , 0.10 , ' unitless';...
' Soil surface roughness length' , emp_cell , 0.005 , ' m ';...
};
para_respiration = {...
' Respiration Ro' , emp_cell , 2.0 , ' mol / (sq m. s)'; ...
' Respiration Q10' , emp_cell , 1.5 , ' mol / (sq m. s)'; ...
};
para_soilCN = {...
' Carbon to nitrogen ratio of microbial biomass' , emp_cell , 11.8 , ' unitless'; ...
' Rate of nitrification' , emp_cell , 0.0001, ' cu m. / (d. gN)'; ...
' Respiration coefficient' , emp_cell , 0.6 , ' unitless'; ...
' Ammonium immobilization coefficient' , emp_cell , 1.0 , ' cu m. / (d. gN)'; ...
' Nitrate immobilization coefficient' , emp_cell , 1.0 , ' cu m. / (d. gN)'; ...
' Maximum ammonium immobilization coefficient' , emp_cell , 0.1 , ' cu m. / (d. gN)'; ...
' Maximum nitrate immobilization coefficient' , emp_cell , 0.1 , ' cu m. / (d. gN)'; ...
' Fraction of dissolved ammonium' , emp_cell , 0.05 , ' unitless'; ...
' Fraction of dissolved nitrate' , emp_cell , 1.0 , ' unitless'; ...
' Bioturbation diffusion coefficient at soil surface' , emp_cell , 4, ' sq cm / yr'; ...
' Litter fragmentation' , emp_cell ,0.0000215, ' / d'; ...
' Fraction of nitrification lost as N2O flux - denitrification' , emp_cell , 0.02 , ' unitless'; ...
' Carbon to nitrogen ratio of humus - 2 pools' , emp_cell , 22 , ' unitless'; ...
' Minimum fraction of the decompoased litter that undergoes humification - 2 pools' , emp_cell, 0.15 , ' unitless'; ...
' Volatilization fraction of urea of applied fertilizer' , emp_cell , 0.205 , ' unitless'; ...
' Volatilization fraction of ammonium of applied fertilizer' , emp_cell , 0.61 , ' unitless'; ...
' Definition zone of disturbance - N uptake with root biomass' , emp_cell , 0.1 , ' mm '; ...
' Maximum root nitrate uptake - N uptake with root biomass' , emp_cell , 0.5 , ' mmolNO3 / g /hr'; ...
' Michaelis nitrate constant - N uptake with root biomass' , emp_cell , 72 , ' mmolNO3 / cu m'; ...
' Maximum root ammonium uptake - N uptake with root biomass' , emp_cell , 0.053 , ' mmolNH4 / g /hr'; ...
' Michaelis ammonium constant - N uptake with root biomass' , emp_cell , 15 , ' mmolNh4 / cu m'; ...
};
% Each species specific parameter
para_soilCN_crop1 = {...
' Constant ratio of ''natural litter input'' to ''belowground litter input'' ' , emp_cell , 0.8 , ' unitless'; ...
};
para_soilCN_crop11 = {...
' Fraction of ammonium demand from total N demand' , emp_cell , 0.0 , ' unitless'; ...
' Fraction of nitrate demand from total N demand' , emp_cell , 1.0 , ' unitless'; ...
' Tortuosity factor in active N uptake' , emp_cell , 3.0 , ' unitless'; ...
' Rescaled diffusion coefficient' , emp_cell , 0.06 , ' m / cu m'; ...
' Nitrgeon fixation index (plant N from fixation / plant N from soil)' , emp_cell , 2.0 , ' unitless'; ...
' Nitrgeon remobilization index (fraction of previous year''s N uptake)', emp_cell , 0.6 , ' unitless'; ...
};
para_soilCN_crop2 = {...
' Constant ratio of ''natural litter input'' to ''belowground litter input'' ' , emp_cell , 0.8 , ' unitless'; ...
};
para_soilCN_crop22 = {...
' Fraction of ammonium demand from total N demand' , emp_cell , 0.0 , ' unitless'; ...
' Fraction of nitrate demand from total N demand' , emp_cell , 1.0 , ' unitless'; ...
' Tortuosity factor in active N uptake' , emp_cell , 3.0 , ' unitless'; ...
' Rescaled diffusion coefficient' , emp_cell , 0.06 , ' m / cu m'; ...
' Nitrgeon fixation index (plant N from fixation / plant N from soil)' , emp_cell , 2.0 , ' unitless'; ...
' Nitrgeon remobilization index (fraction of previous year''s N uptake)', emp_cell , 0.6 , ' unitless'; ...
};
para_soilCN_crop3 = {...
' Constant ratio of ''natural litter input'' to ''belowground litter input'' ' , emp_cell , 0.8 , ' unitless'; ...
};
para_soilCN_crop33 = {...
' Fraction of ammonium demand from total N demand' , emp_cell , 0.0 , ' unitless'; ...
' Fraction of nitrate demand from total N demand' , emp_cell , 1.0 , ' unitless'; ...
' Tortuosity factor in active N uptake' , emp_cell , 3.0 , ' unitless'; ...
' Rescaled diffusion coefficient' , emp_cell , 0.06 , ' m / cu m'; ...
' Nitrgeon fixation index (plant N from fixation / plant N from soil)' , emp_cell , 2.0 , ' unitless'; ...
' Nitrgeon remobilization index (fraction of previous year''s N uptake)', emp_cell , 0.6 , ' unitless'; ...
};
para_soilCN_crop4 = {...
' Constant ratio of ''natural litter input'' to ''belowground litter input'' ' , emp_cell , 0.8 , ' unitless'; ...
};
para_soilCN_crop44 = {...
' Fraction of ammonium demand from total N demand' , emp_cell , 0.0 , ' unitless'; ...
' Fraction of nitrate demand from total N demand' , emp_cell , 1.0 , ' unitless'; ...
' Tortuosity factor in active N uptake' , emp_cell , 3.0 , ' unitless'; ...
' Rescaled diffusion coefficient' , emp_cell , 0.06 , ' m / cu m'; ...
' Nitrgeon fixation index (plant N from fixation / plant N from soil)' , emp_cell , 2.0 , ' unitless'; ...
' Nitrgeon remobilization index (fraction of previous year''s N uptake)', emp_cell , 0.6 , ' unitless'; ...
};
%
para_leaf_crop1 = {...
' Latent Heat production from 1 or both sides of leaf' , emp_cell , 1 , ' unitless';...
' Sensible Heat production from 1 or both sides of leaf' , emp_cell , 1 , ' unitless';...
' Longwave production from 1 or both sides of leaf' , emp_cell , 2 , ' unitless';...
' Leaf Type: 1-Broad leaf or 2-Needle leaf' , emp_cell , 1 , ' unitless';...
};
para_leaf_crop11 = {...
' Maximum h2o storage capacity for foliage' , emp_cell , 0.2 , ' mm / LAI unit';...
};
para_leaf_crop2 = {...
' Latent Heat production from 1 or both sides of leaf' , emp_cell , 1 , ' unitless';...
' Sensible Heat production from 1 or both sides of leaf' , emp_cell , 1 , ' unitless';...
' Longwave production from 1 or both sides of leaf' , emp_cell , 2 , ' unitless';...
' Leaf Type: 1-Broad leaf or 2-Needle leaf' , emp_cell , 1 , ' unitless';...
};
para_leaf_crop22 = {...
' Maximum h2o storage capacity for foliage' , emp_cell , 0.2 , ' mm / LAI unit';...
};
para_leaf_crop3 = {...
' Latent Heat production from 1 or both sides of leaf' , emp_cell , 1 , ' unitless';...
' Sensible Heat production from 1 or both sides of leaf' , emp_cell , 1 , ' unitless';...
' Longwave production from 1 or both sides of leaf' , emp_cell , 2 , ' unitless';...
' Leaf Type: 1-Broad leaf or 2-Needle leaf' , emp_cell , 1 , ' unitless';...
};
para_leaf_crop33 = {...
' Maximum h2o storage capacity for foliage' , emp_cell , 0.2 , ' mm / LAI unit';...
};
para_leaf_crop4 = {...
' Latent Heat production from 1 or both sides of leaf' , emp_cell , 1 , ' unitless';...
' Sensible Heat production from 1 or both sides of leaf' , emp_cell , 1 , ' unitless';...
' Longwave production from 1 or both sides of leaf' , emp_cell , 2 , ' unitless';...
' Leaf Type: 1-Broad leaf or 2-Needle leaf' , emp_cell , 1 , ' unitless';...
};
para_leaf_crop44 = {...
' Maximum h2o storage capacity for foliage' , emp_cell , 0.2 , ' mm / LAI unit';...
};
%
para_canopy_crop1 = {...
' Leaf width or needle diameter' , emp_cell , 0.05 , ' m ';...
' Shoot diameter for conifers or leaf width for broad leaf' , emp_cell , 0.05 , ' m ';...
};
para_canopy_crop_fixed = {...
' Maximum wetted fraction' , emp_cell , 0.2 , ' unitless';...
' Rainfall interception factor' , emp_cell , 0.2 , ' unitless';...
' Canopy height' , emp_cell , 40 , ' m ';...
' Flux tower observation height' , emp_cell , 64 , ' m ';...
' Canopy roughness length' , emp_cell , 5.2 , ' m ';...
};
para_canopy_crop2 = {...
' Leaf width or needle diameter' , emp_cell , 0.05 , ' m ';...
' Shoot diameter for conifers or leaf width for broad leaf' , emp_cell , 0.05 , ' m ';...
};
para_canopy_crop3 = {...
' Leaf width or needle diameter' , emp_cell , 0.05 , ' m ';...
' Shoot diameter for conifers or leaf width for broad leaf' , emp_cell , 0.05 , ' m ';...
};
para_canopy_crop4 = {...
' Leaf width or needle diameter' , emp_cell , 0.05 , ' m ';...
' Shoot diameter for conifers or leaf width for broad leaf' , emp_cell , 0.05 , ' m ';...
};
%
para_photosynthesisC4_crop1 = {...
' Maximum Rubisco capacity Vmax' , emp_cell , 45 , ' mol / (sq m. s)'; ...
' Leaf respiration Rd' , emp_cell , 0.8 , ' mol / (sq m. s)'; ...
' Temperature sensitivity Q10' , emp_cell , 0.57 , ' unitless'; ...
' Initial slope of CO2 response' , emp_cell , 0.7 , ' mol / (sq m. s)'; ...
' Curvature factor theta' , emp_cell , 0.83 , ' unitless'; ...
' Curvature factor beta' , emp_cell , 0.93 , ' unitless'; ...
' Intrisic quantum yield of C4 photosynthesis - alpha' , emp_cell , 0.04 , ' unitless'; ...
' Vertical distribution of Photosynthetic capacity' , emp_cell , 0.4 , ' unitless'; ...
};
para_photosynthesisC3_crop1 = {...
' Fraction absorbed Q available to photosystem II' , emp_cell , 0.5 , ' unitless'; ...
' Maximum rate of Rubisco-limited carbonxylation at 25 C - Vcmax' , emp_cell , 31 , ' umol / (sq m. s)'; ...
' Maximum electron transport rate - Jmax' , emp_cell , 37 , ' umol / (sq m. s)'; ...
' Rd25' , emp_cell , 0.3 , ' umol / (sq m. s)'; ...
' Vertical distribution of Photosynthetic capacity' , emp_cell , 0.4 , ' unitless'; ...
};
para_photosynthesisC4_crop2 = {...
' Maximum Rubisco capacity Vmax' , emp_cell , 45 , ' mol / (sq m. s)'; ...
' Leaf respiration Rd' , emp_cell , 0.8 , ' mol / (sq m. s)'; ...
' Temperature sensitivity Q10' , emp_cell , 0.57 , ' unitless'; ...
' Initial slope of CO2 response' , emp_cell , 0.7 , ' mol / (sq m. s)'; ...
' Curvature factor theta' , emp_cell , 0.83 , ' unitless'; ...
' Curvature factor beta' , emp_cell , 0.93 , ' unitless'; ...
' Intrisic quantum yield of C4 photosynthesis - alpha' , emp_cell , 0.04 , ' unitless'; ...
};
para_photosynthesisC3_crop2 = {...
' Fraction absorbed Q available to photosystem II' , emp_cell , 0.5 , ' unitless'; ...
' Maximum rate of Rubisco-limited carbonxylation at 25 C - Vcmax' , emp_cell , 57 , ' umol / (sq m. s)'; ...
' Maximum electron transport rate - Jmax' , emp_cell , 81 , ' umol / (sq m. s)'; ...
' Rd25' , emp_cell , 0.58 , ' umol / (sq m. s)'; ...
};
para_photosynthesisC4_crop3 = {...
' Maximum Rubisco capacity Vmax' , emp_cell , 45 , ' mol / (sq m. s)'; ...
' Leaf respiration Rd' , emp_cell , 0.8 , ' mol / (sq m. s)'; ...
' Temperature sensitivity Q10' , emp_cell , 0.57 , ' unitless'; ...
' Initial slope of CO2 response' , emp_cell , 0.7 , ' mol / (sq m. s)'; ...
' Curvature factor theta' , emp_cell , 0.83 , ' unitless'; ...
' Curvature factor beta' , emp_cell , 0.93 , ' unitless'; ...
' Intrisic quantum yield of C4 photosynthesis - alpha' , emp_cell , 0.04 , ' unitless'; ...
};
para_photosynthesisC3_crop3 = {...
' Fraction absorbed Q available to photosystem II' , emp_cell , 0.5 , ' unitless'; ...
' Maximum rate of Rubisco-limited carbonxylation at 25 C - Vcmax' , emp_cell , 81 , ' umol / (sq m. s)'; ...
' Maximum electron transport rate - Jmax' , emp_cell , 112 , ' umol / (sq m. s)'; ...
' Rd25' , emp_cell , 1.36 , ' umol / (sq m. s)'; ...
};
para_photosynthesisC4_crop4 = {...
' Maximum Rubisco capacity Vmax' , emp_cell , 45 , ' mol / (sq m. s)'; ...
' Leaf respiration Rd' , emp_cell , 0.8 , ' mol / (sq m. s)'; ...
' Temperature sensitivity Q10' , emp_cell , 0.57 , ' unitless'; ...
' Initial slope of CO2 response' , emp_cell , 0.7 , ' mol / (sq m. s)'; ...
' Curvature factor theta' , emp_cell , 0.83 , ' unitless'; ...
' Curvature factor beta' , emp_cell , 0.93 , ' unitless'; ...
' Intrisic quantum yield of C4 photosynthesis - alpha' , emp_cell , 0.04 , ' unitless'; ...
};
para_photosynthesisC3_crop4 = {...
' Fraction absorbed Q available to photosystem II' , emp_cell , 0.5 , ' unitless'; ...
' Maximum rate of Rubisco-limited carbonxylation at 25 C - Vcmax' , emp_cell , 59 , ' umol / (sq m. s)'; ...
' Maximum electron transport rate - Jmax' , emp_cell , 87 , ' umol / (sq m. s)'; ...
' Rd25' , emp_cell , 1.25 , ' umol / (sq m. s)'; ...
};
%
para_conductance_crop1 = {...
' Slope parameter in Ball-Berry model, m' , emp_cell , 12 , ' unitless'; ...
' Intercepts in Ball Berry model, b' , emp_cell , 0.008 , ' mol / (sq m. s)'; ...
' Sensitivity parameter for initial decrease in leaf potential' , emp_cell , 3.2 , ' unitless '; ...
' Leaf potential at which half of the hydraulic conductance is lost' , emp_cell , -3 , ' MPa '; ...
' Radial conductivity of the root system' , emp_cell ,4.66e-9, ' /s '; ...
' Axial specific conductivity of the root system' , emp_cell ,4.5e-5 , ' mm/s '; ...
' Parameter, kpar_ax' , emp_cell ,0.00036, ' unitless'; ...
' Parameter, Rp' , emp_cell , 8 , ' unitless'; ...
};
para_conductance_crop2 = {...
' Slope parameter in Ball-Berry model, m' , emp_cell , 12 , ' unitless'; ...
' Intercepts in Ball Berry model, b' , emp_cell , 0.008 , ' mol / (sq m. s)'; ...
' Sensitivity parameter for initial decrease in leaf potential' , emp_cell , 3.2 , ' unitless '; ...
' Leaf potential at which half of the hydraulic conductance is lost' , emp_cell , -3 , ' MPa '; ...
' Radial conductivity of the root system' , emp_cell ,1.612e-8, ' /s '; ...
' Axial specific conductivity of the root system' , emp_cell ,2.4e-4 , ' mm/s '; ...
' Parameter, kpar_ax' , emp_cell ,0.00036, ' unitless'; ...
' Parameter, Rp' , emp_cell , 8 , ' unitless'; ...
};
para_conductance_crop3 = {...
' Slope parameter in Ball-Berry model, m' , emp_cell , 12 , ' unitless'; ...
' Intercepts in Ball Berry model, b' , emp_cell , 0.008 , ' mol / (sq m. s)'; ...
' Sensitivity parameter for initial decrease in leaf potential' , emp_cell , 3.2 , ' unitless '; ...
' Leaf potential at which half of the hydraulic conductance is lost' , emp_cell , -3 , ' MPa '; ...
' Radial conductivity of the root system' , emp_cell ,8.831e-9, ' /s '; ...
' Axial specific conductivity of the root system' , emp_cell ,1.28e-4 , ' mm/s '; ...
' Parameter, kpar_ax' , emp_cell ,0.00036, ' unitless'; ...
' Parameter, Rp' , emp_cell , 8 , ' unitless'; ...
};
para_conductance_crop4 = {...
' Slope parameter in Ball-Berry model, m' , emp_cell , 12 , ' unitless'; ...
' Intercepts in Ball Berry model, b' , emp_cell , 0.008 , ' mol / (sq m. s)'; ...
' Sensitivity parameter for initial decrease in leaf potential' , emp_cell , 3.2 , ' unitless '; ...
' Leaf potential at which half of the hydraulic conductance is lost' , emp_cell , -3 , ' MPa '; ...
' Radial conductivity of the root system' , emp_cell ,2.366e-9, ' /s '; ...
' Axial specific conductivity of the root system' , emp_cell ,3.75e-6 , ' mm/s '; ...
' Parameter, kpar_ax' , emp_cell ,0.00036, ' unitless'; ...
' Parameter, Rp' , emp_cell , 8 , ' unitless'; ...
};
current_species = 1;
% save empty information for new project-------------------------------
save (fullpath_filename, ...
'num_species' , ...
'lat_face' , 'long_face' , 'elev_face' , 'LAImin_face' , ...
'DOY_start' , 'DOY_end' , ...
'crop_name1' , 'crop_name2' , 'crop_name3' , 'crop_name4' , ...
'ph_type1' , 'ph_type2' , 'ph_type3' , 'ph_type4' , ...
'num_root1' , 'num_root2' , 'num_root3' , 'num_root4' , ...
'num_LAD1' , 'num_LAD2' , 'num_LAD3' , 'num_LAD4' , ...
'opt_root1' , 'opt_root2' , 'opt_root3' , 'opt_root4' , ...
'Sim_species' , 'Sim_species_con' , 'RHC' , 'CO2_Elev' , ...
'CO2_Ambient' , 'vanGen' , ...
'CO2_Elev_con' , 'Temp_Elev' , 'Temp_Elev_con' , 'Soil_nutrient' , ...
'Soil_heat' , 'Turbulence' , 'HR' , ...
...
'Soil_C_pool1' , 'N_denit' , 'N_Fix' , 'N_Remo' , ...
'N_Uptake_RB' , ...
'N_Adepo' , 'N_Adepo_amm' , 'N_Adepo_nit' , ...
'N_Fert' , 'N_Fert_DOY' , ...
'N_Fert_amm' , 'N_Fert_nit' , 'N_Fert_urea' , ...
'opt_root_para' , ...
'root_init' , 'root_name' , 'nutrient_int' , ...
'nutrient_name1' , 'nutrient_name2' , ...
'root_init_litter' ,'nutrient_int_litter' , ...
'dat_LAD1' , 'dat_LAD2' , 'dat_LAD3' , 'dat_LAD4' , ...
'dat_root1' , 'dat_root2' , 'dat_root3' , 'dat_root4' , ...
'dat_decom' , 'dat_decom_litter' , ...
'set_para_root1' , 'set_para_root2' , 'set_para_root3' , 'set_para_root4' , ...
'set_root_func' , 'litter_depth' , ...
'para_radiation' ,'para_microenvironment', 'para_soil' , 'para_respiration' , ...
'para_soilCN' , ...
'para_soilCN_crop1' , 'para_soilCN_crop2' , 'para_soilCN_crop3' ,'para_soilCN_crop4' , ...
'para_soilCN_crop11' , 'para_soilCN_crop22' , 'para_soilCN_crop33' ,'para_soilCN_crop44' , ...
'para_leaf_crop1' , 'para_leaf_crop2' , 'para_leaf_crop3' , 'para_leaf_crop4' , ...
'para_leaf_crop11' , 'para_leaf_crop22' , 'para_leaf_crop33' , 'para_leaf_crop44' , ...
'para_canopy_crop1' , 'para_canopy_crop2' , 'para_canopy_crop3' , 'para_canopy_crop4' , ...
'para_canopy_crop_fixed', ...
'para_photosynthesisC3_crop1','para_photosynthesisC3_crop2','para_photosynthesisC3_crop3','para_photosynthesisC3_crop4', ...
'para_photosynthesisC4_crop1','para_photosynthesisC4_crop2','para_photosynthesisC4_crop3','para_photosynthesisC4_crop4', ...
'para_conductance_crop1','para_conductance_crop2','para_conductance_crop3','para_conductance_crop4', ...
'current_species' , ...
'working_forcings' , 'fullpath_forcings' );
% save to temporary files.---------------------------------------------
save ('./Temps/temp_variable.mat',...
'num_species' , ...
'lat_face' , 'long_face' , 'elev_face' , 'LAImin_face' , ...
'DOY_start' , 'DOY_end' , ...
'crop_name1' , 'crop_name2' , 'crop_name3' , 'crop_name4' , ...
'ph_type1' , 'ph_type2' , 'ph_type3' , 'ph_type4' , ...
'num_root1' , 'num_root2' , 'num_root3' , 'num_root4' , ...
'num_LAD1' , 'num_LAD2' , 'num_LAD3' , 'num_LAD4' , ...
'opt_root1' , 'opt_root2' , 'opt_root3' , 'opt_root4' , ...
'Sim_species' , 'Sim_species_con' , 'RHC' , 'CO2_Elev' , ...
'CO2_Ambient' , 'vanGen' , ...
'CO2_Elev_con' , 'Temp_Elev' , 'Temp_Elev_con' , 'Soil_nutrient' , ...
'Soil_heat' , 'Turbulence' , 'HR' , ...
...
'Soil_C_pool1' , 'N_denit' , 'N_Fix' , 'N_Remo' , ...
'N_Uptake_RB' , ...
'N_Adepo' , 'N_Adepo_amm' , 'N_Adepo_nit' , ...
'N_Fert' , 'N_Fert_DOY' , ...
'N_Fert_amm' , 'N_Fert_nit' , 'N_Fert_urea' , ...
'opt_root_para' , ...
'root_init' , 'root_name' , 'nutrient_int' , ...
'nutrient_name1' , 'nutrient_name2' , ...
'root_init_litter' ,'nutrient_int_litter' , ...
'dat_LAD1' , 'dat_LAD2' , 'dat_LAD3' , 'dat_LAD4' , ...
'dat_root1' , 'dat_root2' , 'dat_root3' , 'dat_root4' , ... ...
'dat_decom' , 'dat_decom_litter' , ...
'set_para_root1' , 'set_para_root2' , 'set_para_root3' , 'set_para_root4' , ...
'set_root_func' , 'litter_depth' , ...
'para_radiation' ,'para_microenvironment', 'para_soil' , 'para_respiration' , ...
'para_soilCN' , ...
'para_soilCN_crop1' , 'para_soilCN_crop2' , 'para_soilCN_crop3' ,'para_soilCN_crop4' , ...
'para_soilCN_crop11' , 'para_soilCN_crop22' , 'para_soilCN_crop33' ,'para_soilCN_crop44' , ...
'para_leaf_crop1' , 'para_leaf_crop2' , 'para_leaf_crop3' , 'para_leaf_crop4' , ...
'para_leaf_crop11' , 'para_leaf_crop22' , 'para_leaf_crop33' , 'para_leaf_crop44' , ...
'para_canopy_crop1' , 'para_canopy_crop2' , 'para_canopy_crop3' , 'para_canopy_crop4' , ...
'para_canopy_crop_fixed', ...
'para_photosynthesisC3_crop1','para_photosynthesisC3_crop2','para_photosynthesisC3_crop3','para_photosynthesisC3_crop4', ...
'para_photosynthesisC4_crop1','para_photosynthesisC4_crop2','para_photosynthesisC4_crop3','para_photosynthesisC4_crop4', ...
'para_conductance_crop1','para_conductance_crop2','para_conductance_crop3','para_conductance_crop4', ...
'current_species' , ...
'working_forcings' , 'fullpath_forcings' );
end
end
%-------------------------------------------------------------------------%
% OPEN BUTTON ON START SCREEN TO OPEN FILES... %
%-------------------------------------------------------------------------%
function button_open_main_Callback(hObject, eventdata, handles)
[filename, pathname] = uigetfile('*.mat', 'Open MLCan files');
if pathname == 0 %if the user pressed cancelled, then we exit this callback
return
else
fullpath_filename = [pathname, filename];
workpath = getappdata(0,'workpath');
rem_path = strrep(fullpath_filename,workpath,'');
if strcmp(rem_path,fullpath_filename) == 1
Msgbox('Please copy project files inside the working folder before loading','MLCan Error');
return
else
working_name = ['.',rem_path];
try
%load(working_name, 'crop_name', 'lat_face', 'long_face', 'LAImin_face', 'num_can', 'num_LAD', 'num_root');
save './Temps/temporary.mat' 'working_name';
copyfile(fullpath_filename,'./Temps/temp_variable.mat','f');
set(handles.pan_start_screen,'Visible','off');
set(handles.Main,'Color',[0.941 0.941 0.941]);
set(handles.pan_layer,'Visible','on');
main_menu_enable(hObject, eventdata, handles);
catch exception
msgbox('Incorrect input file','MLCan: Error');
return
end
end
end
%-------------------------------------------------------------------------%
% EXIT BUTTON... %
%-------------------------------------------------------------------------%
function button_exit_main_Callback(hObject, eventdata, handles)
close
% --------------------------------------------------------------------
function mnu_about_Callback(hObject, eventdata, handles)
% hObject handle to mnu_about (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
model_about()
%-------------------------------------------------------------------------%
% Enable some menu in the main screen %
%-------------------------------------------------------------------------%
function main_menu_enable(hObject, eventdata, handles)
set(handles.mnu_model,'Enable','on');
set(handles.mnu_result,'Enable','on');
set(handles.mnu_save,'Enable','on');
set(handles.mnu_saveas,'Enable','on');
set(handles.toolbar_save,'Enable','on');
set(handles.button_setup_model,'Visible','on');
set(handles.txt_model_mlcan,'Visible','on');
set(handles.txt_model_full_name,'Visible','on');
%-------------------------------------------------------------------------%
% Call MODEL SETUP interface from button in main screen %
%-------------------------------------------------------------------------%
function button_group_setup_Callback(hObject, eventdata, handles)
model_setup;
%-------------------------------------------------------------------------%
% Call OPTIONS interface from button in main screen %
%-------------------------------------------------------------------------%
function button_group_option_Callback(hObject, eventdata, handles)
load './Temps/temp_variable.mat' 'DOY_start' 'DOY_end'
if isstr(DOY_start)
DOY_start=str2num(DOY_start);
end
if isstr(DOY_end)
DOY_end=str2num(DOY_end);
end
if isempty(DOY_start) || isempty(DOY_end)
msgbox( 'Please go back to MODEL SETUP - Set Specified DOY', ...
'MLCan Error','Error');
return
else
model_option;
end
%-------------------------------------------------------------------------%
% Call FORCINGS/INITIAL CONDITONS interface from button in main screen %
%-------------------------------------------------------------------------%
function button_group_condition_Callback(hObject, eventdata, handles)
load './Temps/temp_variable.mat' 'root_init' 'num_root1' 'dat_root1'
try
dat_length = length(root_init(:,1));
if isstr(num_root1) == 1
root_num = str2num(num_root1);
else
root_num = num_root1;
end
if dat_length > root_num
root_init = root_init(1:root_num,:);
elseif dat_length < root_num
root_init_add = zeros(root_num-dat_length,3);
root_init = [root_init; root_init_add];
end
root_init = [dat_root1(:,1),root_init(:,2:3)];
model_forcings;
catch exception
msgbox( 'Please go back to MODEL SETUP - Click on Add/Edit Input root profile and/or Leaf area density', ...
'MLCan Error','Error');
return
end
%-------------------------------------------------------------------------%
% Call PARAMETERS interface from button in main screen %
%-------------------------------------------------------------------------%
function button_group_parameters_Callback(hObject, eventdata, handles)
model_parameters;
%-------------------------------------------------------------------------%
% Call RESULTS interface from button in main screen %
%-------------------------------------------------------------------------%
function button_group_result_Callback(hObject, eventdata, handles)
model_results;
%-------------------------------------------------------------------------%
% Loading icon for buttons in main interface %
function axes3_CreateFcn(hObject, eventdata, handles)
modelicon = imread('./users/icons/wheat.png');
image(modelicon)
axis off
%imshow('./users/icons/wheat.png');
function axes4_CreateFcn(hObject, eventdata, handles)
optionicon = imread('./users/icons/option.png');
image(optionicon)
axis off
%imshow('./users/icons/option.png');
function axes5_CreateFcn(hObject, eventdata, handles)
forceicon = imread('./users/icons/forcings.png');
image(forceicon)
axis off
%imshow('./users/icons/forcings.png');
function axes6_CreateFcn(hObject, eventdata, handles)
paraicon = imread('./users/icons/parameter.png');
image(paraicon)
axis off
%imshow('./users/icons/parameter.png');
function axes7_CreateFcn(hObject, eventdata, handles)
resulticon = imread('./users/icons/result.png');
image(resulticon)
axis off
%imshow('./users/icons/result.png');
% End of loading icon %
%-------------------------------------------------------------------------%
%-------------------------------------------------------------------------%
% Toolbar functions %
%-------------------------------------------------------------------------%
function toolbar_new_ClickedCallback(hObject, eventdata, handles)
button_new_main_Callback(hObject, eventdata, handles)
function toolbar_save_ClickedCallback(hObject, eventdata, handles)
mnu_save_Callback(hObject, eventdata, handles)
function mnu_setup_model_Callback(hObject, eventdata, handles)
button_group_setup_Callback(hObject, eventdata, handles)
function mnu_options_Callback(hObject, eventdata, handles)
button_group_option_Callback(hObject, eventdata, handles)
function mnu_result_viewer_Callback(hObject, eventdata, handles)
button_group_result_Callback(hObject, eventdata, handles)
% --- If Enable == 'on', executes on mouse press in 5 pixel border.
% --- Otherwise, executes on mouse press in 5 pixel border or over button_group_parameters.
function button_group_parameters_ButtonDownFcn(hObject, eventdata, handles)
% hObject handle to button_group_parameters (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function mnu_help_Callback(hObject, eventdata, handles)
% hObject handle to mnu_help (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)