Changeset 24521


Ignore:
Timestamp:
01/14/20 20:09:11 (5 years ago)
Author:
jdquinn
Message:

CHG: Modification to short-circuit

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

Legend:

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

    r22955 r24521  
    77        //methods
    88                this.setdefaultparameters = function (){ //{{{
    9                
     9
    1010                //Convergence criterion: absolute, relative and residual
    11                 this.reltol=0.01; // 1 per cent 
     11                this.reltol=0.01; // 1 per cent
    1212                this.abstol=NaN;  //default
    1313
     
    1515                this.maxiter=5;
    1616
    17                 //computational flags: 
     17                //computational flags:
    1818                this.rigid=1;
    1919                this.elastic=1;
    2020                this.rotation=0;
    2121                this.ocean_area_scaling=0;
    22                
    23                 //tidal love numbers: 
     22
     23                //tidal love numbers:
    2424                this.tide_love_h=0.6149; //degree 2
    2525                this.tide_love_k=0.3055; //degree 2
    26        
    27                 //secular fluid love number: 
    28                 this.fluid_love=0.942; 
    29                
    30                 //moment of inertia: 
    31                 this.equatorial_moi=8.0077*10^37; // [kg m^2] 
    32                 this.polar_moi           =8.0345*10^37; // [kg m^2] 
     26
     27                //secular fluid love number:
     28                this.fluid_love=0.942;
     29
     30                //moment of inertia:
     31                this.equatorial_moi=8.0077*10^37; // [kg m^2]
     32                this.polar_moi           =8.0345*10^37; // [kg m^2]
    3333
    3434                // mean rotational velocity of earth:
    35                 this.angular_velocity=7.2921*10^-5; // [s^-1] 
     35                this.angular_velocity=7.2921*10^-5; // [s^-1]
    3636
    3737                //numerical discretization accuracy
    3838                this.degacc=.01;
    39                
    40                 //steric: 
     39
     40                //steric:
    4141                this.steric_rate=0;
    42                
    43                
     42
     43
    4444                //output default:
    4545                this.requested_outputs=['default'];
    4646
    47                 //transitions should be a cell array of vectors: 
     47                //transitions should be a cell array of vectors:
    4848                this.transitions=[];
    49                
     49
    5050                }// }}}
    5151                this.checkconsistency = function(md,solution,analyses) { //{{{
    5252
    5353                        //Early return
    54                         if(ArrayAnyEqual(ArrayIsMember('SealevelriseAnalysis',analyses),0))return;
    55                        
     54                        if (ArrayAnyEqual(ArrayIsMember('SealevelriseAnalysis',analyses),0) || ArrayAnyEqual(ArrayIsMember('TransientSolution',analyses),0) && !md.transient.isslr) {
     55                                return;
     56                        }
     57
    5658                        md = checkfield(md,'fieldname','slr.deltathickness','NaN',1,'Inf',1,'size',[md.mesh.numberofelements, 1]);
    5759                        md = checkfield(md,'fieldname','slr.sealevel','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
     
    7173                        md = checkfield(md,'fieldname','slr.degacc','size',[1, 1],'>=',1e-10);
    7274                        md = checkfield(md,'fieldname','slr.requested_outputs','stringrow',1);
    73                        
    74                         //check that love numbers are provided at the same level of accuracy: 
     75
     76                        //check that love numbers are provided at the same level of accuracy:
    7577                        if (this.love_h.length != this.love_k.length || this.love_h.length != this.love_l.length){
    7678                                throw Error('slr error message: love numbers should be provided at the same level of accuracy');
     
    8587                }// }}}
    8688                this.disp= function(){// {{{
    87                        
     89
    8890                        console.log(sprintf('   Sealevelrise solution parameters:'));
    8991
     
    9597                fielddisplay(this,'love_h','load Love number for radial displacement');
    9698                fielddisplay(this,'love_k','load Love number for gravitational potential perturbation');
    97                 fielddisplay(this,'love_l','load Love number for horizontal displacements'); 
     99                fielddisplay(this,'love_l','load Love number for horizontal displacements');
    98100                fielddisplay(this,'tide_love_h','tidal love number (degree 2)');
    99101                fielddisplay(this,'tide_love_k','tidal love number (degree 2)');
     
    101103                fielddisplay(this,'equatorial_moi','mean equatorial moment of inertia [kg m^2]');
    102104                fielddisplay(this,'polar_moi','polar moment of inertia [kg m^2]');
    103                 fielddisplay(this,'angular_velocity','mean rotational velocity of earth [per second]'); 
     105                fielddisplay(this,'angular_velocity','mean rotational velocity of earth [per second]');
    104106                fielddisplay(this,'rigid','rigid earth graviational potential perturbation');
    105107                fielddisplay(this,'elastic','elastic earth graviational potential perturbation');
    106108                fielddisplay(this,'rotation','rotational earth potential perturbation');
    107                 fielddisplay(this,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]'); 
     109                fielddisplay(this,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]');
    108110                fielddisplay(this,'degacc',"accuracy (default .01 deg) for numerical discretization of the Green's functions");
    109111                fielddisplay(this,'transitions','indices into parts of the mesh that will be icecaps');
    110112                fielddisplay(this,'requested_outputs','additional outputs requested');
    111                 fielddisplay(this,'steric_rate','rate of steric ocean expansion [mm/yr]'); 
     113                fielddisplay(this,'steric_rate','rate of steric ocean expansion [mm/yr]');
    112114                } //}}}
    113115                this.marshall=function(md,prefix,fid) { //{{{
     
    171173        //{{{
    172174        this.deltathickness = NaN;
    173         this.sealevel       = NaN; 
     175        this.sealevel       = NaN;
    174176        this.maxiter        = 0;
    175177        this.reltol         = 0;
     
    178180        this.love_k         = 0; //idam
    179181        this.love_l         = 0; //idam
    180         this.tide_love_h    = 0; 
    181         this.tide_love_k    = 0; 
    182         this.fluid_love   = 0; 
    183         this.equatorial_moi     = 0; 
    184         this.polar_moi                  = 0; 
    185         this.angular_velocity = 0; 
     182        this.tide_love_h    = 0;
     183        this.tide_love_k    = 0;
     184        this.fluid_love   = 0;
     185        this.equatorial_moi     = 0;
     186        this.polar_moi                  = 0;
     187        this.angular_velocity = 0;
    186188        this.rigid          = 0;
    187189        this.elastic        = 0;
    188190        this.rotation       = 0;
    189191        this.ocean_area_scaling = 0;
    190         this.steric_rate    = 0; //rate of ocean expansion from steric effects. 
     192        this.steric_rate    = 0; //rate of ocean expansion from steric effects.
    191193        this.degacc         = 0;
    192194        this.requested_outputs = [];
  • issm/trunk-jpl/src/m/classes/slr.py

    r24519 r24521  
    127127    def checkconsistency(self, md, solution, analyses):  # {{{
    128128        #Early return
    129         if (solution != 'SealevelriseAnalysis') (solution == 'TransientSolution' and not md.transient.isslr:
     129        if (solution != 'SealevelriseAnalysis') or (solution == 'TransientSolution' and not md.transient.isslr:
    130130            return md
    131131
Note: See TracChangeset for help on using the changeset viewer.