1 | % PROJECT_STARTUP initialisation of matlab/octave environment for PROJECT project |
---|
2 | |
---|
3 | %+ |
---|
4 | % |
---|
5 | % .. _project_startup.m: |
---|
6 | % |
---|
7 | % ================== |
---|
8 | % project_startup.m |
---|
9 | % ================== |
---|
10 | % |
---|
11 | % ---------------------------------------------------------------- |
---|
12 | % initialisation of matlab/octave environment for PROJECT project |
---|
13 | % ---------------------------------------------------------------- |
---|
14 | % |
---|
15 | % DESCRIPTION |
---|
16 | % =========== |
---|
17 | % |
---|
18 | % Define : |
---|
19 | % - path for matlab/octave commands used in PROJECT project |
---|
20 | % - IO directories in global variables |
---|
21 | % |
---|
22 | % This file can be either run classicaly when current directory |
---|
23 | % is ${PROJECT}:: |
---|
24 | % |
---|
25 | % >> project_startup |
---|
26 | % |
---|
27 | % |
---|
28 | % If linked or copy to ./startup.m, it will be automaticaly |
---|
29 | % run by matlab at start. |
---|
30 | % |
---|
31 | % If linked or copy to ${HOME}/.octaverc, it will be automaticaly |
---|
32 | % run by octave at start. |
---|
33 | % |
---|
34 | % SEE ALSO |
---|
35 | % ======== |
---|
36 | % |
---|
37 | % :ref:`project_profile.sh` |
---|
38 | % |
---|
39 | % TODO |
---|
40 | % ==== |
---|
41 | % |
---|
42 | % EVOLUTIONS |
---|
43 | % ========== |
---|
44 | % |
---|
45 | % - fplod 20110105T164207Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
46 | % |
---|
47 | % * creation |
---|
48 | % |
---|
49 | % |
---|
50 | %- |
---|
51 | % |
---|
52 | %clear all |
---|
53 | % |
---|
54 | matlab_minimal_version_required = '7.4'; |
---|
55 | octave_minimal_version_required = '3.0.2'; |
---|
56 | % |
---|
57 | %disp('iii : adding path to PROJECT matlab tools') |
---|
58 | % |
---|
59 | % test if PROJECT environment set |
---|
60 | global PROJECT; |
---|
61 | PROJECT=getenv('PROJECT'); |
---|
62 | %if ( isempty(PROJECT) ) |
---|
63 | % error('eee : PROJECT environment not set'); |
---|
64 | %else |
---|
65 | % disp(['iii : PROJECT =' PROJECT]) |
---|
66 | %end |
---|
67 | % |
---|
68 | % add path |
---|
69 | addpath(PROJECT); |
---|
70 | % |
---|
71 | % IO directories |
---|
72 | % test if PROJECT_ID environment set |
---|
73 | |
---|
74 | global PROJECT_ID; |
---|
75 | PROJECT_ID=getenv('PROJECT_ID'); |
---|
76 | %if ( isempty(PROJECT_ID) ) |
---|
77 | % error('eee : PROJECT_ID environment not set'); |
---|
78 | %end |
---|
79 | % |
---|
80 | % test if PROJECT_OD environment set |
---|
81 | global PROJECT_OD; |
---|
82 | PROJECT_OD=getenv('PROJECT_OD'); |
---|
83 | %if ( isempty(PROJECT_OD) ) |
---|
84 | % error('eee : PROJECT_OD environment not set'); |
---|
85 | %end |
---|
86 | % |
---|
87 | global application; |
---|
88 | global application_version; |
---|
89 | % |
---|
90 | % detect if either octave or matlab running |
---|
91 | if exist('matlabpath','builtin') |
---|
92 | application='matlab'; |
---|
93 | tmp=ver(application); |
---|
94 | application_version=tmp.Version; |
---|
95 | clear tmp; |
---|
96 | if verLessThan('matlab', matlab_minimal_version_required) |
---|
97 | disp(['matlab_minimal_version_required = ', matlab_minimal_version_required]); |
---|
98 | disp(['application_version =', application_version]); |
---|
99 | warning('www : you have trouble running an older matlab version'); |
---|
100 | end |
---|
101 | end |
---|
102 | if exist('OCTAVE_VERSION','builtin') |
---|
103 | application='octave'; |
---|
104 | application_version=version; %% WARNING : do not add () because of matlab 6 |
---|
105 | end |
---|
106 | % |
---|
107 | global netcdf_available |
---|
108 | %netcdf_file=which('netcdf'); |
---|
109 | %if (isempty(netcdf_file)) |
---|
110 | % netcdf_available=0; |
---|
111 | %else |
---|
112 | % netcdf_available=1; |
---|
113 | %end |
---|
114 | %clear netcdf_file; |
---|
115 | % |
---|
116 | more on |
---|