/[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.8 by gforget, Fri Mar 20 14:32:54 2015 UTC revision 1.15 by gforget, Mon Jan 25 19:02:57 2016 UTC
# Line 1  Line 1 
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/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  choiceGrid='v4';  %choose verbose level
   
 %old option that eventually should be re-activated:  
 % fprintf('\n Please set the demo grid : \n');  
 % fprintf('    ''llc'': lat-lon-cap grid (5 faces). \n');  
 % fprintf('    ''ll'' : simple lat-lon grid (1 face). \n');  
 % choiceGrid=input(' and type return. ''llc'' is the default.\n');  
 % if isempty(choiceGrid); choiceGrid='llc'; end;  
 % if strcmp(choiceGrid,'llc'); choiceGrid='v4';  
 % elseif strcmp(choiceGrid,'ll'); choiceGrid='v3';  
 % else; error('wrong grid choice');  
 % end;  
   
 %choose verbise level  
31  fprintf('\n Please set the amount of explanatory text display :\n');  fprintf('\n Please set the amount of explanatory text display :\n');
32  fprintf('    0: none.\n');  fprintf('    0: none.\n');
33  fprintf('    1: comments.\n');  fprintf('    1: comments.\n');
# Line 21  fprintf('    3: same as 2, but preceeded Line 36  fprintf('    3: same as 2, but preceeded
36  verbose=input(' and/or type return. 0 is the default. \n');  verbose=input(' and/or type return. 0 is the default. \n');
37  if isempty(verbose); verbose=0; end;  if isempty(verbose); verbose=0; end;
38    
39  %initialize environment variables and mygrid  fprintf('\n');
40  addpath gcmfaces;  
41  gcmfaces_global;  %so that gcmfaces_msg will work even before calling gcmfaces_global:
42  myenv.issueWarnings=0;  tmp1=which('gcmfaces_demo');
43  myenv.verbose=verbose;  [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;  if myenv.verbose>0;
57      gcmfaces_msg('* set path and environment variables (myenv) by calling gcmfaces_global');      gcmfaces_msg(['* gcmfaces_global: adds gcmfaces directories to path' ...
58                     ' and define environment variables (see myenv)']);
59  end;  end;
60    myenv=[];
61  addpath MITprof;  gcmfaces_global;%this will display warning
62  if ~isempty(which('MITprof_global'));  myenv.issueWarnings=0;%skip warnings
63  MITprof_global;  myenv.verbose=verbose;%apply verbose level selected by user
64  if myenv.verbose>0;  if myenv.verbose>0;
65      gcmfaces_msg('* set MITprof path by calling MITprof_global');      gcmfaces_msg('* (this warning gets resolved below by calling grid_load)');
66  end;  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;  end;
74    
75  fprintf('\n\n');  fprintf('\n\n');
76  gcmfaces_msg('/////////////////////////////////////');  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 :');  gcmfaces_msg('demo of plotting routines','// PART 1 :');
87  gcmfaces_msg('please hit return','// >> ');  gcmfaces_msg('please hit return','// >> ');
88  gcmfaces_msg('/////////////////////////////////////');  gcmfaces_msg('/////////////////////////////////////');
89  fprintf('\n\n');  fprintf('\n\n');
90  pause;  pause;
91  plot_one_field(choiceGrid,0);%%incl. call to m_map_gcmfaces;  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');  fprintf('\n\n');
103  gcmfaces_msg('///////////////////////////////////////////');  gcmfaces_msg('///////////////////////////////////////////');
104  gcmfaces_msg('demo of gridding v interpolating','// PART 2 :');  gcmfaces_msg('demo of bin averaging data sample to grid','// PART 2 :');
105  gcmfaces_msg('please hit return','// >> ');  gcmfaces_msg('please hit return','// >> ');
106  gcmfaces_msg('///////////////////////////////////////////');  gcmfaces_msg('///////////////////////////////////////////');
107  fprintf('\n\n');  fprintf('\n\n');
108  pause;  pause;
109  example_bin_average(choiceGrid,1);%incl. call to example_smooth.m;  fld=example_bin_average;
110  example_griddata(choiceGrid);  
111  example_interp(choiceGrid);  fprintf('\n\n');
112  example_faces2latlon2faces(choiceGrid);  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');  fprintf('\n\n');
121  gcmfaces_msg('/////////////////////////////////////////');  gcmfaces_msg('/////////////////////////////////////////');
# Line 66  gcmfaces_msg('please hit return','// >> Line 124  gcmfaces_msg('please hit return','// >>
124  gcmfaces_msg('/////////////////////////////////////////');  gcmfaces_msg('/////////////////////////////////////////');
125  fprintf('\n\n');  fprintf('\n\n');
126  pause;  pause;
127  diags=example_transports(choiceGrid);  diags=example_transports;
128    
129  if ~isempty(diags);  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);      example_transports_disp(diags);
137  end;  end;
138    
# Line 78  gcmfaces_msg('please hit return','// >> Line 143  gcmfaces_msg('please hit return','// >>
143  gcmfaces_msg('/////////////////////////////////////////');  gcmfaces_msg('/////////////////////////////////////////');
144  fprintf('\n\n');  fprintf('\n\n');
145  pause;  pause;
146  example_budget(choiceGrid);  example_budget;
147    

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

  ViewVC Help
Powered by ViewVC 1.1.22