Ignore:
Timestamp:
06/07/21 11:12:48 (4 years ago)
Author:
dlcheng
Message:

CHG (JS): Large update of JS classes in for solid earth/sea level solver.

File:
1 edited

Legend:

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

    r21065 r26300  
    1212                console.log(sprintf('   surface forcings parameters:'));
    1313                fielddisplay(this,'mass_balance','surface mass balance [m/yr ice eq]');
     14                fielddisplay(this,'steps_per_step', 'number of smb steps per time step');
    1415                fielddisplay(this,'requested_outputs','additional outputs requested');
     16                fielddisplay(this,'averaging','averaging methods from short to long steps');
     17                console.log(sprintf('%51s  0: Arithmetic (default)',' '));
     18                console.log(sprintf('%51s  1: Geometric',' '));
     19                console.log(sprintf('%51s  2: Harmonic',' '));
    1520        } // }}}
    1621        this.defaultoutputs = function(){ // {{{
     
    3338    } // }}}
    3439    this.checkconsistency = function(md,solution,analyses) { //{{{
    35 
     40                if (solution=='TransientSolution' && md.transient.issmb == 0) return;
    3641        if(ArrayAnyEqual(ArrayIsMember('MasstransportAnalysis',analyses),1)){
    3742            checkfield(md,'fieldname','smb.mass_balance','timeseries',1,'NaN',1,'Inf',1);
     
    4045            checkfield(md,'fieldname','smb.mass_balance','size',[md.mesh.numberofvertices,1],'NaN',1,'Inf',1);
    4146        }
    42         checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
    43 
     47                checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
     48                checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
     49                checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0,1,2]);
    4450    } // }}}
    4551    this.marshall=function(md,prefix,fid) { //{{{
     
    4955        WriteData(fid,prefix,'name','md.smb.model','data',1,'format','Integer');
    5056        WriteData(fid,prefix,'object',this,'class','smb','fieldname','mass_balance','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
     57                WriteData(fid,prefix,'object',this,'fieldname','steps_per_step','format','Integer');
     58                WriteData(fid,prefix,'object',this,'fieldname','averaging','format','Integer');
    5159
    5260        //process requested outputs
     
    6674        //properties
    6775    // {{{
    68         this.mass_balance = NaN;
    69         this.requested_outputs      = [];
     76        this.mass_balance          = NaN;
     77        this.requested_outputs = [];
     78        this.steps_per_step    = 1;
     79        this.averaging         = 0;
    7080        this.setdefaultparameters();
    7181    // }}}
Note: See TracChangeset for help on using the changeset viewer.