Changeset 1650


Ignore:
Timestamp:
08/11/09 15:13:09 (16 years ago)
Author:
Mathieu Morlighem
Message:

Analysis_types are now always Enums not strings

Location:
issm/trunk/src/m/classes/public
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/public/BuildQueueingScriptGeneric.m

    r1111 r1650  
    1515fprintf(fid,'#!/bin/sh\n');
    1616fprintf(fid,'rm -rf %s/%s.lock\n',executionpath,md.name);
    17 fprintf(fid,'mpirun -np %i %s/%s.exe %s %s.bin %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',md.np,codepath,md.analysis_type,executionpath,md.name,md.name,md.name,md.name,md.name);
     17fprintf(fid,'mpirun -np %i %s/%s.exe %s %s.bin %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',md.np,codepath,AnalysisTypeAsEnum(md.analysis_type),executionpath,md.name,md.name,md.name,md.name,md.name);
    1818fclose(fid);
  • issm/trunk/src/m/classes/public/marshall.m

    r1629 r1650  
    2222end
    2323
    24 WriteData(fid,md.analysis_type','String','analysis_type');
    25 WriteData(fid,md.sub_analysis_type','String','sub_analysis_type');
     24WriteData(fid,md.analysis_type','Integer','analysis_type');
     25WriteData(fid,md.sub_analysis_type','Integer','sub_analysis_type');
    2626WriteData(fid,md.type,'String','type');
    2727WriteData(fid,md.numberofgrids,'Integer','numberofgrids');
  • issm/trunk/src/m/classes/public/process_solve_options.m

    r1309 r1650  
    66%
    77%   See also: SOLVE,RECOVER_SOLVE_OPTIONS
    8 
    9 %analysis_type: check on this option, error out otherwise
    10 found=0;
    11 for i=1:size(options,1),
    12         if strcmpi(options{i,1},'analysis_type'),
    13                 analysis_type=options{i,2};
    14                 found=1;
    15         end
    16 end
    17 if ~found,
    18         error('recover_solve_options error message: no ''analysis_type'' was provided');
    19 end
    208
    219%package: is there one? check to ''cielo''
     
    3220        package='cielo';
    3321end
     22if ~(strcmpi(package,'cielo') |  ...
     23                strcmpi(package,'ice') |  ...
     24                strcmpi(package,'macayeal') ),
     25        error(['process_solve_options error message: package ' package ' not supported yet!']);
     26end
    3427
    35 if ~ischar(package),
    36         error(['process_solve_options error message: package ' package ' not supported yet']);
     28%analysis_type: check on this option, error out otherwise
     29found=0;
     30for i=1:size(options,1),
     31        if strcmpi(options{i,1},'analysis_type'),
     32                analysis_type=options{i,2};
     33                found=1;
     34        end
     35end
     36if ~found,
     37        error('recover_solve_options error message: no ''analysis_type'' was provided');
    3738end
    3839
     
    6970end
    7071
    71 
    7272%check solution type is supported
    73 if ~(   strcmpi(analysis_type,'control') |  ...
    74                 strcmpi(analysis_type,'diagnostic') |  ...
    75                 strcmpi(analysis_type,'prognostic') |  ...
    76                 strcmpi(analysis_type,'thermal') |  ...
    77                 strcmpi(analysis_type,'parameters') |  ...
    78                 strcmpi(analysis_type,'mesh') |  ...
    79                 strcmpi(analysis_type,'mesh2grid') |  ...
    80                 strcmpi(analysis_type,'transient') ),
     73if ~ismemberi(analysis_type,{'control','diagnostic','prognostic','thermal','parameters','mesh2grid','transient'}),
    8174        error(['process_solve_options error message: analysis_type ' analysis_type ' not supported yet!']);
     75else
     76        %convert to enum
     77        analysis_type=eval([upper(analysis_type(1)) lower(analysis_type(2:end)) 'AnalysisEnum']);
    8278end
    83 if ~(   strcmpi(sub_analysis_type,'none') |  ...
    84                 strcmpi(sub_analysis_type,'steady') |  ...
    85                 strcmpi(sub_analysis_type,'horiz') |  ...
    86                 strcmpi(sub_analysis_type,'adjoint') |  ...
    87                 strcmpi(sub_analysis_type,'gradient') |  ...
    88                 strcmpi(sub_analysis_type,'inverse') |  ...
    89                 strcmpi(sub_analysis_type,'vert') |  ...
    90                 strcmpi(sub_analysis_type,'') |  ...
    91                 strcmpi(sub_analysis_type,'transient') ),
     79if ~ismemberi(sub_analysis_type,{'none','steady','horiz','adjoint','gradient','inverse','vert','','transient'}),
    9280        error(['process_solve_options error message: sub_analysis_type ' sub_analysis_type ' not supported yet!']);
     81else
     82        %convert to enum
     83        sub_analysis_type=eval([upper(sub_analysis_type(1)) lower(sub_analysis_type(2:end)) 'AnalysisEnum']);
    9384end
    94 if ~(strcmpi(package,'cielo') |  ...
    95                 strcmpi(package,'ice') |  ...
    96                 strcmpi(package,'macayeal') ),
    97         error(['process_solve_options error message: package ' package ' not supported yet!']);
    98 end
    99 
    10085
    10186%  process qmu arguments
  • issm/trunk/src/m/classes/public/solve.m

    r1629 r1650  
    5555
    5656%Launch correct solution sequence
    57 if strcmpi(md.analysis_type,'diagnostic'),
     57if md.analysis_type==DiagnosticAnalysisEnum,
    5858        md=diagnostic(md);
    5959
    60 elseif strcmpi(md.analysis_type,'mesh'),
    61         md=mesh(md);
    62 
    63 elseif strcmpi(md.analysis_type,'transient'),
     60elseif md.analysis_type==TransientAnalysisEnum,
    6461        md=transient(md);
    6562
    66 elseif strcmpi(md.analysis_type,'mesh2grid'),
     63elseif md.analysis_type==Mesh2gridAnalysisEnum,
    6764        md=mesh2grid(md);;
    6865
    69 elseif strcmpi(md.analysis_type,'prognostic'),
     66elseif md.analysis_type==PrognosticAnalysisEnum,
    7067        md=prognostic(md);;
    7168
    72 elseif strcmpi(md.analysis_type,'control'),
     69elseif md.analysis_type==ControlAnalysisEnum,
    7370        md=control(md);
    7471
    75 elseif strcmpi(md.analysis_type,'thermal'),
     72elseif md.analysis_type==ThermalAnalysisEnum,
    7673        md=thermal(md);
    7774
    78 elseif strcmpi(md.analysis_type,'parameters'),
     75elseif md.analysis_type==ParametersAnalysisEnum,
    7976        md=parameters(md);
    8077
     
    10097addpath(genpath_ice([ISSM_DIR '/src/m/solutions/cielo']));
    10198addpath(genpath_ice([ISSM_DIR '/bin']));
    102 
Note: See TracChangeset for help on using the changeset viewer.