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

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

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

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

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.22