[24684] | 1 | Index: ../trunk-jpl/src/c/cores/smb_core.cpp
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/c/cores/smb_core.cpp (revision 24655)
|
---|
| 4 | +++ ../trunk-jpl/src/c/cores/smb_core.cpp (revision 24656)
|
---|
| 5 | @@ -68,6 +68,7 @@
|
---|
| 6 | femmodel->parameters->SetParam(subdt,TimesteppingTimeStepEnum);
|
---|
| 7 |
|
---|
| 8 | femmodel->InitTransientInputx(&transientinput[0],numaveragedinput);
|
---|
| 9 | + analysis = new SmbAnalysis();
|
---|
| 10 | while(substep<dtslices){ //loop on sub dts
|
---|
| 11 | substep+=1;
|
---|
| 12 | subtime+=subdt;
|
---|
| 13 | @@ -74,13 +75,12 @@
|
---|
| 14 | femmodel->parameters->SetParam(subtime,TimeEnum);
|
---|
| 15 | if(VerboseSolution()) _printf0_("sub iteration " << substep << "/" << dtslices << " time [yr]: " << setprecision(4) << subtime/yts << " (time step: " << subdt/yts << ")\n");
|
---|
| 16 | if(VerboseSolution()) _printf0_(" computing smb\n");
|
---|
| 17 | - analysis = new SmbAnalysis();
|
---|
| 18 | if(VerboseSolution()) _printf0_(" Calling core\n");
|
---|
| 19 | analysis->Core(femmodel);
|
---|
| 20 | /*If we have a sub-timestep we store the substep inputs in a transient input here*/
|
---|
| 21 | femmodel->StackTransientInputx(&substepinput[0],&transientinput[0],subtime,numaveragedinput);
|
---|
| 22 | - delete analysis;
|
---|
| 23 | }
|
---|
| 24 | + delete analysis;
|
---|
| 25 | /*averaging the transient input*/
|
---|
| 26 | femmodel->AverageTransientInputx(&transientinput[0],&averagedinput[0],global_time-dt,subtime,numaveragedinput);
|
---|
| 27 | /*and reset timesteping variables to original*/
|
---|
| 28 | Index: ../trunk-jpl/src/c/classes/FemModel.cpp
|
---|
| 29 | ===================================================================
|
---|
| 30 | --- ../trunk-jpl/src/c/classes/FemModel.cpp (revision 24655)
|
---|
| 31 | +++ ../trunk-jpl/src/c/classes/FemModel.cpp (revision 24656)
|
---|
| 32 | @@ -5259,6 +5259,7 @@
|
---|
| 33 | IssmDouble* values=xNew<IssmDouble>(numvertices);
|
---|
| 34 | int *vertexlids = xNew<int>(numvertices);
|
---|
| 35 | element->GetInputListOnVertices(&values[0],input_enum[i]); //this is the enum to stack
|
---|
| 36 | +
|
---|
| 37 | element->GetVerticesLidList(vertexlids);
|
---|
| 38 |
|
---|
| 39 | switch(element->ObjectEnum()){
|
---|
| 40 | Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
|
---|
| 41 | ===================================================================
|
---|
| 42 | --- ../trunk-jpl/src/c/classes/Elements/Tria.cpp (revision 24655)
|
---|
| 43 | +++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp (revision 24656)
|
---|
| 44 | @@ -2159,9 +2159,11 @@
|
---|
| 45 | }
|
---|
| 46 | if(offset == numtimesteps-1){
|
---|
| 47 | dt = end_time - timesteps[offset];
|
---|
| 48 | + _assert_(dt>0.);
|
---|
| 49 | }
|
---|
| 50 | else{
|
---|
| 51 | - dt = timesteps[offset+1] - timesteps[offset]; _assert_(dt>0.);
|
---|
| 52 | + dt = timesteps[offset+1] - timesteps[offset];
|
---|
| 53 | + _assert_(dt>0.);
|
---|
| 54 | }
|
---|
| 55 | }
|
---|
| 56 |
|
---|
| 57 | Index: ../trunk-jpl/src/c/classes/Inputs2/TransientInput2.cpp
|
---|
| 58 | ===================================================================
|
---|
| 59 | --- ../trunk-jpl/src/c/classes/Inputs2/TransientInput2.cpp (revision 24655)
|
---|
| 60 | +++ ../trunk-jpl/src/c/classes/Inputs2/TransientInput2.cpp (revision 24656)
|
---|
| 61 | @@ -137,9 +137,10 @@
|
---|
| 62 | /*Intermediary*/
|
---|
| 63 | void TransientInput2::AddTriaTimeInput(IssmDouble time,int numindices,int* indices,IssmDouble* values_in,int interp_in){/*{{{*/
|
---|
| 64 |
|
---|
| 65 | +
|
---|
| 66 | /*Check whether this is the last time step that we have*/
|
---|
| 67 | if(this->numtimesteps){
|
---|
| 68 | - if(this->timesteps[this->numtimesteps-1]>time-1.e-5 && this->timesteps[this->numtimesteps-1]<time+1.e-5){
|
---|
| 69 | + if(abs(this->timesteps[this->numtimesteps-1]-time)<1.0e-5){
|
---|
| 70 | this->AddTriaTimeInput(this->numtimesteps-1,numindices,indices,values_in,interp_in);
|
---|
| 71 | return;
|
---|
| 72 | }
|
---|