Ignore:
Timestamp:
10/02/09 13:19:15 (15 years ago)
Author:
Mathieu Morlighem
Message:

renamed test -> check

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/public/ismodelselfconsistent.m

    r2357 r2366  
    55%      ismodelselfconsistent(md),
    66
    7 %tolerance we use in litmus tests for the consistency of the model
     7%tolerance we use in litmus checks for the consistency of the model
    88tolerance=10^-12;
    99
     
    7171if strcmpi(md.type,'2d'),
    7272        fields={'pressureload'};
    73         testsize(md,fields,[NaN 3]);
     73        checksize(md,fields,[NaN 3]);
    7474elseif strcmpi(md.type,'3d'),
    7575        fields={'pressureload'};
    76         testsize(md,fields,[NaN 5]);
     76        checksize(md,fields,[NaN 5]);
    7777end
    7878
     
    8181        'rho_ice','rho_water','B','elementoniceshelf','surface','thickness','bed','g','lowmem','sparsity','nsteps','maxiter',...
    8282        'tolx','np','eps_res','exclusive','n','gridonbed','gridonsurface','elementonbed','elementonsurface','deltaH','DeltaH','timeacc','timedec'};
    83 testnan(md,fields);
     83checknan(md,fields);
    8484
    8585%FIELDS >= 0
     
    8787        'rho_ice','rho_water','B','elementoniceshelf','thickness','g','eps_res','eps_rel','eps_abs','nsteps','maxiter','tolx','exclusive',...
    8888        'sparsity','lowmem','n','gridonbed','gridonsurface','elementonbed','elementonsurface','deltaH','DeltaH','timeacc','timedec'};
    89 testgreater(md,fields,0);
     89checkgreater(md,fields,0);
    9090
    9191%FIELDS > 0
     
    9393        'rho_ice','rho_water','B','thickness','g','eps_res','eps_rel','eps_abs','maxiter','tolx',...
    9494        'sparsity','deltaH','DeltaH','timeacc','timedec'};
    95 testgreaterstrict(md,fields,0);
     95checkgreaterstrict(md,fields,0);
    9696
    9797%SIZE NUMBEROFELEMENTS
    9898fields={'elements','p','q','elementoniceshelf','n','elementonbed'};
    99 testlength(md,fields,md.numberofelements);
     99checklength(md,fields,md.numberofelements);
    100100
    101101%SIZE NUMBEROFGRIDS
    102102fields={'x','y','z','B','drag','spcvelocity','melting','accumulation','surface','thickness','bed','gridonbed','gridonsurface'};
    103 testlength(md,fields,md.numberofgrids);
     103checklength(md,fields,md.numberofgrids);
    104104
    105105%THICKNESS = SURFACE - BED
     
    155155        %NAN VALUES
    156156        fields={'time','np'};
    157         testnan(md,fields);
     157        checknan(md,fields);
    158158
    159159        %FIELD > 0
    160160        fields={'time','np'};
    161         testgreaterstrict(md,fields,0);
     161        checkgreaterstrict(md,fields,0);
    162162
    163163end
     
    221221        %INITIAL VELOCITIES
    222222        fields={'vx','vy'};
    223         testsize(md,fields,[md.numberofgrids 1]);
    224         testnan(md,fields);
     223        checksize(md,fields,[md.numberofgrids 1]);
     224        checknan(md,fields);
    225225
    226226end
     
    260260        %VELOCITIES AND PRESSURE
    261261        fields={'vx','vy','vz','pressure'};
    262         testsize(md,fields,[md.numberofgrids 1]);
    263         testnan(md,fields);
     262        checksize(md,fields,[md.numberofgrids 1]);
     263        checknan(md,fields);
    264264
    265265end
     
    270270        %DT and NDT
    271271        fields={'dt','ndt'};
    272         testgreaterstrict(md,fields,0);
     272        checkgreaterstrict(md,fields,0);
    273273
    274274        %INITIAL TEMPERATURE, MELTING AND ACCUMULATION
    275275        fields={'temperature','accumulation','melting'};
    276         testsize(md,fields,[md.numberofgrids 1]);
     276        checksize(md,fields,[md.numberofgrids 1]);
    277277
    278278end
     
    288288        %LENGTH CONTROL FIELDS
    289289        fields={'maxiter','optscal','fit','cm_jump'};
    290         testlength(md,fields,md.nsteps);
     290        checklength(md,fields,md.nsteps);
    291291
    292292        %FIT
     
    297297        %OBSERVED VELOCITIES
    298298        fields={'vx_obs','vy_obs'};
    299         testsize(md,fields,[md.numberofgrids 1]);
    300         testnan(md,fields);
     299        checksize(md,fields,[md.numberofgrids 1]);
     300        checknan(md,fields);
    301301
    302302        %DIRICHLET IF THICKNESS <= 0
     
    320320end %end function
    321321
    322 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TEST FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    323 
    324 function testlength(md,fields,fieldlength)
    325         %TESTSIZE - test length of a field
     322%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CHECK FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     323
     324function checklength(md,fields,fieldlength)
     325        %CHECKSIZE - check length of a field
    326326        for i=1:length(fields),
    327327                if length(eval(['md.' fields{i}]))~=fieldlength,
     
    331331end
    332332
    333 function testsize(md,fields,fieldsize)
    334         %TESTSIZE - test size of a field
     333function checksize(md,fields,fieldsize)
     334        %CHECKSIZE - check size of a field
    335335        for i=1:length(fields),
    336336                if isnan(fieldsize(1)),
     
    350350end
    351351
    352 function testnan(md,fields)
    353         %TESTNAN - test nan values of a field
     352function checknan(md,fields)
     353        %CHECKNAN - check nan values of a field
    354354        for i=1:length(fields),
    355355                if any(isnan(eval(['md.' fields{i}]))),
     
    359359end
    360360
    361 function testreal(md,fields)
    362         %TESTREAL - test real values of a field
     361function checkreal(md,fields)
     362        %CHECKREAL - check real values of a field
    363363        for i=1:length(fields),
    364364                if any(eval(['~isreal(md.' fields{i} ')'])),
     
    368368end
    369369
    370 function testgreaterstrict(md,fields,lowerbound)
    371         %TESTGREATERSTRICT - test values of a field
     370function checkgreaterstrict(md,fields,lowerbound)
     371        %CHECKGREATERSTRICT - check values of a field
    372372        for i=1:length(fields),
    373373                if any(eval(['md.' fields{i} '<=' num2str(lowerbound) ])),
     
    377377end
    378378
    379 function testgreater(md,fields,lowerbound)
    380         %TESTGREATER - test values of a field
     379function checkgreater(md,fields,lowerbound)
     380        %CHECKGREATER - check values of a field
    381381        for i=1:length(fields),
    382382                if any(eval(['md.' fields{i} '<' num2str(lowerbound) ])),
     
    386386end
    387387
    388 function testlessstrict(md,fields,upperbound)
    389         %TESTLESSSTRICT - test values of a field
     388function checklessstrict(md,fields,upperbound)
     389        %CHECKLESSSTRICT - check values of a field
    390390        for i=1:length(fields),
    391391                if any(eval(['md.' fields{i} '>=' num2str(upperbound) ])),
     
    395395end
    396396
    397 function testless(md,fields,upperbound)
    398         %TESTLESS - test values of a field
     397function checkless(md,fields,upperbound)
     398        %CHECKLESS - check values of a field
    399399        for i=1:length(fields),
    400400                if any(eval(['md.' fields{i} '>' num2str(upperbound) ])),
Note: See TracChangeset for help on using the changeset viewer.