Changeset 27430


Ignore:
Timestamp:
11/27/22 15:42:45 (2 years ago)
Author:
jdquinn
Message:

CHG: Missing translations to initialization.py; cleanup

Location:
issm/trunk-jpl
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk-jpl/etc/environment.sh

    r27336 r27430  
    675675fi
    676676
    677 VALGRIND_ROOT="${ISSM_EXT_DIR}/valgrind/install"
    678 path_prepend "${VALGRIND_ROOT}/bin"
     677VALGRIND_ROOT="${ISSM_DIR}/externalpackages/valgrind/install"
     678if [ -d "${VALGRIND_ROOT="${ISSM_DIR}/valgrind/install"
     679}" ]; then
     680        path_prepend "${VALGRIND_ROOT}/bin"
     681fi
    679682
    680683DOXYGEN_ROOT="${ISSM_EXT_DIR}/doxygen/install"
  • TabularUnified issm/trunk-jpl/src/m/classes/SMBpddSicopolis.m

    r27407 r27430  
    7272                        self.desfac        = -log(2.0)/1000;
    7373                        self.rlaps         = 7.4;
    74          self.requested_outputs={'default'};
     74                        self.requested_outputs={'default'};
    7575
    7676                end % }}}
  • TabularUnified issm/trunk-jpl/src/m/classes/initialization.m

    r27297 r27430  
    2525                str                 = NaN;
    2626                sample              = NaN;
    27                 debris              = NaN;
     27                debris              = NaN;
    2828        end
    2929        methods
     
    157157                        yts=md.constants.yts;
    158158
    159                         WriteData(fid,prefix,'object',self,'fieldname','vx','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
    160                         WriteData(fid,prefix,'object',self,'fieldname','vy','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
     159                        WriteData(fid,prefix,'object',self,'fieldname','vx','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
     160                        WriteData(fid,prefix,'object',self,'fieldname','vy','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
    161161                        WriteData(fid,prefix,'object',self,'fieldname','vz','format','DoubleMat','mattype',1,'scale',1./yts);
    162162                        WriteData(fid,prefix,'object',self,'fieldname','pressure','format','DoubleMat','mattype',1);
    163                         WriteData(fid,prefix,'object',self,'fieldname','sealevel','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
     163                        WriteData(fid,prefix,'object',self,'fieldname','sealevel','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
    164164                        WriteData(fid,prefix,'object',self,'fieldname','bottompressure','format','DoubleMat','mattype',1);
    165165                        WriteData(fid,prefix,'object',self,'fieldname','str','format','DoubleMat','mattype',1);
  • TabularUnified issm/trunk-jpl/src/m/classes/initialization.py

    r27175 r27430  
    3434        self.str = np.nan
    3535        self.sample = np.nan
     36        self.debris = np.nan
    3637
    3738        self.setdefaultparameters()
     
    5556        s += '{}\n'.format(fielddisplay(self, 'channelarea', 'subglaciale water channel area (for GlaDS) [m2]'))
    5657        s += '{}\n'.format(fielddisplay(self, 'sample', 'Realization of a Gaussian random field'))
     58        s += '{}\n'.format(fielddisplay(self, 'debris', 'Surface debris layer [m]'))
    5759        return s
    5860    #}}}
     
    6567        if 'StressbalanceAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.isstressbalance:
    6668            if not np.any(np.logical_or(np.isnan(md.initialization.vx), np.isnan(md.initialization.vy))):
    67                 md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
    68                 md = checkfield(md, 'fieldname', 'initialization.vy', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
     69                if np.size(md.initialization.vx) > 1 or np.size(md.initialization.vy) > 1:
     70                    md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
     71                    md = checkfield(md, 'fieldname', 'initialization.vy', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
    6972        if 'MasstransportAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.ismasstransport:
    7073            md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
     
    7982            md = checkfield(md, 'fieldname', 'initialization.vy', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
    8083            # Triangle with zero velocity
    81             if np.any(np.logical_and(np.sum(np.abs(md.initialization.vx[md.mesh.elements - 1]), axis=1) == 0,
    82                                      np.sum(np.abs(md.initialization.vy[md.mesh.elements - 1]), axis=1) == 0)):
    83                 md.checkmessage("at least one triangle has all its vertices with a zero velocity")
     84            if np.any(np.logical_and(np.sum(np.abs(md.initialization.vx[md.mesh.elements - 1]), axis=1) == 0, np.sum(np.abs(md.initialization.vy[md.mesh.elements - 1]), axis=1) == 0, np.min(md.mask.ice_levelset(md.mesh.elements), [], 2) < 0)):
     85                md.checkmessage('at least one triangle has all its vertices with a zero velocity')
    8486        if 'ThermalAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.isthermal:
    8587            md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
     
    99101                if (solution == 'TransientSolution' and md.transient.ishydrology) or solution == 'HydrologySolution':
    100102                    md = checkfield(md, 'fieldname', 'initialization.watercolumn', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
    101         if 'HydrologyDCAnalysis' in analyses:
    102             if type(md.hydrology).__name__ == 'hydrologydc':
    103                 if (solution == 'TransientSolution' and md.transient.ishydrology) or solution == 'HydrologySolution':
    104                     md = checkfield(md, 'fieldname', 'initialization.sediment_head', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
    105103        if 'HydrologyTwsAnalysis' in analyses:
    106104            if type(md.hydrology).__name__ == 'hydrologytws':
     
    114112                md = checkfield(md, 'fieldname', 'initialization.hydraulic_potential', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
    115113                md = checkfield(md, 'fieldname', 'initialization.channelarea', 'NaN', 1, 'Inf', 1, '>=', 0, 'size', [md.mesh.numberofelements])
     114        if 'HydrologyDCInefficientAnalysis' in analyses:
     115            if type(md.hydrology).__name__ == 'hydrologydc':
     116                md = checkfield(md, 'fieldname', 'initialization.sediment_head', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
     117        if 'HydrologyDCEfficientAnalysis' in analyses:
     118            if type(md.hydrology).__name__ == 'hydrologydc':
     119                if md.hydrology.isefficientlayer:
     120                    md = checkfield(md, 'fieldname', 'initialization.epl_head', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
     121                    md = checkfield(md, 'fieldname', 'initialization.epl_thickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
    116122        if 'SamplingAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.issampling:
    117123            if np.any(np.isnan(md.initialization.sample)):
    118124                md = checkfield(md, 'fieldname', 'initialization.sample', 'NaN', 1,'Inf', 1, 'size', [md.mesh.numberofvertices])
     125        if 'DebrisAnalysis' in analyses:
     126            if not np.isnan(md.initialization.debris):
     127                if (solution == 'TransientSolution' and md.transient.ishydrology) or solution == 'HydrologySolution':
     128                    md = checkfield(md, 'fieldname', 'initialization.debris', 'NaN', 1,'Inf', 1, 'size', [md.mesh.numberofvertices])
    119129        return md
    120130    #}}}
     
    123133        yts = md.constants.yts
    124134
    125         WriteData(fid, prefix, 'object', self, 'fieldname', 'vx', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts)
    126         WriteData(fid, prefix, 'object', self, 'fieldname', 'vy', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts)
     135        WriteData(fid, prefix, 'object', self, 'fieldname', 'vx', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
     136        WriteData(fid, prefix, 'object', self, 'fieldname', 'vy', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
    127137        WriteData(fid, prefix, 'object', self, 'fieldname', 'vz', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts)
    128138        WriteData(fid, prefix, 'object', self, 'fieldname', 'pressure', 'format', 'DoubleMat', 'mattype', 1)
     
    140150        WriteData(fid, prefix, 'object', self, 'fieldname', 'hydraulic_potential', 'format', 'DoubleMat', 'mattype', 1)
    141151        WriteData(fid, prefix, 'object', self, 'fieldname', 'sample', 'format', 'DoubleMat', 'mattype', 1)
     152        WriteData(fid, prefix, 'object', self, 'fieldname', 'debris', 'format', 'DoubleMat', 'mattype', 1)
    142153
    143154        if md.thermal.isenthalpy:
     
    168179        self.dsl = project3d(md, 'vector', self.dsl, 'type', 'node', 'layer', 1)
    169180        self.str = project3d(md, 'vector', self.str, 'type', 'node', 'layer', 1)
     181        self.debris = project3d(md, 'vector', self.debris, 'type', 'node', 'layer', 1)
    170182
    171183        # Lithostatic pressure by default
  • TabularUnified issm/trunk-jpl/src/m/classes/model.m

    r27417 r27430  
    543543                        end
    544544
    545                         %Initialize the 2d mesh
     545                        %Initialize 2d mesh
    546546                        mesh=mesh2d();
    547547                        mesh.x=md.mesh.x2d;
     
    721721                        end
    722722
    723                         %Initial 2d mesh 
     723                        %Initial 2d mesh
    724724                        if isa(md1.mesh,'mesh3dprisms'),
    725725                                flag_elem_2d=flag_elem(1:md1.mesh.numberofelements2d);
     
    10911091                        end
    10921092
    1093                         %Initialize with the 2d mesh
     1093                        %Initialize with 2d mesh
    10941094                        mesh2d = md.mesh;
    10951095                        md.mesh=mesh3dprisms();
  • TabularUnified issm/trunk-jpl/src/m/classes/model.py

    r27417 r27430  
    633633            raise TypeError('Cannot extrude a 3d mesh (extrude cannot be called more than once)')
    634634
    635         #Initialize with the 2d mesh
     635        #Initialize with 2d mesh
    636636        mesh2d = md.mesh
    637637        md.mesh = mesh3dprisms()
     
    853853        if not np.isnan(md.initialization.watercolumn).all():
    854854            md.initialization.watercolumn = project2d(md, md.initialization.watercolumn, 1)
     855        if not np.isnan(md.initialization.debris).all():
     856            md.initialization.debris = project2d(md, md.initialization.debris, 1)
    855857
    856858        # elementstype
     
    960962                                    setattr(fieldr, solutionsubfield, project2d(md, subfield, 1))
    961963
    962         # Initialize he 2d mesh
     964        # Initialize 2d mesh
    963965        mesh = mesh2d()
    964966        mesh.x = md.mesh.x2d
Note: See TracChangeset for help on using the changeset viewer.