/[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.1 by gforget, Tue Jun 21 21:07:09 2011 UTC revision 1.4 by gforget, Tue Jul 31 19:12:44 2012 UTC
# Line 1  Line 1 
1    
2  %environment variables:  %choose grid for test
3  global myenv;  fprintf('\n Please set the demo grid : \n');
4  myenv.gcmfaces_verbose=0;  fprintf('    ''llc'': lat-lon-cap grid (5 faces). \n');
5  myenv.gcmfaces_dir=[pwd '/gcmfaces/'];  fprintf('    ''ll'' : simple lat-lon grid (1 face). \n');
6  myenv.MITprof_verbose=0;  choiceGrid=input(' and type return. ''llc'' is the default.\n');
7  myenv.MITprof_dir=[pwd '/gcmfaces/'];  if isempty(choiceGrid); choiceGrid='llc'; end;
8  myenv.useNativeMatlabNetcdf = ~isempty(which('netcdf.open'));  if strcmp(choiceGrid,'llc'); choiceGrid='v4';
9    elseif strcmp(choiceGrid,'ll'); choiceGrid='v3';
10    else; error('wrong grid choice');
11    end;
12    
13    %choose verbise level
14    fprintf('\n Please set the amount of explanatory text display :\n');
15    fprintf('    0: none.\n');
16    fprintf('    1: comments.\n');
17    fprintf('    2: comments preceeded with calling sequence.\n');
18    fprintf('    3: same as 2, but preceeded with pause.\n');
19    verbose=input(' and/or type return. 0 is the default. \n');
20    if isempty(verbose); verbose=0; end;
21    
22    %initialize environment variables and mygrid
23    gcmfaces_global;
24    myenv.verbose=verbose;
25    if myenv.verbose>0;
26        gcmfaces_msg('* set path and environment variables (myenv) by calling gcmfaces_global');
27    end;
28    
 %re-init mygrid:  
 global mygrid; mygrid=[];  
   
 choiceGrid='v4';  
   
 %transform those to functions with v3/v4 arguments:  
29  basic_diags_compute_v3_or_v4(choiceGrid);  basic_diags_compute_v3_or_v4(choiceGrid);
30  basic_diags_display_v3_or_v4(choiceGrid);  basic_diags_display_v3_or_v4(choiceGrid);
31    
32  example_bin_average(choiceGrid,1);%incl. call to example_smooth.m;  example_bin_average(choiceGrid,1);%incl. call to example_smooth.m;
33  example_griddata(choiceGrid);  example_griddata(choiceGrid);
34  example_interp(choiceGrid);  example_interp(choiceGrid);
35    example_faces2latlon2faces(choiceGrid);
36    
37  plot_one_field(choiceGrid,0);%%incl. call to m_map_gcmfaces;  plot_one_field(choiceGrid,0);%%incl. call to m_map_gcmfaces;
38    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.22