[16] | 1 | % IRCAAM_STARTUP initialisation of matlab/octave environment for IRCAAM project |
---|
| 2 | |
---|
[12] | 3 | %+ |
---|
| 4 | % |
---|
[86] | 5 | % |
---|
| 6 | % .. _ircaam_startup.m: |
---|
| 7 | % |
---|
[75] | 8 | % ================ |
---|
| 9 | % ircaam_startup.m |
---|
| 10 | % ================ |
---|
[12] | 11 | % |
---|
[75] | 12 | % -------------------------------------------------------------- |
---|
[12] | 13 | % initialisation of matlab/octave environment for IRCAAM project |
---|
[75] | 14 | % -------------------------------------------------------------- |
---|
[12] | 15 | % |
---|
| 16 | % DESCRIPTION |
---|
| 17 | % =========== |
---|
| 18 | % |
---|
| 19 | % Define : |
---|
| 20 | % - path for matlab/octave commands used in IRCAAM project |
---|
[31] | 21 | % - IO directories in global variables |
---|
[12] | 22 | % |
---|
[75] | 23 | % This file can be either run classicaly when current directory |
---|
[12] | 24 | % is ${IRCAAM} : |
---|
| 25 | % .. |
---|
| 26 | % |
---|
| 27 | % >> ircaam_startup |
---|
| 28 | % |
---|
| 29 | % |
---|
[24] | 30 | % If linked or copy to ./startup.m, it will be automaticaly |
---|
[12] | 31 | % run by matlab at start. |
---|
| 32 | % |
---|
[14] | 33 | % If linked or copy to ${HOME}/.octaverc, it will be automaticaly |
---|
| 34 | % run by octave at start. |
---|
| 35 | % |
---|
[12] | 36 | % SEE ALSO |
---|
| 37 | % ======== |
---|
| 38 | % |
---|
[82] | 39 | % :ref:`ircaam_profile.sh` |
---|
[12] | 40 | % |
---|
| 41 | % EVOLUTIONS |
---|
| 42 | % ========== |
---|
| 43 | % |
---|
| 44 | % $Id$ |
---|
| 45 | % |
---|
[31] | 46 | % - fplod 2009-01-27T11:25:50Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 47 | % |
---|
| 48 | % * define global variables |
---|
| 49 | % |
---|
[24] | 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 | % |
---|
[14] | 56 | % - fplod 2008-12-22T13:24:38Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 57 | % |
---|
| 58 | % * add detection of either matlab or octave running |
---|
| 59 | % |
---|
[12] | 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 | % |
---|
[15] | 71 | disp('iii : adding path to IRCAAM matlab tools') |
---|
[12] | 72 | % |
---|
| 73 | % test if IRCAAM environment set |
---|
[31] | 74 | global IRCAAM; |
---|
| 75 | IRCAAM=getenv('IRCAAM'); |
---|
| 76 | if ( isempty(IRCAAM) ) |
---|
[12] | 77 | error('eee : IRCAAM environment not set'); |
---|
| 78 | else |
---|
[31] | 79 | disp(['iii : IRCAAM =' IRCAAM]) |
---|
[12] | 80 | end |
---|
| 81 | % |
---|
| 82 | % add path |
---|
[31] | 83 | addpath(IRCAAM); |
---|
| 84 | addpath([IRCAAM '/mode_sahelien/']); |
---|
| 85 | addpath([IRCAAM '/SIMULS_IRCAAM/']); |
---|
| 86 | addpath([IRCAAM '/indice_flore/']); |
---|
[12] | 87 | % |
---|
| 88 | % IO directories |
---|
| 89 | % test if IRCAAM_ID environment set |
---|
[31] | 90 | |
---|
| 91 | global IRCAAM_ID; |
---|
| 92 | IRCAAM_ID=getenv('IRCAAM_ID'); |
---|
| 93 | if ( isempty(IRCAAM_ID) ) |
---|
[12] | 94 | error('eee : IRCAAM_ID environment not set'); |
---|
| 95 | end |
---|
| 96 | % |
---|
| 97 | % test if IRCAAM_OD environment set |
---|
[31] | 98 | global IRCAAM_OD; |
---|
| 99 | IRCAAM_OD=getenv('IRCAAM_OD'); |
---|
| 100 | if ( isempty(IRCAAM_OD) ) |
---|
[12] | 101 | error('eee : IRCAAM_OD environment not set'); |
---|
| 102 | end |
---|
| 103 | % |
---|
[14] | 104 | % detect if either octave or matlab running |
---|
[24] | 105 | if ~ exist('OCTAVE_VERSION') |
---|
| 106 | run_octave=0; |
---|
| 107 | else |
---|
[14] | 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 | % |
---|
[12] | 116 | more on |
---|