Changeset 20958


Ignore:
Timestamp:
07/20/16 09:22:55 (9 years ago)
Author:
Mathieu Morlighem
Message:

CHG: do not start from starttime, start from provided time (either from ModelProcessor, which uses starttime, or from restart file)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/cores/transient_core.cpp

    r20955 r20958  
    2020
    2121        /*parameters: */
    22         IssmDouble starttime,finaltime,dt,yts;
     22        IssmDouble finaltime,dt,yts;
    2323        bool       isstressbalance,ismasstransport,issmb,isFS,isthermal,isgroundingline,isgia,isslr,iscoupler,ismovingfront,isdamageevolution,ishydrology;
    2424        bool       save_results,dakota_analysis;
     
    3535        IssmDouble time;
    3636
    37         //then recover parameters common to all solutions
     37        /*first, figure out if there was a check point, if so, do a reset of the FemModel* femmodel structure. */
     38        if(recording_frequency) femmodel->Restart();
     39
     40        /*then recover parameters common to all solutions*/
    3841        femmodel->parameters->FindParam(&domaintype,DomainTypeEnum);
    3942        femmodel->parameters->FindParam(&step,StepEnum);
    40         femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
     43        femmodel->parameters->FindParam(&time,TimeEnum);
    4144        femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
    4245        femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
     
    6164        femmodel->parameters->FindParam(&numoutputs,TransientNumRequestedOutputsEnum);
    6265        if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,TransientRequestedOutputsEnum);
    63 
    64         /*first, figure out if there was a check point, if so, do a reset of the FemModel* femmodel structure. */
    65         if(recording_frequency)femmodel->Restart();
    66 
    67         /*initialize: */
    68         time=starttime;
    6966
    7067        while(time < finaltime - (yts*DBL_EPSILON)){ //make sure we run up to finaltime.
     
    158155                }
    159156
    160                 if(recording_frequency&& step%recording_frequency==0){
     157                if(recording_frequency && (step%recording_frequency==0)){
    161158                        if(VerboseSolution()) _printf0_("   checkpointing model \n");
    162159                        femmodel->CheckPoint();
Note: See TracChangeset for help on using the changeset viewer.