Changeset 19236


Ignore:
Timestamp:
04/01/15 14:31:17 (10 years ago)
Author:
schlegel
Message:

CHG: allow removal of interpolation routine from TransientParam

Location:
issm/trunk-jpl/src/c
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Params/TransientParam.cpp

    r18064 r19236  
    2020}
    2121/*}}}*/
    22 TransientParam::TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,int in_N){/*{{{*/
     22TransientParam::TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_on,int in_N){/*{{{*/
    2323
    2424        _assert_(in_values && in_time);
     
    2626        enum_type=in_enum_type;
    2727        N=in_N;
     28        interpolation=interpolation_on;
    2829
    2930        values=xNew<IssmDouble>(N);
     
    5960}
    6061/*}}}*/
    61 int    TransientParam::Id(void){ return -1; }/*{{{*/
     62int  TransientParam::Id(void){ return -1; }/*{{{*/
    6263/*}}}*/
    63 int TransientParam::ObjectEnum(void){/*{{{*/
     64int  TransientParam::ObjectEnum(void){/*{{{*/
    6465
    6566        return TransientParamEnum;
     
    6970Object* TransientParam::copy() {/*{{{*/
    7071
    71         return new TransientParam(this->enum_type,this->values,this->timesteps,this->N);
     72        return new TransientParam(this->enum_type,this->values,this->timesteps,this->interpolation,this->N);
    7273
    7374}
     
    8788                found=true;
    8889        }
    89         else if(time>this->timesteps[this->N-1]){
     90        else if(time>this->timesteps[this->N-1] || !interpolation){
    9091                /*get values for the last time: */
    9192                output=this->values[this->N-1];
  • issm/trunk-jpl/src/c/classes/Params/TransientParam.h

    r19198 r19236  
    2323                int         enum_type;
    2424                int         N;
     25                bool        interpolation;
    2526                IssmDouble *values;
    2627                IssmDouble *timesteps;
     
    2930                /*TransientParam constructors, destructors: {{{*/
    3031                TransientParam();
    31                 TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,int in_N);
     32                TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_on,int in_N);
    3233                ~TransientParam();
    3334                /*}}}*/
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp

    r19200 r19236  
    2222        char**      requestedoutputs = NULL;
    2323        IssmDouble  time;
    24         bool        isdelta18o,ismungsm,isd18opd;
     24        bool        isdelta18o,ismungsm,isd18opd,interp;
    2525
    2626        /*parameters for mass flux:*/
     
    101101        parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsEnum));
    102102        iomodel->Constant(&smb_model,SurfaceforcingsEnum);
     103        iomodel->Constant(&interp,TimesteppingInterpForcingsEnum);
    103104        switch(smb_model){
    104105                case SMBEnum:
     
    119120                          iomodel->FetchData(&temp,&N,&M,SurfaceforcingsPfacEnum); _assert_(N==2);
    120121                          for(i=0;i<M;i++) temp[M+i]=temp[M+i];
    121                           parameters->AddObject(new TransientParam(SurfaceforcingsPfacEnum,&temp[0],&temp[M],M));
     122                          parameters->AddObject(new TransientParam(SurfaceforcingsPfacEnum,&temp[0],&temp[M],interp,M));
    122123                          iomodel->DeleteData(temp,SurfaceforcingsPfacEnum);
    123124                       
    124125                          iomodel->FetchData(&temp,&N,&M,SurfaceforcingsTdiffEnum); _assert_(N==2);
    125126                          for(i=0;i<M;i++) temp[M+i]=temp[M+i];
    126                           parameters->AddObject(new TransientParam(SurfaceforcingsTdiffEnum,&temp[0],&temp[M],M));
     127                          parameters->AddObject(new TransientParam(SurfaceforcingsTdiffEnum,&temp[0],&temp[M],interp,M));
    127128                          iomodel->DeleteData(temp,SurfaceforcingsTdiffEnum);
    128129
    129130                          iomodel->FetchData(&temp,&N,&M,SurfaceforcingsSealevEnum); _assert_(N==2);
    130131                          for(i=0;i<M;i++) temp[M+i]=temp[M+i];
    131                           parameters->AddObject(new TransientParam(SurfaceforcingsSealevEnum,&temp[0],&temp[M],M));
     132                          parameters->AddObject(new TransientParam(SurfaceforcingsSealevEnum,&temp[0],&temp[M],interp,M));
    132133                          iomodel->DeleteData(temp,SurfaceforcingsSealevEnum);
    133134                        }
     
    137138                                iomodel->FetchData(&temp,&N,&M,SurfaceforcingsDelta18oEnum); _assert_(N==2);
    138139                                for(i=0;i<M;i++) temp[M+i]=yts*temp[M+i];
    139                                 parameters->AddObject(new TransientParam(SurfaceforcingsDelta18oEnum,&temp[0],&temp[M],M));
     140                                parameters->AddObject(new TransientParam(SurfaceforcingsDelta18oEnum,&temp[0],&temp[M],interp,M));
    140141                                iomodel->DeleteData(temp,SurfaceforcingsDelta18oEnum);
    141142
    142143                                iomodel->FetchData(&temp,&N,&M,SurfaceforcingsDelta18oSurfaceEnum); _assert_(N==2);
    143144                                for(i=0;i<M;i++) temp[M+i]=yts*temp[M+i];
    144                                 parameters->AddObject(new TransientParam(SurfaceforcingsDelta18oSurfaceEnum,&temp[0],&temp[M],M));
     145                                parameters->AddObject(new TransientParam(SurfaceforcingsDelta18oSurfaceEnum,&temp[0],&temp[M],interp,M));
    145146                                iomodel->DeleteData(temp,SurfaceforcingsDelta18oSurfaceEnum);
    146147                        }
     
    161162                                iomodel->FetchData(&temp,&N,&M,SurfaceforcingsDelta18oEnum); _assert_(N==2);
    162163                                for(i=0;i<M;i++) temp[M+i]=yts*temp[M+i];
    163                                 parameters->AddObject(new TransientParam(SurfaceforcingsDelta18oEnum,&temp[0],&temp[M],M));
     164                                parameters->AddObject(new TransientParam(SurfaceforcingsDelta18oEnum,&temp[0],&temp[M],interp,M));
    164165                                iomodel->DeleteData(temp,SurfaceforcingsDelta18oEnum);
    165166                               
  • issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp

    r19200 r19236  
    4040                                if(VerboseSolution()) _printf0_("   call Delta18opdParameterization module\n");
    4141                                Delta18opdParameterizationx(femmodel);
    42                         if(VerboseSolution()) _printf0_("   call positive degree day module\n");
    43                         PositiveDegreeDayx(femmodel);
     42                                if(VerboseSolution()) _printf0_("   call positive degree day module\n");
     43                                PositiveDegreeDayx(femmodel);
    4444                        }
    4545                        break;
Note: See TracChangeset for help on using the changeset viewer.