-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscript_make_ameriflux.m
77 lines (64 loc) · 2.16 KB
/
script_make_ameriflux.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
%close all;
%clear all;
%
sitelist_1 = {UNM_sites.MCon, UNM_sites.JSav, UNM_sites.PJ, UNM_sites.PJ_girdle, ...
UNM_sites.SLand, UNM_sites.GLand, UNM_sites.PPine, UNM_sites.New_GLand};
yearlist_1 = 2010:2015;
sitelist_2 = {UNM_sites.JSav, ...
UNM_sites.SLand, UNM_sites.GLand, UNM_sites.PPine, UNM_sites.MCon};
yearlist_2 = 2007:2009;
sitelist_3={UNM_sites.PJ};
% Years to create files for
yearlist_3 = 2008:2009;
sitelist_4 = {UNM_sites.PJ_girdle}
yearlist = 2009 ;
% Partitioned data source
partmethod = 'eddyproc'; %'Reddyproc'
% Make daily files? All AF files should be in $FLUXROOT$/Ameriflux_files
make_daily = false;
write_files = true;
process_soil = false;
for k = 1:4
% Automatically cycles through earlier site years to account for
% different startup dates.
switch k
case 1
sitelist = sitelist_1;
yearlist = yearlist_1;
case 2
sitelist = sitelist_2;
yearlist = yearlist_2;
case 3
sitelist = sitelist_3;
yearlist = yearlist_3;
case 4
sitelist = sitelist_4;
yearlist = yearlist_4;
end
for i = 1:length(sitelist);
%close all;
for j = 1:length(yearlist);
% Set site and year
sitecode = sitelist{i};
year = yearlist(j);
if strcmp(partmethod, 'eddyproc');
UNM_Ameriflux_File_Maker( sitecode, year, ...
'write_files', write_files, ...
'write_daily_file', make_daily, ...
'process_soil_data', process_soil );
elseif strcmp(partmethod, 'Reddyproc');
%error( ' not implemented yet ' );
UNM_Ameriflux_File_Maker(sitecode, year,...
'write_daily_file', make_daily, ...
'process_soil_data', process_soil, ...
'gf_part_source', 'Reddyproc');
end
% New files go into FLUXROOT - look at the file you made
%UNM_Ameriflux_Data_Viewer( sitecode, year, 'AFlux_dir',...
% fullfile(getenv('FLUXROOT'), 'FluxOut' ));
%clear year;
end
close all;
clear sitecode;
end
end