[16134] | 1 | Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/c/classes/Elements/Tria.cpp (revision 15972)
|
---|
| 4 | +++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp (revision 15973)
|
---|
| 5 | @@ -7302,6 +7302,7 @@
|
---|
| 6 | void Tria::MigrateGroundingLine(IssmDouble* phi_ungrounding){
|
---|
| 7 |
|
---|
| 8 | int i,migration_style;
|
---|
| 9 | + bool oldfloating;
|
---|
| 10 | bool floatingelement = false;
|
---|
| 11 | bool groundedelement = false;
|
---|
| 12 | IssmDouble bed_hydro,yts,gl_melting_rate;
|
---|
| 13 | @@ -7319,9 +7320,10 @@
|
---|
| 14 | GetInputListOnVertices(&b[0],BedEnum);
|
---|
| 15 | GetInputListOnVertices(&r[0],BathymetryEnum);
|
---|
| 16 | GetInputListOnVertices(&phi[0],MaskGroundediceLevelsetEnum);
|
---|
| 17 | - rho_water = matpar->GetRhoWater();
|
---|
| 18 | - rho_ice = matpar->GetRhoIce();
|
---|
| 19 | - density = rho_ice/rho_water;
|
---|
| 20 | + rho_water = matpar->GetRhoWater();
|
---|
| 21 | + rho_ice = matpar->GetRhoIce();
|
---|
| 22 | + density = rho_ice/rho_water;
|
---|
| 23 | + oldfloating = this->IsFloating(); //figure out if element is floating before we start to change everything
|
---|
| 24 |
|
---|
| 25 | /*go through vertices, and update inputs, considering them to be TriaVertex type: */
|
---|
| 26 | for(i=0;i<NUMVERTICES;i++){
|
---|
| 27 | @@ -7392,7 +7394,7 @@
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | /*Add basal melting rate if element just ungrounded*/
|
---|
| 31 | - if(!this->IsFloating() && floatingelement==true){
|
---|
| 32 | + if(!oldfloating && floatingelement==true){
|
---|
| 33 | for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts;
|
---|
| 34 | this->inputs->AddInput(new TriaInput(BasalforcingsMeltingRateEnum,&melting[0],P1Enum));
|
---|
| 35 | }
|
---|
| 36 | Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
|
---|
| 37 | ===================================================================
|
---|
| 38 | --- ../trunk-jpl/src/c/classes/Elements/Penta.cpp (revision 15972)
|
---|
| 39 | +++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp (revision 15973)
|
---|
| 40 | @@ -11189,6 +11189,7 @@
|
---|
| 41 | void Penta::MigrateGroundingLine(IssmDouble* phi_ungrounding){
|
---|
| 42 |
|
---|
| 43 | int i,migration_style;
|
---|
| 44 | + bool oldfloating;
|
---|
| 45 | bool floatingelement = false;
|
---|
| 46 | bool groundedelement = false;
|
---|
| 47 | IssmDouble bed_hydro,yts,gl_melting_rate;
|
---|
| 48 | @@ -11208,9 +11209,10 @@
|
---|
| 49 | GetInputListOnVertices(&b[0],BedEnum);
|
---|
| 50 | GetInputListOnVertices(&r[0],BathymetryEnum);
|
---|
| 51 | GetInputListOnVertices(&phi[0],MaskGroundediceLevelsetEnum);
|
---|
| 52 | - rho_water = matpar->GetRhoWater();
|
---|
| 53 | - rho_ice = matpar->GetRhoIce();
|
---|
| 54 | - density = rho_ice/rho_water;
|
---|
| 55 | + rho_water = matpar->GetRhoWater();
|
---|
| 56 | + rho_ice = matpar->GetRhoIce();
|
---|
| 57 | + density = rho_ice/rho_water;
|
---|
| 58 | + oldfloating = this->IsFloating(); //figure out if the element is floating before starting to change everything
|
---|
| 59 |
|
---|
| 60 | /*go through vertices, and update inputs, considering them to be PentaVertex type: */
|
---|
| 61 | for(i=0;i<NUMVERTICES;i++){
|
---|
| 62 | @@ -11281,7 +11283,7 @@
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 | /*Add basal melting rate if element just ungrounded*/
|
---|
| 66 | - if(!this->IsFloating() && floatingelement==true){
|
---|
| 67 | + if(!oldfloating && floatingelement==true){
|
---|
| 68 | for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts;
|
---|
| 69 | this->inputs->AddInput(new PentaInput(BasalforcingsMeltingRateEnum,&melting[0],P1Enum));
|
---|
| 70 | }
|
---|