Changeset 2357


Ignore:
Timestamp:
10/02/09 07:38:13 (16 years ago)
Author:
seroussi
Message:

Added check on observed velocity to avoid NaN

File:
1 edited

Legend:

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

    r2353 r2357  
    213213                end
    214214        end
     215
    215216end
    216217
     
    218219if md.analysis_type==PrognosticAnalysisEnum,
    219220
    220         %VELOCITIES
    221         if (size(md.vx,1)~=md.numberofgrids | size(md.vy,1)~=md.numberofgrids),
    222                 error(['model not consistent: a 3d velocity is required. Run ''diagnostic'' solution first!'])
    223         end
     221        %INITIAL VELOCITIES
     222        fields={'vx','vy'};
     223        testsize(md,fields,[md.numberofgrids 1]);
     224        testnan(md,fields);
     225
    224226end
    225227
     
    257259
    258260        %VELOCITIES AND PRESSURE
    259         if (length(md.vx)~=md.numberofgrids | length(md.vy)~=md.numberofgrids | length(md.vz)~=md.numberofgrids),
    260                 error(['model not consistent: a 3d velocity is required. Run ''diagnostic'' solution first!'])
    261         end
    262         if (length(md.pressure)~=md.numberofgrids),
    263                 error(['model not consistent: pressure is required. Run ''diagnostic'' solution first!'])
    264         end
     261        fields={'vx','vy','vz','pressure'};
     262        testsize(md,fields,[md.numberofgrids 1]);
     263        testnan(md,fields);
     264
    265265end
    266266
Note: See TracChangeset for help on using the changeset viewer.