Changeset 71


Ignore:
Timestamp:
04/27/09 16:51:25 (16 years ago)
Author:
seroussi
Message:

count start at 1 even in ice

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/solutions/ice/diagnostic_core_nonlinear.m

    r36 r71  
    4242                soln(1).u_g=velocity_param;
    4343                soln(1).u_g(4:6:gridset.gsize)=0; %no pressure in the velocity
    44                 soln(2).u_g=velocity_param;
    45                 soln(2).u_g(4:6:gridset.gsize)=0; %no pressure in the velocity
    4644        else   
    4745                soln(1).u_g={};
    48                 soln(2).u_g={};
    4946        end
    5047else
     
    5249        inputs=struct();
    5350        soln(1).u_g={};
    54         soln(2).u_g={};
    5551end
    5652
    5753
    5854%Initialization
    59 count=2;
     55count=1;
    6056converged=0;
    6157       
     
    7369                pflag=1;
    7470        else
    75                 if count==2, pflag=1; else pflag=0; end
     71                if count==1, pflag=1; else pflag=0; end
    7672        end
    7773
    7874        %add velocity to inputs
    7975        inputs.velocity=soln(count).u_g;
    80         inputs.oldvelocity=soln(count-1).u_g;
     76        if count>1,
     77                inputs.oldvelocity=soln(count-1).u_g;
     78        end
    8179       
    8280        %generate stiffness and loads
     
    8583
    8684        %Save loads
    87         if count==2,
     85        if count==1,
    8886                p_g_old=p_g;
    8987        else
     
    117115
    118116        %Figure out if convergence is reached.
    119         if((count>=4)| velocity_is_present), %make sure we already iterated at least once.
     117        if((count>=3)| velocity_is_present), %make sure we already iterated at least once.
    120118
    121119                %compute relative velocity difference for this step.
Note: See TracChangeset for help on using the changeset viewer.