Changeset 22459
- Timestamp:
- 02/23/18 14:10:41 (7 years ago)
- Location:
- issm/trunk-jpl/src/m/classes
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/timestepping.js
r21787 r22459 25 25 fielddisplay(this,'time_step','length of time steps [' +unit+ ']'); 26 26 fielddisplay(this,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)'); 27 fielddisplay(this,'coupling_time','length of coupling time steps with ocean model [' +unit+ ']'); 27 28 28 29 }// }}} … … 37 38 checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>=',0,'NaN',1,'Inf',1); 38 39 checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0,1]); 40 checkfield(md,'fieldname','timestepping.coupling_time','numel',[1],'>=',0,'NaN',1,'Inf',1); 39 41 if (this.final_time-this.start_time<0){ 40 42 md.checkmessage('timestepping.final_time should be larger than timestepping.start_time'); … … 51 53 WriteData(fid,prefix,'object',this,'fieldname','time_step','format','Double','scale',scale); 52 54 WriteData(fid,prefix,'object',this,'fieldname','interp_forcings','format','Boolean'); 55 WriteData(fid,prefix,'object',this,'fieldname','coupling_time','format','Double','scale',scale); 53 56 54 57 }//}}} … … 61 64 this.time_step = 0.; 62 65 this.interp_forcings = 1; 66 this.coupling_time = 0.; 63 67 64 68 this.setdefaultparameters(); -
issm/trunk-jpl/src/m/classes/timestepping.m
r22040 r22459 10 10 time_step = 0.; 11 11 interp_forcings = 1; 12 coupling_time = 0.; 12 13 end 13 14 methods … … 44 45 if strcmp(solution,'TransientSolution'), 45 46 md = checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>',0,'NaN',1,'Inf',1); 47 md = checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>=',0,'NaN',1,'Inf',1); 46 48 end 47 49 end % }}} … … 54 56 fielddisplay(self,'time_step',['length of time steps [' unit ']']); 55 57 fielddisplay(self,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)'); 58 fielddisplay(self,'coupling_time',['length of coupling time step with ocean model [' unit ']']); 56 59 57 60 end % }}} … … 64 67 WriteData(fid,prefix,'object',self,'fieldname','time_step','format','Double','scale',scale); 65 68 WriteData(fid,prefix,'object',self,'fieldname','interp_forcings','format','Boolean'); 69 WriteData(fid,prefix,'object',self,'fieldname','coupling_time','format','Double','scale',scale); 66 70 end % }}} 67 71 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/timestepping.py
r21787 r22459 16 16 self.time_step = 0. 17 17 self.interp_forcings = 1 18 self.coupling_time = 0. 18 19 19 20 #set defaults … … 27 28 string="%s\n%s"%(string,fielddisplay(self,"time_step","length of time steps [yr]")) 28 29 string="%s\n%s"%(string,fielddisplay(self,"interp_forcings","interpolate in time between requested forcing values ? (0 or 1)")) 30 string="%s\n%s"%(string,fielddisplay(self,"coupling_time","length of coupling time steps with ocean model [yr]")) 29 31 return string 30 32 #}}} … … 49 51 if self.final_time-self.start_time<0: 50 52 md.checkmessage("timestepping.final_time should be larger than timestepping.start_time") 53 md = checkfield(md,'fieldname','timestepping.coupling_time','numel',[1],'>=',0,'NaN',1,'Inf',1) 51 54 md = checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0,1]) 52 55 … … 61 64 WriteData(fid,prefix,'object',self,'fieldname','time_step','format','Double','scale',yts) 62 65 WriteData(fid,prefix,'object',self,'fieldname','interp_forcings','format','Boolean') 66 WriteData(fid,prefix,'object',self,'fieldname','coupling_time','format','Double','scale',yts) 63 67 # }}} -
issm/trunk-jpl/src/m/classes/timesteppingadaptive.js
r21787 r22459 31 31 fielddisplay(this,'cfl_coefficient','coefficient applied to cfl condition'); 32 32 fielddisplay(this,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)'); 33 fielddisplay(this,'coupling_time','coupling time steps with ocean model [' +unit+ ']'); 33 34 34 35 }// }}} … … 48 49 md.checkmessage('timestepping.final_time should be larger than timestepping.start_time'); 49 50 } 51 checkfield(md,'fieldname','timestepping.coupling_time','numel',[1],'>=',0,'NaN',1,'Inf',1); 50 52 } // }}} 51 53 this.marshall=function(md,prefix,fid) { //{{{ … … 61 63 WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','cfl_coefficient','format','Double'); 62 64 WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','interp_forcings','format','Boolean'); 65 WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','coupling_time','format','Double','scale',scale); 63 66 64 67 }//}}} … … 73 76 this.cfl_coefficient = 0.; 74 77 this.interp_forcings = 1; 78 this.coupling_time = 0.; 75 79 76 80 this.setdefaultparameters(); -
issm/trunk-jpl/src/m/classes/timesteppingadaptive.m
r21787 r22459 12 12 cfl_coefficient = 0.; 13 13 interp_forcings = 1; 14 coupling_time = 0.; 14 15 end 15 16 methods … … 47 48 md = checkfield(md,'fieldname','timestepping.cfl_coefficient','numel',[1],'>',0,'<=',1); 48 49 md = checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0 1]); 50 md = checkfield(md,'fieldname','timestepping.coupling_time','numel',[1],'>=',md.timestepping.coupling_time,'NaN',1,'Inf',1); 49 51 if self.final_time-self.start_time<0, 50 52 md = checkmessage(md,'timestepping.final_time should be larger than timestepping.start_time'); … … 61 63 fielddisplay(self,'cfl_coefficient','coefficient applied to cfl condition'); 62 64 fielddisplay(self,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)'); 65 fielddisplay(self,'coupling_time',['coupling time step with ocean model [' unit ']']); 63 66 64 67 end % }}} … … 73 76 WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','cfl_coefficient','format','Double'); 74 77 WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','interp_forcings','format','Boolean'); 78 WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','coupling_time','format','Double','scale',scale); 75 79 end % }}} 76 80 function savemodeljs(self,fid,modelname) % {{{ … … 82 86 writejsdouble(fid,[modelname '.timesteppingadaptive.cfl_coefficient'],self.cfl_coefficient); 83 87 writejsdouble(fid,[modelname '.timesteppingadaptive.interp_forcings'],self.interp_forcings); 88 writejsdouble(fid,[modelname '.timesteppingadaptive.coupling_time'],self.time_step_max); 84 89 85 90 end % }}} -
issm/trunk-jpl/src/m/classes/timesteppingadaptive.py
r21787 r22459 19 19 self.cfl_coefficient = 0. 20 20 self.interp_forcings = 1 21 self.coupling_time = 0. 21 22 22 23 #set defaults … … 42 43 string="%s\n%s"%(string,fielddisplay(self,"cfl_coefficient","coefficient applied to cfl condition")) 43 44 string="%s\n%s"%(string,fielddisplay(self,"interp_forcings","interpolate in time between requested forcing values ? (0 or 1)")) 45 string="%s\n%s"%(string,fielddisplay(self,"coupling_time","coupling time steps with ocean model [yr]")) 44 46 return string 45 47 #}}} … … 71 73 md.checkmessage("timestepping.final_time should be larger than timestepping.start_time") 72 74 md = checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0,1]) 75 md = checkfield(md,'fieldname','timestepping.coupling_time','numel',[1],'>=',0,'NaN',1,'Inf',1) 73 76 74 77 return md … … 84 87 WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','cfl_coefficient','format','Double') 85 88 WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','interp_forcings','format','Boolean') 89 WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','coupling_time','format','Double','scale',yts) 86 90 # }}}
Note:
See TracChangeset
for help on using the changeset viewer.