/[MITgcm]/MITgcm_contrib/gmaze_pv/visu/get_plotlistdef.m
ViewVC logotype

Annotation of /MITgcm_contrib/gmaze_pv/visu/get_plotlistdef.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Fri Oct 6 18:56:55 2006 UTC (18 years, 10 months ago) by gmaze
Branch: MAIN
update visu

1 gmaze 1.1 %
2     % get_plotlistdef(MASTER,SUBDIR)
3     %
4     % This function display description of pre-defined plots
5     % available with the MASTER.m in the folder SUBDIR
6     %
7     % 07/12/06
8     % gmaze@mit.edu
9    
10     function LIST = get_plotlistdef(MASTER,SUBDIR)
11    
12     global sla
13    
14     % Define suffixe of plot module:
15     suff = '_pl';
16    
17    
18     d = dir(SUBDIR);
19     ii = 0;
20     % Select Matlab files:
21     for id = 1 : length(d)
22     en = length( d(id).name );
23     if en~=1 & (d(id).name(en-1:en) == '.m') & ~d(id).isdir
24     ii = ii + 1;
25     l(ii).name = d(id).name;
26     end
27     end
28    
29     % Select Matlab files with MASTER as prefix
30     ii = 0;
31     for il = 1 : length(l)
32     fil = l(il).name;
33     pref = strcat(MASTER,suff);
34     iM = findstr( strcat(SUBDIR,sla,fil) , pref ) ;
35    
36     if ~isempty(iM)
37     ii = ii + 1;
38     LIST(ii).name = l(il).name;
39    
40     % Recup description of plot module:
41     fid = fopen(strcat(SUBDIR,sla,fil));
42     thatsit = 0;
43     while thatsit ~= 1
44     tline = fgetl(fid);
45     if tline ~= -1
46     if length(tline)>4 & tline(1:4) == '%DEF'
47     LIST(ii).description = tline(5:end);
48     thatsit = 1;
49     end %if
50     else
51     LIST(ii).description = 'Not found';
52     thatsit = 1;
53     end %if
54     end %while
55     disp(strcat('Module extension :', fil(iM+length(pref):end-2)));
56     disp(strcat('------ description :' , LIST(ii).description ));
57     disp(char(2))
58    
59     end %if
60    
61     end %for il
62    
63     if ~exist('LIST')
64     LIST= NaN;
65     end
66    

  ViewVC Help
Powered by ViewVC 1.1.22