Ignore:
Timestamp:
04/23/21 15:37:25 (4 years ago)
Author:
schlegel
Message:

CHG: clean up GEMB, change interp_forcings to interp_forcing, isclimatology is now cycle_forcing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp

    r26200 r26208  
    417417        /*First, recover current time from parameters: */
    418418        bool linear_interp,cycle;
    419         this->parameters->FindParam(&linear_interp,TimesteppingInterpForcingsEnum);
     419        IssmDouble dt;
     420        this->parameters->FindParam(&linear_interp,TimesteppingInterpForcingEnum);
    420421        this->parameters->FindParam(&cycle,TimesteppingCycleForcingEnum);
     422        this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);          /*transient core time step*/
    421423
    422424        /*Change input time if we cycle through the forcing*/
    423425        IssmDouble time0 = this->timesteps[0];
    424426        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
    425434        if(cycle && (time<time0 || time>time1)){
    426435
     
    433442                /*Uncomment following line if you would like to apply a cycle BEFORE the time series starts*/
    434443                //if(time<time0) num_intervals = -num_intervals-1;
    435                
     444
    436445                if(fabs(time-time0)/deltat == reCast<IssmDouble>(num_intervals)){
    437446                        /*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.