function []=MITprof_global(varargin); %object: take care of path and global variables (mygrid and mitprofenv), % and sends global variables to caller routine workspace %notes: - in any call, if this has not yet been done, % this routine also adds MITprof subdirectories % to the matlab path, and it defines mitprofenv. % - this routine replaces MITprof_path %get/define global variables: global mitprofenv; %take care of path: test0=which('MITprof_load.m'); if isempty(test0); test0=which('MITprof_global.m'); ii=strfind(test0,filesep); mydir=test0(1:ii(end)); % addpath(fullfile(mydir)); addpath(fullfile(mydir,'profiles_process_main_v2')); addpath(fullfile(mydir,'profiles_IO_v2')); addpath(fullfile(mydir,'profiles_IO_external')); addpath(fullfile(mydir,'profiles_misc')); addpath(fullfile(mydir,'profiles_stats')); addpath(fullfile(mydir,'ecco_v4')); addpath(fullfile(mydir,'profiles_devel')); end; %environment variables: if isempty(mitprofenv); test0=which('MITprof_global.m'); ii=strfind(test0,filesep); mitprofenv.MITprof_dir=test0(1:ii(end)); mitprofenv.verbose=0; mitprofenv.lessplot=0; mitprofenv.lesstest=0; mitprofenv.useNativeMatlabNetcdf = ~isempty(which('netcdf.open')); %... check for gcmfaces end; %send to workspace: evalin('caller','global mygrid mitprofenv');