source: issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.m@ 13018

Last change on this file since 13018 was 13018, checked in by seroussi, 13 years ago

BUG: not more addnotes function

File size: 2.8 KB
RevLine 
[2326]1function ismodelselfconsistent(md),
[1]2%ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
3%
4% Usage:
[2326]5% ismodelselfconsistent(md),
[1]6
[9730]7%initialize consistency as true
[12664]8md.private.isconsistent=true;
[9730]9
[9853]10%Get solution and associated analyses
11solution=md.private.solution;
12[analyses,numanalyses]=AnalysisConfiguration(solution);
13
[12755]14%Go through a model field, check that it is a class, and call checkconsistency
[11221]15fields=properties('model');
[9739]16for i=1:length(fields),
17 field=fields{i};
[9853]18
19 %Some properties do not need to be checked
[9751]20 if ismember(field,{'results' 'debug' 'radaroverlay'}),
[9739]21 continue;
22 end
[9853]23
24 %Check that current field is an object
[9739]25 if ~isobject(md.(field))
[12664]26 md=checkmessage(md,['field ''' char(field) ''' is not an object']);
[9739]27 end
[9853]28
29 %Check consistency of the object
[11224]30 if verLessThan('matlab', '7.6')
[12664]31 md=checkconsistency(md.(field),md,solution,analyses);
[11224]32 else
[12664]33 md=md.(field).checkconsistency(md,solution,analyses);
[11224]34 end
[9732]35end
36
[9730]37%error message if mode is not consistent
[12664]38if md.private.isconsistent==false,
39 error('Model not consistent, see messages above');
[9730]40end
[13005]41end
42
43function [analyses,numanalyses]=AnalysisConfiguration(solutiontype), % {{{
44%ANALYSISCONFIGURATION - return type of analyses, number of analyses
45%
46% Usage:
47% [analyses, numanalyses]=AnalysisConfiguration(solutiontype);
48
49
50
51switch solutiontype,
52
53 case DiagnosticSolutionEnum,
54 numanalyses=5;
55 analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum];
56
57 case SteadystateSolutionEnum,
58 numanalyses=7;
59 analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum];
60
61 case ThermalSolutionEnum,
62 numanalyses=2;
63 analyses=[ThermalAnalysisEnum;MeltingAnalysisEnum];
64
65 case EnthalpySolutionEnum,
66 numanalyses=1;
67 analyses=[EnthalpyAnalysisEnum];
68
69 case PrognosticSolutionEnum,
70 numanalyses=1;
71 analyses=[PrognosticAnalysisEnum];
72
73 case BalancethicknessSolutionEnum,
74 numanalyses=1;
75 analyses=[BalancethicknessAnalysisEnum];
76
77 case SurfaceSlopeSolutionEnum,
78 numanalyses=1;
79 analyses=[SurfaceSlopeAnalysisEnum];
80
81 case BedSlopeSolutionEnum,
82 numanalyses=1;
83 analyses=[BedSlopeAnalysisEnum];
84
85 case TransientSolutionEnum,
86 numanalyses=9;
87 analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum;EnthalpyAnalysisEnum;PrognosticAnalysisEnum];
88
89 case FlaimSolutionEnum,
90 numanalyses=1;
91 analyses=[FlaimAnalysisEnum];
92
93 case HydrologySolutionEnum,
94 numanalyses=3;
95 analyses=[BedSlopeAnalysisEnum;SurfaceSlopeAnalysisEnum;HydrologyAnalysisEnum];
96
97 otherwise
98 error('%s%s%s',' solution type: ',EnumToString(solutiontype),' not supported yet!');
99
[13018]100 end
[13005]101end % }}}
Note: See TracBrowser for help on using the repository browser.