Changeset 19857
- Timestamp:
- 12/04/15 14:27:30 (9 years ago)
- Location:
- issm/trunk-jpl/src/m/classes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/timestepping.js
r19791 r19857 19 19 //should we interpolate forcings between timesteps? 20 20 this.interp_forcings=1; 21 22 //In years by default23 this.in_years = 1;24 25 21 }// }}} 26 22 this.disp= function(){// {{{ 27 23 console.log(sprintf(' timestepping parameters:')); 28 24 29 if(this.in_years) unit = 'yr'; 30 else unit = 's'; 25 unit = 'yr'; 31 26 fielddisplay(this,'start_time','simulation starting time ['+ unit + ']'); 32 27 fielddisplay(this,'final_time','final time to stop the simulation ['+ unit + ']'); … … 35 30 fielddisplay(this,'cfl_coefficient','coefficient applied to cfl condition'); 36 31 fielddisplay(this,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)'); 37 fielddisplay(this,'in_years','time unit, 1: years, 0: seconds');38 39 32 40 33 }// }}} … … 58 51 59 52 var scale; 60 if (this.in_years) scale = 365.0*24.0*3600.0; 61 else scale = 1.; 53 scale = 365.0*24.0*3600.0; 62 54 63 55 WriteData(fid,'object',this,'fieldname','start_time','format','Double','scale',scale); … … 77 69 this.cfl_coefficient = 0.; 78 70 this.interp_forcings = 1; 79 this.in_years = 1;80 71 81 72 this.setdefaultparameters(); -
issm/trunk-jpl/src/m/classes/timestepping.m
r19040 r19857 12 12 cfl_coefficient = 0.; 13 13 interp_forcings = 1; 14 in_years = 1;15 14 end 16 15 methods … … 51 50 %should we interpolate forcings between timesteps? 52 51 self.interp_forcings=1; 53 54 %In years by default55 self.in_years = 1;56 52 end % }}} 57 53 function md = checkconsistency(self,md,solution,analyses) % {{{ … … 70 66 disp(sprintf(' timestepping parameters:')); 71 67 72 if(self.in_years) 73 unit = 'yr'; 74 else 75 unit = 's'; 76 end 68 unit = 'yr'; 77 69 fielddisplay(self,'start_time',['simulation starting time [' unit ']']); 78 70 fielddisplay(self,'final_time',['final time to stop the simulation [' unit ']']); … … 81 73 fielddisplay(self,'cfl_coefficient','coefficient applied to cfl condition'); 82 74 fielddisplay(self,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)'); 83 fielddisplay(self,'in_years','time unit, 1: years, 0: seconds');84 75 85 76 end % }}} 86 77 function marshall(self,md,fid) % {{{ 87 78 88 if self.in_years, 89 scale = 365.0*24.0*3600.0; 90 else 91 scale = 1.; 92 end 79 scale = 365.0*24.0*3600.0; 93 80 WriteData(fid,'object',self,'fieldname','start_time','format','Double','scale',scale); 94 81 WriteData(fid,'object',self,'fieldname','final_time','format','Double','scale',scale);
Note:
See TracChangeset
for help on using the changeset viewer.