Changeset 19236
- Timestamp:
- 04/01/15 14:31:17 (10 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Params/TransientParam.cpp
r18064 r19236 20 20 } 21 21 /*}}}*/ 22 TransientParam::TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time, int in_N){/*{{{*/22 TransientParam::TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_on,int in_N){/*{{{*/ 23 23 24 24 _assert_(in_values && in_time); … … 26 26 enum_type=in_enum_type; 27 27 N=in_N; 28 interpolation=interpolation_on; 28 29 29 30 values=xNew<IssmDouble>(N); … … 59 60 } 60 61 /*}}}*/ 61 int 62 int TransientParam::Id(void){ return -1; }/*{{{*/ 62 63 /*}}}*/ 63 int TransientParam::ObjectEnum(void){/*{{{*/64 int TransientParam::ObjectEnum(void){/*{{{*/ 64 65 65 66 return TransientParamEnum; … … 69 70 Object* TransientParam::copy() {/*{{{*/ 70 71 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); 72 73 73 74 } … … 87 88 found=true; 88 89 } 89 else if(time>this->timesteps[this->N-1] ){90 else if(time>this->timesteps[this->N-1] || !interpolation){ 90 91 /*get values for the last time: */ 91 92 output=this->values[this->N-1]; -
issm/trunk-jpl/src/c/classes/Params/TransientParam.h
r19198 r19236 23 23 int enum_type; 24 24 int N; 25 bool interpolation; 25 26 IssmDouble *values; 26 27 IssmDouble *timesteps; … … 29 30 /*TransientParam constructors, destructors: {{{*/ 30 31 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); 32 33 ~TransientParam(); 33 34 /*}}}*/ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
r19200 r19236 22 22 char** requestedoutputs = NULL; 23 23 IssmDouble time; 24 bool isdelta18o,ismungsm,isd18opd ;24 bool isdelta18o,ismungsm,isd18opd,interp; 25 25 26 26 /*parameters for mass flux:*/ … … 101 101 parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsEnum)); 102 102 iomodel->Constant(&smb_model,SurfaceforcingsEnum); 103 iomodel->Constant(&interp,TimesteppingInterpForcingsEnum); 103 104 switch(smb_model){ 104 105 case SMBEnum: … … 119 120 iomodel->FetchData(&temp,&N,&M,SurfaceforcingsPfacEnum); _assert_(N==2); 120 121 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)); 122 123 iomodel->DeleteData(temp,SurfaceforcingsPfacEnum); 123 124 124 125 iomodel->FetchData(&temp,&N,&M,SurfaceforcingsTdiffEnum); _assert_(N==2); 125 126 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)); 127 128 iomodel->DeleteData(temp,SurfaceforcingsTdiffEnum); 128 129 129 130 iomodel->FetchData(&temp,&N,&M,SurfaceforcingsSealevEnum); _assert_(N==2); 130 131 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)); 132 133 iomodel->DeleteData(temp,SurfaceforcingsSealevEnum); 133 134 } … … 137 138 iomodel->FetchData(&temp,&N,&M,SurfaceforcingsDelta18oEnum); _assert_(N==2); 138 139 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)); 140 141 iomodel->DeleteData(temp,SurfaceforcingsDelta18oEnum); 141 142 142 143 iomodel->FetchData(&temp,&N,&M,SurfaceforcingsDelta18oSurfaceEnum); _assert_(N==2); 143 144 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)); 145 146 iomodel->DeleteData(temp,SurfaceforcingsDelta18oSurfaceEnum); 146 147 } … … 161 162 iomodel->FetchData(&temp,&N,&M,SurfaceforcingsDelta18oEnum); _assert_(N==2); 162 163 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)); 164 165 iomodel->DeleteData(temp,SurfaceforcingsDelta18oEnum); 165 166 -
issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
r19200 r19236 40 40 if(VerboseSolution()) _printf0_(" call Delta18opdParameterization module\n"); 41 41 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); 44 44 } 45 45 break;
Note:
See TracChangeset
for help on using the changeset viewer.