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