Changeset 23422


Ignore:
Timestamp:
10/15/18 03:08:36 (7 years ago)
Author:
bdef
Message:

BUG:syntax issue in queue scriptclasses/clusters/stallo.m

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

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/clusters/stallo.m

    r23378 r23422  
    115115                         end
    116116                         fprintf(fid,'#SBATCH --account=%s\n',cluster.accountname);
    117                          fprintf(fid,'#SBATCH --output %s/%s/%s.outlog \n',cluster.executionpath,dirname,modelname);
    118                          fprintf(fid,'#SBATCH --error %s/%s/%s.errlog \n\n',cluster.executionpath,dirname,modelname);
     117                         fprintf(fid,'#SBATCH -output %s.outlog \n',[cluster.executionpath '/' dirname '/' modelname]);
     118                         fprintf(fid,'#SBATCH -error %s.errlog \n\n',[cluster.executionpath '/' dirname '/' modelname]);
    119119
    120120                         fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath);%FIXME
     
    187187                         if ~cluster.interactive,
    188188                                 if ~isempty(restart)
    189                                          launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
     189                                         launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && sbatch ' modelname '.queue '];
    190190                                 else
    191191                                         launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
    192                                                  ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
     192                                                 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && sbatch ' modelname '.queue '];
    193193                                 end
    194194                         else
  • issm/trunk-jpl/src/m/classes/frictionhydro.py

    r21739 r23422  
    88class frictionhydro(object):
    99        """
    10         FRICTIONWEERTMAN class definition
     10        friction hydro is the friction law from Schoof 2005 or Gagliardini2007
    1111
    1212        Usage:
     
    1515        def __init__(self): # {{{
    1616                self.coupling                           = 0
    17                 self.q                                  = float('NaN')
    18                 self.C                                  = float('NaN')
    19                 self.As                                 = float('NaN')
    20                 self.effective_pressure                 = float('NaN')
     17                self.q                                                                  = np.nan
     18                self.C                                                                  = np.nan
     19                self.As                                                                 = np.nan
     20                self.effective_pressure = np.nan
    2121                #set defaults
     22
    2223                self.setdefaultparameters()
    23         #}}}
     24        # }}}
    2425
    25                 #what is this:
    26                 #function self = frictionhydro(varargin) % {{{
    27                 #       switch nargin
    28                 #               case 0
    29                 #                       self=setdefaultparameters(self);
    30                 #               otherwise
    31                 #                       error('constructor not supported');
    32                 #       end
    33                 #end % }}}
    34                
    35         def checkconsistency(self,md,solution,analyses): #{{{
     26        def __repr__(self): # {{{
     27                string='Effective Pressure based friction law described in Gagliardini 2007'
     28                string="%s\n%s"%(string,fielddisplay(self,'coupling','Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure)  and 2 for coupled(not implemented yet)'))
     29                string="%s\n%s"%(string,fielddisplay(self,'q','friction law exponent q>=1'))
     30                string="%s\n%s"%(string,fielddisplay(self,'C','friction law max value (Iken bound)'))
     31                string="%s\n%s"%(string,fielddisplay(self,'As','Sliding Parameter without cavitation [m Pa^-n s^-1]'))
     32                string="%s\n%s"%(string,fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]'))
    3633
    37                 #Early return
    38                 if 'StressbalanceAnalysis' in analyses and 'ThermalAnalysis' in analyses:
    39                         return md
    40                
    41                 md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0,1,2])
    42                 md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements,1])
    43                 md = checkfield(md,'fieldname','friction.C','NaN',1,'Inf',1,'size',[md.mesh.numberofelements,1])
    44                 md = checkfield(md,'fieldname','friction.As','NaN',1,'Inf',1,'size',[md.mesh.numberofelements,1])
    45                 if self.coupling==1:
    46                         md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1)
    47                 elif self.coupling==2:
    48                         raise ValueError('coupling not supported yet')
    49                 elif self.coupling > 2:
    50                         raise ValueError('md.friction.coupling larger than 2, not supported yet')
     34                return string
    5135        # }}}
    5236
     
    6044                        raise ValueError('coupling not supported yet')
    6145                elif self.coupling > 2:
    62                         raise ValueError('md.friction.coupling larger than 2, not supported yet')               
    63                 return self     
    64          # }}}
     46                        raise ValueError('md.friction.coupling larger than 2, not supported yet')
     47                return self
     48        # }}}
    6549
     50        def setdefaultparameters(self): # {{{
    6651
    67         def __repr__(self): # {{{
    68                 string='Effective Pressure based friction law described in Gagliardini 2007'
    69                 string="%s\n%s"%(string,fielddisplay(self,'coupling','Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure)  and 2 for coupled(not implemented yet)'))
    70                 string="%s\n%s"%(string,fielddisplay(self,'q','friction law exponent q>=1'))
    71                 string="%s\n%s"%(string,fielddisplay(self,'C','friction law max value [SI]'))
    72                 string="%s\n%s"%(string,fielddisplay(self,'As','Sliding Parameter without cavitation [m Pa^-n s^-1]'))
    73                 string="%s\n%s"%(string,fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]'))
     52                self.coupling                           = 0
     53                self.effective_pressure = np.nan
    7454
    75                 return string
    76         #}}}
     55                return self
     56        # }}}
    7757
     58        def checkconsistency(self,md,solution,analyses): #{{{
     59
     60                #Early return
     61                if 'StressbalanceAnalysis' in analyses and 'ThermalAnalysis' in analyses:
     62                        return md
     63
     64                md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0,1,2])
     65                md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
     66                md = checkfield(md,'fieldname','friction.C','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
     67                md = checkfield(md,'fieldname','friction.As','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
     68                if self.coupling==1:
     69                        md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1)
     70                elif self.coupling==2:
     71                        raise ValueError('coupling not supported yet')
     72                elif self.coupling > 2:
     73                        raise ValueError('md.friction.coupling larger than 2, not supported yet')
     74        # }}}
    7875
    7976        def marshall(self,prefix,md,fid): #{{{
     
    9087                        raise ValueError('md.friction.coupling larger than 2, not supported yet')
    9188        #}}}
    92 
    93 
Note: See TracChangeset for help on using the changeset viewer.