1 |
|
function []=gcmfaces_demo(); |
2 |
%call sequence: |
% GCMFACES_DEMO demonstrate capabilities of the gcmfaces toolbox. |
|
% |
|
|
% addpath gcmfaces; gcmfaces_demo; |
|
3 |
% |
% |
4 |
%expected directory structure: |
%expected directory structure: |
5 |
% |
% |
7 |
% MITprof (codes) |
% MITprof (codes) |
8 |
% nctiles_grid (ECCO v4 grid) |
% nctiles_grid (ECCO v4 grid) |
9 |
% release1 (ECCO v4 output) |
% release1 (ECCO v4 output) |
10 |
% sample_input (test material) |
% sample_input (additional demo material) |
11 |
% |
% |
12 |
%to activate example_remap: |
%to activate example_remap: |
13 |
% |
% |
28 |
% mv mit.ecco-group.org/gforget/nctiles_budget_2d sample_input/. |
% mv mit.ecco-group.org/gforget/nctiles_budget_2d sample_input/. |
29 |
% rm -rf mit.ecco-group.org |
% rm -rf mit.ecco-group.org |
30 |
% |
% |
31 |
|
% call sequence: |
32 |
|
% addpath gcmfaces; |
33 |
|
% addpath MITprof; |
34 |
|
% gcmfaces_demo; |
35 |
|
|
36 |
%choose verbose level |
%choose verbose level |
37 |
fprintf('\n Please set the amount of explanatory text display :\n'); |
fprintf('\n Please set the amount of explanatory text display :\n'); |
42 |
verbose=input(' and/or type return. 0 is the default. \n'); |
verbose=input(' and/or type return. 0 is the default. \n'); |
43 |
if isempty(verbose); verbose=0; end; |
if isempty(verbose); verbose=0; end; |
44 |
|
|
45 |
%initialize environment variables and mygrid |
fprintf('\n'); |
46 |
addpath gcmfaces; |
|
47 |
gcmfaces_global; |
%so that gcmfaces_msg will work even before calling gcmfaces_global: |
48 |
myenv.issueWarnings=0; |
tmp1=which('gcmfaces_demo'); |
49 |
myenv.verbose=verbose; |
[PATH,NAME,EXT] = fileparts(tmp1); |
50 |
|
addpath([PATH filesep 'gcmfaces_misc' filesep]); |
51 |
|
global myenv; |
52 |
|
myenv.issueWarnings=0;%skip warnings |
53 |
|
myenv.verbose=verbose;%apply verbose level selected by user |
54 |
|
% |
55 |
|
fprintf('\n\n'); |
56 |
|
gcmfaces_msg('/////////////////////////////////////'); |
57 |
|
gcmfaces_msg('demo of gcmfaces_global and MITprof_global','// PART 0 :'); |
58 |
|
gcmfaces_msg('please hit return','// >> '); |
59 |
|
gcmfaces_msg('/////////////////////////////////////'); |
60 |
|
fprintf('\n\n'); |
61 |
|
pause; |
62 |
if myenv.verbose>0; |
if myenv.verbose>0; |
63 |
gcmfaces_msg('* set path and environment variables (myenv) by calling gcmfaces_global'); |
gcmfaces_msg(['* gcmfaces_global: adds gcmfaces directories to path' ... |
64 |
|
' and define environment variables (see myenv)']); |
65 |
|
end; |
66 |
|
myenv=[]; |
67 |
|
gcmfaces_global;%this will display warning |
68 |
|
myenv.issueWarnings=0;%skip warnings |
69 |
|
myenv.verbose=verbose;%apply verbose level selected by user |
70 |
|
if myenv.verbose>0; |
71 |
|
gcmfaces_msg('* (this warning gets resolved below by calling grid_load)'); |
72 |
end; |
end; |
73 |
|
|
|
addpath MITprof; |
|
74 |
if ~isempty(which('MITprof_global')); |
if ~isempty(which('MITprof_global')); |
75 |
MITprof_global; |
MITprof_global; |
76 |
if myenv.verbose>0; |
if myenv.verbose>0; |
77 |
gcmfaces_msg('* set MITprof path by calling MITprof_global'); |
gcmfaces_msg('* MITprof_global: adds MITprof directories to path'); |
78 |
end; |
end; |
79 |
end; |
end; |
80 |
|
|
81 |
fprintf('\n\n'); |
fprintf('\n\n'); |
82 |
gcmfaces_msg('/////////////////////////////////////'); |
gcmfaces_msg('/////////////////////////////////////'); |
83 |
|
gcmfaces_msg('demo of grid_load','// PART 1 :'); |
84 |
|
gcmfaces_msg('please hit return','// >> '); |
85 |
|
gcmfaces_msg('/////////////////////////////////////'); |
86 |
|
fprintf('\n\n'); |
87 |
|
pause; |
88 |
|
grid_load; |
89 |
|
|
90 |
|
fprintf('\n\n'); |
91 |
|
gcmfaces_msg('/////////////////////////////////////'); |
92 |
gcmfaces_msg('demo of plotting routines','// PART 1 :'); |
gcmfaces_msg('demo of plotting routines','// PART 1 :'); |
93 |
gcmfaces_msg('please hit return','// >> '); |
gcmfaces_msg('please hit return','// >> '); |
94 |
gcmfaces_msg('/////////////////////////////////////'); |
gcmfaces_msg('/////////////////////////////////////'); |