Changeset 26661 for issm/trunk-jpl/src


Ignore:
Timestamp:
11/24/21 10:35:23 (3 years ago)
Author:
jdquinn
Message:

CHG: Pending translations; cleanup

Location:
issm/trunk-jpl/src/m
Files:
1 added
11 edited

Legend:

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

    r24305 r26661  
    4242                        if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
    4343
    44                         md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'nan',1,'Inf',1);
    45                         md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'nan',1,'Inf',1);
     44                        md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'NaN',1,'Inf',1);
     45                        md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'NaN',1,'Inf',1);
    4646                        md = checkfield(md,'fieldname','calving.height_above_floatation','<=',0);
    4747                end % }}}
  • issm/trunk-jpl/src/m/classes/calvingvonmises.m

    r24305 r26661  
    4444                        if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
    4545
    46                         md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'nan',1,'Inf',1);
    47                         md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'nan',1,'Inf',1);
     46                        md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'NaN',1,'Inf',1);
     47                        md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'NaN',1,'Inf',1);
    4848                        md = checkfield(md,'fieldname','calving.min_thickness','>=',0,'NaN',1,'Inf',1,'numel',1);
    4949                end % }}}
  • issm/trunk-jpl/src/m/coordsystems/laea.py

    r25065 r26661  
    11def laea(lat, long): #{{{
    2     '''
    3     LAEA - Lambert Azimuthal Equal Area projection at lat, long projection
     2    """LAEA - Lambert Azimuthal Equal Area projection at lat, long projection
    43    center.
    54
     
    109            string = laea(45, -90)
    1110            return string = '+proj=laea +lat_0=45 +lon_0=-90 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs'
    12     '''
     11    """
    1312
    1413    return '+proj=laea +lat_0={} +lon_0={} +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs'.format(lat, long)
  • issm/trunk-jpl/src/m/exp/expwrite.py

    r24213 r26661  
    33
    44def expwrite(contours, filename):
    5     """
    6     EXPWRITE - write an Argus file from a dictionary given in input
     5    """EXPWRITE - write an Argus file from a dictionary given in input
    76
    8        This routine writes an Argus file from a dict containing the fields:
    9        x and y of the coordinates of the points.
    10        The first argument is the list containing the points coordinates
    11        and the second one the file to be written.
     7    This routine writes an Argus file from a dict containing the fields:
     8    x and y of the coordinates of the points.
     9    The first argument is the list containing the points coordinates and the
     10    second one the file to be written.
    1211
    13        Usage:
    14           expwrite(contours, filename)
     12    Usage:
     13        expwrite(contours, filename)
    1514
    16        Example:
    17           expwrite(coordstruct, 'domainoutline.exp')
     15    Example:
     16        expwrite(coordstruct, 'domainoutline.exp')
    1817
    19        See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
     18    See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
    2019    """
    2120
    2221    fid = open(filename, 'w')
    2322    for x, y in zip(contours['x'], contours['y']):
    24         #if np.size(contour['x']) != np.size(contour['y']):
    2523        if len(x) != len(y):
    26             raise RuntimeError("contours x and y coordinates must be of identical size")
     24            raise RuntimeError('contours x and y coordinates must be of identical size')
     25
    2726        if 'name' in contours:
    28             fid.write("%s%s\n" % ('  # Name:', contours['name']))
     27            fid.write('{}{}\n'.format('# Name:', contours['name']))
    2928        else:
    30             fid.write("%s%s\n" % ('  # Name:', filename))
     29            fid.write('{}{}\n'.format('# Name:', filename))
    3130
    3231        #Add density if it's not there FIXME what is this ever used for?
     
    3534        density = 1
    3635
    37         fid.write("%s\n" % '  # Icon:0')
    38         fid.write("%s\n" % '  # Points Count Value')
    39     #fid.write("%i %f\n" % (np.size(contour['x']), contour['density']))
    40         fid.write("%i %f\n" % (np.size(x), density))
    41         fid.write("%s\n" % '  # X pos Y pos')
    42     #for x, y in zip(contour['x'], contour['y']):
     36        fid.write('{}\n'.format('## Icon:0'))
     37        fid.write('{}\n'.format('# Points Count Value')
     38        if 'density' in contours:
     39            if isinstance(contours['density'], int):
     40                fid.write('{} {}\n'.format(np.size(x), density))
     41            else:
     42                fid.write('{} {}\n'.format(np.size(x), 1.))
     43        else:
     44            fid.write('{} {}\n'.format(np.size(x), 1.))
     45        fid.write('{}\n'.format('# X pos Y pos'))
    4346        for xi, yi in zip(x, y):
    44             fid.write("%10.10f %10.10f\n" % (xi, yi))
    45         fid.write("\n")
     47            fid.write('%10.10f %10.10f\n' % (xi, yi))
     48        fid.write('\n')
    4649
    4750    fid.close()
  • issm/trunk-jpl/src/m/modules/ExpToLevelSet.py

    r26375 r26661  
    3030            contourname = shpread(contourname)
    3131
    32     # NOTE: This library does not currently exist! See TODO list in function
     32    # NOTE: This module does not currently exist! See TODO list in function
    3333    #       header.
    3434    distance = ExpToLevelSet_python(x, y, contourname)
  • issm/trunk-jpl/src/m/shp/shp2exp.m

    r26631 r26661  
    11function shp2exp(shpfilename,expfilename)
    2 %SHP2EXP- transform shape file to Argus .exp file
     2%SHP2EXP - transform shape file to Argus .exp file
    33%
    44%   Usage:
  • issm/trunk-jpl/src/m/shp/shp2exp.py

    r24213 r26661  
     1import os
    12import shapefile
    2 import os
    33from expwrite import expwrite
    44
    55
    6 def shp2exp(shapefilename, * expfilename):
    7     '''
    8     Convert a shapefile to an .exp file.  Optionally, expfilename can be
    9     specified to give a name for the .exp file to be created, otherwise the
    10     .exp file will have the same prefix as the .shp file.
     6def shp2exp(shapefilename, *expfilename):
     7    """SHP2EXP - Convert a shapefile to an Argus .exp file. Optionally,
     8    expfilename can be specified to give a name for the .exp file to be
     9    created, otherwise the .exp file will have the same prefix as the .shp
     10    file.
    1111
    1212    Usage:
     
    1515
    1616    Examples:
    17         shp2exp('Domain.shp') % creates Domain.exp
    18         shp2exp('Domain.shp', 'DomainForISSM.exp')
    19     '''
     17        shp2exp('Domain.shp') # Creates Domain.exp
     18        shp2exp('Domain.shp', 'Domain.exp')
     19
     20    See also EXPMASTER, EXPDOC
     21    """
    2022
    2123    if not os.path.exists(shapefilename):
    22         raise IOError("shp2exp error message: file '%s' not found!" % shapefilename)
     24        raise IOError('shp2exp error message: file {} not found!'.format(shapefilename))
    2325    if not len(expfilename):
    2426        expfile = os.path.splitext(shapefilename)[0] + '.exp'
     
    3335    for i in range(len(shp.shapes())):
    3436        geom = shp.shapes()[i].shapeType
    35         if geom == 5:  # polygon
     37        if geom == 5: # polygon
    3638            expdict['closed'] = 1
    3739            tmpx = [p[0] for p in shp.shapes()[i].points]
     
    3941            x.append(tmpx)
    4042            y.append(tmpy)
    41         elif geom == 3:  # line
     43        elif geom == 3: # line
    4244            expdict['closed'] = 0
    4345            tmpx = [p[0] for p in shp.shapes()[i].points]
     
    4547            x.append(tmpx)
    4648            y.append(tmpy)
    47         elif geom == 1:  # point
     49        elif geom == 1: # point
    4850            expdict['closed'] = 0
    4951            x.append(shp.shapes()[i].points[0][0])
  • issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py

    r26358 r26661  
    2222        md = loadresultsfromcluster(md)
    2323        md = loadresultsfromcluster(md, 'runtimename', runtimename)
     24
     25        Options include: 'runtimename', 'nolog'
     26
     27    Example:
     28        md = loadresultsfromcluster(md, 'runtimename', 'test101-06-15-2021-13-24-18-4883')
    2429    """
    2530
  • issm/trunk-jpl/src/m/solvers/asmoptions.m

    r26607 r26661  
    11function asm=asmoptions(varargin)
    2 %ASMOPTIONS - return Additive Schwartz Method petsc options
     2%ASMOPTIONS - return Additive Schwartz Method PETSc options
    33%
    44%   Usage:
  • issm/trunk-jpl/src/m/solvers/asmoptions.py

    r26383 r26661  
    33
    44def asmoptions(*args):
    5     #ASMOPTIONS - return ASM petsc options
    6     #
    7     #   Usage:
    8     #      options = asmoptions
     5    """ASMOPTIONS - Return Additive Schwartz Method PETSc options
    96
    10     #retrieve options provided in *args
     7    Usage:
     8        options = asmoptions
     9    """
     10
     11    # Retrieve options provided in *args
    1112    arguments = pairoptions(*args)
    1213
    13     options = [['toolkit', 'petsc'],
    14                ['mat_type', 'mpiaij'],
    15                ['ksp_type', 'gmres'],
    16                ['pc_type', 'asm'],
    17                ['sub_pc_type', 'lu'],
    18                ['pc_asm_overlap', 3],
    19                ['ksp_max_it', 100],
    20                ['ksp_rtol', 1e-30]]
     14    options = [
     15        ['toolkit', 'petsc'],
     16        ['mat_type', 'mpiaij'],
     17        ['ksp_type', 'gmres'],
     18        ['pc_type', 'asm'],
     19        ['sub_pc_type', 'lu'],
     20        ['pc_asm_overlap', 3],
     21        ['ksp_max_it', 100],
     22        ['ksp_rtol', 1e-30]
     23    ]
    2124
    22     #now, go through our arguments, and write over default options.
     25    # Now, go through our arguments, and write over default options
    2326    for i in range(len(arguments.list)):
    2427        arg1 = arguments.list[i][0]
     
    3336                break
    3437        if not found:
    35             #this option did not exist, add it:
     38            # This option did not exist; add it
    3639            options.append([arg1, arg2])
    3740
  • issm/trunk-jpl/src/m/solvers/asmstokesoptions.m

    r26607 r26661  
    1 function asm=asmoptions(varargin)
    2 %ASMOPTIONS - return Additive Schwartz Method petsc options
     1function asm=asmstokesoptions(varargin)
     2%ASMSTOKESOPTIONS - return Additive Schwartz Method Stokes PETSc options
    33%
    44%   Usage:
    5 %      options=asmoptions;
     5%      options=asmstokesoptions;
    66
    77%retrieve options provided in varargin
Note: See TracChangeset for help on using the changeset viewer.