source: trunk/src/test/project_startup.m @ 182

Last change on this file since 182 was 50, checked in by pinsard, 13 years ago

replace TROPFLUX by PROJECT

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%  - 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%
54matlab_minimal_version_required = '7.4';
55octave_minimal_version_required = '3.0.2';
56%
57%disp('iii : adding path to PROJECT matlab tools')
58%
59% test if PROJECT environment set
60global PROJECT;
61PROJECT=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
69addpath(PROJECT);
70%
71% IO directories
72% test if PROJECT_ID environment set
73
74global PROJECT_ID;
75PROJECT_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
81global PROJECT_OD;
82PROJECT_OD=getenv('PROJECT_OD');
83%if ( isempty(PROJECT_OD) )
84% error('eee : PROJECT_OD environment not set');
85%end
86%
87global application;
88global application_version;
89%
90% detect if either octave or matlab running
91if 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
101end
102if exist('OCTAVE_VERSION','builtin')
103 application='octave';
104 application_version=version; %% WARNING : do not add () because of matlab 6
105end
106%
107global 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%
116more on
Note: See TracBrowser for help on using the repository browser.