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

Annotation of /MITgcm_contrib/gmaze_pv/visu/get_plotlist.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     % LIST = get_plotlist(MASTER,SUBDIR)
3     %
4     % This function determines the list of pre-defined plots
5     % available with the MASTER.m in the folder SUBDIR
6     % LIST is a structure with name and description of each modules.
7     %
8    
9     function LIST = get_plotlist(MASTER,SUBDIR)
10    
11     global sla
12    
13     % Define suffixe of plot module:
14     suff = '_pl';
15    
16    
17     d = dir(strcat(SUBDIR,sla));
18    
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    
30     % Select Matlab files with MASTER as prefix
31     ii = 0;
32    
33     for il = 1 : size(l,2)
34     fil = l(il).name;
35     pref = strcat(MASTER,suff);
36     iM = findstr( strcat(SUBDIR,sla,fil) , pref ) ;
37    
38     if ~isempty(iM)
39     ii = ii + 1;
40     LIST(ii).name = l(il).name;
41    
42     % Recup description of plot module:
43     fid = fopen(strcat(SUBDIR,sla,fil));
44     thatsit = 0;
45     while thatsit ~= 1
46     tline = fgetl(fid);
47     if tline ~= -1
48     if length(tline)>4 & tline(1:4) == '%DEF'
49     LIST(ii).description = tline(5:end);
50     thatsit = 1;
51     end %if
52     else
53     LIST(ii).description = 'Not found';
54     thatsit = 1;
55     end %if
56     end %while
57    
58     end %if
59    
60     end %for il
61    
62     if ~exist('LIST')
63     LIST= NaN;
64     end

  ViewVC Help
Powered by ViewVC 1.1.22