Changeset 7691


Ignore:
Timestamp:
03/28/11 07:10:19 (14 years ago)
Author:
Mathieu Morlighem
Message:

better organization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk/src/m/model/ismodelselfconsistent.m

    r7686 r7691  
    288288%}}}
    289289
     290%Solution specific check
     291%TRANSIENT {{{1
     292if (md.solution_type==Transient2DSolutionEnum | md.solution_type==Transient3DSolutionEnum),
     293
     294        if md.dt<=0,
     295                error('model not consistent: field dt must be positive for a transient run')
     296        end
     297
     298        if(md.cfl_coefficient>1 | md.cfl_coefficient<0),
     299                error(['model not consistent: model ' md.name ' cfl_coefficient field should between  0 and 1']);
     300        end
     301end
     302%}}}
     303%STEADYSTATE{{{1
     304if md.solution_type==SteadystateSolutionEnum,
     305
     306        %NDT
     307        if md.dt~=0,
     308                error(['model not consistent: for a steadystate computation, dt must be zero.']);
     309        end
     310
     311        %eps:
     312        if isnan(md.eps_rel),
     313                error(['model not consistent: for a steadystate computation, eps_rel (relative convergence criterion) must be defined!']);
     314        end
     315end
     316%}}}
     317%GROUNDINGLINEMIGRATION2D{{{1
     318if md.solution_type==GroundingLineMigration2DSolutionEnum,
     319        if strcmpi(md.cluster.name,'none'),
     320                error(['model not consistent: ' md.solution_type ' is only implemented in parallel mode !'])
     321        end
     322
     323        if md.dt<=0,
     324                error('model not consistent: field dt must be positive for a transient run')
     325        end
     326
     327        %recursive call to ismodelselfconsistent
     328        if (md.dim~=2),
     329                error(['model not consistent: for a ' md.solution_type ' computation, the grounding line module is only implemented in 2d !'])
     330        end
     331
     332        if(md.cfl_coefficient>1 | md.cfl_coefficient<0),
     333                error(['model not consistent: model ' md.name ' cfl_coefficient field should between  0 and 1']);
     334        end
     335end
     336%}}}
    290337%FLAIM {{{1
    291338if (md.solution_type == FlaimSolutionEnum),
     
    293340                error(['model not consistent: fm_tracks file ''' md.fm_tracks ''' must exist.']);
    294341        end
    295 %   probably going to need some checks on fm_flightreqs here
     342        %   probably going to need some checks on fm_flightreqs here
    296343        if (numel(md.fm_criterion) ~= md.numberofgrids) && (numel(md.fm_criterion) ~= md.numberofelements)
    297344                error(['model not consistent: fm_criterion vector must have number of nodes (' int2str(md.numberofgrids) ') or elements (' int2str(md.numberofelements) ') values, not ' int2str(numel(md.fm_criterion)) ' values.']);
     
    300347%}}}
    301348
    302 %Solution specific check
    303 %TRANSIENT {{{1
    304 if (md.solution_type==Transient2DSolutionEnum | md.solution_type==Transient3DSolutionEnum),
    305 
    306         if md.dt<=0,
    307                 error('model not consistent: field dt must be positive for a transient run')
    308         end
    309 
    310         if(md.cfl_coefficient>1 | md.cfl_coefficient<0),
    311                 error(['model not consistent: model ' md.name ' cfl_coefficient field should between  0 and 1']);
    312         end
    313 end
    314 %}}}
    315 %STEADYSTATE{{{1
    316 if md.solution_type==SteadystateSolutionEnum,
    317 
    318         %NDT
    319         if md.dt~=0,
    320                 error(['model not consistent: for a steadystate computation, dt must be zero.']);
    321         end
    322 
    323         %eps:
    324         if isnan(md.eps_rel),
    325                 error(['model not consistent: for a steadystate computation, eps_rel (relative convergence criterion) must be defined!']);
    326         end
    327 end
    328 %}}}
    329 %GROUNDINGLINEMIGRATION2D{{{1
    330 if md.solution_type==GroundingLineMigration2DSolutionEnum,
    331         if strcmpi(md.cluster.name,'none'),
    332                 error(['model not consistent: ' md.solution_type ' is only implemented in parallel mode !'])
    333         end
    334 
    335         if md.dt<=0,
    336                 error('model not consistent: field dt must be positive for a transient run')
    337         end
    338 
    339         %recursive call to ismodelselfconsistent
    340         if (md.dim~=2),
    341                 error(['model not consistent: for a ' md.solution_type ' computation, the grounding line module is only implemented in 2d !'])
    342         end
    343 
    344         if(md.cfl_coefficient>1 | md.cfl_coefficient<0),
    345                 error(['model not consistent: model ' md.name ' cfl_coefficient field should between  0 and 1']);
    346         end
    347 end
    348 %}}}
     349%Now check all analyses called for a given solution
    349350%ANALYSESCHECKS {{{1
    350351[analyses,numanalyses,solutioncore]=SolutionConfiguration(md.solution_type);
Note: See TracChangeset for help on using the changeset viewer.