@@ -36,7 +36,10 @@ TransientInput::TransientInput(int in_enum_type,int nbe,int nbv,IssmDouble* time
3636 /* Allocate values and timesteps, and copy: */
3737 _assert_ (N>=0 && N<1e6 );
3838 this ->numtimesteps = N;
39- for (int i=0 ;i<N;i++) this ->timesteps .push_back (timesin[i]);
39+ for (int i=0 ;i<N;i++){
40+ this ->timesteps .push_back (timesin[i]);
41+ this ->inputs .push_back (NULL );
42+ }
4043 this ->parameters = NULL ;
4144 this ->current_input =NULL ;
4245 this ->current_step =-1 ;
@@ -234,6 +237,8 @@ void TransientInput::AddPentaTimeInput(IssmDouble time,int numindices,int* indic
234237void TransientInput::AddTriaTimeInput (int step,int numindices,int * indices,IssmDouble* values_in,int interp_in){/* {{{*/
235238
236239 _assert_ (step>=0 && step<this ->numtimesteps );
240+ _assert_ (this ->timesteps .size ()==this ->numtimesteps );
241+ _assert_ (this ->inputs .size ()==this ->numtimesteps );
237242
238243 /* Create it if necessary*/
239244 if (this ->inputs [step]){
@@ -382,6 +387,9 @@ PentaInput* TransientInput::GetPentaInput(IssmDouble start_time, IssmDouble end_
382387
383388void TransientInput::SetCurrentTimeInput (IssmDouble time){/* {{{*/
384389
390+ _assert_ (this ->timesteps .size ()==this ->numtimesteps );
391+ _assert_ (this ->inputs .size ()==this ->numtimesteps );
392+
385393 /* First, recover current time from parameters: */
386394 bool linear_interp,average,cycle;
387395 int timestepping;
0 commit comments