Changeset 7623


Ignore:
Timestamp:
03/04/11 12:09:20 (14 years ago)
Author:
seroussi
Message:

added recursive checks for steadystate and grounding lines solutions in ismodelselfconsistent

File:
1 edited

Legend:

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

    r7622 r7623  
    2525        else
    2626                analysis=[DiagnosticSolutionEnum PrognosticSolutionEnum ThermalSolutionEnum];
     27        end
     28
     29        for i=1:length(analysis),
     30                md.analysis_type=analysis(i);
     31                ismodelselfconsistent(md);
     32        end
     33
     34        if(md.cfl_coefficient>1 | md.cfl_coefficient<0),
     35                error(['model not consistent: model ' md.name ' cfl_coefficient field should between  0 and 1']);
     36        end
     37end
     38%}}}
     39%recursive call for STEADYSTATE{{{1
     40if md.analysis_type==SteadystateSolutionEnum,
     41
     42        %NDT
     43        if md.dt~=0,
     44                error(['model not consistent: for a steadystate computation, dt must be zero.']);
     45        end
     46
     47        %PRESSURE
     48        if isnans(md.pressure),
     49                error(['model not consistent: for a steadystate computation, the model must have an initial pressure, even lithostatic will do.']);
     50        end
     51
     52        %eps:
     53        if isnan(md.eps_rel),
     54                error(['model not consistent: for a steadystate computation, eps_rel (relative convergence criterion) must be defined!']);
     55        end
     56
     57        %recursive call to ismodelselfconsistent
     58        analysis=[DiagnosticSolutionEnum ThermalSolutionEnum];
     59
     60        for i=1:length(analysis),
     61                md.analysis_type=analysis(i);
     62                ismodelselfconsistent(md);
     63        end
     64
     65end
     66%}}}
     67%recursive call for GROUNDINGLINEMIGRATION2D{{{1
     68if md.analysis_type==GroundingLineMigration2DSolutionEnum,
     69        if strcmpi(md.cluster.name,'none'),
     70                error(['model not consistent: ' md.analysis_type ' is only implemented in parallel mode !'])
     71        end
     72
     73        if md.dt<=0,
     74                error('model not consistent: field dt must be positive for a transient run')
     75        end
     76
     77        %recursive call to ismodelselfconsistent
     78        if (md.dim==2),
     79                analysis=[DiagnosticSolutionEnum PrognosticSolutionEnum];
     80        else
     81                error(['model not consistent: for a ' md.analysis_type ' computation, the grounding line module is only implemented in 2d !'])
    2782        end
    2883
     
    155210checkvalues(md,{'gl_migration'},[NoneEnum() AgressiveMigrationEnum() SoftMigrationEnum()]);
    156211if (md.gl_migration~=NoneEnum),
     212        if (md.dim==3 | strcmpi(md.cluster.name,'none')),
     213                error(['model ' md.name ' requesting grounding line migration, but grounding line module only implemented for 2d models and parallel runs!']);
     214        end
    157215        if isnan(md.bathymetry),
    158                 error(['model not consistent: model ' md.name ' requesting grounding line migration, buth bathymetry is absent!']);
     216                error(['model not consistent: model ' md.name ' requesting grounding line migration, but bathymetry is absent!']);
    159217        end
    160218end
     
    265323end
    266324%}}}
    267 %STEADYSTATE{{{1
    268 if md.analysis_type==SteadystateSolutionEnum,
    269 
    270         %NDT
    271         if md.dt~=0,
    272                 error(['model not consistent: for a steadystate computation, dt must be zero.']);
    273         end
    274 
    275         %PRESSURE
    276         if isnans(md.pressure),
    277                 error(['model not consistent: for a steadystate computation, the model must have an initial pressure, even lithostatic will do.']);
    278         end
    279 
    280         %eps:
    281         if isnan(md.eps_rel),
    282                 error(['model not consistent: for a steadystate computation, eps_rel (relative convergence criterion) must be defined!']);
    283         end
    284 
    285         %dim:
    286         if (md.dim==2),
    287                 error(['model not consistent: for a steadystate computation, model needs to be 3d']);
    288         end
    289 end
    290 %}}}
    291325%THERMAL {{{1
    292326%THERMAL STEADY AND THERMAL TRANSIENT
     
    325359        fields={'temperature','spctemperature(:,2)','observed_temperature'};
    326360        checkgreater(md,fields,0)
    327 
    328 end
    329 %}}}
    330 %GROUNDINGLINEMIGRATION2D{{{1
    331 if md.analysis_type==GroundingLineMigration2DSolutionEnum,
    332         if md.dim==3,
    333                 error(['model not consistent: for a ' md.analysis_type ' computation, the grounding line module is only implemented in 2d !'])
    334         end
    335         if strcmpi(md.cluster.name,'none'),
    336                 error(['model not consistent: ' md.analysis_type ' is only implemented in parallel mode !'])
    337         end
    338361
    339362end
Note: See TracChangeset for help on using the changeset viewer.