/[MITgcm]/MITgcm_contrib/gael/matlab_class/gcmfaces_global.m
ViewVC logotype

Diff of /MITgcm_contrib/gael/matlab_class/gcmfaces_global.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2 by gforget, Thu Jan 17 20:23:22 2013 UTC revision 1.5 by gforget, Fri Mar 20 14:32:54 2015 UTC
# Line 13  function []=gcmfaces_global(varargin); Line 13  function []=gcmfaces_global(varargin);
13  %           - calls to this routine will eventually replace  %           - calls to this routine will eventually replace
14  %           both gcmfaces_path and 'global mygrid' calls.  %           both gcmfaces_path and 'global mygrid' calls.
15    
   
16  %set optional paramaters to default values  %set optional paramaters to default values
17  resetGrid=0; listVars={};  resetGrid=0; listVars={};
18  %set more optional paramaters to user defined values  %set more optional paramaters to user defined values
# Line 50  global myenv mygrid; Line 49  global myenv mygrid;
49  %take care of path:  %take care of path:
50  test0=which('convert2gcmfaces.m');  test0=which('convert2gcmfaces.m');
51  if isempty(test0);  if isempty(test0);
52      test0=which('gcmfaces_global.m'); ii=strfind(test0,'/');      test0=which('gcmfaces_global.m'); ii=strfind(test0,filesep);
53      mydir=test0(1:ii(end));      mydir=test0(1:ii(end));
54      %      %
55      eval(['addpath ' mydir ';']);      eval(['addpath ' mydir ';']);
# Line 70  end; Line 69  end;
69    
70  %environment variables:  %environment variables:
71  if isempty(myenv);  if isempty(myenv);
72      test0=which('gcmfaces_global.m'); ii=strfind(test0,'/');      test0=which('gcmfaces_global.m'); ii=strfind(test0,filesep);
73      myenv.gcmfaces_dir=test0(1:ii(end));      myenv.gcmfaces_dir=test0(1:ii(end));
74      myenv.verbose=0;      myenv.verbose=0;
75      myenv.lessplot=0;      myenv.lessplot=0;
76      myenv.lesstest=0;      myenv.lesstest=0;
77      myenv.useNativeMatlabNetcdf = ~isempty(which('netcdf.open'));      myenv.useNativeMatlabNetcdf = ~isempty(which('netcdf.open'));
78        myenv.issueWarnings=1;
79      %... check m_map and netcdf      %... check m_map and netcdf
80  end;  end;
81    
# Line 99  for ii=1:length(listVars); Line 99  for ii=1:length(listVars);
99      end;      end;
100  end;  end;
101    
102    %issue warning if mygrid is empty:
103    test0=isfield(mygrid,'XC');
104    if ~test0&myenv.issueWarnings;
105        warning('mygrid has not yet been loaded to memory. To use gcmfaces please use grid_load.m first.');
106    end;
107    
108  %send to workspace:  %send to workspace:
109  evalin('caller','global mygrid myenv');  evalin('caller','global mygrid myenv');
110    

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

  ViewVC Help
Powered by ViewVC 1.1.22