/[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.17 - (show annotations) (download)
Mon Mar 14 01:24:17 2016 UTC (9 years, 4 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint65x, checkpoint65v, checkpoint65w, checkpoint65u
Changes since 1.16: +12 -6 lines
- add directions to download grid
- comment out call to MITprof_global to avoid
  the need to download gcmfaces_climatologies

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

  ViewVC Help
Powered by ViewVC 1.1.22