/[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.10 by gforget, Fri Mar 20 23:20:04 2015 UTC
# Line 1  Line 1 
1    
2  choiceGrid='v4';  %to load the ECCO v4 / LLC90 grid:
3    %
4    %nF=5;
5    %fileFormat='compact';
6    %dirGrid=fullfile([myenv.gcmfaces_dir '../']);
7    %dirGrid=fullfile(dirGrid,'GRID/');
8    %
9    %to instead load e.g. your MITgcm lat-lon grid,
10    %you would edit the example routines to look like:
11    %
12    % nF=1;
13    % fileFormat='straight';
14    % dirGrid='./';
15    %
16    %to activate example_transports:
17    %
18    %mkdir release1
19    %wget --recursive ftp://mit.ecco-group.org/ecco_for_las/version_4/release1/nctiles_climatology
20    %mv mit.ecco-group.org/gforget/nctiles_climatology release1/.
21    %rm -rf mit.ecco-group.org
22    %
23    %to activate example_budget:
24    %
25    %wget --recursive ftp://mit.ecco-group.org/gforget/nctiles_budget
26    %mv mit.ecco-group.org/gforget/nctiles_budget gcmfaces/sample_input/.
27    %rm -rf mit.ecco-group.org
28    %
29    %to activate example_remap:
30    %
31    %wget ftp://mit.ecco-group.org/gforget/testcase_remap.mat
32    %mv testcase_remap.mat gcmfaces/sample_input/.
33    
34  %old option that eventually should be re-activated:  %choose verbose level
 % 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  
35  fprintf('\n Please set the amount of explanatory text display :\n');  fprintf('\n Please set the amount of explanatory text display :\n');
36  fprintf('    0: none.\n');  fprintf('    0: none.\n');
37  fprintf('    1: comments.\n');  fprintf('    1: comments.\n');
# Line 23  if isempty(verbose); verbose=0; end; Line 42  if isempty(verbose); verbose=0; end;
42    
43  %initialize environment variables and mygrid  %initialize environment variables and mygrid
44  addpath gcmfaces;  addpath gcmfaces;
45  gcmfaces_global;  gcmfaces_global;
46  myenv.issueWarnings=0;  myenv.issueWarnings=0;
47  myenv.verbose=verbose;  myenv.verbose=verbose;
48  if myenv.verbose>0;  if myenv.verbose>0;
# Line 32  end; Line 51  end;
51    
52  addpath MITprof;  addpath MITprof;
53  if ~isempty(which('MITprof_global'));  if ~isempty(which('MITprof_global'));
54  MITprof_global;      MITprof_global;
55  if myenv.verbose>0;      if myenv.verbose>0;
56      gcmfaces_msg('* set MITprof path by calling MITprof_global');          gcmfaces_msg('* set MITprof path by calling MITprof_global');
57  end;      end;
58  end;  end;
59    
60  fprintf('\n\n');  fprintf('\n\n');
# Line 45  gcmfaces_msg('please hit return','// >> Line 64  gcmfaces_msg('please hit return','// >>
64  gcmfaces_msg('/////////////////////////////////////');  gcmfaces_msg('/////////////////////////////////////');
65  fprintf('\n\n');  fprintf('\n\n');
66  pause;  pause;
67  plot_one_field(choiceGrid,0);%%incl. call to m_map_gcmfaces;  plot_one_field;
68    
69  fprintf('\n\n');  fprintf('\n\n');
70  gcmfaces_msg('///////////////////////////////////////////');  gcmfaces_msg('///////////////////////////////////////////');
71  gcmfaces_msg('demo of gridding v interpolating','// PART 2 :');  gcmfaces_msg('demo of remapping and smoothing','// PART 2 :');
72  gcmfaces_msg('please hit return','// >> ');  gcmfaces_msg('please hit return','// >> ');
73  gcmfaces_msg('///////////////////////////////////////////');  gcmfaces_msg('///////////////////////////////////////////');
74  fprintf('\n\n');  fprintf('\n\n');
75  pause;  pause;
76  example_bin_average(choiceGrid,1);%incl. call to example_smooth.m;  
77  example_griddata(choiceGrid);  if 1;%one method to map lon-lat fields to gcmfaces
78  example_interp(choiceGrid);      example_remap(1);
79  example_faces2latlon2faces(choiceGrid);  else;%alternatives
80        example_griddata;
81        example_interp;
82        example_faces2latlon2faces;
83    end;
84    example_bin_average(1);%incl. call to example_smooth.m;
85    
86  fprintf('\n\n');  fprintf('\n\n');
87  gcmfaces_msg('/////////////////////////////////////////');  gcmfaces_msg('/////////////////////////////////////////');
# Line 66  gcmfaces_msg('please hit return','// >> Line 90  gcmfaces_msg('please hit return','// >>
90  gcmfaces_msg('/////////////////////////////////////////');  gcmfaces_msg('/////////////////////////////////////////');
91  fprintf('\n\n');  fprintf('\n\n');
92  pause;  pause;
93  diags=example_transports(choiceGrid);  diags=example_transports;
94  if ~isempty(diags);  if ~isempty(diags);
95      example_transports_disp(diags);      example_transports_disp(diags);
96  end;  end;
# Line 78  gcmfaces_msg('please hit return','// >> Line 102  gcmfaces_msg('please hit return','// >>
102  gcmfaces_msg('/////////////////////////////////////////');  gcmfaces_msg('/////////////////////////////////////////');
103  fprintf('\n\n');  fprintf('\n\n');
104  pause;  pause;
105  example_budget(choiceGrid);  example_budget;
106    

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

  ViewVC Help
Powered by ViewVC 1.1.22