Changeset 10320
- Timestamp:
- 10/26/11 11:16:46 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Tria.cpp
r10314 r10320 286 286 double rho_water,rho_ice,density; 287 287 double h[3],s[3],b[3],ba[3]; 288 double *values = NULL;289 288 290 289 /*vertices and material parameters: */ … … 2178 2177 void Tria::ShelfSync(void){ 2179 2178 2180 int i,swap; 2179 int i; 2180 bool elementonshelf = false; 2181 2181 double bed_hydro,gl_melting_rate; 2182 2182 double yts,rho_water,rho_ice,density; 2183 2183 double melting[NUMVERTICES]; 2184 2184 double h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],ba[NUMVERTICES]; 2185 bool elementonshelf = false;2186 2185 2187 2186 /*recover parameters: */ 2188 2187 parameters->FindParam(&yts,ConstantsYtsEnum); 2189 2188 parameters->FindParam(&gl_melting_rate,GroundinglineMeltingRateEnum); 2189 rho_water=matpar->GetRhoWater(); 2190 rho_ice=matpar->GetRhoIce(); 2191 density=rho_ice/rho_water; 2190 2192 2191 2193 /*Recover info at the vertices: */ … … 2194 2196 GetInputListOnVertices(&b[0],BedEnum); 2195 2197 GetInputListOnVertices(&ba[0],BathymetryEnum); 2196 2197 /*material parameters: */2198 rho_water=matpar->GetRhoWater();2199 rho_ice=matpar->GetRhoIce();2200 density=rho_ice/rho_water;2201 2198 2202 2199 /*go through vertices, and update inputs, considering them to be TriaVertex type: */ … … 2212 2209 } 2213 2210 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*/ 2217 2212 for(i=0;i<NUMVERTICES;i++){ 2218 2213 if(nodes[i]->IsFloating()){ … … 2221 2216 } 2222 2217 } 2223 if(!this->IsFloating() && elementonshelf==true)swap=1;2224 this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,elementonshelf));2225 2218 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){ 2228 2221 for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts; 2229 2222 this->inputs->AddInput(new TriaVertexInput(BasalforcingsMeltingRateEnum,&melting[0])); 2230 } 2223 } 2224 2225 /*Update inputs*/ 2226 this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,elementonshelf)); 2231 2227 } 2232 2228 /*}}}*/ … … 2234 2230 void Tria::SoftMigration(double* sheet_ungrounding){ 2235 2231 2236 double *values = NULL;2237 double h[3],s[3],b[3],ba[3];2232 int i; 2233 bool elementonshelf = false; 2238 2234 double bed_hydro; 2239 2235 double rho_water,rho_ice,density; 2240 int i; 2241 bool elementonshelf = false; 2236 double h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],ba[NUMVERTICES]; 2242 2237 2243 2238 /*Recover info at the vertices: */ … … 2253 2248 2254 2249 /*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++){ 2256 2251 if (nodes[i]->IsFloating()){ 2257 2252 /*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.