Changeset 12654
- Timestamp:
- 07/18/12 15:07:47 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/objects/Elements/Tria.cpp
r12553 r12654 5352 5352 switch(name){ 5353 5353 case ThicknessEnum: 5354 /*Update thickness + surface: assume bed is constant. On ice shelves, takes hydrostatic equilibrium {{{*/5355 5354 IssmDouble thickness[3]; 5356 5355 IssmDouble thickness_init[3]; … … 5365 5364 GetInputListOnVertices(&surface[0],SurfaceEnum); 5366 5365 5367 /*build new thickness: */5368 // for(j=0;j<3;j++)thickness[j]=values[j];5369 5370 5366 /*build new bed and surface: */ 5371 5367 if (this->IsFloating()){ 5372 5368 /*hydrostatic equilibrium: */ 5373 5369 IssmDouble rho_ice,rho_water,di; 5374 rho_ice=this->matpar->GetRhoIce(); 5375 rho_water=this->matpar->GetRhoWater(); 5376 5377 di=rho_ice/rho_water; 5370 rho_ice = this->matpar->GetRhoIce(); 5371 rho_water = this->matpar->GetRhoWater(); 5372 di = rho_ice/rho_water; 5378 5373 5379 5374 /*build new thickness: */ 5380 5375 for (j=0; j<3; j++) { 5381 /* for observed/interpolated/hydrostatic thickness, remove scaling from any hydrostatic thickness */5382 if 5376 /* for observed/interpolated/hydrostatic thickness, remove scaling from any hydrostatic thickness */ 5377 if (hydrostatic_ratio[j] >= 0.) 5383 5378 thickness[j]=values[j]-(values[j]/thickness_init[j]-1.)*hydrostatic_ratio[j]*surface[j]/(1.-di); 5384 /* for minimum thickness, don't scale */5379 /* for minimum thickness, don't scale */ 5385 5380 else 5386 5381 thickness[j]=thickness_init[j]; 5387 5382 5388 /* check the computed thickness and update bed */ 5389 if (thickness[j] < 0.) 5390 thickness[j]=1./(1.-di); 5383 /* check the computed thickness and update bed*/ 5384 if (thickness[j] < 0.) thickness[j]=1./(1.-di); 5391 5385 bed[j]=surface[j]-thickness[j]; 5392 5386 } 5393 5394 // for(j=0;j<3;j++){5395 // surface[j]=(1-di)*thickness[j];5396 // bed[j]=-di*thickness[j];5397 // }5398 5387 } 5399 5388 else{ 5400 5389 /*build new thickness: */ 5401 5390 for (j=0; j<3; j++) { 5402 /* for observed thickness, use scaled value */5391 /* for observed thickness, use scaled value */ 5403 5392 if (hydrostatic_ratio[j] >= 0.) 5404 5393 thickness[j]=values[j]; 5405 /* for minimum thickness, don't scale */5394 /* for minimum thickness, don't scale */ 5406 5395 else 5407 5396 thickness[j]=thickness_init[j]; … … 5409 5398 5410 5399 /*update bed on grounded ice: */ 5411 // for(j=0;j<3;j++)surface[j]=bed[j]+thickness[j];5412 5400 for(j=0;j<3;j++)bed[j]=surface[j]-thickness[j]; 5413 5401 } … … 5418 5406 this->inputs->AddInput(new TriaP1Input(SurfaceEnum,surface)); 5419 5407 5420 /*}}}*/5421 5408 break; 5422 5409 default:
Note:
See TracChangeset
for help on using the changeset viewer.