1 |
gforget |
1.1 |
|
2 |
gforget |
1.6 |
global gcmfaces_skipplottest; %externally set key that will bypass the interactive plotting test |
3 |
|
|
if isempty(gcmfaces_skipplottest); gcmfaces_skipplottest=0; end; |
4 |
|
|
|
5 |
|
|
global gcmfaces_verbose; %to print notes to screen |
6 |
|
|
if isempty(gcmfaces_verbose); gcmfaces_verbose=1; end; |
7 |
|
|
|
8 |
gforget |
1.5 |
|
9 |
gforget |
1.9 |
global gcmfaces_dir; gcmfaces_dir=[pwd '/']; |
10 |
gforget |
1.1 |
|
11 |
gforget |
1.9 |
fid=fopen([gcmfaces_dir 'gcmfaces_path.m'],'wt'); |
12 |
|
|
fprintf(fid,['global gcmfaces_dir; gcmfaces_dir=''' gcmfaces_dir ''';\n']); |
13 |
|
|
fprintf(fid,['addpath ' gcmfaces_dir ';\n']); |
14 |
|
|
fprintf(fid,['addpath ' gcmfaces_dir 'gcmfaces_IO/;\n']); |
15 |
|
|
fprintf(fid,['addpath ' gcmfaces_dir 'gcmfaces_convert/;\n']); |
16 |
|
|
fprintf(fid,['addpath ' gcmfaces_dir 'gcmfaces_exch/;\n']); |
17 |
|
|
fprintf(fid,['addpath ' gcmfaces_dir 'gcmfaces_maps/;\n']); |
18 |
|
|
fprintf(fid,['addpath ' gcmfaces_dir 'gcmfaces_misc/;\n']); |
19 |
|
|
fprintf(fid,['addpath ' gcmfaces_dir 'gcmfaces_calc/;\n']); |
20 |
|
|
fprintf(fid,['addpath ' gcmfaces_dir 'gcmfaces_smooth/;\n']); |
21 |
|
|
%fprintf(fid,['addpath ' gcmfaces_dir 'gcmfaces_specs/;\n']); |
22 |
|
|
%fprintf(fid,['addpath ' gcmfaces_dir 'gcmfaces_legacy/;\n']); |
23 |
|
|
fprintf(fid,['addpath ' gcmfaces_dir 'gcmfaces_devel/;\n']); |
24 |
|
|
fprintf(fid,['addpath ' gcmfaces_dir 'sample_analysis/;\n']); |
25 |
|
|
fprintf(fid,['addpath ' gcmfaces_dir 'sample_processing/;\n']); |
26 |
|
|
fprintf(fid,['addpath ' gcmfaces_dir 'ecco_v4/;\n']); |
27 |
gforget |
1.1 |
fclose(fid); |
28 |
|
|
|
29 |
gforget |
1.6 |
if gcmfaces_verbose; |
30 |
gforget |
1.1 |
fprintf('\n\n\n***********message from gcmfaces_init.m************ \n'); |
31 |
|
|
fprintf(' gcmfaces_path.m was created that, when executed, \n'); |
32 |
|
|
fprintf(' adds the gcmfaces directories to your path \n\n\n'); |
33 |
|
|
fprintf(' ultimately you may want to copy it in your startup.m \n'); |
34 |
gforget |
1.6 |
end; |
35 |
gforget |
1.1 |
|
36 |
|
|
gcmfaces_path; |
37 |
|
|
|
38 |
gforget |
1.4 |
test0=dir('sample_input'); if isempty(test0); fprintf('no sample input data found\n'); return; end; |
39 |
|
|
|
40 |
gforget |
1.6 |
fprintf('\n\n basic gcmfaces test: started... \n'); |
41 |
|
|
gcmfaces_path; |
42 |
gforget |
1.10 |
global mygrid; mygrid=[]; grid_load([gcmfaces_dir '/sample_input/GRIDv4/'],5,'compact'); |
43 |
gforget |
1.6 |
nameFld='DDetan'; tt=[53:78]*336; cc=[0 0.10]; |
44 |
gforget |
1.10 |
fld=rdmds2gcmfaces([gcmfaces_dir '/sample_input/SAMPLEv4/' nameFld],tt); |
45 |
gforget |
1.6 |
fld=std(fld,[],3); msk=mygrid.hFacC(:,:,1); fld(find(msk==0))=NaN; |
46 |
|
|
fprintf(' basic gcmfaces test: completed. \n\n'); |
47 |
|
|
|
48 |
|
|
if ~gcmfaces_skipplottest; |
49 |
|
|
|
50 |
|
|
if gcmfaces_verbose; |
51 |
gforget |
1.1 |
fprintf('\n\n\n***********message from gcmfaces_init.m************\n '); |
52 |
|
|
fprintf(' starting 1st example routine: plot_one_field ... \n'); |
53 |
gforget |
1.6 |
end; |
54 |
gforget |
1.1 |
|
55 |
gforget |
1.10 |
plot_one_field('v4',0); |
56 |
gforget |
1.1 |
|
57 |
gforget |
1.6 |
if gcmfaces_verbose; |
58 |
gforget |
1.1 |
fprintf('\n\n\n***********message from gcmfaces_init.m************\n '); |
59 |
|
|
fprintf(' starting 2nd example routine: plot_std_field ... \n'); |
60 |
gforget |
1.6 |
end; |
61 |
gforget |
1.1 |
|
62 |
gforget |
1.10 |
plot_std_field('v4'); |
63 |
gforget |
1.1 |
|
64 |
gforget |
1.6 |
end; |
65 |
|
|
|
66 |
|
|
if gcmfaces_verbose; |
67 |
gforget |
1.1 |
fprintf('\n\n\n***********message from gcmfaces_init.m************\n '); |
68 |
gforget |
1.6 |
fprintf(' --- initialization of gcmfaces completed correctly \n'); |
69 |
|
|
fprintf(' --- you are all set and may now use the gcmfaces package \n'); |
70 |
|
|
fprintf(' --- eventually, to avoid running gcmfaces_init over again \n'); |
71 |
|
|
fprintf(' --- you may want to copy the gcmfaces_path.m code to your startup.m \n\n\n'); |
72 |
|
|
end; |
73 |
gforget |
1.1 |
|