Changeset 22459


Ignore:
Timestamp:
02/23/18 14:10:41 (7 years ago)
Author:
seroussi
Message:

ADD: adding coupling_time for ice/ocean coupling

Location:
issm/trunk-jpl/src/m/classes
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/timestepping.js

    r21787 r22459  
    2525                fielddisplay(this,'time_step','length of time steps [' +unit+ ']');
    2626                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+ ']');
    2728
    2829        }// }}}
     
    3738                checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>=',0,'NaN',1,'Inf',1);
    3839                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);
    3941                if (this.final_time-this.start_time<0){
    4042                        md.checkmessage('timestepping.final_time should be larger than timestepping.start_time');
     
    5153                WriteData(fid,prefix,'object',this,'fieldname','time_step','format','Double','scale',scale);
    5254                WriteData(fid,prefix,'object',this,'fieldname','interp_forcings','format','Boolean');
     55                WriteData(fid,prefix,'object',this,'fieldname','coupling_time','format','Double','scale',scale);
    5356
    5457        }//}}}
     
    6164        this.time_step       = 0.;
    6265        this.interp_forcings = 1;
     66        this.coupling_time   = 0.;
    6367
    6468        this.setdefaultparameters();
  • issm/trunk-jpl/src/m/classes/timestepping.m

    r22040 r22459  
    1010                time_step       = 0.;
    1111                interp_forcings = 1;
     12                coupling_time   = 0.;
    1213        end
    1314        methods
     
    4445                        if strcmp(solution,'TransientSolution'),
    4546                                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);
    4648                        end
    4749                end % }}}
     
    5456                        fielddisplay(self,'time_step',['length of time steps [' unit ']']);
    5557                        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 ']']);
    5659
    5760                end % }}}
     
    6467                        WriteData(fid,prefix,'object',self,'fieldname','time_step','format','Double','scale',scale);
    6568                        WriteData(fid,prefix,'object',self,'fieldname','interp_forcings','format','Boolean');
     69                        WriteData(fid,prefix,'object',self,'fieldname','coupling_time','format','Double','scale',scale);
    6670                end % }}}
    6771                function savemodeljs(self,fid,modelname) % {{{
  • issm/trunk-jpl/src/m/classes/timestepping.py

    r21787 r22459  
    1616                self.time_step       = 0.
    1717                self.interp_forcings = 1
     18                self.coupling_time   = 0.
    1819               
    1920                #set defaults
     
    2728                string="%s\n%s"%(string,fielddisplay(self,"time_step","length of time steps [yr]"))
    2829                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]"))
    2931                return string
    3032                #}}}
     
    4951                if self.final_time-self.start_time<0:
    5052                        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)
    5154                md = checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0,1])
    5255
     
    6164                WriteData(fid,prefix,'object',self,'fieldname','time_step','format','Double','scale',yts)
    6265                WriteData(fid,prefix,'object',self,'fieldname','interp_forcings','format','Boolean')
     66                WriteData(fid,prefix,'object',self,'fieldname','coupling_time','format','Double','scale',yts)
    6367        # }}}
  • issm/trunk-jpl/src/m/classes/timesteppingadaptive.js

    r21787 r22459  
    3131                fielddisplay(this,'cfl_coefficient','coefficient applied to cfl condition');
    3232                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+ ']');
    3334
    3435        }// }}}
     
    4849                        md.checkmessage('timestepping.final_time should be larger than timestepping.start_time');
    4950                }
     51                checkfield(md,'fieldname','timestepping.coupling_time','numel',[1],'>=',0,'NaN',1,'Inf',1);
    5052        } // }}}
    5153        this.marshall=function(md,prefix,fid) { //{{{
     
    6163                WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','cfl_coefficient','format','Double');
    6264                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);
    6366
    6467        }//}}}
     
    7376        this.cfl_coefficient = 0.;
    7477        this.interp_forcings = 1;
     78        this.coupling_time   = 0.;
    7579
    7680        this.setdefaultparameters();
  • issm/trunk-jpl/src/m/classes/timesteppingadaptive.m

    r21787 r22459  
    1212                cfl_coefficient = 0.;
    1313                interp_forcings = 1;
     14                coupling_time   = 0.;
    1415        end
    1516        methods
     
    4748                        md = checkfield(md,'fieldname','timestepping.cfl_coefficient','numel',[1],'>',0,'<=',1);
    4849                        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);
    4951                        if self.final_time-self.start_time<0,
    5052                                md = checkmessage(md,'timestepping.final_time should be larger than timestepping.start_time');
     
    6163                        fielddisplay(self,'cfl_coefficient','coefficient applied to cfl condition');
    6264                        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 ']']);
    6366
    6467                end % }}}
     
    7376                        WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','cfl_coefficient','format','Double');
    7477                        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);
    7579                end % }}}
    7680                function savemodeljs(self,fid,modelname) % {{{
     
    8286                        writejsdouble(fid,[modelname '.timesteppingadaptive.cfl_coefficient'],self.cfl_coefficient);
    8387                        writejsdouble(fid,[modelname '.timesteppingadaptive.interp_forcings'],self.interp_forcings);
     88                        writejsdouble(fid,[modelname '.timesteppingadaptive.coupling_time'],self.time_step_max);
    8489
    8590                end % }}}
  • issm/trunk-jpl/src/m/classes/timesteppingadaptive.py

    r21787 r22459  
    1919                        self.cfl_coefficient = 0.
    2020                        self.interp_forcings = 1
     21                        self.coupling_time   = 0.
    2122                       
    2223                        #set defaults
     
    4243                string="%s\n%s"%(string,fielddisplay(self,"cfl_coefficient","coefficient applied to cfl condition"))
    4344                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]"))
    4446                return string
    4547                #}}}
     
    7173                        md.checkmessage("timestepping.final_time should be larger than timestepping.start_time")
    7274                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)
    7376
    7477                return md
     
    8487                WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','cfl_coefficient','format','Double')
    8588                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)
    8690        # }}}
Note: See TracChangeset for help on using the changeset viewer.