1 |
|
|
2 |
global gcmfaces_skipplottest; %externally set key that will bypass the interactive plotting test |
gcmfaces_global; |
|
if isempty(gcmfaces_skipplottest); gcmfaces_skipplottest=0; end; |
|
3 |
|
|
4 |
global gcmfaces_verbose; %to print notes to screen |
warning('off','MATLAB:HandleGraphics:noJVM'); |
|
if isempty(gcmfaces_verbose); gcmfaces_verbose=1; end; |
|
5 |
|
|
6 |
|
if myenv.verbose; |
7 |
global mydir; mydir=[pwd '/']; |
fprintf('\n\n\n***********message from gcmfaces_init.m************\n '); |
8 |
|
fprintf(' starting basic test : example_IO ... \n'); |
|
fid=fopen([mydir 'gcmfaces_path.m'],'wt'); |
|
|
fprintf(fid,['global mydir; mydir=''' mydir ''';\n']); |
|
|
fprintf(fid,['addpath ' mydir ';\n']); |
|
|
fprintf(fid,['addpath ' mydir 'gcmfaces_IO/;\n']); |
|
|
fprintf(fid,['addpath ' mydir 'gcmfaces_convert/;\n']); |
|
|
fprintf(fid,['addpath ' mydir 'gcmfaces_exch/;\n']); |
|
|
fprintf(fid,['addpath ' mydir 'gcmfaces_maps/;\n']); |
|
|
fprintf(fid,['addpath ' mydir 'gcmfaces_misc/;\n']); |
|
|
fprintf(fid,['addpath ' mydir 'gcmfaces_calc/;\n']); |
|
|
fprintf(fid,['addpath ' mydir 'gcmfaces_smooth/;\n']); |
|
|
%fprintf(fid,['addpath ' mydir 'gcmfaces_specs/;\n']); |
|
|
%fprintf(fid,['addpath ' mydir 'gcmfaces_legacy/;\n']); |
|
|
%fprintf(fid,['addpath ' mydir 'gcmfaces_devel/;\n']); |
|
|
fprintf(fid,['addpath ' mydir 'sample_analysis/;\n']); |
|
|
fprintf(fid,['addpath ' mydir 'sample_processing/;\n']); |
|
|
fclose(fid); |
|
|
|
|
|
if gcmfaces_verbose; |
|
|
fprintf('\n\n\n***********message from gcmfaces_init.m************ \n'); |
|
|
fprintf(' gcmfaces_path.m was created that, when executed, \n'); |
|
|
fprintf(' adds the gcmfaces directories to your path \n\n\n'); |
|
|
fprintf(' ultimately you may want to copy it in your startup.m \n'); |
|
|
end; |
|
|
|
|
|
gcmfaces_path; |
|
|
|
|
|
test0=dir('sample_input'); if isempty(test0); fprintf('no sample input data found\n'); return; end; |
|
|
|
|
|
fprintf('\n\n basic gcmfaces test: started... \n'); |
|
|
gcmfaces_path; |
|
|
global mygrid; mygrid=[]; grid_load([mydir '/sample_input/GRIDv4/'],5); |
|
|
nameFld='DDetan'; tt=[53:78]*336; cc=[0 0.10]; |
|
|
fld=rdmds2gcmfaces([mydir '/sample_input/SAMPLEv4/' nameFld],tt,5); |
|
|
fld=std(fld,[],3); msk=mygrid.hFacC(:,:,1); fld(find(msk==0))=NaN; |
|
|
fprintf(' basic gcmfaces test: completed. \n\n'); |
|
|
|
|
|
if ~gcmfaces_skipplottest; |
|
|
|
|
|
if gcmfaces_verbose; |
|
|
fprintf('\n\n\n***********message from gcmfaces_init.m************\n '); |
|
|
fprintf(' starting 1st example routine: plot_one_field ... \n'); |
|
9 |
end; |
end; |
10 |
|
example_IO; |
11 |
|
|
12 |
plot_one_field; |
if ~myenv.lessplot; |
13 |
|
if myenv.verbose; |
14 |
if gcmfaces_verbose; |
fprintf('\n\n\n***********message from gcmfaces_init.m************\n '); |
15 |
fprintf('\n\n\n***********message from gcmfaces_init.m************\n '); |
fprintf(' starting plot test: example_display ... \n'); |
16 |
fprintf(' starting 2nd example routine: plot_std_field ... \n'); |
end; |
17 |
end; |
example_display; |
|
|
|
|
plot_std_field; |
|
|
|
|
18 |
end; |
end; |
19 |
|
|
20 |
if gcmfaces_verbose; |
if myenv.verbose; |
21 |
fprintf('\n\n\n***********message from gcmfaces_init.m************\n '); |
fprintf('\n\n\n***********message from gcmfaces_init.m************\n'); |
22 |
fprintf(' --- initialization of gcmfaces completed correctly \n'); |
fprintf(' --- initialization of gcmfaces completed correctly \n'); |
23 |
fprintf(' --- you are all set and may now use the gcmfaces package \n'); |
fprintf(' --- you are all set and may now use the gcmfaces package. \n\n\n'); |
|
fprintf(' --- eventually, to avoid running gcmfaces_init over again \n'); |
|
|
fprintf(' --- you may want to copy the gcmfaces_path.m code to your startup.m \n\n\n'); |
|
24 |
end; |
end; |
25 |
|
|