/[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.5 by gforget, Wed Dec 3 14:21:55 2014 UTC revision 1.16 by gforget, Thu Mar 10 17:17:35 2016 UTC
# Line 1  Line 1 
1    function []=gcmfaces_demo();
2  choiceGrid='v4';  % GCMFACES_DEMO demonstrate capabilities of the gcmfaces toolbox.
3    %
4  %need to replace the missing v3 files...  %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  %choose grid for test  %  mkdir sample_input
22  % fprintf('\n Please set the demo grid : \n');  %  wget --recursive ftp://mit.ecco-group.org/gforget/nctiles_budget_2d
23  % fprintf('    ''llc'': lat-lon-cap grid (5 faces). \n');  %  mv mit.ecco-group.org/gforget/nctiles_budget_2d sample_input/.
24  % fprintf('    ''ll'' : simple lat-lon grid (1 face). \n');  %  rm -rf mit.ecco-group.org
25  % choiceGrid=input(' and type return. ''llc'' is the default.\n');  %
26  % if isempty(choiceGrid); choiceGrid='llc'; end;  % call sequence:
27  % if strcmp(choiceGrid,'llc'); choiceGrid='v4';  %  addpath gcmfaces;
28  % elseif strcmp(choiceGrid,'ll'); choiceGrid='v3';  %  addpath MITprof;
29  % else; error('wrong grid choice');  %  gcmfaces_demo;
 % end;  
30    
31  %choose verbise level  %choose verbose level
32  fprintf('\n Please set the amount of explanatory text display :\n');  fprintf('\n Please set the amount of explanatory text display :\n');
33  fprintf('    0: none.\n');  fprintf('    0: none.\n');
34  fprintf('    1: comments.\n');  fprintf('    1: comments.\n');
# Line 23  fprintf('    3: same as 2, but preceeded Line 37  fprintf('    3: same as 2, but preceeded
37  verbose=input(' and/or type return. 0 is the default. \n');  verbose=input(' and/or type return. 0 is the default. \n');
38  if isempty(verbose); verbose=0; end;  if isempty(verbose); verbose=0; end;
39    
40  %initialize environment variables and mygrid  fprintf('\n');
41  gcmfaces_global;  
42  myenv.verbose=verbose;  %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;  if myenv.verbose>0;
66      gcmfaces_msg('* set path and environment variables (myenv) by calling gcmfaces_global');      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;  end;
75    
76  fprintf('\n\n');  fprintf('\n\n');
77  gcmfaces_msg('/////////////////////////////////////////');  gcmfaces_msg('/////////////////////////////////////');
78  gcmfaces_msg('demo of transport computations','// PART 1 :');  gcmfaces_msg('demo of grid_load','// PART 1 :');
79  gcmfaces_msg('please hit return','// >> ');  gcmfaces_msg('please hit return','// >> ');
80  gcmfaces_msg('/////////////////////////////////////////');  gcmfaces_msg('/////////////////////////////////////');
81  fprintf('\n\n');  fprintf('\n\n');
82  pause;  pause;
83  diags=example_transports(choiceGrid);  grid_load;
 if ~isempty(diags);  
     example_transports_disp(diags);  
 end;  
84    
85  fprintf('\n\n');  fprintf('\n\n');
86  gcmfaces_msg('/////////////////////////////////////');  gcmfaces_msg('/////////////////////////////////////');
87  gcmfaces_msg('demo of plotting routines','// PART 2 :');  gcmfaces_msg('demo of plotting routines','// PART 1 :');
88  gcmfaces_msg('please hit return','// >> ');  gcmfaces_msg('please hit return','// >> ');
89  gcmfaces_msg('/////////////////////////////////////');  gcmfaces_msg('/////////////////////////////////////');
90  fprintf('\n\n');  fprintf('\n\n');
91  pause;  pause;
92  plot_one_field(choiceGrid,0);%%incl. call to m_map_gcmfaces;  example_display;
93    
94  fprintf('\n\n');  fprintf('\n\n');
95  gcmfaces_msg('///////////////////////////////////////////');  gcmfaces_msg('///////////////////////////////////////////');
96  gcmfaces_msg('demo of gridding v interpolating','// PART 3 :');  gcmfaces_msg('demo of interpolation and remapping ','// PART 2 :');
97  gcmfaces_msg('please hit return','// >> ');  gcmfaces_msg('please hit return','// >> ');
98  gcmfaces_msg('///////////////////////////////////////////');  gcmfaces_msg('///////////////////////////////////////////');
99  fprintf('\n\n');  fprintf('\n\n');
100  pause;  pause;
101  example_bin_average(choiceGrid,1);%incl. call to example_smooth.m;  example_interp;
 example_griddata(choiceGrid);  
 example_interp(choiceGrid);  
 example_faces2latlon2faces(choiceGrid);  
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    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.22