/[MITgcm]/MITgcm_contrib/gael/profilesMatlabProcessing/profiles_misc/MITprof_struct.m
ViewVC logotype

Diff of /MITgcm_contrib/gael/profilesMatlabProcessing/profiles_misc/MITprof_struct.m

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

revision 1.3 by roquet, Thu Apr 14 20:12:07 2011 UTC revision 1.5 by gforget, Mon Mar 30 03:42:19 2015 UTC
# Line 1  Line 1 
1  function [MITprof]=MITprof_struct(nProf,prof_depth,varargin);  function [MITprof]=MITprof_struct(nProf,dataset,varargin);
2  %   [MITprof]=MITprof_struct;  %   [MITprof]=MITprof_struct;
3  %   create an empty struct variable using the format MITprof  %   create an empty struct variable using the format MITprof
4  %       nProf: number of profiles  %       nProf: number of profiles
5  %       prof_depth: list of depth levels  %       prof_depth: list of depth levels
6  %       list_var: specify name of created fields  %       list_var: specify name of created fields
7  %        %
8  %   list of fields always created:  %   list of fields always created:
9  %       prof_depth      [nDepth x 1]  %       prof_depth      [nDepth x 1]
10  %       prof_descr      {nProf x 1}  %       prof_descr      {nProf x 1}
# Line 22  function [MITprof]=MITprof_struct(nProf, Line 22  function [MITprof]=MITprof_struct(nProf,
22  %       prof_S, prof_Sflag, prof_Serr, prof_Sweight, prof_Sestim  %       prof_S, prof_Sflag, prof_Serr, prof_Sweight, prof_Sestim
23  %           array size: [nProf x nLev]  %           array size: [nProf x nLev]
24    
25    prof_depth=dataset.z_std;
26    
27  list_vars={'prof_T','prof_Tweight','prof_Testim','prof_Terr','prof_Tflag',...  if isfield(dataset,'var_tmp');
28        var_tmp=dataset.var_tmp;
29        var_out=dataset.var_out;
30        jj=find(~strcmp(var_tmp,'z'));
31        var_tmp={var_tmp{jj}};
32        var_out={var_out{jj}};
33        list_vars={};
34        for ii=1:length(var_tmp);
35            list_vars={list_vars{:},['prof_' var_out{ii} ]};
36            list_vars={list_vars{:},['prof_' var_out{ii} 'weight']};
37            list_vars={list_vars{:},['prof_' var_out{ii} 'estim']};
38            list_vars={list_vars{:},['prof_' var_out{ii} 'err']};
39            list_vars={list_vars{:},['prof_' var_out{ii} 'flag']};
40        end;
41    else;
42        list_vars={'prof_T','prof_Tweight','prof_Testim','prof_Terr','prof_Tflag',...
43          'prof_S','prof_Sweight','prof_Sestim','prof_Serr','prof_Sflag'};          'prof_S','prof_Sweight','prof_Sestim','prof_Serr','prof_Sflag'};
44        if ~strcmp(dataset.coord,'depth');
45            list_vars={list_vars{:},'prof_D','prof_Destim'};
46        end;
47    end;
48  if nargin>2,  if nargin>2,
49      list_vars=varargin{1};      list_vars=varargin{1};
50  end  end

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.22