Ignore:
Timestamp:
08/01/22 06:36:56 (3 years ago)
Author:
bdef
Message:

CHG: minor formating

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/test/NightlyRun/test2004.py

    r26840 r27167  
    22#
    33# TODO:
    4 # - Save boundaries by name to some data structure with tag so that they can be 
    5 #   copied to basins that use identical shapefiles and projections (will need 
    6 #   to check if the cost of the additional structure, checks, and copying are 
     4# - Save boundaries by name to some data structure with tag so that they can be
     5#   copied to basins that use identical shapefiles and projections (will need
     6#   to check if the cost of the additional structure, checks, and copying are
    77#   greater than the cost of projecting).
    88#
     
    4141#HemisphereWest #{{{
    4242sl.addbasin(
    43     basin('continent', 'hemispherewest', 'name', 'hemispherewest', 'proj', laea(0, -90), 'boundaries', [ # Peru projection 3587
     43    basin('continent', 'hemispherewest', 'name', 'hemispherewest', 'proj', laea(0, -90), 'boundaries', [  # Peru projection 3587
    4444        boundary('shppath', shppath, 'shpfilename', 'HemisphereSplit', 'proj', proj4326, 'orientation', 'reverse'),
    4545        boundary('shppath', shppath, 'shpfilename', 'NorthAntarctica', 'proj', proj3031),
     
    4949        boundary('shppath', shppath, 'shpfilename', 'RonneWestSummit', 'proj', proj3031),
    5050        boundary('shppath', shppath, 'shpfilename', 'WestAntarctica2', 'proj', proj3031, 'orientation', 'reverse'),
    51         boundary('shppath', shppath, 'shpfilename', 'SouthAntarctica', 'proj', proj3031)
    52         ]
     51        boundary('shppath', shppath, 'shpfilename', 'SouthAntarctica', 'proj', proj3031)]
    5352    )
    5453)
     
    5958        boundary('shppath', shppath, 'shpfilename', 'SouthAntarctica', 'proj', proj3031),
    6059        boundary('shppath', shppath, 'shpfilename', 'RossIceShelf', 'proj', proj3031),
    61         boundary('shppath', shppath, 'shpfilename', 'RossWestFront','proj', proj3031),
    62         boundary('shppath', shppath, 'shpfilename', 'RossFront', 'proj', proj3031, 'orientation', 'reverse')
    63         ]
     60        boundary('shppath', shppath, 'shpfilename', 'RossWestFront', 'proj', proj3031),
     61        boundary('shppath', shppath, 'shpfilename', 'RossFront', 'proj', proj3031, 'orientation', 'reverse')]
    6462    )
    6563)
     
    6765#HemisphereEast: {{{
    6866sl.addbasin(
    69     basin('continent', 'hemisphereeast', 'name', 'hemisphereeast', 'proj', laea(0, +90), 'boundaries', [ #Australian projection lat, long
     67    basin('continent', 'hemisphereeast', 'name', 'hemisphereeast', 'proj', laea(0, +90), 'boundaries', [  #Australian projection lat, long
    7068        boundary('shppath', shppath, 'shpfilename', 'HemisphereSplit', 'proj', proj4326),
    7169        boundary('shppath', shppath, 'shpfilename', 'SouthAntarctica', 'proj', proj3031),
    72         boundary('shppath', shppath, 'shpfilename','RossFront', 'proj', proj3031),
     70        boundary('shppath', shppath, 'shpfilename', 'RossFront', 'proj', proj3031),
    7371        boundary('shppath', shppath, 'shpfilename', 'RossWestFront', 'proj', proj3031),
    74         boundary('shppath', shppath, 'shpfilename', 'EastAntarctica2', 'proj', proj3031,'orientation', 'reverse'),
    75         boundary('shppath', shppath, 'shpfilename', 'NorthAntarctica', 'proj', proj3031)
    76         ]
     72        boundary('shppath', shppath, 'shpfilename', 'EastAntarctica2', 'proj', proj3031, 'orientation', 'reverse'),
     73        boundary('shppath', shppath, 'shpfilename', 'NorthAntarctica', 'proj', proj3031)]
    7774    )
    7875)
     
    9087        boundary('shppath', shppath, 'shpfilename', 'RonneIceShelf', 'proj', proj3031),
    9188        boundary('shppath', shppath, 'shpfilename', 'RonneEastSummit', 'proj', proj3031),
    92         boundary('shppath', shppath, 'shpfilename', 'RonneBrunt', 'proj', proj3031)
    93         ]
     89        boundary('shppath', shppath, 'shpfilename', 'RonneBrunt', 'proj', proj3031)]
    9490    )
    9591)
     
    10197        boundary('shppath', shppath, 'shpfilename', 'RonneIceShelf', 'proj', proj3031),
    10298        boundary('shppath', shppath, 'shpfilename', 'RonneEastSummit', 'proj', proj3031),
    103         boundary('shppath', shppath, 'shpfilename', 'RonneFront', 'proj', proj3031, 'orientation', 'reverse')
    104         ]
     99        boundary('shppath', shppath, 'shpfilename', 'RonneFront', 'proj', proj3031, 'orientation', 'reverse')]
    105100    )
    106101)
     
    114109hmin = hmin * 1000
    115110hmax = hmax * 1000
    116 tolerance = 100 # tolerance of 100m on Earth position when merging 3d meshes
     111tolerance = 100  # tolerance of 100m on Earth position when merging 3d meshes
    117112threshold = 5
    118 defaultoptions = [
    119     'KeepVertices', 0,
    120     'MaxCornerAngle', 0.0000000001,
    121     'NoBoundaryRefinement', 1
    122 ]
     113defaultoptions = ['KeepVertices', 0,
     114                  'MaxCornerAngle', 0.0000000001,
     115                  'NoBoundaryRefinement', 1]
    123116alreadyloaded = 0
    124117#}}}
     
    134127
    135128    # Mesh
    136     md = bamg(model(), 'domain', domain, 'subdomains', coastline, 'hmin', hmin, 'hmax', hmax, *defaultoptions) # NOTE: Unpacking defaultoptions with '*'
     129    md = bamg(model(), 'domain', domain, 'subdomains', coastline, 'hmin', hmin, 'hmax', hmax, *defaultoptions)  # NOTE: Unpacking defaultoptions with '*'
    137130
    138131    # Miscellaneous
     
    254247    landelsconocean = landels[np.nonzero(sumconnectedisonocean)[0]]
    255248
    256     ind1 = np.hstack((
    257         md.mesh.elements[landelsconocean, 0],
    258         md.mesh.elements[landelsconocean, 1],
    259         md.mesh.elements[landelsconocean, 2]
    260     ))
    261     ind2 = np.hstack((
    262         md.mesh.elements[landelsconocean, 1],
    263         md.mesh.elements[landelsconocean, 2],
    264         md.mesh.elements[landelsconocean, 0]
    265     ))
     249    ind1 = np.hstack((md.mesh.elements[landelsconocean, 0],
     250                      md.mesh.elements[landelsconocean, 1],
     251                      md.mesh.elements[landelsconocean, 2]))
     252    ind2 = np.hstack((md.mesh.elements[landelsconocean, 1],
     253                      md.mesh.elements[landelsconocean, 2],
     254                      md.mesh.elements[landelsconocean, 0]))
    266255
    267256    # Edge ind1 and ind2
     
    325314        delHGLA = InterpFromMeshToMesh2d(index, longGLA, latGLA, delHGLA, longe, late)
    326315
    327         # NOTE: For some reason, cannot apply pos to multiple arrays in a 
    328         #       singlelike we might do in MATLAB. Instead, we iterate over 
     316        # NOTE: For some reason, cannot apply pos to multiple arrays in a
     317        #       singlelike we might do in MATLAB. Instead, we iterate over
    329318        #       elements of pos.
    330319        #
     
    461450md.solidearth.settings.rotation = 0
    462451md.solidearth.settings.viscous = 0
    463 md.solidearth.requested_outputs = [
    464     'default',
    465     'DeltaIceThickness',
    466     'Sealevel',
    467     'Bed',
    468     'SealevelBarystaticIceMask',
    469     'SealevelBarystaticOceanMask',
    470 ]
     452md.solidearth.requested_outputs = ['default',
     453                                   'DeltaIceThickness',
     454                                   'Sealevel',
     455                                   'Bed',
     456                                   'SealevelBarystaticIceMask',
     457                                   'SealevelBarystaticOceanMask']
    471458md = solve(md, 'Transient')
    472459Seustatic = md.results.TransientSolution.Sealevel
Note: See TracChangeset for help on using the changeset viewer.