source:
issm/oecreview/Archive/25834-26739/ISSM-26196-26197.diff
Last change on this file was 26740, checked in by , 3 years ago | |
---|---|
File size: 1.4 KB |
-
../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
419 419 this->parameters->FindParam(&linear_interp,TimesteppingInterpForcingsEnum); 420 420 this->parameters->FindParam(&cycle,TimesteppingCycleForcingEnum); 421 421 422 if(cycle) _error_("not implemented yet"); 422 /*Change input time if we cycle through the forcing*/ 423 IssmDouble time0 = this->timesteps[0]; 424 IssmDouble time1 = this->timesteps[this->numtimesteps - 1]; 425 if(cycle && (time<time0 || time>time1)){ 423 426 427 /*See by how many intervals we have to offset time*/ 428 IssmDouble deltat = time1-time0; 429 430 //int num_intervals = floor((time-time0)/deltat); //Cannot do that because of AD! 431 int num_intervals = reCast<int,IssmDouble>(fabs(time-time0)/deltat); 432 if(time<time0) num_intervals = -num_intervals-1; 433 434 /*Now offset time so that we do the right interpolation below*/ 435 time = time - num_intervals*deltat; 436 } 437 424 438 /*Figure step out*/ 425 439 int offset; 426 440 if(!binary_search(&offset,time,this->timesteps,this->numtimesteps)){ … … 479 493 this->current_input->Scale(alpha1); 480 494 this->current_input->AXPY(input2,alpha2); 481 495 } 482 483 496 }/*}}}*/ 484 497 void TransientInput::SetAverageAsCurrentTimeInput(IssmDouble start_time,IssmDouble end_time, int averaging_method){/*{{{*/ 485 498
Note:
See TracBrowser
for help on using the repository browser.