/[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.12 by gforget, Sun Jan 24 13:28:52 2016 UTC
# Line 1  Line 1 
1    
2  choiceGrid='v4';  %call sequence:
3    %
4  %need to replace the missing v3 files...  %  addpath gcmfaces; gcmfaces_demo;
5    %
6    %expected directory structure:
7    %
8    %  gcmfaces     (codes)
9    %  MITprof      (codes)
10    %  nctiles_grid (ECCO v4 grid)
11    %  release1     (ECCO v4 output)
12    %  sample_input (test material)
13    %
14    %to activate example_remap:
15    %
16    %  mkdir sample_input
17    %  wget ftp://mit.ecco-group.org/gforget/testcase_remap.mat
18    %  mv testcase_remap.mat sample_input/.
19    %
20    %to activate example_transports:
21    %
22    %  mkdir release1
23    %  wget --recursive ftp://mit.ecco-group.org/ecco_for_las/version_4/release1/nctiles_climatology
24    %  mv mit.ecco-group.org/gforget/nctiles_climatology release1/.
25    %  rm -rf mit.ecco-group.org
26    %
27    %to activate example_budget:
28    %
29    %  wget --recursive ftp://mit.ecco-group.org/gforget/nctiles_budget_2d
30    %  mv mit.ecco-group.org/gforget/nctiles_budget_2d sample_input/.
31    %  rm -rf mit.ecco-group.org
32  %  %
 %choose grid for test  
 % 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;  
33    
34  %choose verbise level  %choose verbose 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 24  verbose=input(' and/or type return. 0 is Line 41  verbose=input(' and/or type return. 0 is
41  if isempty(verbose); verbose=0; end;  if isempty(verbose); verbose=0; end;
42    
43  %initialize environment variables and mygrid  %initialize environment variables and mygrid
44    addpath gcmfaces;
45  gcmfaces_global;  gcmfaces_global;
46    myenv.issueWarnings=0;
47  myenv.verbose=verbose;  myenv.verbose=verbose;
48  if myenv.verbose>0;  if myenv.verbose>0;
49      gcmfaces_msg('* set path and environment variables (myenv) by calling gcmfaces_global');      gcmfaces_msg('* set path and environment variables (myenv) by calling gcmfaces_global');
50  end;  end;
51    
52  fprintf('\n\n');  addpath MITprof;
53  gcmfaces_msg('/////////////////////////////////////////');  if ~isempty(which('MITprof_global'));
54  gcmfaces_msg('demo of transport computations','// PART 1 :');      MITprof_global;
55  gcmfaces_msg('please hit return','// >> ');      if myenv.verbose>0;
56  gcmfaces_msg('/////////////////////////////////////////');          gcmfaces_msg('* set MITprof path by calling MITprof_global');
57  fprintf('\n\n');      end;
 pause;  
 diags=example_transports(choiceGrid);  
 if ~isempty(diags);  
     example_transports_disp(diags);  
58  end;  end;
59    
60  fprintf('\n\n');  fprintf('\n\n');
61  gcmfaces_msg('/////////////////////////////////////');  gcmfaces_msg('/////////////////////////////////////');
62  gcmfaces_msg('demo of plotting routines','// PART 2 :');  gcmfaces_msg('demo of plotting routines','// PART 1 :');
63  gcmfaces_msg('please hit return','// >> ');  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;  example_display;
68    
69  fprintf('\n\n');  fprintf('\n\n');
70  gcmfaces_msg('///////////////////////////////////////////');  gcmfaces_msg('///////////////////////////////////////////');
71  gcmfaces_msg('demo of gridding v interpolating','// PART 3 :');  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;
 example_bin_average(choiceGrid,1);%incl. call to example_smooth.m;  
 example_griddata(choiceGrid);  
 example_interp(choiceGrid);  
 example_faces2latlon2faces(choiceGrid);  
76    
77    if 1;%one method to map lon-lat fields to gcmfaces
78        example_remap(1);
79    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');
87    gcmfaces_msg('/////////////////////////////////////////');
88    gcmfaces_msg('demo of transport computations','// PART 3 :');
89    gcmfaces_msg('please hit return','// >> ');
90    gcmfaces_msg('/////////////////////////////////////////');
91    fprintf('\n\n');
92    pause;
93    diags=example_transports;
94    if ~isempty(diags);
95        example_transports_disp(diags);
96    end;
97    
98    fprintf('\n\n');
99    gcmfaces_msg('/////////////////////////////////////////');
100    gcmfaces_msg('demo of budget computations','// PART 4 :');
101    gcmfaces_msg('please hit return','// >> ');
102    gcmfaces_msg('/////////////////////////////////////////');
103    fprintf('\n\n');
104    pause;
105    example_budget;
106    

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

  ViewVC Help
Powered by ViewVC 1.1.22