Changeset 26208 for issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
- Timestamp:
- 04/23/21 15:37:25 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
r26200 r26208 417 417 /*First, recover current time from parameters: */ 418 418 bool linear_interp,cycle; 419 this->parameters->FindParam(&linear_interp,TimesteppingInterpForcingsEnum); 419 IssmDouble dt; 420 this->parameters->FindParam(&linear_interp,TimesteppingInterpForcingEnum); 420 421 this->parameters->FindParam(&cycle,TimesteppingCycleForcingEnum); 422 this->parameters->FindParam(&dt,TimesteppingTimeStepEnum); /*transient core time step*/ 421 423 422 424 /*Change input time if we cycle through the forcing*/ 423 425 IssmDouble time0 = this->timesteps[0]; 424 426 IssmDouble time1 = this->timesteps[this->numtimesteps - 1]; 427 428 /*We need the end time to be the last timestep that would be taken*/ 429 /* i.e., the case where GEMB has time stamps (finer timestep) after the last timestep */ 430 IssmDouble nsteps = reCast<int,IssmDouble>(time1/dt); 431 if (reCast<IssmDouble>(nsteps)<time1/dt) nsteps=nsteps+1; 432 time1 = nsteps*dt; 433 425 434 if(cycle && (time<time0 || time>time1)){ 426 435 … … 433 442 /*Uncomment following line if you would like to apply a cycle BEFORE the time series starts*/ 434 443 //if(time<time0) num_intervals = -num_intervals-1; 435 444 436 445 if(fabs(time-time0)/deltat == reCast<IssmDouble>(num_intervals)){ 437 446 /*Hack to make sure we always cover the last value of the series (discussion with Nicole)*/
Note:
See TracChangeset
for help on using the changeset viewer.