1 | % IRCAAM_STARTUP initialisation of matlab/octave environment for IRCAAM project |
---|
2 | |
---|
3 | %+ |
---|
4 | % |
---|
5 | % module |
---|
6 | % ====== |
---|
7 | % |
---|
8 | % initialisation of matlab/octave environment for IRCAAM project |
---|
9 | % |
---|
10 | % DESCRIPTION |
---|
11 | % =========== |
---|
12 | % |
---|
13 | % Define : |
---|
14 | % - path for matlab/octave commands used in IRCAAM project |
---|
15 | % - IO directories |
---|
16 | % |
---|
17 | % This file can be either run classicaly when currect directory |
---|
18 | % is ${IRCAAM} : |
---|
19 | % .. |
---|
20 | % |
---|
21 | % >> ircaam_startup |
---|
22 | % |
---|
23 | % |
---|
24 | % If linked or copy to ./startup.m, it will be automaticaly |
---|
25 | % run by matlab at start. |
---|
26 | % |
---|
27 | % If linked or copy to ${HOME}/.octaverc, it will be automaticaly |
---|
28 | % run by octave at start. |
---|
29 | % |
---|
30 | % SEE ALSO |
---|
31 | % ======== |
---|
32 | % |
---|
33 | % ircaam_profile.sh_ |
---|
34 | % |
---|
35 | % .. _ircaam_profile.sh : ircaam_profile.sh.html |
---|
36 | % |
---|
37 | % EVOLUTIONS |
---|
38 | % ========== |
---|
39 | % |
---|
40 | % $Id$ |
---|
41 | % |
---|
42 | % - fplod 2009-01-07T11:12:31Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
43 | % |
---|
44 | % * add indice_flore directory to path |
---|
45 | % * more elegant way to know if eithe octave or matlab is running |
---|
46 | % thanks to http://enacit1.epfl.ch/cours_matlab/mfiles.html#scripts |
---|
47 | % |
---|
48 | % - fplod 2008-12-22T13:24:38Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
49 | % |
---|
50 | % * add detection of either matlab or octave running |
---|
51 | % |
---|
52 | % - fplod 2008-12-22T09:38:20Z zeus.locean-ipsl.upmc.fr (Linux) |
---|
53 | % |
---|
54 | % * creation |
---|
55 | % |
---|
56 | % TODO |
---|
57 | % ==== |
---|
58 | % |
---|
59 | %- |
---|
60 | % |
---|
61 | clear all |
---|
62 | % |
---|
63 | disp('iii : adding path to IRCAAM matlab tools') |
---|
64 | % |
---|
65 | % test if IRCAAM environment set |
---|
66 | ircaam=getenv('IRCAAM'); |
---|
67 | if ( isempty(ircaam) ) |
---|
68 | error('eee : IRCAAM environment not set'); |
---|
69 | else |
---|
70 | disp(['iii : IRCAAM =' ircaam]) |
---|
71 | end |
---|
72 | % |
---|
73 | % add path |
---|
74 | addpath(ircaam); |
---|
75 | addpath([ircaam '/mode_sahelien/']); |
---|
76 | addpath([ircaam '/SIMULS_IRCAAM/']); |
---|
77 | addpath([ircaam '/indice_flore/']); |
---|
78 | % |
---|
79 | % IO directories |
---|
80 | % test if IRCAAM_ID environment set |
---|
81 | ircaam_id=getenv('IRCAAM_ID'); |
---|
82 | if ( isempty(ircaam_id) ) |
---|
83 | error('eee : IRCAAM_ID environment not set'); |
---|
84 | end |
---|
85 | % |
---|
86 | % test if IRCAAM_OD environment set |
---|
87 | ircaam_od=getenv('IRCAAM_OD'); |
---|
88 | if ( isempty(ircaam_od) ) |
---|
89 | error('eee : IRCAAM_OD environment not set'); |
---|
90 | end |
---|
91 | % |
---|
92 | % detect if either octave or matlab running |
---|
93 | if ~ exist('OCTAVE_VERSION') |
---|
94 | run_octave=0; |
---|
95 | else |
---|
96 | run_octave=1; |
---|
97 | end |
---|
98 | % |
---|
99 | if (run_octave == 0) |
---|
100 | % to display help written in ISO-LATIN |
---|
101 | slCharacterEncoding('ISO-8859-1'); |
---|
102 | end |
---|
103 | % |
---|
104 | more on |
---|