%% argo home directory
% [s, ARGOHOME] = system('echo -n $ARGOHOME'); % home directory for argo
% ARGOHOME = '/argo'; % for powerbook
ARGOHOME = '/Volumes/DVP/argo'; % for xriley and titania
ARGOMAT = fullfile(ARGOHOME,'matlab');
USERMATLAB = '/Users/Shared/matlab_scripts';

%% generate matlab path
genpath;


%% remove symbolic toolbox which  conflicts with the netcdf software
argo_path = path;
sym = findstr(argo_path,'symbolic');
semi = findstr(argo_path,':');
if ~isempty(sym)
    i1 = max(find(semi < sym));
    i2 = min(find(semi > sym));
    rmpath(argo_path(semi(i1)+1:semi(i2)-1));
end

%% set path for matlab
%% Removed this line as we don't actually want it using the processing dir
%%            fullfile(ARGOMAT, 'processing'), ...
argo_path =  ...
    addpath(ARGOMAT, ...
            fullfile(ARGOMAT, 'fsi'), ...
            fullfile(ARGOMAT, 'iridium'), ...
            fullfile(ARGOMAT, 'argos'), ...
            fullfile(ARGOMAT, 'common'), ...
            fullfile(ARGOMAT, 'plotting'), ...
            fullfile(ARGOMAT, 'DMQC'), ...
            fullfile(ARGOMAT, 'OW'), ...
            fullfile(ARGOMAT, 'editroutines'), ...
            fullfile(ARGOMAT, 'editroutines/profile'), ...
            fullfile(ARGOMAT, 'editroutines/profile/profed'), ...
            fullfile(ARGOMAT, 'editroutines/profile/mirror'), ...
            fullfile(ARGOMAT, 'editroutines/colormap'), ...
            fullfile(ARGOMAT, 'editroutines/trajectory'), ...
            fullfile(ARGOMAT, 'edt_calseries'), ...
            fullfile(USERMATLAB, 'netcdf'), ...
            fullfile(USERMATLAB, 'netcdf/nctype'), ...
            fullfile(USERMATLAB, 'netcdf/ncutility'), ...
            fullfile(USERMATLAB, 'seawater'), ...
            fullfile(USERMATLAB, 'misc'), ...
            fullfile(USERMATLAB, 'm_map') );
        
clear argo_path USERMATLAB semi sym

%%  Delayed mode QC setup
% lo_system_configuration = load_configuration( fullfile(ARGOHOME,'DMQC','whoi_config.txt') );

ARGODMQC = fullfile(ARGOHOME,'DMQC');

%% suppress netcdf subs warning
warning off MATLAB:mir_warning_variable_used_as_function
