1 | function outoptions=process_solve_options(options)
|
---|
2 | %DEFAULT_SOLVE_OPTIONS - set up default options for solve phase
|
---|
3 | %
|
---|
4 | % Usage:
|
---|
5 | % options=process_solve_options(options)
|
---|
6 | %
|
---|
7 | % See also: SOLVE
|
---|
8 |
|
---|
9 | %solution_type: check on this option, error out otherwise
|
---|
10 | solution_type=getfieldvalue(options,'analysis_type');
|
---|
11 |
|
---|
12 | %batch mode for launching jobs.
|
---|
13 | outoptions.batch=getfieldvalue(options,'batch','no');
|
---|
14 |
|
---|
15 | %directory
|
---|
16 | outoptions.directory=getfieldvalue(options,'directory','');
|
---|
17 |
|
---|
18 | %convert to Enum if a string was provided
|
---|
19 | if ischar(solution_type), error(['only Enums are supported as ''solution_type''. For example: md=solve(md,''solution_type'',DiagnosticSolutionEnum); ']); end
|
---|
20 |
|
---|
21 | %check solution type is supported
|
---|
22 | if ~ismember(solution_type,[DiagnosticSolutionEnum,PrognosticSolutionEnum,ThermalSolutionEnum,...
|
---|
23 | SteadystateSolutionEnum,ParametersSolutionEnum,Transient2DSolutionEnum,Transient3DSolutionEnum...
|
---|
24 | BalancethicknessSolutionEnum,BalancevelocitiesSolutionEnum,BedSlopeSolutionEnum,SurfaceSlopeSolutionEnum,GroundingLineMigration2DSolutionEnum,HydrologySolutionEnum,FlaimSolutionEnum]),
|
---|
25 | error(['process_solve_options error message: solution_type ' EnumToString(solution_type) ' not supported yet!']);
|
---|
26 | end
|
---|
27 | outoptions.solution_type=solution_type;
|
---|
28 | outoptions.upload=getfieldvalue(options,'upload','off');
|
---|
29 |
|
---|
30 | % process qmu arguments
|
---|
31 | outoptions.qmudir=getfieldvalue(options,'qmudir',['qmu' num2str(GetPId)]); % qmudir =['qmu_' datestr(now,'yyyymmdd_HHMMSS')];
|
---|
32 | outoptions.qmufile=getfieldvalue(options,'qmufile','qmu');% qmufile cannot be changed unless ????script.sh is also changed
|
---|
33 | outoptions.overwrite=getfieldvalue(options,'overwrite','n');
|
---|
34 | outoptions.keep=getfieldvalue(options,'keep','n');
|
---|
35 | outoptions.ivar=getfieldvalue(options,'ivar',1);
|
---|
36 | outoptions.iresp=getfieldvalue(options,'iresp',1);
|
---|
37 | outoptions.imethod=getfieldvalue(options,'imethod',1);
|
---|
38 | outoptions.iparams=getfieldvalue(options,'iparams',1);
|
---|
39 | outoptions.runmpi=getfieldvalue(options,'runmpi',false);
|
---|
40 |
|
---|
41 | % process flaim arguments
|
---|
42 | outoptions.fmdir=getfieldvalue(options,'fmdir',['fm' num2str(GetPId)]);
|
---|
43 | outoptions.fmfile=getfieldvalue(options,'fmfile','fm_targets');
|
---|
44 | outoptions.overwrite=getfieldvalue(options,'overwrite','n');
|
---|
45 | outoptions.keep=getfieldvalue(options,'keep','y');
|
---|
46 | outoptions.latsgn=getfieldvalue(options,'latsgn',0);
|
---|
47 | outoptions.cmap=getfieldvalue(options,'cmap',[]);
|
---|
48 |
|
---|