Changeset 10320


Ignore:
Timestamp:
10/26/11 11:16:46 (13 years ago)
Author:
seroussi
Message:

minor cleaning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r10314 r10320  
    286286        double  rho_water,rho_ice,density;
    287287        double  h[3],s[3],b[3],ba[3];
    288         double *values         = NULL;
    289288
    290289        /*vertices and material parameters: */
     
    21782177void  Tria::ShelfSync(void){
    21792178
    2180         int     i,swap;
     2179        int     i;
     2180        bool    elementonshelf = false;
    21812181        double  bed_hydro,gl_melting_rate;
    21822182        double  yts,rho_water,rho_ice,density;
    21832183        double  melting[NUMVERTICES];
    21842184        double  h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],ba[NUMVERTICES];
    2185         bool    elementonshelf = false;
    21862185
    21872186        /*recover parameters: */
    21882187        parameters->FindParam(&yts,ConstantsYtsEnum);
    21892188        parameters->FindParam(&gl_melting_rate,GroundinglineMeltingRateEnum);
     2189        rho_water=matpar->GetRhoWater();
     2190        rho_ice=matpar->GetRhoIce();
     2191        density=rho_ice/rho_water;
    21902192
    21912193        /*Recover info at the vertices: */
     
    21942196        GetInputListOnVertices(&b[0],BedEnum);
    21952197        GetInputListOnVertices(&ba[0],BathymetryEnum);
    2196 
    2197         /*material parameters: */
    2198         rho_water=matpar->GetRhoWater();
    2199         rho_ice=matpar->GetRhoIce();
    2200         density=rho_ice/rho_water;
    22012198
    22022199        /*go through vertices, and update inputs, considering them to be TriaVertex type: */
     
    22122209        }
    22132210
    2214         /*Now, update  shelf status of element. An element can only be on shelf if all its nodes are on shelf: */
    2215         swap=0;
    2216         elementonshelf=false;
     2211        /*If at least one vertex is now floating, the element is an iceshelf*/
    22172212        for(i=0;i<NUMVERTICES;i++){
    22182213                if(nodes[i]->IsFloating()){
     
    22212216                }
    22222217        }
    2223         if(!this->IsFloating() && elementonshelf==true)swap=1;
    2224     this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,elementonshelf));
    22252218       
    2226     /*If this element just  became ungrounded, set its basal melting rate at 50 m/yr:*/
    2227         if(swap){
     2219   /*Add basal melting rate if element just ungrounded*/
     2220        if(!this->IsFloating() && elementonshelf==true){
    22282221                for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts;
    22292222                this->inputs->AddInput(new TriaVertexInput(BasalforcingsMeltingRateEnum,&melting[0]));
    2230         }
     2223        }
     2224
     2225        /*Update inputs*/
     2226   this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,elementonshelf));
    22312227}
    22322228/*}}}*/
     
    22342230void  Tria::SoftMigration(double* sheet_ungrounding){
    22352231
    2236         double *values         = NULL;
    2237         double  h[3],s[3],b[3],ba[3];
     2232        int     i;
     2233        bool    elementonshelf = false;
    22382234        double  bed_hydro;
    22392235        double  rho_water,rho_ice,density;
    2240         int     i;
    2241         bool    elementonshelf = false;
     2236        double  h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],ba[NUMVERTICES];
    22422237
    22432238        /*Recover info at the vertices: */
     
    22532248       
    22542249        /*go through vertices, and update inputs, considering them to be TriaVertex type: */
    2255         for(i=0;i<3;i++){
     2250        for(i=0;i<NUMVERTICES;i++){
    22562251                if (nodes[i]->IsFloating()){
    22572252                        /*This node is on the shelf. See if its bed is going under the bathymetry: */
Note: See TracChangeset for help on using the changeset viewer.