% IRCAAM_STARTUP initialisation of matlab/octave environment for IRCAAM project

%+
%
% module
% ======
%
% initialisation of matlab/octave environment for IRCAAM project
%
% DESCRIPTION
% ===========
%
% Define :
%  - path for matlab/octave commands used in IRCAAM project
%  - IO directories
%
% This file can be either run classicaly when currect directory
% is ${IRCAAM} :
% ..
%
%  >> ircaam_startup
%
%
% If linked or copy to ${HOME}/startup.m, it will be automaticaly
% run by matlab at start.
%
% If linked or copy to ${HOME}/.octaverc, it will be automaticaly
% run by octave at start.
%
% SEE ALSO
% ========
%
% ircaam_profile.sh_
%
% .. _ircaam_profile.sh : ircaam_profile.sh.html
%
% EVOLUTIONS
% ==========
%
% $Id$
%
% - fplod 2008-12-22T13:24:38Z aedon.locean-ipsl.upmc.fr (Darwin)
%
%   * add detection of either matlab or octave running
%
% - fplod 2008-12-22T09:38:20Z zeus.locean-ipsl.upmc.fr (Linux)
%
%   * creation
%
% TODO
% ====
%
%-
%
clear all
%
disp('iii : adding path to IRCAAM matlab tools')
%
% test if IRCAAM environment set
ircaam=getenv('IRCAAM');
if ( isempty(ircaam) )
 error('eee : IRCAAM environment not set');
else
 disp(['iii : IRCAAM =' ircaam])
end
%
% add path
addpath(ircaam);
addpath([ircaam '/mode_sahelien/']);
addpath([ircaam '/SIMULS_IRCAAM/']);
%
% IO directories
% test if IRCAAM_ID environment set
ircaam_id=getenv('IRCAAM_ID');
if ( isempty(ircaam_id) )
 error('eee : IRCAAM_ID environment not set');
end
%
% test if IRCAAM_OD environment set
ircaam_od=getenv('IRCAAM_OD');
if ( isempty(ircaam_od) )
 error('eee : IRCAAM_OD environment not set');
end
%
% detect if either octave or matlab running
cversion=version();
if cversion(1:1) < '7'
 run_octave=1;
else
 run_octave=0;
end
%
if (run_octave == 0)
 % to display help written in ISO-LATIN
 slCharacterEncoding('ISO-8859-1');
end
%
more on
