source: issm/trunk/src/m/qmu/process_qmu_options.m@ 7629

Last change on this file since 7629 was 7629, checked in by Mathieu Morlighem, 14 years ago

moved md.analysis_type to md.solution_type

File size: 2.4 KB
Line 
1function outoptions=process_qmu_options(options)
2%PROCESS_QMU_OPTIONS - set up default options for qmu phase
3%
4% Usage:
5% options=process_qmu_options(options)
6%
7% See also: QMU,RECOVER_QMU_OPTIONS
8
9%analysis_type: check on this option, error out otherwise
10found=0;
11for i=1:size(options,1),
12 if strcmpi(options{i,1},'analysis_type'),
13 analysis_type=options{i,2};
14 found=1;
15 end
16end
17if ~found,
18 error('recover_qmu_options error message: no ''analysis_type'' was provided');
19end
20
21%package: is there one? default to ''JPL''
22found=0;
23for i=1:size(options,1),
24 if strcmpi(options{i,1},'package'),
25 package=options{i,2};
26 found=1;
27 end
28end
29if ~found,
30 disp('recover_qmu_options info message: no ''package'' was provided, defaulting to ''JPL''');
31 options(end+1,:)={'package' 'JPL'};
32 package='JPL';
33end
34
35if ~ischar(package),
36 error(['process_qmu_options error message: package ' package ' not supported yet']);
37end
38
39%check solution type is supported
40if ~(strcmpi(analysis_type,'control') | ...
41 strcmpi(analysis_type,'diagnostic') | ...
42 strcmpi(analysis_type,'prognostic') | ...
43 strcmpi(analysis_type,'thermal') | ...
44 strcmpi(analysis_type,'parameters') | ...
45 strcmpi(analysis_type,'mesh') | ...
46 strcmpi(analysis_type,'mesh2grid') | ...
47 strcmpi(analysis_type,'transient') ),
48 error(['process_qmu_options error message: analysis_type ' analysis_type ' not supported yet!']);
49end
50
51% process qmu arguments
52
53%first, the defaults
54qmudir ='qmu';% qmudir =['qmu_' datestr(now,'yyyymmdd_HHMMSS')];
55qmufile='qmu';
56ivar =1;
57iresp =1;
58imethod=1;
59iparams=1;
60runmpi =false;
61
62for i=1:size(options,1),
63 switch options{i,1},
64 case 'qmudir'
65 qmudir=options{i,2};
66 case 'qmufile'
67 qmufile=options{i,2};
68 case 'ivar'
69 ivar=options{i,2};
70 case 'iresp'
71 iresp=options{i,2};
72 case 'imethod'
73 imethod=options{i,2};
74 case 'iparams'
75 iparams=options{i,2};
76 case 'overwrite'
77 outoptions.overwrite=options{i,2};
78 case 'keep'
79 outoptions.keep=options{i,2};
80 case 'outfiles'
81 outoptions.outfiles=options{i,2};
82 case 'rstfile'
83 outoptions.rstfile=options{i,2};
84 case 'rundakota'
85 outoptions.rundakota=options{i,2};
86 case 'runmpi'
87 runmpi=options{i,2};
88 otherwise
89 %nothing
90 end
91end
92
93%setup final options structure
94outoptions.analysis_type=analysis_type;
95outoptions.package=package;
96outoptions.qmudir=qmudir;
97outoptions.qmufile=qmufile;
98outoptions.ivar=ivar;
99outoptions.iresp=iresp;
100outoptions.imethod=imethod;
101outoptions.iparams=iparams;
102outoptions.runmpi=runmpi;
103
Note: See TracBrowser for help on using the repository browser.