/[MITgcm]/MITgcm_contrib/gael/matlab_class/gcmfaces_demo.m
ViewVC logotype

Contents of /MITgcm_contrib/gael/matlab_class/gcmfaces_demo.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.16 - (show annotations) (download)
Thu Mar 10 17:17:35 2016 UTC (9 years, 4 months ago) by gforget
Branch: MAIN
Changes since 1.15: +2 -1 lines
- fix directions (contributed by D. Spiegel).

1 function []=gcmfaces_demo();
2 % GCMFACES_DEMO demonstrate capabilities of the gcmfaces toolbox.
3 %
4 %expected directory structure:
5 %
6 % gcmfaces (codes)
7 % MITprof (codes)
8 % nctiles_grid (ECCO v4 grid)
9 % release1 (ECCO v4 output)
10 % sample_input (additional demo material)
11 %
12 %to activate example_transports:
13 %
14 % mkdir release1
15 % wget --recursive ftp://mit.ecco-group.org/ecco_for_las/version_4/release1/nctiles_climatology
16 % mv mit.ecco-group.org/ecco_for_las/version_4/release1/nctiles_climatology release1/.
17 % rm -rf mit.ecco-group.org
18 %
19 %to activate example_budget:
20 %
21 % mkdir sample_input
22 % wget --recursive ftp://mit.ecco-group.org/gforget/nctiles_budget_2d
23 % mv mit.ecco-group.org/gforget/nctiles_budget_2d sample_input/.
24 % rm -rf mit.ecco-group.org
25 %
26 % call sequence:
27 % addpath gcmfaces;
28 % addpath MITprof;
29 % gcmfaces_demo;
30
31 %choose verbose level
32 fprintf('\n Please set the amount of explanatory text display :\n');
33 fprintf(' 0: none.\n');
34 fprintf(' 1: comments.\n');
35 fprintf(' 2: comments preceeded with calling sequence.\n');
36 fprintf(' 3: same as 2, but preceeded with pause.\n');
37 verbose=input(' and/or type return. 0 is the default. \n');
38 if isempty(verbose); verbose=0; end;
39
40 fprintf('\n');
41
42 %so that gcmfaces_msg will work even before calling gcmfaces_global:
43 tmp1=which('gcmfaces_demo');
44 [PATH,NAME,EXT] = fileparts(tmp1);
45 addpath([PATH filesep 'gcmfaces_misc' filesep]);
46 global myenv;
47 myenv.issueWarnings=0;%skip warnings
48 myenv.verbose=verbose;%apply verbose level selected by user
49 %
50 fprintf('\n\n');
51 gcmfaces_msg('/////////////////////////////////////');
52 gcmfaces_msg('demo of gcmfaces_global and MITprof_global','// PART 0 :');
53 gcmfaces_msg('please hit return','// >> ');
54 gcmfaces_msg('/////////////////////////////////////');
55 fprintf('\n\n');
56 pause;
57 if myenv.verbose>0;
58 gcmfaces_msg(['* gcmfaces_global: adds gcmfaces directories to path' ...
59 ' and define environment variables (see myenv)']);
60 end;
61 myenv=[];
62 gcmfaces_global;%this will display warning
63 myenv.issueWarnings=0;%skip warnings
64 myenv.verbose=verbose;%apply verbose level selected by user
65 if myenv.verbose>0;
66 gcmfaces_msg('* (this warning gets resolved below by calling grid_load)');
67 end;
68
69 if ~isempty(which('MITprof_global'));
70 MITprof_global;
71 if myenv.verbose>0;
72 gcmfaces_msg('* MITprof_global: adds MITprof directories to path');
73 end;
74 end;
75
76 fprintf('\n\n');
77 gcmfaces_msg('/////////////////////////////////////');
78 gcmfaces_msg('demo of grid_load','// PART 1 :');
79 gcmfaces_msg('please hit return','// >> ');
80 gcmfaces_msg('/////////////////////////////////////');
81 fprintf('\n\n');
82 pause;
83 grid_load;
84
85 fprintf('\n\n');
86 gcmfaces_msg('/////////////////////////////////////');
87 gcmfaces_msg('demo of plotting routines','// PART 1 :');
88 gcmfaces_msg('please hit return','// >> ');
89 gcmfaces_msg('/////////////////////////////////////');
90 fprintf('\n\n');
91 pause;
92 example_display;
93
94 fprintf('\n\n');
95 gcmfaces_msg('///////////////////////////////////////////');
96 gcmfaces_msg('demo of interpolation and remapping ','// PART 2 :');
97 gcmfaces_msg('please hit return','// >> ');
98 gcmfaces_msg('///////////////////////////////////////////');
99 fprintf('\n\n');
100 pause;
101 example_interp;
102
103 fprintf('\n\n');
104 gcmfaces_msg('///////////////////////////////////////////');
105 gcmfaces_msg('demo of bin averaging data sample to grid','// PART 2 :');
106 gcmfaces_msg('please hit return','// >> ');
107 gcmfaces_msg('///////////////////////////////////////////');
108 fprintf('\n\n');
109 pause;
110 fld=example_bin_average;
111
112 fprintf('\n\n');
113 gcmfaces_msg('///////////////////////////////////////////');
114 gcmfaces_msg('demo of smoothing through diffusion','// PART 2 :');
115 gcmfaces_msg('please hit return','// >> ');
116 gcmfaces_msg('///////////////////////////////////////////');
117 fprintf('\n\n');
118 pause;
119 example_smooth(fld);
120
121 fprintf('\n\n');
122 gcmfaces_msg('/////////////////////////////////////////');
123 gcmfaces_msg('demo of transport computations','// PART 3 :');
124 gcmfaces_msg('please hit return','// >> ');
125 gcmfaces_msg('/////////////////////////////////////////');
126 fprintf('\n\n');
127 pause;
128 diags=example_transports;
129
130 if ~isempty(diags);
131 fprintf('\n\n');
132 gcmfaces_msg('/////////////////////////////////////////');
133 gcmfaces_msg('demo of transport display','// PART 3 :');
134 gcmfaces_msg('please hit return','// >> ');
135 gcmfaces_msg('/////////////////////////////////////////');
136 fprintf('\n\n');
137 example_transports_disp(diags);
138 end;
139
140 fprintf('\n\n');
141 gcmfaces_msg('/////////////////////////////////////////');
142 gcmfaces_msg('demo of budget computations','// PART 4 :');
143 gcmfaces_msg('please hit return','// >> ');
144 gcmfaces_msg('/////////////////////////////////////////');
145 fprintf('\n\n');
146 pause;
147 example_budget;
148

  ViewVC Help
Powered by ViewVC 1.1.22