source: trunk/src/test/project_startup.m

Last change on this file was 204, checked in by pinsard, 10 years ago

fix thanks to coding rules; typo

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