Changeset 24214


Ignore:
Timestamp:
10/11/19 00:27:00 (5 years ago)
Author:
bdef
Message:

CHG: syntax cahnge to meet most of Pep8 requirement

Location:
issm/trunk-jpl/test
Files:
163 edited

Legend:

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

    r23793 r24214  
    1 #! /usr/bin/env python
     1#! / usr / bin / env python
    22from IdToName import *
    33from IdFromString import *
     
    99     GetIds - output ids from a given array of IDs and test names
    1010
    11               the test names can be any string or sub-string present
     11              the test names can be any string or sub - string present
    1212              in the test's name (first line of corresponding file)
    1313
     
    1818             ids = GetIds('Dakota')
    1919             ids = GetIds([101, 102...])
    20              ids = GetIds([\'Dakota\',\'Slr\'...])
    21              ids = GetIds([[101, 102...],[\'Dakota\',\'Slr\'...]])
     20             ids = GetIds([\'Dakota\', \'Slr\'...])
     21             ids = GetIds([[101, 102...], [\'Dakota\', \'Slr\'...]])
    2222    """
    2323
     
    3030            # fail silently
    3131            return []
    32         #raise RuntimeError('runme.py: GetIds.py: No tests with names matching "'+ids_names+'" were found. Note that name checking is case sensitive. Test names are in the first line of a given test eg: "Square" would include test101.py: "SquareShelfConstrainedStressSSA2d"')
     32        #raise RuntimeError('runme.py: GetIds.py: No tests with names matching "' + ids_names + '" were found. Note that name checking is case sensitive. Test names are in the first line of a given test eg: "Square" would include test101.py: "SquareShelfConstrainedStressSSA2d"')
    3333
    3434    if type(ids_names) == int:
     
    3737            # fail silently
    3838            return []
    39         #raise RuntimeError('runme.py: GetIds.py: No tests with ids matching "'+ids_names+'" were found. Check that there is a test file named "test'+str(ids_names)+'.py"')
     39        #raise RuntimeError('runme.py: GetIds.py: No tests with ids matching "' + ids_names + '" were found. Check that there is a test file named "test' + str(ids_names) + '.py"')
    4040
    41     # many inputs of either ids or test names
     41        # many inputs of either ids or test names
    4242    if type(ids_names) == list and len(ids_names) > 0:
    4343        # is everything a string or int?
     
    4949                raise RuntimeError('runme.py: GetIds.py: No tests with names matching "' + ids_names + '" were found. Note that name checking is case sensitive.')
    5050
    51     # many inputs of both ids and test names
    52     # ids_names[0] -> ids_names by id
    53     # ids_names[1] -> ids_names by test name
     51            # many inputs of both ids and test names
     52            # ids_names[0] - > ids_names by id
     53            # ids_names[1] - > ids_names by test name
    5454    if type(ids_names) == list and len(ids_names) == 2:
    5555        if type(ids_names[0]) == list and len(ids_names[0]) > 0 and type(ids_names[0][0]) == int:
     
    6060                raise RuntimeError('runme.py: GetIds.py: No tests with names matching "' + ids_names + '" were found. Note that name checking is case sensitive.')
    6161
    62     # no recognizable ids or id formats
     62            # no recognizable ids or id formats
    6363    if np.size(ids) == 0 and not np.all(np.equal(ids_names, None)):
    64         raise RuntimeError('runme.py: GetIds.py: include and exclude options (-i/--id; -in/--include_name; -e/--exclude; -en/--exclude_name) options must follow GetIds usage format:\n' + GetIds.__doc__)
     64        raise RuntimeError('runme.py: GetIds.py: include and exclude options (- i / - -    id; - in / - -    include_name; - e / - -    exclude; - en / - -    exclude_name) options must follow GetIds usage format:\n' + GetIds.__doc__)
    6565
    6666    return np.array(ids).astype(int)
  • issm/trunk-jpl/test/NightlyRun/IdFromString.py

    r23793 r24214  
    1 #! /usr/bin/env python
     1#! / usr / bin / env python
    22from IdToName import IdToName
    33import os
     
    1414            ids = IdFromString('Parallel')
    1515            ids = IdFromString('79North')
    16             ids = IdFromString('*')
     16            ids = IdFromString(' * ')
    1717    """
    1818
    19     #Check input
     19#Check input
    2020    if not isinstance(string, str):
    2121        raise TypeError('IdFromString error message: input argument is not a string.')
     
    2323    string = string.replace('"', '')
    2424
    25     #Get the test ids and names and scan for matches
     25#Get the test ids and names and scan for matches
    2626
    2727    ids = []
     
    3030        if f.endswith('.py') and f.startswith('test'):
    3131            # all tests look like: "testwxyz.py" so 5th to 3rd to last is always the full id
    32             s = int(f[4:-3])
     32            s = int(f[4: - 3])
    3333            name = IdToName(s)
    34             if (string == '*') or (name is not None and string in name):
     34            if (string == ' * ') or (name is not None and string in name):
    3535                ids.append(s)
    3636                idnames.append(name)
    3737
    38     #Return if no test found
     38#Return if no test found
    3939    if not ids:
    4040        print("No test matches '%s'." % string)
    4141        return ids
    4242
    43     #Display names
     43#Display names
    4444    if verbose:
    4545        idnames = [i for _, i in sorted(zip(ids, idnames), key=lambda pair: pair[0])]
  • issm/trunk-jpl/test/NightlyRun/IdToName.py

    r23793 r24214  
    1 #! /usr/bin/env python
     1#! / usr / bin / env python
    22
    33
    44def IdToName(test_id):
    55    """
    6         IDTONAME- return name of test
     6        IDTONAME - return name of test
    77
    88            Usage:
     
    1212    file_text = infile.readline()
    1313
    14     string = '#Test Name:'
    15     name = file_text[len(string) + 1:-1]
     14    string = '  #Test Name:'
     15    name = file_text[len(string) + 1: - 1]
    1616    return name
  • issm/trunk-jpl/test/NightlyRun/runme.py

    r23833 r24214  
    1 #!/usr/bin/env python
     1#! / usr / bin / env python
    22import os
    33import argparse
     
    1818
    1919def runme(id=None, exclude=None, benchmark='nightly', procedure='check', output='none', rank=1, numprocs=1):
    20 
    2120    """
    2221    RUNME - test deck for ISSM nightly runs
    2322
    24         In a test deck directory (tests/Vertification/NightlyRun for example)
     23        In a test deck directory (tests / Vertification / NightlyRun for example)
    2524        The following command will launch all the existing tests:
    26         >> runme()
     25    >>    runme()
    2726        To run the tests 101 and 102:
    28         >> runme(id = [101, 102])
     27    >>    runme(id = [101, 102])
    2928        etc...
    3029
     
    3736
    3837            'benchmark'     'all' (all of the tests)
    39                             'nightly' (nightly run/ daily run)
    40                             'ismip'  : validation of ismip-hom tests
     38                            'nightly' (nightly run / daily run)
     39                            'ismip'  : validation of ismip - hom tests
    4140                            'eismint': validation of eismint tests
    4241                            'thermal': validation of thermal tests
     
    5655            runme('SquareShelf')
    5756            runme(exclude = 2001)
    58             runme(exclude='Dakota', benchmark='all')
    59             runme(id = [[101, 102],['Dakota', 'Slr']])
     57            runme(exclude = 'Dakota', benchmark = 'all')
     58            runme(id = [[101, 102], ['Dakota', 'Slr']])
    6059        """
    6160    #Get ISSM_DIR variable
     
    6968        print(("runme warning: benchmark '{}' not supported, defaulting to test 'nightly'.".format(benchmark)))
    7069        benchmark = 'nightly'
    71     # }}}
    72     #GET procedure {{{
     70        # }}}
     71        #GET procedure {{{
    7372    if procedure not in ['check', 'update']:
    7473        print(("runme warning: procedure '{}' not supported, defaulting to test 'check'.".format(procedure)))
    7574        procedure = 'check'
    76     # }}}
    77     #GET output {{{
     75        # }}}
     76        #GET output {{{
    7877    if output not in ['nightly', 'none']:
    7978        print(("runme warning: output '{}' not supported, defaulting to test 'none'.".format(output)))
    8079        output = 'none'
    81     # }}}
    82     #GET RANK and NUMPROCS for multithreaded runs {{{
     80        # }}}
     81        #GET RANK and NUMPROCS for multithreaded runs {{{
    8382    if (numprocs < rank):
    8483        numprocs = 1
    85     # }}}
    86     #GET ids  {{{
    87     flist = glob('test*.py')    #File name must start with 'test' and must end by '.py' and must be different than 'test.py'
    88     list_ids = [int(file[4:-3]) for file in flist if not file == 'test.py']    #Keep test id only (skip 'test' and '.py')
    89 
    90     i1, i2 = parallelrange(rank, numprocs, len(list_ids))    #Get tests for this cpu only
     84        # }}}
     85        #GET ids  {{{
     86    flist = glob('test*.py')  #File name must start with 'test' and must end by '.py' and must be different than 'test.py'
     87    list_ids = [int(file[4: -3]) for file in flist if not file == 'test.py']  #Keep test id only (skip 'test' and '.py')
     88
     89    i1, i2 = parallelrange(rank, numprocs, len(list_ids))  #Get tests for this cpu only
    9190    list_ids = list_ids[i1:i2 + 1]
    92 
    9391    if np.size(id) > 0 and id is not None:
    9492        test_ids = set(GetIds(id)).intersection(set(list_ids))
     
    10199    #GET exclude {{{
    102100    exclude_ids = GetIds(exclude)
    103 
    104101    test_ids = test_ids.difference(exclude_ids)
    105102    # }}}
     
    131128    #Loop over tests and launch sequence
    132129    root = os.getcwd()
     130    errorcount = 0
     131    erroredtest_list = []
    133132    for id in test_ids:
    134         print(("----------------starting:{}-----------------------".format(id)))
     133        print(("----------------starting:{}----------------------- ".format(id)))
    135134        try:
    136135            #Execute test
     
    154153                        elif len(field.shape) == 0:
    155154                            field = field.reshape(1, 1)
    156                         # Matlab uses base 1, so use base 1 in labels
     155                            # Matlab uses base 1, so use base 1 in labels
    157156                        archwrite(archive_file, archive_name + '_field' + str(k + 1), field)
    158157                    print(("File {} saved. \n".format(os.path.join('..', 'Archives', archive_name + '.arch'))))
    159158
    160             #ELSE: CHECK TEST
     159                    #ELSE: CHECK TEST
    161160            else:
    162161                #load archive
     
    192191                            error_diff = error_diff[0]
    193192
    194                         #disp test result
     193                            #disp test result
    195194                        if (np.any(error_diff > tolerance) or np.isnan(error_diff)):
    196195                            print(('ERROR   difference: {} > {} test id: {} test name: {} field: {}'.format(error_diff, tolerance, id, id_string, fieldname)))
     196                            errorcount += 1
     197                            np.append(erroredtest_list, id)
    197198                        else:
    198199                            print(('SUCCESS difference: {} < {} test id: {} test name: {} field: {}'.format(error_diff, tolerance, id, id_string, fieldname)))
     
    204205                            fid = open(os.path.join(ISSM_DIR, 'nightlylog', 'pythonerror.log'), 'a')
    205206                            fid.write('%s' % message)
    206                             fid.write('\n------------------------------------------------------------------\n')
     207                            fid.write('\n------------------------------------------------------------------    \n')
    207208                            fid.close()
    208                             print(('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id, id_string, fieldname)))
     209                            print(('FAILURE difference: N / A test id: {} test name: {} field: {}'.format(id, id_string, fieldname)))
    209210                        else:
    210                             print(('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id, id_string, fieldname)))
     211                            print(('FAILURE difference: N / A test id: {} test name: {} field: {}'.format(id, id_string, fieldname)))
    211212                            raise RuntimeError(message)
    212213
     
    217218                fid = open(os.path.join(ISSM_DIR, 'nightlylog', 'pythonerror.log'), 'a')
    218219                fid.write('%s' % message)
    219                 fid.write('\n------------------------------------------------------------------\n')
     220                fid.write('\n------------------------------------------------------------------    \n')
    220221                fid.close()
    221                 print(('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id, id_string, 'N/A')))
     222                print(('FAILURE difference: N / A test id: {} test name: {} field: {}'.format(id, id_string, 'N/A')))
    222223            else:
    223                 print(('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id, id_string, 'N/A')))
     224                print(('FAILURE difference: N / A test id: {} test name: {} field: {}'.format(id, id_string, 'N/A')))
    224225                raise RuntimeError(message)
    225226
    226         print(("----------------finished:{}-----------------------".format(id)))
     227        print(("----------------    finished:{}----------------------- ".format(id)))
     228
     229    if errorcount > 0:
     230        print("{} errors were detected in test {}".format(errorcount, erroredtest_list))
    227231    return
    228232
     
    231235    if 'PYTHONSTARTUP' in os.environ:
    232236        PYTHONSTARTUP = os.environ['PYTHONSTARTUP']
    233         #print 'PYTHONSTARTUP =', PYTHONSTARTUP
     237#print 'PYTHONSTARTUP = ', PYTHONSTARTUP
    234238        if os.path.exists(PYTHONSTARTUP):
    235239            try:
     
    241245
    242246        parser = argparse.ArgumentParser(description='RUNME - test deck for ISSM nightly runs')
    243         parser.add_argument('-i', '--id', nargs='*', type=int, help='followed by the list of ids requested', default=[])
    244         parser.add_argument('-in', '--include_name', nargs='*', type=str, help='followed by the list of test names requested', default=[])
    245         parser.add_argument('-e', '--exclude', nargs='+', type=int, help='ids to be excluded from the test', default=[])
    246         parser.add_argument('-en', '--exclude_name', nargs='+', type=str, help='test names to be excluded from the test', default=[])
    247         parser.add_argument('-b', '--benchmark', help='nightly/ismip/eismint/thermal/mesh/...', default='nightly')
    248         parser.add_argument('-p', '--procedure', help='check/update', default='check')
    249         parser.add_argument('-o', '--output', help='nightly/daily/none', default='none')
    250         parser.add_argument('-r', '--rank', type=int, help='rank', default=1)
    251         parser.add_argument('-n', '--numprocs', type=int, help='numprocs', default=1)
     247        parser.add_argument(' -i', '--id', nargs=' * ', type=int, help='followed by the list of ids requested', default=[])
     248        parser.add_argument(' -in', '--include_name', nargs=' * ', type=str, help='followed by the list of test names requested', default=[])
     249        parser.add_argument(' -e', '--exclude', nargs=' + ', type=int, help='ids to be excluded from the test', default=[])
     250        parser.add_argument(' -en', '--exclude_name', nargs=' + ', type=str, help='test names to be excluded from the test', default=[])
     251        parser.add_argument(' -b', '--benchmark', help='nightly/ismip/eismint/thermal/mesh/...', default='nightly')
     252        parser.add_argument(' -p', '--procedure', help='check/update', default='check')
     253        parser.add_argument(' -o', '--output', help='nightly/daily/none', default='none')
     254        parser.add_argument(' -r', '--rank', type=int, help='rank', default=1)
     255        parser.add_argument(' -n', '--numprocs', type=int, help='numprocs', default=1)
    252256        args = parser.parse_args()
    253257
  • issm/trunk-jpl/test/NightlyRun/test1101.py

    r23793 r24214  
    1010
    1111"""
    12 This test is a test from the ISMP-HOM Intercomparison project.
     12This test is a test from the ISMP - HOM Intercomparison project.
    1313Pattyn and Payne 2006
    1414"""
     
    2222
    2323for L in L_list:
    24     nx = 20    #numberof nodes in x direction
     24    nx = 20  #numberof nodes in x direction
    2525    ny = 20
    2626    md = model()
    2727    md = squaremesh(md, L, L, nx, ny)
    28     md = setmask(md, '', '')    #ice sheet test
     28    md = setmask(md, '', '')  #ice sheet test
    2929    md = parameterize(md, '../Par/ISMIPA.py')
    3030    md.extrude(9, 1.)
     
    3232    md = setflowequation(md, 'HO', 'all')
    3333
    34     #Create dirichlet on the bed only
     34#Create dirichlet on the bed only
    3535    md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
    3636    md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
     
    4141    md.stressbalance.spcvy[pos] = 0.
    4242
    43     #Create MPCs to have periodic boundary conditions
     43#Create MPCs to have periodic boundary conditions
    4444    posx = np.where(md.mesh.x == 0.)[0]
    4545    posx2 = np.where(md.mesh.x == np.max(md.mesh.x))[0]
     
    5050    md.stressbalance.vertex_pairing = np.vstack((np.vstack((posx + 1, posx2 + 1)).T, np.vstack((posy + 1, posy2 + 1)).T))
    5151
    52     #Compute the stressbalance
     52#Compute the stressbalance
    5353    md.cluster = generic('name', gethostname(), 'np', 8)
    5454    md = solve(md, 'Stressbalance')
    5555
    56     #Plot the results and save them
     56#Plot the results and save them
    5757    vx = md.results.StressbalanceSolution.Vx
    5858    vy = md.results.StressbalanceSolution.Vy
     
    6262    maxvx.append(np.max(vx[-md.mesh.numberofvertices2d:]))
    6363
    64     #Now plot vx, vy, vz and vx on a cross section
    65 #   plotmodel(md, 'data', vx, 'layer#all', md.mesh.numberoflayers, 'xlim',[0 L/10^3], 'ylim',[0 L/10^3], 'unit', 'km')
     64#Now plot vx, vy, vz and vx on a cross section
     65#   plotmodel(md, 'data', vx, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 10^3], 'ylim', [0 L / 10^3], 'unit', 'km')
    6666    if printingflag:
    6767        pass
    6868#           set(gcf, 'Color', 'w')
    6969#           printmodel(['ismipaHOvx' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    70 #           shutil.move("ismipaHOvx%d.png" % L, ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
    71 #   plotmodel(md, 'data', vy, 'layer#all', md.mesh.numberoflayers, 'xlim',[0 L/10^3], 'ylim',[0 L/10^3], 'unit', 'km')
     70#           shutil.move("ismipaHOvx%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
     71#   plotmodel(md, 'data', vy, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 10^3], 'ylim', [0 L / 10^3], 'unit', 'km')
    7272    if printingflag:
    7373        pass
    7474#           set(gcf, 'Color', 'w')
    7575#           printmodel(['ismipaHOvy' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    76 #           shutil.move("ismipaHOvy%d.png" % L, ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
    77 #   plotmodel(md, 'data', vz, 'layer#all', md.mesh.numberoflayers, 'xlim',[0 L/10^3], 'ylim',[0 L/10^3], 'unit', 'km')
     76#           shutil.move("ismipaHOvy%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
     77#   plotmodel(md, 'data', vz, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 10^3], 'ylim', [0 L / 10^3], 'unit', 'km')
    7878    if printingflag:
    7979        pass
    8080#           set(gcf, 'Color', 'w')
    8181#           printmodel(['ismipaHOvz' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    82 #           shutil.move("ismipaHOvz%d.png" % L, ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
     82#           shutil.move("ismipaHOvz%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
    8383
    8484    if (L == 5000.):
    8585        pass
    86 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP5000.exp', 'layer', md.mesh.numberoflayers,...
    87 #                   'resolution',[10 10], 'ylim',[10 18], 'xlim',[0 5000], 'title', '', 'xlabel', '')
     86#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP5000.exp', 'layer', md.mesh.numberoflayers, ...
     87#                   'resolution', [10 10], 'ylim', [10 18], 'xlim', [0 5000], 'title', '', 'xlabel', '')
    8888    elif (L == 10000.):
    8989        pass
    90 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP10000.exp', 'layer', md.mesh.numberoflayers,...
    91 #                   'resolution',[10 10], 'ylim',[10 30], 'xlim',[0 10000], 'title', '', 'xlabel', '')
     90#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP10000.exp', 'layer', md.mesh.numberoflayers, ...
     91#                   'resolution', [10 10], 'ylim', [10 30], 'xlim', [0 10000], 'title', '', 'xlabel', '')
    9292    elif (L == 20000.):
    9393        pass
    94 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP20000.exp', 'layer', md.mesh.numberoflayers,...
    95 #                   'resolution',[10 10], 'ylim',[0 50], 'xlim',[0 20000], 'title', '', 'xlabel', '')
     94#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP20000.exp', 'layer', md.mesh.numberoflayers, ...
     95#                   'resolution', [10 10], 'ylim', [0 50], 'xlim', [0 20000], 'title', '', 'xlabel', '')
    9696    elif (L == 40000.):
    9797        pass
    98 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP40000.exp', 'layer', md.mesh.numberoflayers,...
    99 #                   'resolution',[10 10], 'ylim',[0 80], 'xlim',[0 40000], 'title', '', 'xlabel', '')
     98#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP40000.exp', 'layer', md.mesh.numberoflayers, ...
     99#                   'resolution', [10 10], 'ylim', [0 80], 'xlim', [0 40000], 'title', '', 'xlabel', '')
    100100    elif (L == 80000.):
    101101        pass
    102 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP80000.exp', 'layer', md.mesh.numberoflayers,...
    103 #                   'resolution',[10 10], 'ylim',[0 100], 'xlim',[0 80000], 'title', '', 'xlabel', '')
     102#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP80000.exp', 'layer', md.mesh.numberoflayers, ...
     103#                   'resolution', [10 10], 'ylim', [0 100], 'xlim', [0 80000], 'title', '', 'xlabel', '')
    104104    elif (L == 160000.):
    105105        pass
    106 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP160000.exp', 'layer', md.mesh.numberoflayers,...
    107 #                   'resolution',[10 10], 'ylim',[0 120], 'xlim',[0 160000], 'title', '', 'xlabel', '')
     106#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP160000.exp', 'layer', md.mesh.numberoflayers, ...
     107#                   'resolution', [10 10], 'ylim', [0 120], 'xlim', [0 160000], 'title', '', 'xlabel', '')
    108108    if printingflag:
    109109        pass
    110110#           set(gcf, 'Color', 'w')
    111111#           printmodel(['ismipaHOvxsec' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    112 #           shutil.move("ismipaHOvxsec%d.png" % L, ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
     112#           shutil.move("ismipaHOvxsec%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
    113113
    114114#Now plot the min and max values of vx for each size of the square
     
    118118#       set(gcf, 'Color', 'w')
    119119#       printmodel('ismipaHOminvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    120 #       shutil.move('ismipaHOminvx.png', ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
     120#       shutil.move('ismipaHOminvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
    121121#plot([5 10 20 40 80 160], maxvx)ylim([0 120])xlim([0 160])
    122122if printingflag:
     
    124124#       set(gcf, 'Color', 'w')
    125125#       printmodel('ismipaHOmaxvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    126 #       shutil.move('ismipaHOmaxvx.png', ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
     126#       shutil.move('ismipaHOmaxvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
    127127
    128128#Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test1102.py

    r23793 r24214  
    1010
    1111"""
    12 This test is a test from the ISMP-HOM Intercomparison project.
     12This test is a test from the ISMP - HOM Intercomparison project.
    1313Pattyn and Payne 2006
    1414"""
     
    2222
    2323for L in L_list:
    24     nx = 20    #numberof nodes in x direction
     24    nx = 20  #numberof nodes in x direction
    2525    ny = 20
    2626    md = model()
    2727    md = squaremesh(md, L, L, nx, ny)
    28     md = setmask(md, '', '')    #ice sheet test
     28    md = setmask(md, '', '')  #ice sheet test
    2929
    30 #   #Find elements at the corner and extract model
    31 #   posnodes = np.nonzero(np.logical_and.reduce(np.logical_or.reduce(md.mesh.x = 0., md.mesh.x = np.max(md.mesh.x)), np.logical_or.reduce(md.mesh.y = 0., md.mesh.y = np.max(md.mesh.y))))
    32 #   a = np.nonzero(ismember(md.mesh.elements, posnodes))[0]
    33 #   elements = np.ones((md.mesh.numberofelements), int)
    34 #   elements[a]=0
    35 #   md.modelextract(elements)
     30    #  #Find elements at the corner and extract model
     31    #   posnodes = np.nonzero(np.logical_and.reduce(np.logical_or.reduce(md.mesh.x = 0., md.mesh.x = np.max(md.mesh.x)), np.logical_or.reduce(md.mesh.y = 0., md.mesh.y = np.max(md.mesh.y))))
     32    #   a = np.nonzero(ismember(md.mesh.elements, posnodes))[0]
     33    #   elements = np.ones((md.mesh.numberofelements), int)
     34    #   elements[a] = 0
     35    #   md.modelextract(elements)
    3636
    3737    md = parameterize(md, '../Par/ISMIPA.py')
     
    5252    md = solve(md, 'Stressbalance')
    5353
    54     #Plot the results and save them
     54#Plot the results and save them
    5555    vx = md.results.StressbalanceSolution.Vx
    5656    vy = md.results.StressbalanceSolution.Vy
     
    6262
    6363    #Now plot vx, vy, vz and vx on a cross section
    64 #   plotmodel(md, 'data', vx, 'layer#all', md.mesh.numberoflayers, 'xlim',[0 L/10^3], 'ylim',[0 L/10^3], 'unit', 'km', 'figure', 2)
     64    #   plotmodel(md, 'data', vx, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 10^3], 'ylim', [0 L / 10^3], 'unit', 'km', 'figure', 2)
    6565    if printingflag:
    6666        pass
    67 #           set(gcf, 'Color', 'w')
    68 #           printmodel(['ismipaFSvx' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    69 #           shutil.move("ismipaFSvx%d.png" % L, ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
    70 #   plotmodel(md, 'data', vy, 'layer#all', md.mesh.numberoflayers, 'xlim',[0 L/10^3], 'ylim',[0 L/10^3], 'unit', 'km', 'figure', 3)
     67    #           set(gcf, 'Color', 'w')
     68    #           printmodel(['ismipaFSvx' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
     69    #           shutil.move("ismipaFSvx%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
     70    #   plotmodel(md, 'data', vy, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 10^3], 'ylim', [0 L / 10^3], 'unit', 'km', 'figure', 3)
    7171    if printingflag:
    7272        pass
    73 #           set(gcf, 'Color', 'w')
    74 #           printmodel(['ismipaFSvy' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    75 #           shutil.move("ismipaFSvy%d.png" % L, ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
    76 #   plotmodel(md, 'data', vz, 'layer#all', md.mesh.numberoflayers, 'xlim',[0 L/10^3], 'ylim',[0 L/10^3], 'unit', 'km', 'figure', 4)
     73    #           set(gcf, 'Color', 'w')
     74    #           printmodel(['ismipaFSvy' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
     75    #           shutil.move("ismipaFSvy%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
     76    #   plotmodel(md, 'data', vz, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 10^3], 'ylim', [0 L / 10^3], 'unit', 'km', 'figure', 4)
    7777    if printingflag:
    7878        pass
    79 #           set(gcf, 'Color', 'w')
    80 #           printmodel(['ismipaFSvz' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    81 #           shutil.move("ismipaFSvz%d.png" % L, ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
     79    #           set(gcf, 'Color', 'w')
     80    #           printmodel(['ismipaFSvz' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
     81    #           shutil.move("ismipaFSvz%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
    8282
    8383    if (L == 5000.):
    8484        pass
    85 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP5000.exp', 'layer', md.mesh.numberoflayers,...
    86 #                   'resolution',[10 10], 'ylim',[10 18], 'xlim',[0 5000], 'title', '', 'xlabel', '')
     85    #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP5000.exp', 'layer', md.mesh.numberoflayers, ...
     86    #                   'resolution', [10 10], 'ylim', [10 18], 'xlim', [0 5000], 'title', '', 'xlabel', '')
    8787    elif (L == 10000.):
    8888        pass
    89 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP10000.exp', 'layer', md.mesh.numberoflayers,...
    90 #                   'resolution',[10 10], 'ylim',[10 30], 'xlim',[0 10000], 'title', '', 'xlabel', '')
     89    #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP10000.exp', 'layer', md.mesh.numberoflayers, ...
     90    #                   'resolution', [10 10], 'ylim', [10 30], 'xlim', [0 10000], 'title', '', 'xlabel', '')
    9191    elif (L == 20000.):
    9292        pass
    93 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP20000.exp', 'layer', md.mesh.numberoflayers,...
    94 #                   'resolution',[10 10], 'ylim',[0 50], 'xlim',[0 20000], 'title', '', 'xlabel', '')
     93    #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP20000.exp', 'layer', md.mesh.numberoflayers, ...
     94    #                   'resolution', [10 10], 'ylim', [0 50], 'xlim', [0 20000], 'title', '', 'xlabel', '')
    9595    elif (L == 40000.):
    9696        pass
    97 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP40000.exp', 'layer', md.mesh.numberoflayers,...
    98 #                   'resolution',[10 10], 'ylim',[0 80], 'xlim',[0 40000], 'title', '', 'xlabel', '')
     97    #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP40000.exp', 'layer', md.mesh.numberoflayers, ...
     98    #                   'resolution', [10 10], 'ylim', [0 80], 'xlim', [0 40000], 'title', '', 'xlabel', '')
    9999    elif (L == 80000.):
    100100        pass
    101 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP80000.exp', 'layer', md.mesh.numberoflayers,...
    102 #                   'resolution',[10 10], 'ylim',[0 100], 'xlim',[0 80000], 'title', '', 'xlabel', '')
     101    #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP80000.exp', 'layer', md.mesh.numberoflayers, ...
     102    #                   'resolution', [10 10], 'ylim', [0 100], 'xlim', [0 80000], 'title', '', 'xlabel', '')
    103103    elif (L == 160000.):
    104104        pass
    105 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP160000.exp', 'layer', md.mesh.numberoflayers,...
    106 #                   'resolution',[10 10], 'ylim',[0 120], 'xlim',[0 160000], 'title', '', 'xlabel', '')
     105    #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP160000.exp', 'layer', md.mesh.numberoflayers, ...
     106    #                   'resolution', [10 10], 'ylim', [0 120], 'xlim', [0 160000], 'title', '', 'xlabel', '')
    107107    if printingflag:
    108108        pass
    109 # set(gcf, 'Color', 'w')
    110 # printmodel(['ismipaFSvxsec' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    111 # shutil.move("ismipaFSvxsec.png" % L, ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
     109    # set(gcf, 'Color', 'w')
     110    # printmodel(['ismipaFSvxsec' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
     111    # shutil.move("ismipaFSvxsec.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
    112112
    113 #Now plot the min and max values of vx for each size of the square
    114 #plot([5 10 20 40 80 160], minvx)ylim([0 18])
     113    #Now plot the min and max values of vx for each size of the square
     114    #plot([5 10 20 40 80 160], minvx)ylim([0 18])
    115115if printingflag:
    116116    pass
    117117#       set(gcf, 'Color', 'w')
    118118#       printmodel('ismipaFSminvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    119 #       shutil.move('ismipaFSminvx.png', ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
     119#       shutil.move('ismipaFSminvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
    120120#plot([5 10 20 40 80 160], maxvx)ylim([0 120])
    121121if printingflag:
     
    123123#       set(gcf, 'Color', 'w')
    124124#       printmodel('ismipaFSmaxvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    125 #       shutil.move('ismipaFSmaxvx.png', ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
     125#       shutil.move('ismipaFSmaxvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
    126126
    127127#Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test1103.py

    r23793 r24214  
    1010
    1111"""
    12 This test is a test from the ISMP-HOM Intercomparison project.
     12This test is a test from the ISMP - HOM Intercomparison project.
    1313Pattyn and Payne 2006
    1414"""
     
    2222
    2323for L in L_list:
    24     nx = 20    #numberof nodes in x direction
     24    nx = 20  #numberof nodes in x direction
    2525    ny = 20
    2626    md = model()
    2727    md = squaremesh(md, L, L, nx, ny)
    28     md = setmask(md, '', '')    #ice sheet test
     28    md = setmask(md, '', '')  #ice sheet test
    2929    md = parameterize(md, '../Par/ISMIPB.py')
    3030    md.extrude(10, 1.)
     
    3232    md = setflowequation(md, 'HO', 'all')
    3333
    34     #Create dirichlet on the bed only
     34#Create dirichlet on the bed only
    3535    md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
    3636    md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
     
    4040    md.stressbalance.spcvy[pos] = 0.
    4141
    42     #Create MPCs to have periodic boundary conditions
     42#Create MPCs to have periodic boundary conditions
    4343    posx = np.where(md.mesh.x == 0.)[0]
    4444    posx2 = np.where(md.mesh.x == np.max(md.mesh.x))[0]
    4545
    46     posy = np.where(np.logical_and.reduce((md.mesh.y == 0., md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]    #Don't take the same nodes two times
     46    posy = np.where(np.logical_and.reduce((md.mesh.y == 0., md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]  #Don't take the same nodes two times
    4747    posy2 = np.where(np.logical_and.reduce((md.mesh.y == np.max(md.mesh.y), md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]
    4848
    4949    md.stressbalance.vertex_pairing = np.vstack((np.vstack((posx + 1, posx2 + 1)).T, np.vstack((posy + 1, posy2 + 1)).T))
    5050
    51     #Compute the stressbalance
     51#Compute the stressbalance
    5252    md.cluster = generic('name', gethostname(), 'np', 8)
    5353    md = solve(md, 'Stressbalance')
    5454
    55     #Plot the results and save them
     55#Plot the results and save them
    5656    vx = md.results.StressbalanceSolution.Vx
    5757    vy = md.results.StressbalanceSolution.Vy
     
    6161    maxvx.append(np.max(vx[md.mesh.numberofvertices2d:]))
    6262
    63     #Now plot vx, vy, vz and vx on a cross section
    64 #   plotmodel(md, 'data', vx, 'layer#all', md.mesh.numberoflayers, 'xlim',[0 L/10^3], 'ylim',[0 L/10^3], 'unit', 'km')
     63#Now plot vx, vy, vz and vx on a cross section
     64#   plotmodel(md, 'data', vx, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 10^3], 'ylim', [0 L / 10^3], 'unit', 'km')
    6565    if printingflag:
    6666        pass
    6767#           set(gcf, 'Color', 'w')
    6868#           printmodel(['ismipbHOvx' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    69 #           shutil.move("ismipbHOvx%d.png" % L, ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestB')
    70 #   plotmodel(md, 'data', vz, 'layer#all', md.mesh.numberoflayers, 'xlim',[0 L/10^3], 'ylim',[0 L/10^3], 'unit', 'km')
     69#           shutil.move("ismipbHOvx%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestB')
     70#   plotmodel(md, 'data', vz, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 10^3], 'ylim', [0 L / 10^3], 'unit', 'km')
    7171    if printingflag:
    7272        pass
    7373#           set(gcf, 'Color', 'w')
    7474#           printmodel(['ismipbHOvz' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    75 #           shutil.move("ismipbHOvz%d.png" % L, ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestB')
     75#           shutil.move("ismipbHOvz%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestB')
    7676
    7777    if (L == 5000.):
    7878        pass
    79 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP5000.exp', 'layer', md.mesh.numberoflayers,...
    80 #                   'resolution',[10 10], 'ylim',[6 16], 'xlim',[0 5000], 'title', '', 'xlabel', '')
     79#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP5000.exp', 'layer', md.mesh.numberoflayers, ...
     80#                   'resolution', [10 10], 'ylim', [6 16], 'xlim', [0 5000], 'title', '', 'xlabel', '')
    8181    elif (L == 10000.):
    8282        pass
    83 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP10000.exp', 'layer', md.mesh.numberoflayers,...
    84 #                   'resolution',[10 10], 'ylim',[0 40], 'xlim',[0 10000], 'title', '', 'xlabel', '')
     83#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP10000.exp', 'layer', md.mesh.numberoflayers, ...
     84#                   'resolution', [10 10], 'ylim', [0 40], 'xlim', [0 10000], 'title', '', 'xlabel', '')
    8585    elif (L == 20000.):
    8686        pass
    87 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP20000.exp', 'layer', md.mesh.numberoflayers,...
    88 #                   'resolution',[10 10], 'ylim',[0 60], 'xlim',[0 20000], 'title', '', 'xlabel', '')
     87#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP20000.exp', 'layer', md.mesh.numberoflayers, ...
     88#                   'resolution', [10 10], 'ylim', [0 60], 'xlim', [0 20000], 'title', '', 'xlabel', '')
    8989    elif (L == 40000.):
    9090        pass
    91 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP40000.exp', 'layer', md.mesh.numberoflayers,...
    92 #                   'resolution',[10 10], 'ylim',[0 100], 'xlim',[0 40000], 'title', '', 'xlabel', '')
     91#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP40000.exp', 'layer', md.mesh.numberoflayers, ...
     92#                   'resolution', [10 10], 'ylim', [0 100], 'xlim', [0 40000], 'title', '', 'xlabel', '')
    9393    elif (L == 80000.):
    9494        pass
    95 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP80000.exp', 'layer', md.mesh.numberoflayers,...
    96 #                   'resolution',[10 10], 'ylim',[0 120], 'xlim',[0 80000], 'title', '', 'xlabel', '')
     95#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP80000.exp', 'layer', md.mesh.numberoflayers, ...
     96#                   'resolution', [10 10], 'ylim', [0 120], 'xlim', [0 80000], 'title', '', 'xlabel', '')
    9797    elif (L == 160000.):
    9898        pass
    99 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP160000.exp', 'layer', md.mesh.numberoflayers,...
    100 #                   'resolution',[10 10], 'ylim',[0 120], 'xlim',[0 160000], 'title', '', 'xlabel', '')
     99#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP160000.exp', 'layer', md.mesh.numberoflayers, ...
     100#                   'resolution', [10 10], 'ylim', [0 120], 'xlim', [0 160000], 'title', '', 'xlabel', '')
    101101    if printingflag:
    102102        pass
    103103#           set(gcf, 'Color', 'w')
    104104#           printmodel(['ismipbHOvxsec' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    105 #           shutil.move("ismipbHOvxsec%d.png" % L, ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestB')
     105#           shutil.move("ismipbHOvxsec%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestB')
    106106
    107107#Now plot the min and max values of vx for each size of the square
     
    111111#       set(gcf, 'Color', 'w')
    112112#       printmodel('ismipbHOminvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    113 #       shutil.move('ismipbHOminvx.png', ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestB')
     113#       shutil.move('ismipbHOminvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestB')
    114114#plot([5 10 20 40 80 160], maxvx)ylim([0 120])xlim([0 160])
    115115if printingflag:
     
    117117#       set(gcf, 'Color', 'w')
    118118#       printmodel('ismipbHOmaxvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    119 #       shutil.move('ismipbHOmaxvx.png', ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestB')
     119#       shutil.move('ismipbHOmaxvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestB')
    120120
    121121#Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test1104.py

    r23793 r24214  
    1010
    1111"""
    12 This test is a test from the ISMP-HOM Intercomparison project.
     12This test is a test from the ISMP - HOM Intercomparison project.
    1313Pattyn and Payne 2006
    1414"""
     
    1818
    1919for L in L_list:
    20     nx = 20    #numberof nodes in x direction
     20    nx = 20  #numberof nodes in x direction
    2121    ny = 20
    2222    md = model()
    2323    md = squaremesh(md, L, L, nx, ny)
    24     md = setmask(md, '', '')    #ice sheet test
     24    md = setmask(md, '', '')  #ice sheet test
    2525    md = parameterize(md, '../Par/ISMIPB.py')
    2626    md.extrude(10, 1.)
    2727    md = setflowequation(md, 'HO', 'all')
    2828
    29     #Create dirichlet on the bed only
     29#Create dirichlet on the bed only
    3030    md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
    3131    md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
     
    3636    md.stressbalance.spcvy[pos] = 0.
    3737
    38     #Create MPCs to have periodic boundary conditions
     38#Create MPCs to have periodic boundary conditions
    3939    posx = np.where(md.mesh.x == 0.)[0]
    4040    posx2 = np.where(md.mesh.x == np.max(md.mesh.x))[0]
    4141
    42     posy = np.where(np.logical_and.reduce((md.mesh.y == 0., md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]    #Don't take the same nodes two times
     42    posy = np.where(np.logical_and.reduce((md.mesh.y == 0., md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]  #Don't take the same nodes two times
    4343    posy2 = np.where(np.logical_and.reduce((md.mesh.y == np.max(md.mesh.y), md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]
    4444
    4545    md.stressbalance.vertex_pairing = np.vstack((np.vstack((posx + 1, posx2 + 1)).T, np.vstack((posy + 1, posy2 + 1)).T))
    4646    print(np.shape(md.stressbalance.vertex_pairing))
    47     #Compute the stressbalance
     47#Compute the stressbalance
    4848    md.stressbalance.abstol = np.nan
    4949    md.cluster = generic('name', gethostname(), 'np', 8)
     
    5656    md = solve(md, 'Stressbalance')
    5757
    58     #Plot the results and save them
     58#Plot the results and save them
    5959    vx = md.results.StressbalanceSolution.Vx
    6060    vy = md.results.StressbalanceSolution.Vy
     
    6262    results.append(md.results.StressbalanceSolution)
    6363
    64 #       plotmodel(md, 'data', vx, 'data', vy, 'data', vz, 'layer#all', md.mesh.numberoflayers)
     64#       plotmodel(md, 'data', vx, 'data', vy, 'data', vz, 'layer  #all', md.mesh.numberoflayers)
    6565
    6666#Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test1105.py

    r23793 r24214  
    1010
    1111"""
    12 This test is a test from the ISMP-HOM Intercomparison project.
     12This test is a test from the ISMP - HOM Intercomparison project.
    1313Pattyn and Payne 2006
    1414"""
     
    2121maxvx = []
    2222
    23 for L in L_list:    #in m (3 times the desired length for BC problems)
    24     nx = 30    #number of nodes in x direction
     23for L in L_list:  #in m (3 times the desired length for BC problems)
     24    nx = 30  #number of nodes in x direction
    2525    ny = 30
    2626    md = model()
    2727    md = squaremesh(md, L, L, nx, ny)
    28     md = setmask(md, '', '')    #ice sheet test
     28    md = setmask(md, '', '')  #ice sheet test
    2929    md = parameterize(md, '../Par/ISMIPC.py')
    3030    md.extrude(10, 1.)
     
    3232    md = setflowequation(md, 'HO', 'all')
    3333
    34     #Create MPCs to have periodic boundary conditions
     34#Create MPCs to have periodic boundary conditions
    3535    md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
    3636    md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
     
    4040    posx2 = np.where(np.logical_and.reduce((md.mesh.x == L, md.mesh.y != 0., md.mesh.y != L)))[0]
    4141
    42     posy = np.where(np.logical_and.reduce((md.mesh.y == 0., md.mesh.x != 0., md.mesh.x != L)))[0]    #Don't take the same nodes two times
     42    posy = np.where(np.logical_and.reduce((md.mesh.y == 0., md.mesh.x != 0., md.mesh.x != L)))[0]  #Don't take the same nodes two times
    4343    posy2 = np.where(np.logical_and.reduce((md.mesh.y == L, md.mesh.x != 0., md.mesh.x != L)))[0]
    4444
    4545    md.stressbalance.vertex_pairing = np.vstack((np.vstack((posx + 1, posx2 + 1)).T, np.vstack((posy + 1, posy2 + 1)).T))
    4646
    47     #Add spc on the corners
     47#Add spc on the corners
    4848    pos = np.where(np.logical_and.reduce((np.logical_or(md.mesh.x == 0., md.mesh.x == L), np.logical_or(md.mesh.y == 0., md.mesh.y == L), md.mesh.vertexonbase)))
    4949    md.stressbalance.spcvx[pos] = 0.
     
    5151    if (L == 5000.):
    5252        md.stressbalance.spcvx[pos] = 15.66
    53         md.stressbalance.spcvy[pos] = -0.1967
     53        md.stressbalance.spcvy[pos] = - 0.1967
    5454    elif (L == 10000.):
    5555        md.stressbalance.spcvx[pos] = 16.04
    56         md.stressbalance.spcvy[pos] = -0.1977
     56        md.stressbalance.spcvy[pos] = - 0.1977
    5757    elif (L == 20000.):
    5858        md.stressbalance.spcvx[pos] = 16.53
    59         md.stressbalance.spcvy[pos] = -1.27
     59        md.stressbalance.spcvy[pos] = - 1.27
    6060    elif (L == 40000.):
    6161        md.stressbalance.spcvx[pos] = 17.23
    62         md.stressbalance.spcvy[pos] = -3.17
     62        md.stressbalance.spcvy[pos] = - 3.17
    6363    elif (L == 80000.):
    6464        md.stressbalance.spcvx[pos] = 16.68
    65         md.stressbalance.spcvy[pos] = -2.69
     65        md.stressbalance.spcvy[pos] = - 2.69
    6666    elif (L == 160000.):
    6767        md.stressbalance.spcvx[pos] = 16.03
    68         md.stressbalance.spcvy[pos] = -1.27
     68        md.stressbalance.spcvy[pos] = - 1.27
    6969
    70     #Spc the bed at zero for vz
     70#Spc the bed at zero for vz
    7171    pos = np.where(md.mesh.vertexonbase)
    7272    md.stressbalance.spcvz[pos] = 0.
    7373
    74     #Compute the stressbalance
     74#Compute the stressbalance
    7575    md.cluster = generic('name', gethostname(), 'np', 8)
    7676    md = solve(md, 'Stressbalance')
    7777
    78     #Plot the results and save them
     78#Plot the results and save them
    7979    vx = md.results.StressbalanceSolution.Vx
    8080    vy = md.results.StressbalanceSolution.Vy
     
    8484    maxvx.append(np.max(vx[-md.mesh.numberofvertices2d:]))
    8585
    86     #Now plot vx, vy, vz and vx on a cross section
    87 #   plotmodel(md, 'data', vx, 'layer#all', md.mesh.numberoflayers, 'xlim',[0 L/10^3], 'ylim',[0 L/10^3], 'unit', 'km', 'figure', 2)
     86#Now plot vx, vy, vz and vx on a cross section
     87#   plotmodel(md, 'data', vx, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 10^3], 'ylim', [0 L / 10^3], 'unit', 'km', 'figure', 2)
    8888    if printingflag:
    8989        pass
    9090#           set(gcf, 'Color', 'w')
    9191#           printmodel(['ismipcHOvx' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    92 #           shutil.move("ismipcHOvx%d.png" % L, ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestC')
    93 #   plotmodel(md, 'data', vy, 'layer#all', md.mesh.numberoflayers, 'xlim',[0 L/10^3], 'ylim',[0 L/10^3], 'unit', 'km', 'figure', 3)
     92#           shutil.move("ismipcHOvx%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestC')
     93#   plotmodel(md, 'data', vy, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 10^3], 'ylim', [0 L / 10^3], 'unit', 'km', 'figure', 3)
    9494    if printingflag:
    9595        pass
    9696#           set(gcf, 'Color', 'w')
    9797#           printmodel(['ismipcHOvy' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    98 #           shutil.move("ismipcHOvy%d.png" % L, ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestC')
    99 #   plotmodel(md, 'data', vz, 'layer#all', md.mesh.numberoflayers, 'xlim',[0 L/10^3], 'ylim',[0 L/10^3], 'unit', 'km', 'figure', 4)
     98#           shutil.move("ismipcHOvy%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestC')
     99#   plotmodel(md, 'data', vz, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 10^3], 'ylim', [0 L / 10^3], 'unit', 'km', 'figure', 4)
    100100    if printingflag:
    101101        pass
    102102#           set(gcf, 'Color', 'w')
    103103#           printmodel(['ismipcHOvz' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    104 #           shutil.move("ismipcHOvz%d.png" % L, ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestC')
     104#           shutil.move("ismipcHOvz%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestC')
    105105
    106106    if (L == 5000.):
    107107        pass
    108 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP5000.exp', 'layer', md.mesh.numberoflayers,...
    109 #                   'resolution',[10 10], 'ylim',[0 20], 'xlim',[0 5000], 'title', '', 'xlabel', '', 'figure', 5)
     108#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP5000.exp', 'layer', md.mesh.numberoflayers, ...
     109#                   'resolution', [10 10], 'ylim', [0 20], 'xlim', [0 5000], 'title', '', 'xlabel', '', 'figure', 5)
    110110    elif (L == 10000.):
    111111        pass
    112 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP10000.exp', 'layer', md.mesh.numberoflayers,...
    113 #                   'resolution',[10 10], 'ylim',[13 18], 'xlim',[0 10000], 'title', '', 'xlabel', '')
     112#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP10000.exp', 'layer', md.mesh.numberoflayers, ...
     113#                   'resolution', [10 10], 'ylim', [13 18], 'xlim', [0 10000], 'title', '', 'xlabel', '')
    114114    elif (L == 20000.):
    115115        pass
    116 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP20000.exp', 'layer', md.mesh.numberoflayers,...
    117 #                   'resolution',[10 10], 'ylim',[14 22], 'xlim',[0 20000], 'title', '', 'xlabel', '')
     116#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP20000.exp', 'layer', md.mesh.numberoflayers, ...
     117#                   'resolution', [10 10], 'ylim', [14 22], 'xlim', [0 20000], 'title', '', 'xlabel', '')
    118118    elif (L == 40000.):
    119119        pass
    120 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP40000.exp', 'layer', md.mesh.numberoflayers,...
    121 #                   'resolution',[10 10], 'ylim',[10 40], 'xlim',[0 40000], 'title', '', 'xlabel', '')
     120#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP40000.exp', 'layer', md.mesh.numberoflayers, ...
     121#                   'resolution', [10 10], 'ylim', [10 40], 'xlim', [0 40000], 'title', '', 'xlabel', '')
    122122    elif (L == 80000.):
    123123        pass
    124 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP80000.exp', 'layer', md.mesh.numberoflayers,...
    125 #                   'resolution',[10 10], 'ylim',[0 80], 'xlim',[0 80000], 'title', '', 'xlabel', '')
     124#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP80000.exp', 'layer', md.mesh.numberoflayers, ...
     125#                   'resolution', [10 10], 'ylim', [0 80], 'xlim', [0 80000], 'title', '', 'xlabel', '')
    126126    elif (L == 160000.):
    127127        pass
    128 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP160000.exp', 'layer', md.mesh.numberoflayers,...
    129 #                   'resolution',[10 10], 'ylim',[0 200], 'xlim',[0 160000], 'title', '', 'xlabel', '')
     128#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP160000.exp', 'layer', md.mesh.numberoflayers, ...
     129#                   'resolution', [10 10], 'ylim', [0 200], 'xlim', [0 160000], 'title', '', 'xlabel', '')
    130130    if printingflag:
    131131        pass
    132132#           set(gcf, 'Color', 'w')
    133133#           printmodel(['ismipcHOvxsec' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    134 #           shutil.move("ismipcHOvxsec%d.png" % L, ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestC')
     134#           shutil.move("ismipcHOvxsec%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestC')
    135135
    136136#Now plot the min and max values of vx for each size of the square
     
    140140#       set(gcf, 'Color', 'w')
    141141#       printmodel('ismipcHOminvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    142 #       shutil.move('ismipcHOminvx.png', ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestC')
     142#       shutil.move('ismipcHOminvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestC')
    143143#plot([5 10 20 40 80 160], maxvx)ylim([0 200]) xlim([0 160])
    144144if printingflag:
     
    146146#       set(gcf, 'Color', 'w')
    147147#       printmodel('ismipcHOmaxvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    148 #       shutil.move('ismipcHOmaxvx.png', ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestC')
     148#       shutil.move('ismipcHOmaxvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestC')
    149149
    150150#Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test1106.py

    r23793 r24214  
    1010
    1111"""
    12 This test is a test from the ISMP-HOM Intercomparison project.
     12This test is a test from the ISMP - HOM Intercomparison project.
    1313Pattyn and Payne 2006
    1414"""
    1515
    16 L_list = [80000.]
     16L_list = [80000]
    1717results = []
    1818
    1919for L in L_list:
    20     md = triangle(model(), "../Exp/Square_{}.exp".format(L), L / 10.)    #size 3*L
    21     md = setmask(md, '', '')    #ice sheet test
     20    md = triangle(model(), "../Exp/Square_{}.exp".format(L), L / 10.)  #size 3 * L
     21    md = setmask(md, '', '')  #ice sheet test
    2222    md = parameterize(md, '../Par/ISMIPC.py')
    2323    md.friction.coefficient = np.sqrt(md.constants.yts * (1000. + 1000. * np.sin(md.mesh.x * 2. * np.pi / L) * np.sin(md.mesh.y * 2. * np.pi / L)))
    2424    md.extrude(10, 1.)
    2525
    26     #Add spc on the borders
     26#Add spc on the borders
    2727    pos = np.where(np.logical_or.reduce((md.mesh.x == 0., md.mesh.x == np.max(md.mesh.x), md.mesh.y == 0., md.mesh.y == np.max(md.mesh.y))))
    2828    md.stressbalance.spcvx[pos] = 0.
     
    3030    if (L == 5000.):
    3131        md.stressbalance.spcvx[pos] = 15.66
    32         md.stressbalance.spcvy[pos] = -0.1967
     32        md.stressbalance.spcvy[pos] = - 0.1967
    3333    elif (L == 10000.):
    3434        md.stressbalance.spcvx[pos] = 16.04
    35         md.stressbalance.spcvy[pos] = -0.1977
     35        md.stressbalance.spcvy[pos] = - 0.1977
    3636    elif (L == 20000.):
    3737        md.stressbalance.spcvx[pos] = 16.53
    38         md.stressbalance.spcvy[pos] = -1.27
     38        md.stressbalance.spcvy[pos] = - 1.27
    3939    elif (L == 40000.):
    4040        md.stressbalance.spcvx[pos] = 17.23
    41         md.stressbalance.spcvy[pos] = -3.17
     41        md.stressbalance.spcvy[pos] = - 3.17
    4242    elif (L == 80000.):
    4343        md.stressbalance.spcvx[pos] = 16.68
    44         md.stressbalance.spcvy[pos] = -2.69
     44        md.stressbalance.spcvy[pos] = - 2.69
    4545    elif (L == 160000.):
    4646        md.stressbalance.spcvx[pos] = 16.03
    47         md.stressbalance.spcvy[pos] = -1.27
     47        md.stressbalance.spcvy[pos] = - 1.27
    4848
    4949    md = setflowequation(md, 'FS', 'all')
    5050
    51     #Compute the stressbalance
     51#Compute the stressbalance
    5252    md.cluster = generic('name', gethostname(), 'np', 8)
    5353    md = solve(md, 'Stressbalance')
    5454
    55     #Plot the results and save them
     55#Plot the results and save them
    5656    vx = md.results.StressbalanceSolution.Vx
    5757    vy = md.results.StressbalanceSolution.Vy
     
    5959    results.append(md.results.StressbalanceSolution)
    6060
    61 #   plotmodel(md, 'data', vx, 'data', vy, 'data', vz, 'layer#all', md.mesh.numberoflayers)
     61#   plotmodel(md, 'data', vx, 'data', vy, 'data', vz, 'layer  #all', md.mesh.numberoflayers)
    6262
    6363#Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test1107.py

    r23793 r24214  
    1010
    1111"""
    12 This test is a test from the ISMP-HOM Intercomparison project.
     12This test is a test from the ISMP - HOM Intercomparison project.
    1313Pattyn and Payne 2006
    1414"""
     
    2222
    2323for L in L_list:
    24     nx = 30    #numberof nodes in x direction
     24    nx = 30  #numberof nodes in x direction
    2525    ny = 30
    2626    md = model()
    2727    md = squaremesh(md, L, L, nx, ny)
    28     md = setmask(md, '', '')    #ice sheet test
     28    md = setmask(md, '', '')  #ice sheet test
    2929    md = parameterize(md, '../Par/ISMIPD.py')
    3030    md.extrude(10, 1.)
     
    3232    md = setflowequation(md, 'HO', 'all')
    3333
    34     #We need one grd on dirichlet: the 4 corners are set to zero
     34#We need one grd on dirichlet: the 4 corners are set to zero
    3535    md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
    3636    md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
    3737    md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices))
    3838
    39     #Create MPCs to have periodic boundary conditions
     39#Create MPCs to have periodic boundary conditions
    4040#   posx = find(md.mesh.x = 0. & ~(md.mesh.y = 0. & md.mesh.vertexonbase) & ~(md.mesh.y = L & md.mesh.vertexonbase))
    4141    posx = np.where(np.logical_and.reduce((md.mesh.x == 0., np.logical_not(np.logical_and(md.mesh.y == 0., md.mesh.vertexonbase)), np.logical_not(np.logical_and(md.mesh.y == L, md.mesh.vertexonbase)))))[0]
     
    4343    posx2 = np.where(np.logical_and.reduce((md.mesh.x == np.max(md.mesh.x), np.logical_not(np.logical_and(md.mesh.y == 0., md.mesh.vertexonbase)), np.logical_not(np.logical_and(md.mesh.y == L, md.mesh.vertexonbase)))))[0]
    4444
    45     posy = np.where(np.logical_and.reduce((md.mesh.y == 0., md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]    #Don't take the same nodes two times
     45    posy = np.where(np.logical_and.reduce((md.mesh.y == 0., md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]  #Don't take the same nodes two times
    4646    posy2 = np.where(np.logical_and.reduce((md.mesh.y == np.max(md.mesh.y), md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]
    4747
    4848    md.stressbalance.vertex_pairing = np.vstack((np.vstack((posx + 1, posx2 + 1)).T, np.vstack((posy + 1, posy2 + 1)).T))
    4949
    50     #Add spc on the corners
     50#Add spc on the corners
    5151    pos = np.where(np.logical_and.reduce((np.logical_or(md.mesh.x == 0., md.mesh.x == L), np.logical_or(md.mesh.y == 0., md.mesh.y == L), md.mesh.vertexonbase)))
    5252    md.stressbalance.spcvy[:] = 0.
     
    6565        md.stressbalance.spcvx[pos] = 16.91
    6666
    67     #Spc the bed at zero for vz
     67#Spc the bed at zero for vz
    6868    pos = np.where(md.mesh.vertexonbase)
    6969    md.stressbalance.spcvz[pos] = 0.
    7070
    71     #Compute the stressbalance
     71#Compute the stressbalance
    7272    md.cluster = generic('name', gethostname(), 'np', 8)
    7373    md = solve(md, 'Stressbalance')
    7474
    75     #Plot the results and save them
     75#Plot the results and save them
    7676    vx = md.results.StressbalanceSolution.Vx
    7777    vy = md.results.StressbalanceSolution.Vy
     
    8181    maxvx.append(np.max(vx[-md.mesh.numberofvertices2d:]))
    8282
    83     #Now plot vx, vy, vz and vx on a cross section
    84 #   plotmodel(md, 'data', vx, 'layer#all', md.mesh.numberoflayers, 'xlim',[0 L/10^3], 'ylim',[0 L/10^3], 'unit', 'km', 'figure', 2)
     83#Now plot vx, vy, vz and vx on a cross section
     84#   plotmodel(md, 'data', vx, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 10^3], 'ylim', [0 L / 10^3], 'unit', 'km', 'figure', 2)
    8585    if printingflag:
    8686        pass
    8787#           set(gcf, 'Color', 'w')
    8888#           printmodel(['ismipdHOvx' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    89 #           shutil.move("ismipdHOvx%d.png" % L, ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestD')
    90 #   plotmodel(md, 'data', vz, 'layer#all', md.mesh.numberoflayers, 'xlim',[0 L/10^3], 'ylim',[0 L/10^3], 'unit', 'km', 'figure', 3)
     89#           shutil.move("ismipdHOvx%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestD')
     90#   plotmodel(md, 'data', vz, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 10^3], 'ylim', [0 L / 10^3], 'unit', 'km', 'figure', 3)
    9191    if printingflag:
    9292        pass
    9393#           set(gcf, 'Color', 'w')
    9494#           printmodel(['ismipdHOvz' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    95 #           shutil.move("ismipdHOvz%d.png" % L, ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestD')
     95#           shutil.move("ismipdHOvz%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestD')
    9696
    9797    if (L == 5000.):
    9898        pass
    99 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP5000.exp', 'layer', md.mesh.numberoflayers,...
    100 #                   'resolution',[10 10], 'ylim',[0 20], 'xlim',[0 5000], 'title', '', 'xlabel', '', 'figure', 4)
     99#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP5000.exp', 'layer', md.mesh.numberoflayers, ...
     100#                   'resolution', [10 10], 'ylim', [0 20], 'xlim', [0 5000], 'title', '', 'xlabel', '', 'figure', 4)
    101101    elif (L == 10000.):
    102102        pass
    103 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP10000.exp', 'layer', md.mesh.numberoflayers,...
    104 #                   'resolution',[10 10], 'ylim',[0 20], 'xlim',[0 10000], 'title', '', 'xlabel', '', 'figure', 4)
     103#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP10000.exp', 'layer', md.mesh.numberoflayers, ...
     104#                   'resolution', [10 10], 'ylim', [0 20], 'xlim', [0 10000], 'title', '', 'xlabel', '', 'figure', 4)
    105105    elif (L == 20000.):
    106106        pass
    107 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP20000.exp', 'layer', md.mesh.numberoflayers,...
    108 #                   'resolution',[10 10], 'ylim',[0 30], 'xlim',[0 20000], 'title', '', 'xlabel', '', 'figure', 4)
     107#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP20000.exp', 'layer', md.mesh.numberoflayers, ...
     108#                   'resolution', [10 10], 'ylim', [0 30], 'xlim', [0 20000], 'title', '', 'xlabel', '', 'figure', 4)
    109109    elif (L == 40000.):
    110110        pass
    111 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP40000.exp', 'layer', md.mesh.numberoflayers,...
    112 #                   'resolution',[10 10], 'ylim',[10 60], 'xlim',[0 40000], 'title', '', 'xlabel', '', 'figure', 4)
     111#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP40000.exp', 'layer', md.mesh.numberoflayers, ...
     112#                   'resolution', [10 10], 'ylim', [10 60], 'xlim', [0 40000], 'title', '', 'xlabel', '', 'figure', 4)
    113113    elif (L == 80000.):
    114114        pass
    115 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP80000.exp', 'layer', md.mesh.numberoflayers,...
    116 #                   'resolution',[10 10], 'ylim',[0 200], 'xlim',[0 80000], 'title', '', 'xlabel', '', 'figure', 4)
     115#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP80000.exp', 'layer', md.mesh.numberoflayers, ...
     116#                   'resolution', [10 10], 'ylim', [0 200], 'xlim', [0 80000], 'title', '', 'xlabel', '', 'figure', 4)
    117117    elif (L == 160000.):
    118118        pass
    119 #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP160000.exp', 'layer', md.mesh.numberoflayers,...
    120 #                   'resolution',[10 10], 'ylim',[0 400], 'xlim',[0 160000], 'title', '', 'xlabel', '', 'figure', 4)
     119#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP160000.exp', 'layer', md.mesh.numberoflayers, ...
     120#                   'resolution', [10 10], 'ylim', [0 400], 'xlim', [0 160000], 'title', '', 'xlabel', '', 'figure', 4)
    121121    if printingflag:
    122122        pass
    123123#           set(gcf, 'Color', 'w')
    124124#           printmodel(['ismipdHOvxsec' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    125 #           shutil.move("ismipdHOvxsec%d.png" % L, ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestD')
     125#           shutil.move("ismipdHOvxsec%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestD')
    126126
    127127#Now plot the min and max values of vx for each size of the square
     
    131131#       set(gcf, 'Color', 'w')
    132132#       printmodel('ismipdHOminvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    133 #       shutil.move('ismipdHOminvx.png', ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestD')
     133#       shutil.move('ismipdHOminvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestD')
    134134#plot([5 10 20 40 80 160], maxvx)ylim([0 300])xlim([0 160])
    135135if printingflag:
     
    137137#       set(gcf, 'Color', 'w')
    138138#       printmodel('ismipdHOmaxvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
    139 #       shutil.move('ismipdHOmaxvx.png', ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestD')
     139#       shutil.move('ismipdHOmaxvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestD')
    140140
    141141#Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test1108.py

    r23793 r24214  
    1313
    1414"""
    15 This test is a test from the ISMP-HOM Intercomparison project.
     15This test is a test from the ISMP - HOM Intercomparison project.
    1616Pattyn and Payne 2006
    1717"""
     
    2222
    2323for L in L_list:
    24     nx = 30    #numberof nodes in x direction
     24    nx = 30  #numberof nodes in x direction
    2525    ny = 30
    2626    md = model()
    2727    md = squaremesh(md, L, L, nx, ny)
    28     md = setmask(md, '', '')    #ice sheet test
     28    md = setmask(md, '', '')  #ice sheet test
    2929    md = parameterize(md, '../Par/ISMIPD.py')
    3030    md.extrude(10, 1.)
     
    3232    md = setflowequation(md, 'HO', 'all')
    3333
    34     #We need one grd on dirichlet: the 4 corners are set to zero
     34#We need one grd on dirichlet: the 4 corners are set to zero
    3535    md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
    3636    md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
     
    4848    md.stressbalance.spcvz[pos] = 0.
    4949
    50     #Create MPCs to have periodic boundary conditions
     50#Create MPCs to have periodic boundary conditions
    5151    posx = np.nonzero(md.mesh.x == 0.)[0]
    5252    posx2 = np.nonzero(md.mesh.x == np.max(md.mesh.x))[0]
    5353
    54     posy = np.intersect1d(np.intersect1d(np.where(md.mesh.y == 0.), np.where(md.mesh.x != 0.)), np.where(md.mesh.x != np.max(md.mesh.x)))[0]    #Don't take the same nodes two times
     54    posy = np.intersect1d(np.intersect1d(np.where(md.mesh.y == 0.), np.where(md.mesh.x != 0.)), np.where(md.mesh.x != np.max(md.mesh.x)))[0]  #Don't take the same nodes two times
    5555    posy2 = np.intersect1d(np.intersect1d(np.where(md.mesh.y == np.max(md.mesh.y)), np.where(md.mesh.x != 0.)), np.where(md.mesh.x != np.max(md.mesh.x)))[0]
    5656
    57     md.stressbalance.vertex_pairing = np.vstack((np.hstack((posx.reshape(-1, 1) + 1, posx2.reshape(-1, 1) + 1)), np.hstack((posy.reshape(-1, 1) + 1, posy2.reshape(-1, 1) + 1))))
     57    md.stressbalance.vertex_pairing = np.vstack((np.hstack((posx.reshape(- 1, 1) + 1, posx2.reshape(- 1, 1) + 1)), np.hstack((posy.reshape(- 1, 1) + 1, posy2.reshape(- 1, 1) + 1))))
    5858
    59     #Compute the stressbalance
     59#Compute the stressbalance
    6060    md.cluster = generic('name', gethostname(), 'np', 8)
    6161    md.verbose = verbose('convergence', True)
     
    6464    md.stressbalance.abstol = np.nan
    6565    md.stressbalance.vertex_pairing = np.empty((0, 2))
    66     #We need one grid on dirichlet: the 4 corners are set to zero
     66#We need one grid on dirichlet: the 4 corners are set to zero
    6767    md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
    6868    md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
    6969    md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices))
    70     pos = np.nonzero(logical_or.reduce_n(md.mesh.y == 0., md.mesh.x == 0., md.mesh.x == np.max(md.mesh.x), md.mesh.y == np.max(md.mesh.y)))    #Don't take the same nodes two times
    71     md.stressbalance.spcvx[pos] = md.results.StressbalanceSolution.Vx[pos]
    72     md.stressbalance.spcvy[pos] = md.results.StressbalanceSolution.Vy[pos]
     70    pos = np.nonzero(np.logical_or.reduce((md.mesh.y == 0., md.mesh.x == 0., md.mesh.x == np.max(md.mesh.x), md.mesh.y == np.max(md.mesh.y))))  #Don't take the same nodes two times
     71    md.stressbalance.spcvx[pos] = np.squeeze(md.results.StressbalanceSolution.Vx[pos])
     72    md.stressbalance.spcvy[pos] = np.squeeze(md.results.StressbalanceSolution.Vy[pos])
    7373    md = setflowequation(md, 'FS', 'all')
    7474    md = solve(md, 'Stressbalance')
    7575
    76     #Plot the results and save them
     76#Plot the results and save them
    7777    vx = md.results.StressbalanceSolution.Vx
    7878    vy = md.results.StressbalanceSolution.Vy
     
    8080    results.append(md.results.StressbalanceSolution)
    8181
    82 #       plotmodel(md, 'data', vx, 'data', vy, 'data', vz, 'layer#all', md.mesh.numberoflayers)
     82#       plotmodel(md, 'data', vx, 'data', vy, 'data', vz, 'layer  #all', md.mesh.numberoflayers)
    8383
    8484#Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test1109.py

    r23793 r24214  
    1010from squaremesh import *
    1111
    12 #This test is a test from the ISMP-HOM Intercomparison project.
     12#This test is a test from the ISMP - HOM Intercomparison project.
    1313#TestE
    1414#Four tests to run: - Pattyn frozen
    15 #                   - Stokes frozen
    16 #                   - Pattyn with some sliding
    17 #                   - Stokes with some sliding
     15# - Stokes frozen
     16# - Pattyn with some sliding
     17# - Stokes with some sliding
    1818printingflag = False
    1919results = []
     
    3535        md = setflowequation(md, 'FS', 'all')
    3636
    37     #Create MPCs to have periodic boundary conditions
     37#Create MPCs to have periodic boundary conditions
    3838    posx = np.where(md.mesh.x == 0.)[0]
    3939    posx2 = np.where(md.mesh.x == max(md.mesh.x))[0]
    4040    md.stressbalance.vertex_pairing = np.column_stack((posx, posx2))
    4141
    42     #Create spcs on the bed
     42#Create spcs on the bed
    4343    pos = np.where(md.mesh.vertexonbase)[0]
    44     md.stressbalance.spcvx = float('NaN') * np.ones((md.mesh.numberofvertices,))
    45     md.stressbalance.spcvy = float('NaN') * np.ones((md.mesh.numberofvertices,))
    46     md.stressbalance.spcvz = float('NaN') * np.ones((md.mesh.numberofvertices,))
     44    md.stressbalance.spcvx = float('NaN') * np.ones((md.mesh.numberofvertices, ))
     45    md.stressbalance.spcvy = float('NaN') * np.ones((md.mesh.numberofvertices, ))
     46    md.stressbalance.spcvz = float('NaN') * np.ones((md.mesh.numberofvertices, ))
    4747    md.stressbalance.spcvx[pos] = 0.
    4848    md.stressbalance.spcvy[pos] = 0.
    4949    md.stressbalance.spcvz[pos] = 0.
    5050
    51     #Remove the spc where there is some sliding (case 3 and 4):
     51#Remove the spc where there is some sliding (case 3 and 4):
    5252    if i == 2 or i == 3:
    5353        pos = np.intersect1d(np.where((md.mesh.y / max(md.mesh.y)) >= 0.44), np.where((md.mesh.y / max(md.mesh.y)) <= 0.5))[0]
     
    5656        md.stressbalance.spcvz[pos] = float('NaN')
    5757
    58     #Compute the stressbalance
     58#Compute the stressbalance
    5959    md.cluster = generic('name', gethostname(), 'np', 8)
    6060    md = solve(md, 'Stressbalance')
  • issm/trunk-jpl/test/NightlyRun/test1110.py

    r23793 r24214  
    1010from squaremesh import *
    1111
    12 #This test is a test from the ISMP-HOM Intercomparison project.
     12#This test is a test from the ISMP - HOM Intercomparison project.
    1313#TestF
    1414printingflag = False
     
    1616
    1717for i in range(4):
    18     L == 100000.  #in m
     18    L = 100000.  #in m
    1919    nx = 30  #numberof nodes in x direction
    2020    ny = 30
    2121    md = model()
    2222    md = squaremesh(md, L, L, nx, ny)
    23 #   md = triangle(md, '../Exp/SquareISMIP.exp', 5500.)
     23    #   md = triangle(md, '../Exp/SquareISMIP.exp', 5500.)
    2424    md = setmask(md, '', '')  #ice sheet test
    2525    md = parameterize(md, '../Par/ISMIPF.py')
     
    3131        md = setflowequation(md, 'FS', 'all')
    3232
    33     md.stressbalance.spcvx = float('NaN') * np.ones((md.mesh.numberofvertices,))
    34     md.stressbalance.spcvy = float('NaN') * np.ones((md.mesh.numberofvertices,))
    35     md.stressbalance.spcvz = float('NaN') * np.ones((md.mesh.numberofvertices,))
     33    md.stressbalance.spcvx = float('NaN') * np.ones((md.mesh.numberofvertices, ))
     34    md.stressbalance.spcvy = float('NaN') * np.ones((md.mesh.numberofvertices, ))
     35    md.stressbalance.spcvz = float('NaN') * np.ones((md.mesh.numberofvertices, ))
    3636    if (i == 0 or i == 2):
    3737        #Create dirichlet on the bed if no slip
     
    8383                  'title', '',
    8484                  'xlabel', '',
    85                   'ylabel', 'Velocity (m/yr)',
     85                  'ylabel', 'Velocity (m / yr)',
    8686                  'linewidth', 3,
    8787                  'grid', 'on',
     
    9494                  'title', '',
    9595                  'xlabel', '',
    96                   'ylabel', 'Velocity (m/yr)',
     96                  'ylabel', 'Velocity (m / yr)',
    9797                  'linewidth', 3,
    9898                  'grid', 'on',
     
    115115            #system(['mv ismipfFSvxsliding.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF'])
    116116
    117     plotmodel(md, 'data', (md.results.TransientSolution().Surface) - md.geometry.surface, 'layer', md.mesh.numberoflayers, 'sectionvalue', '../Exp/ISMIP100000.exp', 'title', '', 'xlabel', '', 'ylabel', 'Surface (m)', 'linewidth', 3, 'grid', 'on', 'unit', 'km', 'ylim', [-30, 50])
     117    plotmodel(md, 'data', (md.results.TransientSolution().Surface) - md.geometry.surface,
     118              'layer', md.mesh.numberoflayers,
     119              'sectionvalue', '../Exp/ISMIP100000.exp',
     120              'title', '',
     121              'xlabel', '',
     122              'ylabel', 'Surface (m)',
     123              'linewidth', 3,
     124              'grid', 'on',
     125              'unit', 'km',
     126              'ylim', [- 30, 50])
    118127    if printingflag:
    119128        #set(gcf, 'Color', 'w')
  • issm/trunk-jpl/test/NightlyRun/test119.py

    r23793 r24214  
    1212
    1313#hVertices
    14 md = bamg(model(), 'domain', '../Exp/Square.exp', 'hmax', 300000., 'hVertices', np.array([10000., 100000., 400000., 100000.]).reshape(-1, 1))
     14md = bamg(model(), 'domain', '../Exp/Square.exp', 'hmax', 300000., 'hVertices', np.array([10000., 100000., 400000., 100000.]).reshape(- 1, 1))
    1515x2 = md.mesh.x
    1616y2 = md.mesh.y
  • issm/trunk-jpl/test/NightlyRun/test1201.py

    r23793 r24214  
    2828    print("      initial velocity")
    2929    md.initialization.vx = np.zeros((md.mesh.numberofvertices))
    30     md.initialization.vy = -400. * np.ones((md.mesh.numberofvertices))
     30    md.initialization.vy = - 400. * np.ones((md.mesh.numberofvertices))
    3131
    32     #Stabilization
     32#Stabilization
    3333    if stabilization == 2:
    3434        md.masstransport.stabilization = 0
     
    3636        md.masstransport.stabilization = stabilization
    3737
    38     #spc thickness
     38#spc thickness
    3939    pos = np.where(md.mesh.y > 199999.9)[0]
    4040    times = np.arange(0, 501)
     
    4444    if stabilization == 3:
    4545        pos = np.nonzero(np.isnan(md.masstransport.spcthickness))
    46         md.masstransport.spcthickness[pos] = 500.    #No NaN for DG
     46        md.masstransport.spcthickness[pos] = 500.  #No NaN for DG
    4747
    48     #solve
     48#solve
    4949    md.transient.isstressbalance = False
    50     md.settings.output_frequency = 500    #keep only last step
     50    md.settings.output_frequency = 500  #keep only last step
    5151    md.verbose = verbose()
    5252    md = solve(md, 'Transient')
     
    5454
    5555#plot results
    56 #[elements, x, y, z, s, h1]=SectionValues(md, results[0], '../Exp/CrossLineEISMINT.exp', 100.)
    57 #[elements, x, y, z, s, h2]=SectionValues(md, results[1], '../Exp/CrossLineEISMINT.exp', 100.)
    58 #[elements, x, y, z, s, h3]=SectionValues(md, results[2], '../Exp/CrossLineEISMINT.exp', 100.)
    59 #[elements, x, y, z, s, hth]=SectionValues(md, 500+100*sin(2*pi/200*(500-md.mesh.y/400)), '../Exp/CrossLineEISMINT.exp', 100.)
     56#[elements, x, y, z, s, h1] = SectionValues(md, results[0], '../Exp/CrossLineEISMINT.exp', 100.)
     57#[elements, x, y, z, s, h2] = SectionValues(md, results[1], '../Exp/CrossLineEISMINT.exp', 100.)
     58#[elements, x, y, z, s, h3] = SectionValues(md, results[2], '../Exp/CrossLineEISMINT.exp', 100.)
     59#[elements, x, y, z, s, hth] = SectionValues(md, 500 + 100 * sin(2 * pi / 200 * (500 - md.mesh.y / 400)), '../Exp/CrossLineEISMINT.exp', 100.)
    6060#plot(s, h1, 'r', s, h2, 'b', s, h3, 'g', s, hth, 'k')
    6161#legend('Art. diff.', 'No Art. diff.', 'D.G.', 'Theoretical')
  • issm/trunk-jpl/test/NightlyRun/test1202.py

    r23793 r24214  
    2020md = setmask(md, 'all', '')
    2121md = parameterize(md, '../Par/SquareEISMINT.py')
    22 md = setflowequation(md, 'SSA', 'all')    #SSA's model and 2d
     22md = setflowequation(md, 'SSA', 'all')  #SSA's model and 2d
    2323
    2424#Compute solution for SSA's model
     
    3030vy = md.results.StressbalanceSolution.Vy
    3131
    32 #plotmodel(md, 'data', vx, 'contourlevels',{0, 20, 40, 60, 60, 100, 120, 140, 160, 180,-20,-40,-60,-80,-100,-120,-140,-160,-180}, ...
     32#plotmodel(md, 'data', vx, 'contourlevels', {0, 20, 40, 60, 60, 100, 120, 140, 160, 180, - 20, - 40, - 60, - 80, - 100, - 120, - 140, - 160, - 180}, ...
    3333#       'contourcolor', 'k')
    3434if printingflag:
     
    3838#       system(['mv eismintdiag1vx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
    3939
    40 #plotmodel(md, 'data', vy, 'contourlevels',{-100,-200,-300,-400,-500,-600,-700,-800,-900,-1000},...
     40#plotmodel(md, 'data', vy, 'contourlevels', { - 100, - 200, - 300, - 400, - 500, - 600, - 700, - 800, - 900, - 1000}, ...
    4141#       'contourcolor', 'k')
    4242if printingflag:
  • issm/trunk-jpl/test/NightlyRun/test1203.py

    r23793 r24214  
    1919#test 5 and 6:
    2020md = model()
    21 md = triangle(md, '../Exp/SquareEISMINT.exp', 5100.)    #test3
     21md = triangle(md, '../Exp/SquareEISMINT.exp', 5100.)  #test3
    2222md = setmask(md, 'all', '')
    2323md = parameterize(md, '../Par/SquareEISMINT.py')
    24 md = setflowequation(md, 'SSA', 'all')    #SSA's model and 2d
     24md = setflowequation(md, 'SSA', 'all')  #SSA's model and 2d
    2525
    2626#Impose a non zero velocity on the upper boundary condition (y = max(y))
     
    3838
    3939#plot results
    40 #plotmodel(md, 'data', vx, 'contourlevels',{0, 20, 40, 60, 80, 100,-20,-40,-60,-80,-100},...
     40#plotmodel(md, 'data', vx, 'contourlevels', {0, 20, 40, 60, 80, 100, - 20, - 40, - 60, - 80, - 100}, ...
    4141#       'contourcolor', 'k')
    4242if printingflag:
     
    4545#       printmodel('eismintdiag2vx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 2, 'hardcopy', 'off')
    4646#       system(['mv eismintdiag2vx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
    47 #plotmodel(md, 'data', vy, 'contourlevels',{-100,-200,-300,-400,-500,-600,-700,-800,-900,-1000},...
     47#plotmodel(md, 'data', vy, 'contourlevels', { - 100, - 200, - 300, - 400, - 500, - 600, - 700, - 800, - 900, - 1000}, ...
    4848#       'contourcolor', 'k')
    4949if printingflag:
  • issm/trunk-jpl/test/NightlyRun/test1204.py

    r23793 r24214  
    2222md = setmask(md, 'all', '')
    2323md = parameterize(md, '../Par/SquareEISMINT.py')
    24 md = setflowequation(md, 'SSA', 'all')    #SSA's model and 2d
     24md = setflowequation(md, 'SSA', 'all')  #SSA's model and 2d
    2525
    2626#Impose a non zero velocity on the upper boundary condition (y = max(y))
     
    4343md = solve(md, 'Transient')
    4444
    45 #plotmodel(md, 'data',(md.results.TransientSolution(end).Vx))
     45#plotmodel(md, 'data', (md.results.TransientSolution(end).Vx))
    4646if printingflag:
    4747    pass
     
    5050#       system(['mv eisminttrans2vx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
    5151
    52 #plotmodel(md, 'data',(md.results.TransientSolution(end).Vy))
     52#plotmodel(md, 'data', (md.results.TransientSolution(end).Vy))
    5353if printingflag:
    5454    pass
     
    5757#       system(['mv eisminttrans2vy.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
    5858
    59 #plotmodel(md, 'data',(md.results.TransientSolution(end).Thickness))
     59#plotmodel(md, 'data', (md.results.TransientSolution(end).Thickness))
    6060if printingflag:
    6161    pass
  • issm/trunk-jpl/test/NightlyRun/test1205.py

    r23793 r24214  
    2222md = model()
    2323md = roundmesh(md, 750000., resolution)
    24 md = setmask(md, '', '')    #We can not test iceshelves nor ice rises with this analytical solution
     24md = setmask(md, '', '')  #We can not test iceshelves nor ice rises with this analytical solution
    2525md = parameterize(md, '../Par/RoundSheetStaticEISMINT.py')
    2626
    2727#Calculation of the analytical 2d velocity field
    2828constant = 0.3
    29 vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**-1
    30 vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**-1
     29vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**- 1
     30vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**- 1
    3131vel_obs = np.sqrt((md.inversion.vx_obs)**2 + (md.inversion.vy_obs)**2)
    3232
     
    5858#Plot of the velocity from the exact and calculated solutions
    5959#figure(1)
    60 #set(gcf, 'Position',[1 1 1580 1150])
     60#set(gcf, 'Position', [1 1 1580 1150])
    6161#subplot(2, 2, 1)
    62 #p = patch('Faces', md.mesh.elements2d, 'Vertices',[md.mesh.x2d md.mesh.y2d], 'FaceVertexCData',...
     62#p = patch('Faces', md.mesh.elements2d, 'Vertices', [md.mesh.x2d md.mesh.y2d], 'FaceVertexCData', ...
    6363#vel, 'FaceColor', 'interp', 'EdgeColor', 'none')
    6464#title('Modelled velocity', 'FontSize', 14, 'FontWeight', 'bold')
     
    6767
    6868#subplot(2, 2, 2)
    69 #p = patch('Faces', md.mesh.elements2d, 'Vertices',[md.mesh.x2d md.mesh.y2d], 'FaceVertexCData',...
     69#p = patch('Faces', md.mesh.elements2d, 'Vertices', [md.mesh.x2d md.mesh.y2d], 'FaceVertexCData', ...
    7070#vel_obs, 'FaceColor', 'interp', 'EdgeColor', 'none')
    7171#title('Analytical velocity', 'FontSize', 14, 'FontWeight', 'bold')
     
    7575#subplot(2, 2, 3)
    7676#hold on
    77 #plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2+(md.mesh.y(1:md.mesh.numberofvertices2d)).^2), vel, 'r.')
    78 #plot(sqrt((md.mesh.x2d).^2+(md.mesh.y2d).^2), vel_obs, 'b.')
     77#plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2 + (md.mesh.y(1:md.mesh.numberofvertices2d)).^2), vel, 'r.')
     78#plot(sqrt((md.mesh.x2d).^2 + (md.mesh.y2d).^2), vel_obs, 'b.')
    7979#title('Analytical vs calculated velocity', 'FontSize', 14, 'FontWeight', 'bold')
    8080#xlabel('distance to the center of the icesheet [m]', 'FontSize', 14, 'FontWeight', 'bold')
    81 #ylabel('velocity [m/yr]', 'FontSize', 14, 'FontWeight', 'bold')
     81#ylabel('velocity [m / yr]', 'FontSize', 14, 'FontWeight', 'bold')
    8282#legend('calculated velocity', 'exact velocity')
    8383#axis([0 750000 0 200])
     
    8585
    8686#subplot(2, 2, 4)
    87 #p = patch('Faces', md.mesh.elements2d, 'Vertices',[md.mesh.x2d md.mesh.y2d], 'FaceVertexCData',...
    88 #abs(vel-vel_obs)./vel_obs*100, 'FaceColor', 'interp', 'EdgeColor', 'none')
     87#p = patch('Faces', md.mesh.elements2d, 'Vertices', [md.mesh.x2d md.mesh.y2d], 'FaceVertexCData', ...
     88#abs(vel - vel_obs). / vel_obs * 100, 'FaceColor', 'interp', 'EdgeColor', 'none')
    8989#title('Relative misfit [%]', 'FontSize', 14, 'FontWeight', 'bold')
    9090#colorbar
  • issm/trunk-jpl/test/NightlyRun/test1206.py

    r23793 r24214  
    2222md = model()
    2323md = roundmesh(md, 750000., resolution)
    24 md = setmask(md, '', '')    #We can not test iceshelves nor ice rises with this analytical solution
     24md = setmask(md, '', '')  #We can not test iceshelves nor ice rises with this analytical solution
    2525md = parameterize(md, '../Par/RoundSheetStaticEISMINT.py')
    2626
    2727#Calculation of the analytical 2d velocity field
    2828constant = 0.3
    29 vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**-1
    30 vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**-1
     29vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**- 1
     30vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**- 1
    3131vel_obs = np.sqrt((md.inversion.vx_obs)**2 + (md.inversion.vy_obs)**2)
    3232
     
    5959#figure(1)
    6060#subplot(2, 2, 1)
    61 #p = patch('Faces', md.mesh.elements2d, 'Vertices',[md.mesh.x2d md.mesh.y2d], 'FaceVertexCData',...
     61#p = patch('Faces', md.mesh.elements2d, 'Vertices', [md.mesh.x2d md.mesh.y2d], 'FaceVertexCData', ...
    6262#vel, 'FaceColor', 'interp', 'EdgeColor', 'none')
    6363#title('Modelled velocity', 'FontSize', 14, 'FontWeight', 'bold')
     
    6666
    6767#subplot(2, 2, 2)
    68 #p = patch('Faces', md.mesh.elements2d, 'Vertices',[md.mesh.x2d md.mesh.y2d], 'FaceVertexCData',...
     68#p = patch('Faces', md.mesh.elements2d, 'Vertices', [md.mesh.x2d md.mesh.y2d], 'FaceVertexCData', ...
    6969#vel_obs, 'FaceColor', 'interp', 'EdgeColor', 'none')
    7070#title('Analytical velocity', 'FontSize', 14, 'FontWeight', 'bold')
     
    7474#subplot(2, 2, 3)
    7575#hold on
    76 #plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2+(md.mesh.y(1:md.mesh.numberofvertices2d)).^2), vel, 'r.')
    77 #plot(sqrt((md.mesh.x2d).^2+(md.mesh.y2d).^2), vel_obs, 'b.')
     76#plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2 + (md.mesh.y(1:md.mesh.numberofvertices2d)).^2), vel, 'r.')
     77#plot(sqrt((md.mesh.x2d).^2 + (md.mesh.y2d).^2), vel_obs, 'b.')
    7878#title('Analytical vs calculated velocity', 'FontSize', 14, 'FontWeight', 'bold')
    7979#xlabel('distance to the center of the icesheet [m]', 'FontSize', 14, 'FontWeight', 'bold')
    80 #ylabel('velocity [m/yr]', 'FontSize', 14, 'FontWeight', 'bold')
     80#ylabel('velocity [m / yr]', 'FontSize', 14, 'FontWeight', 'bold')
    8181#legend('calculated velocity', 'exact velocity')
    8282#axis([0 750000 0 200])
     
    8484
    8585#subplot(2, 2, 4)
    86 #p = patch('Faces', md.mesh.elements2d, 'Vertices',[md.mesh.x2d md.mesh.y2d], 'FaceVertexCData',...
    87 #abs(vel-vel_obs)./vel_obs*100, 'FaceColor', 'interp', 'EdgeColor', 'none')
     86#p = patch('Faces', md.mesh.elements2d, 'Vertices', [md.mesh.x2d md.mesh.y2d], 'FaceVertexCData', ...
     87#abs(vel - vel_obs). / vel_obs * 100, 'FaceColor', 'interp', 'EdgeColor', 'none')
    8888#title('Relative misfit [%]', 'FontSize', 14, 'FontWeight', 'bold')
    8989#colorbar
  • issm/trunk-jpl/test/NightlyRun/test1207.py

    r23793 r24214  
    2222md = model()
    2323md = roundmesh(md, 750000., resolution)
    24 md = setmask(md, '', '')    #We can not test iceshelves nor ice rises with this analytical solution
     24md = setmask(md, '', '')  #We can not test iceshelves nor ice rises with this analytical solution
    2525md = parameterize(md, '../Par/RoundSheetStaticEISMINT.py')
    2626
    2727#Calculation of the analytical 2d velocity field
    2828constant = 0.3
    29 vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**-1
    30 vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**-1
     29vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**- 1
     30vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**- 1
    3131vel_obs = np.sqrt((md.inversion.vx_obs)**2 + (md.inversion.vy_obs)**2)
    3232
     
    5959#figure(1)
    6060#subplot(2, 2, 1)
    61 #p = patch('Faces', md.mesh.elements2d, 'Vertices',[md.mesh.x2d md.mesh.y2d], 'FaceVertexCData',...
     61#p = patch('Faces', md.mesh.elements2d, 'Vertices', [md.mesh.x2d md.mesh.y2d], 'FaceVertexCData', ...
    6262#vel, 'FaceColor', 'interp', 'EdgeColor', 'none')
    6363#title('Modelled velocity', 'FontSize', 14, 'FontWeight', 'bold')
     
    6666
    6767#subplot(2, 2, 2)
    68 #p = patch('Faces', md.mesh.elements2d, 'Vertices',[md.mesh.x2d md.mesh.y2d], 'FaceVertexCData',...
     68#p = patch('Faces', md.mesh.elements2d, 'Vertices', [md.mesh.x2d md.mesh.y2d], 'FaceVertexCData', ...
    6969#vel_obs, 'FaceColor', 'interp', 'EdgeColor', 'none')
    7070#title('Analytical velocity', 'FontSize', 14, 'FontWeight', 'bold')
     
    7474#subplot(2, 2, 3)
    7575#hold on
    76 #plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2+(md.mesh.y(1:md.mesh.numberofvertices2d)).^2), vel, 'r.')
    77 #plot(sqrt((md.mesh.x2d).^2+(md.mesh.y2d).^2), vel_obs, 'b.')
     76#plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2 + (md.mesh.y(1:md.mesh.numberofvertices2d)).^2), vel, 'r.')
     77#plot(sqrt((md.mesh.x2d).^2 + (md.mesh.y2d).^2), vel_obs, 'b.')
    7878#title('Analytical vs calculated velocity', 'FontSize', 14, 'FontWeight', 'bold')
    7979#xlabel('distance to the center of the icesheet [m]', 'FontSize', 14, 'FontWeight', 'bold')
    80 #ylabel('velocity [m/yr]', 'FontSize', 14, 'FontWeight', 'bold')
     80#ylabel('velocity [m / yr]', 'FontSize', 14, 'FontWeight', 'bold')
    8181#legend('calculated velocity', 'exact velocity')
    8282#axis([0 750000 0 200])
     
    8484
    8585#subplot(2, 2, 4)
    86 #p = patch('Faces', md.mesh.elements2d, 'Vertices',[md.mesh.x2d md.mesh.y2d], 'FaceVertexCData',...
    87 #abs(vel-vel_obs)./vel_obs*100, 'FaceColor', 'interp', 'EdgeColor', 'none')
     86#p = patch('Faces', md.mesh.elements2d, 'Vertices', [md.mesh.x2d md.mesh.y2d], 'FaceVertexCData', ...
     87#abs(vel - vel_obs). / vel_obs * 100, 'FaceColor', 'interp', 'EdgeColor', 'none')
    8888#title('Relative misfit [%]', 'FontSize', 14, 'FontWeight', 'bold')
    8989#colorbar
  • issm/trunk-jpl/test/NightlyRun/test1301.py

    r23793 r24214  
    3636#analytical results
    3737#melting heat = geothermal flux
    38 #Mb*L*rho = G => Mb = G/L*rho
     38#Mb * L * rho = G = > Mb = G / L * rho
    3939melting = md.basalforcings.geothermalflux / (md.materials.rho_ice * md.materials.latentheat) * md.constants.yts
    4040
     
    4747relative = np.abs((comp_melting - melting) / melting) * 100.
    4848relative[np.nonzero(comp_melting == melting)[0]] = 0.
    49 #plotmodel(md, 'data', comp_melting, 'title', 'Modeled melting', 'data', melting, 'title', 'Analytical melting',...
    50 #       'data', comp_melting-melting, 'title', 'Absolute error', 'data', relative, 'title', 'Relative error [%]',...
    51 #       'layer#all', 1, 'caxis#2',[1.02964 1.02966]*10^-4, 'FontSize#all', 20, 'figposition', 'mathieu')
     49#plotmodel(md, 'data', comp_melting, 'title', 'Modeled melting', 'data', melting, 'title', 'Analytical melting', ...
     50#       'data', comp_melting - melting, 'title', 'Absolute error', 'data', relative, 'title', 'Relative error [%]', ...
     51#       'layer  #all', 1, 'caxis  #2', [1.02964 1.02966] * 10^ - 4, 'FontSize  #all', 20, 'figposition', 'mathieu')
    5252if printingflag:
    5353    pass
  • issm/trunk-jpl/test/NightlyRun/test1302.py

    r23793 r24214  
    1111
    1212"""
    13 This file can be run to check that the advection-diffusion  is correctly modeled.
    14 There is u = v=0 and w = cst everywhere the only thermal boundary conditions are an imposed temperature
     13This file can be run to check that the advection - diffusion  is correctly modeled.
     14There is u = v = 0 and w = cst everywhere the only thermal boundary conditions are an imposed temperature
    1515at upper surface and an impose flux at its base.
    1616"""
     
    2222md = setmask(md, '', '')
    2323md = parameterize(md, '../Par/SquareThermal.py')
    24 md.extrude(30, 1.)    #NB: the more one extrudes, the better (10-> relative~0.35%, 20->0.1%, 30->0.05%)
     24md.extrude(30, 1.)  #NB: the more one extrudes, the better (10 - > relative~0.35%, 20 - > 0.1%, 30 - > 0.05%)
    2525md = setflowequation(md, 'HO', 'all')
    2626
     
    3636md.thermal.stabilization = 2
    3737#analytical results
    38 #d2T/dz2-w*rho_ice*c/k*dT/dz = 0   T(surface)=0  T(bed)=10 => T = A exp(alpha z)+B
    39 alpha = 0.1 / md.constants.yts * md.materials.rho_ice * md.materials.heatcapacity / md.materials.thermalconductivity    #alpha = w rho_ice c /k  and w = 0.1m/an
    40 A = 10. / (np.exp(alpha * (-1000.)) - 1.)    #A = T(bed)/(exp(alpha*bed)-1)  with bed=-1000 T(bed)=10
    41 B = -A
     38#d2T / dz2 - w * rho_ice * c / k * dT / dz = 0   T(surface)=0  T(bed)=10 = > T = A exp(alpha z) + B
     39alpha = 0.1 / md.constants.yts * md.materials.rho_ice * md.materials.heatcapacity / md.materials.thermalconductivity  #alpha = w rho_ice c / k  and w = 0.1m / an
     40A = 10. / (np.exp(alpha * (- 1000.)) - 1.)  #A = T(bed) / (exp(alpha * bed) - 1)  with bed= - 1000 T(bed)=10
     41B = - A
    4242md.initialization.temperature = A * np.exp(alpha * md.mesh.z) + B
    4343
     
    5050relative = np.abs((comp_temp - md.initialization.temperature) / md.initialization.temperature) * 100.
    5151relative[np.nonzero(comp_temp == md.initialization.temperature)[0]] = 0.
    52 #plotmodel(md, 'data', comp_temp, 'title', 'Modeled temperature [K]', 'data', md.initialization.temperature, 'view', 3,...
    53 #       'title', 'Analytical temperature [K]', 'view', 3, 'data', comp_temp-md.initialization.temperature,...
    54 #       'title', 'Absolute error [K]', 'view', 3, 'data', relative, 'title', 'Relative error [%]', 'view', 3,...
    55 #       'figposition', 'mathieu', 'FontSize#all', 20)
     52#plotmodel(md, 'data', comp_temp, 'title', 'Modeled temperature [K]', 'data', md.initialization.temperature, 'view', 3, ...
     53#       'title', 'Analytical temperature [K]', 'view', 3, 'data', comp_temp - md.initialization.temperature, ...
     54#       'title', 'Absolute error [K]', 'view', 3, 'data', relative, 'title', 'Relative error [%]', 'view', 3, ...
     55#       'figposition', 'mathieu', 'FontSize  #all', 20)
    5656if printingflag:
    5757    pass
  • issm/trunk-jpl/test/NightlyRun/test1303.py

    r23793 r24214  
    3434
    3535#analytical results
    36 #d2T/dz2 = 0 T(bed)=10 T(surface)=0 => T = 0*(z-bed)/thickness+10*(surface-z)/thickness
     36#d2T / dz2 = 0 T(bed)=10 T(surface)=0 = > T = 0 * (z - bed) / thickness + 10 * (surface-z) / thickness
    3737#each layer of the 3d mesh must have a constant value
    3838md.initialization.temperature = 10. * (md.geometry.surface - md.mesh.z) / md.geometry.thickness
     
    4646relative = np.abs((comp_temp - md.initialization.temperature) / md.initialization.temperature) * 100.
    4747relative[np.nonzero(comp_temp == md.initialization.temperature)[0]] = 0.
    48 #plotmodel(md, 'data', comp_temp, 'title', 'Modeled temperature [K]', 'data', md.initialization.temperature, 'view', 3,...
    49 #       'title', 'Analytical temperature [K]', 'view', 3, 'data', comp_temp-md.initialization.temperature,...
    50 #       'title', 'Absolute error [K]', 'view', 3, 'data', relative, 'title', 'Relative error [%]', 'view', 3,...
    51 #       'figposition', 'mathieu', 'FontSize#all', 20)
     48#plotmodel(md, 'data', comp_temp, 'title', 'Modeled temperature [K]', 'data', md.initialization.temperature, 'view', 3, ...
     49#       'title', 'Analytical temperature [K]', 'view', 3, 'data', comp_temp - md.initialization.temperature, ...
     50#       'title', 'Absolute error [K]', 'view', 3, 'data', relative, 'title', 'Relative error [%]', 'view', 3, ...
     51#       'figposition', 'mathieu', 'FontSize  #all', 20)
    5252if printingflag:
    5353    pass
  • issm/trunk-jpl/test/NightlyRun/test1304.py

    r23793 r24214  
    2929md.thermal.spctemperature[md.mesh.elements[pos2, 3:6] - 1] = 0.
    3030md.initialization.pressure = np.zeros((md.mesh.numberofvertices), int)
    31 md.basalforcings.geothermalflux[:] = 0.1    #100mW/m^2
     31md.basalforcings.geothermalflux[:] = 0.1  #100mW / m^2
    3232
    3333#analytical results
    3434#the result is linear with depth and is equal to 0 on the upper surface (See BC)
    35 #d2T/dz2 = 0  -k*dT/dz(bed)=G  T(surface)=0 => T=-G/k*(z-surface)
    36 md.initialization.temperature = -0.1 / md.materials.thermalconductivity * (md.mesh.z - md.geometry.surface)    #G = 0.1 W/m2
     35#d2T / dz2 = 0 - k * dT / dz(bed)=G  T(surface)=0 = > T= - G / k * (z - surface)
     36md.initialization.temperature = - 0.1 / md.materials.thermalconductivity * (md.mesh.z - md.geometry.surface)  #G = 0.1 W / m2
    3737
    3838#modeled results
     
    4444relative = np.abs((comp_temp - md.initialization.temperature) / md.initialization.temperature) * 100.
    4545relative[np.where(comp_temp == md.initialization.temperature)[0]] = 0.
    46 #plotmodel(md, 'data', comp_temp, 'title', 'Modeled temperature [K]', 'data', md.initialization.temperature, 'view', 3,...
    47 #       'title', 'Analytical temperature', 'view', 3, 'data', comp_temp-md.initialization.temperature,...
    48 #       'title', 'Absolute error [K]', 'view', 3, 'data', relative, 'title', 'Relative error [%]', 'view', 3,...
    49 #       'figposition', 'mathieu', 'FontSize#all', 20)
     46#plotmodel(md, 'data', comp_temp, 'title', 'Modeled temperature [K]', 'data', md.initialization.temperature, 'view', 3, ...
     47#       'title', 'Analytical temperature', 'view', 3, 'data', comp_temp - md.initialization.temperature, ...
     48#       'title', 'Absolute error [K]', 'view', 3, 'data', relative, 'title', 'Relative error [%]', 'view', 3, ...
     49#       'figposition', 'mathieu', 'FontSize  #all', 20)
    5050if printingflag:
    5151    pass
  • issm/trunk-jpl/test/NightlyRun/test1501.py

    r23793 r24214  
    2323md.timestepping.final_time = 2000.
    2424
    25 #Solve for thinning rate -> -1 * surface mass balance
     25#Solve for thinning rate-> - 1 * surface mass balance
    2626smb = 2. * np.ones((md.mesh.numberofvertices))
    2727md.smb.mass_balance = smb
     
    3737smb = md.smb.mass_balance
    3838
    39 #tooth= [ [ones(400, 1)*(smb') - 10.]' [ones(400, 1)*(smb')]' ]
     39#tooth= [ [ones(400, 1) * (smb') - 10.]' [ones(400, 1) * (smb')]' ]
    4040tooth = np.hstack((np.tile(smb - 10., (1, 400)), np.tile(smb, (1, 400))))
    41 #smb = [ [ones(399, 1)*(smb')]' smb  tooth tooth]
     41#smb = [ [ones(399, 1) * (smb')]' smb  tooth tooth]
    4242smb = np.hstack((np.tile(smb, (1, 399)), smb, tooth, tooth))
    4343
    4444#md.smb.mass_balance= smb
    45 #md.smb.mass_balance(end+1,:)=[1.:2000.]
     45#md.smb.mass_balance(end + 1, :) = [1.:2000.]
    4646md.smb.mass_balance = np.vstack((smb, np.arange(1, 2001)))
    4747
     
    112112    x1 = md.mesh.x(index(:)) x2 = md.mesh.x(index(:, 2)) x3 = md.mesh.x(index(:, 3))
    113113    y1 = md.mesh.y(index(:)) y2 = md.mesh.y(index(:, 2)) y3 = md.mesh.y(index(:, 3))
    114     areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)))
     114    areas=(0.5 * ((x2 - x1). * (y3 - y1) - (y2 - y1). * (x3 - x1)))
    115115
    116116    thickness = []
     
    120120    for t = starttime:endtime
    121121            thickness = [thickness (md.results.TransientSolution(t).Thickness)]
    122             volume = [volume mean(md.results.TransientSolution(t).Thickness.value, 2).*areas]
     122            volume = [volume mean(md.results.TransientSolution(t).Thickness.value, 2). * areas]
    123123            massbal = [massbal (md.results.TransientSolution(t).SmbMassBalance)]
    124124            velocity = [velocity (md.results.TransientSolution(t).Vel)]
     
    135135    for i = ts
    136136
    137         subplot(5, 9,[28:31 37:40])
    138         set(gca, 'pos', get(gca, 'pos')+[-0.08 -0.08 0.07 0.08])
     137        subplot(5, 9, [28:31 37:40])
     138        set(gca, 'pos', get(gca, 'pos') + [ - 0.08 - 0.08 0.07 0.08])
    139139        field = 'Thickness'
    140140
    141141        %process data
    142         [x y z elements is2d isplanet]=processmesh(md, results(i).(field), options)
    143         [data datatype]=processdata(md, results(i).(field), options)
    144 
    145         titlestring = [field ' at time ' num2str(results(i).time/md.constants.yts) ' year']
     142        [x y z elements is2d isplanet] = processmesh(md, results(i).(field), options)
     143        [data datatype] = processdata(md, results(i).(field), options)
     144
     145        titlestring = [field ' at time ' num2str(results(i).time / md.constants.yts) ' year']
    146146        plot_unit(x, y, z, elements, data, is2d, isplanet, datatype, options)
    147147        options = changefieldvalue(options, 'title', titlestring)
    148148        options = addfielddefault(options, 'colorbar', 1)
    149         options = changefieldvalue(options, 'caxis',[0 max(max(thickness))])
    150         applyoptions(md,[], options)
    151 
    152         subplot(5, 9,[33:36 42:45])
    153         set(gca, 'pos', get(gca, 'pos')+[-0.00 -0.08 0.07 0.08])
     149        options = changefieldvalue(options, 'caxis', [0 max(max(thickness))])
     150        applyoptions(md, [], options)
     151
     152        subplot(5, 9, [33:36 42:45])
     153        set(gca, 'pos', get(gca, 'pos') + [ - 0.00 - 0.08 0.07 0.08])
    154154        field = 'Vel'
    155155
    156156        %process data
    157         [x y z elements is2d isplanet]=processmesh(md, results(i).(field), options)
    158         [data datatype]=processdata(md, results(i).(field), options)
    159 
    160         titlestring = [field ' at time ' num2str(results(i).time/md.constants.yts) ' year']
     157        [x y z elements is2d isplanet] = processmesh(md, results(i).(field), options)
     158        [data datatype] = processdata(md, results(i).(field), options)
     159
     160        titlestring = [field ' at time ' num2str(results(i).time / md.constants.yts) ' year']
    161161        plot_unit(x, y, z, elements, data, is2d, isplanet, datatype, options)
    162162        options = changefieldvalue(options, 'title', titlestring)
    163163        options = addfielddefault(options, 'colorbar', 1)
    164         options = changefieldvalue(options, 'caxis',[0 max(max(velocity))])
    165         applyoptions(md,[], options)
     164        options = changefieldvalue(options, 'caxis', [0 max(max(velocity))])
     165        applyoptions(md, [], options)
    166166
    167167        subplot(5, 4, 1:4)
    168168        cla
    169         set(gca, 'pos', get(gca, 'pos')+[-0.07 0.03 0.12 0.015])
     169        set(gca, 'pos', get(gca, 'pos') + [ - 0.07 0.03 0.12 0.015])
    170170        plot(starttime:endtime, mean(massbal), 'k', 'LineWidth', 4)
    171171        hold on
     
    178178        subplot(5, 4, 5:8)
    179179        cla
    180         set(gca, 'pos', get(gca, 'pos')+[-0.07 0.015 0.12 0.015])
    181         plot(starttime:endtime, sum(volume)/1000/1000/1000, 'LineWidth', 4)
     180        set(gca, 'pos', get(gca, 'pos') + [ - 0.07 0.015 0.12 0.015])
     181        plot(starttime:endtime, sum(volume) / 1000 / 1000 / 1000, 'LineWidth', 4)
    182182        hold on
    183183        ya = ylim
     
    189189        subplot(5, 4, 9:12)
    190190        cla
    191         set(gca, 'pos', get(gca, 'pos')+[-0.07 0 0.12 0.015])
    192         plot(starttime:endtime, mean(velocity)/1000, 'LineWidth', 4)
     191        set(gca, 'pos', get(gca, 'pos') + [ - 0.07 0 0.12 0.015])
     192        plot(starttime:endtime, mean(velocity) / 1000, 'LineWidth', 4)
    193193        hold on
    194194        ya = ylim
     
    203203                %initialize images and frame
    204204                frame = getframe(gcf)
    205                 [images, map]=rgb2ind(frame.cdata, 256, 'nodither')
     205                [images, map] = rgb2ind(frame.cdata, 256, 'nodither')
    206206                images(1, 1, 1, length(ts))=0
    207207        else
    208208                frame = getframe(gcf)
    209                 images(:,:, 1, count) = rgb2ind(frame.cdata, map, 'nodither')
     209                images(:, :, 1, count) = rgb2ind(frame.cdata, map, 'nodither')
    210210        end
    211211
    212         count = count+1
     212        count = count + 1
    213213
    214214        end
    215215
    216         filename='transawtooth2d.gif'
     216        filename = 'transawtooth2d.gif'
    217217        imwrite(images, map, filename, 'DelayTime', 1.0, 'LoopCount', inf)
    218218        """
  • issm/trunk-jpl/test/NightlyRun/test1502.py

    r23793 r24214  
    2424md.timestepping.final_time = 2000.
    2525
    26 #Solve for thinning rate -> -1 * surface mass balance
     26#Solve for thinning rate-> - 1 * surface mass balance
    2727smb = 2. * np.ones((md.mesh.numberofvertices))
    2828md.smb.mass_balance = smb
     
    3838smb = md.smb.mass_balance
    3939
    40 #tooth= [ [ones(400, 1)*(smb') - 10.]' [ones(400, 1)*(smb')]' ]
     40#tooth= [ [ones(400, 1) * (smb') - 10.]' [ones(400, 1) * (smb')]' ]
    4141tooth = np.hstack((np.tile(smb - 10., (1, 400)), np.tile(smb, (1, 400))))
    42 #smb = [ [ones(399, 1)*(smb')]' smb  tooth tooth]
     42#smb = [ [ones(399, 1) * (smb')]' smb  tooth tooth]
    4343smb = np.hstack((np.tile(smb, (1, 399)), smb, tooth, tooth))
    4444
    4545#md.smb.mass_balance= smb
    46 #md.smb.mass_balance(end+1,:)=[1.:2000.]
     46#md.smb.mass_balance(end + 1, :) = [1.:2000.]
    4747md.smb.mass_balance = np.vstack((smb, np.arange(1, 2001)))
    4848
     
    118118    x1 = md.mesh.x(index(:)) x2 = md.mesh.x(index(:, 2)) x3 = md.mesh.x(index(:, 3))
    119119    y1 = md.mesh.y(index(:)) y2 = md.mesh.y(index(:, 2)) y3 = md.mesh.y(index(:, 3))
    120     areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)))
     120    areas=(0.5 * ((x2 - x1). * (y3 - y1) - (y2 - y1). * (x3 - x1)))
    121121
    122122    thickness = []
     
    126126    for t = starttime:endtime
    127127            thickness = [thickness (md.results.TransientSolution(t).Thickness)]
    128             volume = [volume mean(md.results.TransientSolution(t).Thickness.value, 2).*areas]
     128            volume = [volume mean(md.results.TransientSolution(t).Thickness.value, 2). * areas]
    129129            massbal = [massbal (md.results.TransientSolution(t).SmbMassBalance)]
    130130            velocity = [velocity (md.results.TransientSolution(t).Vel)]
     
    142142    for i = ts
    143143
    144         subplot(5, 9,[28:31 37:40])
    145         set(gca, 'pos', get(gca, 'pos')+[-0.08 -0.08 0.07 0.08])
     144        subplot(5, 9, [28:31 37:40])
     145        set(gca, 'pos', get(gca, 'pos') + [ - 0.08 - 0.08 0.07 0.08])
    146146        field = 'Thickness'
    147147
    148148        %process data
    149         [x y z elements is2d isplanet]=processmesh(md, results(i).(field), options)
    150         [data datatype]=processdata(md, results(i).(field), options)
    151 
    152         titlestring = [field ' at time ' num2str(results(i).time/md.constants.yts) ' year']
     149        [x y z elements is2d isplanet] = processmesh(md, results(i).(field), options)
     150        [data datatype] = processdata(md, results(i).(field), options)
     151
     152        titlestring = [field ' at time ' num2str(results(i).time / md.constants.yts) ' year']
    153153        plot_unit(x, y, z, elements, data, is2d, isplanet, datatype, options)
    154154        options = changefieldvalue(options, 'title', titlestring)
    155155        options = addfielddefault(options, 'colorbar', 1)
    156         options = changefieldvalue(options, 'caxis',[0 max(max(thickness))])
    157         applyoptions(md,[], options)
    158 
    159         subplot(5, 9,[33:36 42:45])
    160         set(gca, 'pos', get(gca, 'pos')+[-0.01 -0.08 0.07 0.08])
     156        options = changefieldvalue(options, 'caxis', [0 max(max(thickness))])
     157        applyoptions(md, [], options)
     158
     159        subplot(5, 9, [33:36 42:45])
     160        set(gca, 'pos', get(gca, 'pos') + [ - 0.01 - 0.08 0.07 0.08])
    161161        field = 'Vel'
    162162
    163163        %process data
    164         [x y z elements is2d isplanet]=processmesh(md, results(i).(field), options)
    165         [data datatype]=processdata(md, results(i).(field), options)
    166 
    167         titlestring = [field ' at time ' num2str(results(i).time/md.constants.yts) ' year']
     164        [x y z elements is2d isplanet] = processmesh(md, results(i).(field), options)
     165        [data datatype] = processdata(md, results(i).(field), options)
     166
     167        titlestring = [field ' at time ' num2str(results(i).time / md.constants.yts) ' year']
    168168        plot_unit(x, y, z, elements, data, is2d, isplanet, datatype, options)
    169169        options = changefieldvalue(options, 'title', titlestring)
    170170        options = addfielddefault(options, 'colorbar', 1)
    171         options = changefieldvalue(options, 'caxis',[0 max(max(velocity))])
    172         applyoptions(md,[], options)
     171        options = changefieldvalue(options, 'caxis', [0 max(max(velocity))])
     172        applyoptions(md, [], options)
    173173
    174174        subplot(5, 4, 1:4)
    175175        cla
    176         set(gca, 'pos', get(gca, 'pos')+[-0.07 0.03 0.12 0.015])
     176        set(gca, 'pos', get(gca, 'pos') + [ - 0.07 0.03 0.12 0.015])
    177177        plot(starttime:endtime, mean(massbal), 'k', 'LineWidth', 4)
    178178        hold on
     
    185185        subplot(5, 4, 5:8)
    186186        cla
    187         set(gca, 'pos', get(gca, 'pos')+[-0.07 0.015 0.12 0.015])
    188         plot(starttime:endtime, sum(volume)/1000/1000/1000, 'LineWidth', 4)
     187        set(gca, 'pos', get(gca, 'pos') + [ - 0.07 0.015 0.12 0.015])
     188        plot(starttime:endtime, sum(volume) / 1000 / 1000 / 1000, 'LineWidth', 4)
    189189        hold on
    190190        ya = ylim
     
    196196        subplot(5, 4, 9:12)
    197197        cla
    198         set(gca, 'pos', get(gca, 'pos')+[-0.07 0 0.12 0.015])
    199         plot(starttime:endtime, mean(velocity)/1000, 'LineWidth', 4)
     198        set(gca, 'pos', get(gca, 'pos') + [ - 0.07 0 0.12 0.015])
     199        plot(starttime:endtime, mean(velocity) / 1000, 'LineWidth', 4)
    200200        hold on
    201201        ya = ylim
     
    210210            %initialize images and frame
    211211            frame = getframe(gcf)
    212             [images, map]=rgb2ind(frame.cdata, 256, 'nodither')
     212            [images, map] = rgb2ind(frame.cdata, 256, 'nodither')
    213213            images(1, 1, 1, length(ts))=0
    214214        else
    215215            frame = getframe(gcf)
    216             images(:,:, 1, count) = rgb2ind(frame.cdata, map, 'nodither')
     216            images(:, :, 1, count) = rgb2ind(frame.cdata, map, 'nodither')
    217217        end
    218218
    219         count = count+1
     219        count = count + 1
    220220
    221221    end
    222222
    223     filename='transawtooth3d.gif'
     223    filename = 'transawtooth3d.gif'
    224224    imwrite(images, map, filename, 'DelayTime', 1.0, 'LoopCount', inf)
    225225    """
  • issm/trunk-jpl/test/NightlyRun/test1601.py

    r23793 r24214  
    3434md = solve(md, 'Stressbalance')
    3535vel1 = md.results.StressbalanceSolution.Vel
    36 #plotmodel(md, 'data', vel0, 'data', vel1, 'data', vel1-vel0, 'title', 'Cartesian CS', 'title', 'Rotated CS', 'title', 'difference')
     36#plotmodel(md, 'data', vel0, 'data', vel1, 'data', vel1 - vel0, 'title', 'Cartesian CS', 'title', 'Rotated CS', 'title', 'difference')
    3737print("Error between Cartesian and rotated CS: {}".format(np.max(np.abs(vel0 - vel1)) / (np.max(np.abs(vel0)) + sys.float_info.epsilon)))
    3838
     
    4545vel2 = md.results.StressbalanceSolution.Vel
    4646
    47 #plotmodel(md, 'data', vel0, 'data', vel2, 'data', vel2-vel0, 'title', 'Cartesian CS', 'title', 'Rotated CS', 'title', 'difference')
     47#plotmodel(md, 'data', vel0, 'data', vel2, 'data', vel2 - vel0, 'title', 'Cartesian CS', 'title', 'Rotated CS', 'title', 'difference')
    4848print("Error between Cartesian and rotated CS: {}".format(np.max(np.abs(vel0 - vel2)) / (np.max(np.abs(vel0)) + sys.float_info.epsilon)))
    4949
  • issm/trunk-jpl/test/NightlyRun/test1602.py

    r23793 r24214  
    3636vel1 = md.results.StressbalanceSolution.Vel
    3737
    38 #plotmodel(md, 'data', vel0, 'data', vel1, 'data', vel1-vel0, 'title', 'Cartesian CS', 'title', 'Rotated CS', 'title', 'difference', 'view#all', 2)
     38#plotmodel(md, 'data', vel0, 'data', vel1, 'data', vel1 - vel0, 'title', 'Cartesian CS', 'title', 'Rotated CS', 'title', 'difference', 'view  #all', 2)
    3939print("Error between Cartesian and rotated CS: {}".format(np.max(np.abs(vel0 - vel1)) / (np.max(np.abs(vel0)) + sys.float_info.epsilon)))
    4040
  • issm/trunk-jpl/test/NightlyRun/test2001.py

    r23793 r24214  
    1717
    1818#Indicate what you want to compute
    19 md.gia.cross_section_shape = 1    # for square-edged x-section
     19md.gia.cross_section_shape = 1  # for square-edged x - section
    2020
    2121#Define loading history (see test2001.m for the description)
  • issm/trunk-jpl/test/NightlyRun/test2002.py

    r23793 r24214  
    2323late = np.sum(md.mesh.lat[md.mesh.elements - 1], axis=1) / 3
    2424longe = np.sum(md.mesh.long[md.mesh.elements - 1], axis=1) / 3
    25 pos = np.where(late < -80)
    26 md.slr.deltathickness[pos] = -100
     25pos = np.where(late < - 80)
     26md.slr.deltathickness[pos] = - 100
    2727#greenland
    28 pos = np.where(np.logical_and.reduce((late > 70, late < 80, longe > -60, longe < -30)))
    29 md.slr.deltathickness[pos] = -100
     28pos = np.where(np.logical_and.reduce((late > 70, late < 80, longe > - 60, longe < - 30)))
     29md.slr.deltathickness[pos] = - 100
    3030
    3131#elastic loading from love numbers:
     
    4141icemask = np.ones((md.mesh.numberofvertices))
    4242pos = np.where(mask == 0)[0]
    43 icemask[pos] = -1
     43icemask[pos] = - 1
    4444pos = np.where(np.sum(mask[md.mesh.elements.astype(int) - 1], axis=1) < 3)[0]
    45 icemask[md.mesh.elements[pos, :].astype(int) - 1] = -1
     45icemask[md.mesh.elements[pos, :].astype(int) - 1] = - 1
    4646md.mask.ice_levelset = icemask
    4747md.mask.ocean_levelset = np.zeros((md.mesh.numberofvertices))
     
    5151#make sure that the ice level set is all inclusive:
    5252md.mask.land_levelset = np.zeros((md.mesh.numberofvertices))
    53 md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices))
     53md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices))
    5454
    5555#make sure that the elements that have loads are fully grounded:
     
    5858
    5959#make sure wherever there is an ice load, that the mask is set to ice:
    60 icemask[md.mesh.elements[pos, :] - 1] = -1
     60icemask[md.mesh.elements[pos, :] - 1] = - 1
    6161md.mask.ice_levelset = icemask
    6262
     
    7676
    7777#New stuff
    78 md.slr.spcthickness = np.nan * np.ones((md.mesh.numberofvertices,))
    79 md.slr.Ngia = np.zeros((md.mesh.numberofvertices,))
    80 md.slr.Ugia = np.zeros((md.mesh.numberofvertices,))
     78md.slr.spcthickness = np.nan * np.ones((md.mesh.numberofvertices, ))
     79md.slr.Ngia = np.zeros((md.mesh.numberofvertices, ))
     80md.slr.Ugia = np.zeros((md.mesh.numberofvertices, ))
    8181
    8282#Miscellaneous
  • issm/trunk-jpl/test/NightlyRun/test2003.py

    r23793 r24214  
    1616#parameterize slr solution:
    1717#slr loading:  {{{
    18 md.slr.deltathickness = np.zeros((md.mesh.numberofelements,))
    19 md.slr.sealevel = np.zeros((md.mesh.numberofvertices,))
    20 md.slr.steric_rate = np.zeros((md.mesh.numberofvertices,))
     18md.slr.deltathickness = np.zeros((md.mesh.numberofelements, ))
     19md.slr.sealevel = np.zeros((md.mesh.numberofvertices, ))
     20md.slr.steric_rate = np.zeros((md.mesh.numberofvertices, ))
    2121
    2222#antarctica
    2323#Access every element in lat using the indices in elements
    24 #-1 to convert to base 0 indexing, 1 (not 2, in matlab) to sum over rows
     24# - 1 to convert to base 0 indexing, 1 (not 2, in matlab) to sum over rows
    2525late = sum(md.mesh.lat[md.mesh.elements - 1], 1) / 3
    2626longe = sum(md.mesh.long[md.mesh.elements - 1], 1) / 3
    27 pos = np.intersect1d(np.array(np.where(late < -75)), np.array(np.where(longe < 0)))
    28 md.slr.deltathickness[pos] = -1
     27pos = np.intersect1d(np.array(np.where(late < - 75)), np.array(np.where(longe < 0)))
     28md.slr.deltathickness[pos] = - 1
    2929
    3030#elastic loading from love numbers:
     
    4242mask = gmtmask(md.mesh.lat, md.mesh.long)
    4343
    44 icemask = np.ones((md.mesh.numberofvertices,))
     44icemask = np.ones((md.mesh.numberofvertices, ))
    4545pos = np.where(mask == 0)
    46 #pos[0] because np.where(mask = 0) returns a 2d array, the latter parts of which are all array/s of 0s
    47 icemask[pos[0]] = -1
     46#pos[0] because np.where(mask = 0) returns a 2d array, the latter parts of which are all array / s of 0s
     47icemask[pos[0]] = - 1
    4848pos = np.where(sum(mask[md.mesh.elements - 1], 1) < 3)
    49 icemask[md.mesh.elements[pos, :] - 1] = -1
     49icemask[md.mesh.elements[pos, :] - 1] = - 1
    5050md.mask.ice_levelset = icemask
    51 md.mask.ocean_levelset = np.zeros((md.mesh.numberofvertices,))
     51md.mask.ocean_levelset = np.zeros((md.mesh.numberofvertices, ))
    5252pos = np.where(md.mask.ice_levelset == 1)
    5353md.mask.ocean_levelset[pos] = 1
    5454
    5555#make sure that the ice level set is all inclusive:
    56 md.mask.land_levelset = np.zeros((md.mesh.numberofvertices,))
    57 md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices,))
     56md.mask.land_levelset = np.zeros((md.mesh.numberofvertices, ))
     57md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices, ))
    5858
    5959#make sure that the elements that have loads are fully grounded:
     
    6262
    6363#make sure wherever there is an ice load, that the mask is set to ice:
    64 icemask[md.mesh.elements[pos, :] - 1] = -1
     64icemask[md.mesh.elements[pos, :] - 1] = - 1
    6565md.mask.ice_levelset = icemask
    6666# }}}
     
    7171#geometry
    7272di = md.materials.rho_ice / md.materials.rho_water
    73 md.geometry.thickness = np.ones((md.mesh.numberofvertices,))
    74 md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices,))
     73md.geometry.thickness = np.ones((md.mesh.numberofvertices, ))
     74md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, ))
    7575md.geometry.base = md.geometry.surface - md.geometry.thickness
    7676md.geometry.bed = md.geometry.base
    7777
    7878#materials
    79 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices,))
     79md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))
    8080md.materials.rheology_B = paterson(md.initialization.temperature)
    81 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements,))
     81md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
    8282
    8383#Miscellaneous
     
    8585
    8686#New stuff
    87 md.slr.spcthickness = np.nan * np.ones((md.mesh.numberofvertices,))
    88 md.slr.Ngia = np.zeros((md.mesh.numberofvertices,))
    89 md.slr.Ugia = np.zeros((md.mesh.numberofvertices,))
     87md.slr.spcthickness = np.nan * np.ones((md.mesh.numberofvertices, ))
     88md.slr.Ngia = np.zeros((md.mesh.numberofvertices, ))
     89md.slr.Ugia = np.zeros((md.mesh.numberofvertices, ))
    9090
    9191#Solution parameters
  • issm/trunk-jpl/test/NightlyRun/test2010.py

    r23793 r24214  
    2020longe = sum(md.mesh.long[md.mesh.elements - 1], 1) / 3
    2121
    22 md.slr.deltathickness = np.zeros((md.mesh.numberofelements,))
    23 pos = np.intersect1d(np.array(np.where(late < -75)), np.array(np.where(longe > 0)))
    24 #python does not include last element in array slices, (6:7) -> [5:7]
    25 md.slr.deltathickness[pos[5:7]] = -1
     22md.slr.deltathickness = np.zeros((md.mesh.numberofelements, ))
     23pos = np.intersect1d(np.array(np.where(late < - 75)), np.array(np.where(longe > 0)))
     24#python does not include last element in array slices, (6:7) - > [5:7]
     25md.slr.deltathickness[pos[5:7]] = - 1
    2626
    27 md.slr.sealevel = np.zeros((md.mesh.numberofvertices,))
    28 md.slr.steric_rate = np.zeros((md.mesh.numberofvertices,))
     27md.slr.sealevel = np.zeros((md.mesh.numberofvertices, ))
     28md.slr.steric_rate = np.zeros((md.mesh.numberofvertices, ))
    2929md.slr.ocean_area_scaling = 1
    3030
     
    4343mask = gmtmask(md.mesh.lat, md.mesh.long)
    4444
    45 icemask = np.ones((md.mesh.numberofvertices,))
     45icemask = np.ones((md.mesh.numberofvertices, ))
    4646pos = np.where(mask == 0)
    47 icemask[pos[0]] = -1
     47icemask[pos[0]] = - 1
    4848pos = np.where(sum(mask[md.mesh.elements - 1], 1) < 3)
    49 icemask[md.mesh.elements[pos, :] - 1] = -1
     49icemask[md.mesh.elements[pos, :] - 1] = - 1
    5050md.mask.ice_levelset = icemask
    51 md.mask.ocean_levelset = np.zeros((md.mesh.numberofvertices,))
     51md.mask.ocean_levelset = np.zeros((md.mesh.numberofvertices, ))
    5252pos = np.where(md.mask.ice_levelset == 1)
    5353md.mask.ocean_levelset[pos] = 1
    5454
    5555#make sure that the ice level set is all inclusive:
    56 md.mask.land_levelset = np.zeros((md.mesh.numberofvertices,))
    57 md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices,))
     56md.mask.land_levelset = np.zeros((md.mesh.numberofvertices, ))
     57md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices, ))
    5858
    5959#make sure that the elements that have loads are fully grounded:
     
    6262
    6363#make sure wherever there is an ice load, that the mask is set to ice:
    64 icemask[md.mesh.elements[pos, :] - 1] = -1
     64icemask[md.mesh.elements[pos, :] - 1] = - 1
    6565md.mask.ice_levelset = icemask
    6666# }}}
    6767#geometry {{{
    6868di = md.materials.rho_ice / md.materials.rho_water
    69 md.geometry.thickness = np.ones((md.mesh.numberofvertices,))
    70 md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices,))
     69md.geometry.thickness = np.ones((md.mesh.numberofvertices, ))
     70md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, ))
    7171md.geometry.base = md.geometry.surface - md.geometry.thickness
    7272md.geometry.bed = md.geometry.base
    7373# }}}
    7474#materials {{{
    75 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices,))
     75md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))
    7676md.materials.rheology_B = paterson(md.initialization.temperature)
    77 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements,))
     77md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
    7878# }}}
    7979#Miscellaneous {{{
     
    8787
    8888#New stuff
    89 md.slr.spcthickness = np.nan * np.ones((md.mesh.numberofvertices,))
    90 md.slr.Ngia = np.zeros((md.mesh.numberofvertices,))
    91 md.slr.Ugia = np.zeros((md.mesh.numberofvertices,))
     89md.slr.spcthickness = np.nan * np.ones((md.mesh.numberofvertices, ))
     90md.slr.Ngia = np.zeros((md.mesh.numberofvertices, ))
     91md.slr.Ugia = np.zeros((md.mesh.numberofvertices, ))
    9292
    9393#eustatic + rigid + elastic run:
     
    105105moizz = md.results.SealevelriseSolution.SealevelInertiaTensorZZ
    106106
    107 # analytical moi => just checking FOR ICE only!!! {{{
    108 # ...have to mute ** slr induced MOI in Tria.cpp ** prior to the comparison
    109 #rad_e = rad_e*1e3 # now in meters
     107# analytical moi = > just checking FOR ICE only!!! {{{
     108# ...have to mute**slr induced MOI in Tria.cpp**prior to the comparison
     109#rad_e = rad_e * 1e3 # now in meters
    110110#areas = GetAreasSphericalTria(md.mesh.elements, md.mesh.lat, md.mesh.long, rad_e)
    111 #lat = late*pi/180 lon = longe*pi/180
    112 #moi_xz = sum(-md.materials.rho_freshwater.*md.slr.deltathickness.*areas.*rad_e^2.*sin(lat).*cos(lat).*cos(lon))
    113 #moi_yz = sum(-md.materials.rho_freshwater.*md.slr.deltathickness.*areas.*rad_e^2.*sin(lat).*cos(lat).*sin(lon))
     111#lat = late * pi / 180 lon = longe * pi / 180
     112#moi_xz = sum(- md.materials.rho_freshwater. * md.slr.deltathickness. * areas. * rad_e^2. * sin(lat). * cos(lat). * cos(lon))
     113#moi_yz = sum(- md.materials.rho_freshwater. * md.slr.deltathickness. * areas. * rad_e^2. * sin(lat). * cos(lat). * sin(lon))
    114114# }}}
    115115
  • issm/trunk-jpl/test/NightlyRun/test2051.py

    r23793 r24214  
    1414
    1515# indicate what you want to compute
    16 md.gia.cross_section_shape = 1  # for square-edged x-section
     16md.gia.cross_section_shape = 1  # for square-edged x - section
    1717
    1818# define loading history
  • issm/trunk-jpl/test/NightlyRun/test2052.py

    r23793 r24214  
    1414
    1515#indicate what you want to compute
    16 md.gia.cross_section_shape = 1  # for square-edged x-section
     16md.gia.cross_section_shape = 1  # for square-edged x - section
    1717
    1818#define loading history
  • issm/trunk-jpl/test/NightlyRun/test2053.py

    r23793 r24214  
    1414
    1515#indicate what you want to compute
    16 md.gia.cross_section_shape = 1    # for square-edged x-section
     16md.gia.cross_section_shape = 1  # for square-edged x - section
    1717
    1818#define loading history
  • issm/trunk-jpl/test/NightlyRun/test2071.py

    r23793 r24214  
    1414
    1515#indicate what you want to compute
    16 md.gia.cross_section_shape = 1  # for square-edged x-section
     16md.gia.cross_section_shape = 1  # for square-edged x - section
    1717
    1818#define loading history
  • issm/trunk-jpl/test/NightlyRun/test2072.py

    r23793 r24214  
    1414
    1515#indicate what you want to compute
    16 md.gia.cross_section_shape = 1  # for square-edged x-section
     16md.gia.cross_section_shape = 1  # for square-edged x - section
    1717
    1818#define loading history
  • issm/trunk-jpl/test/NightlyRun/test2073.py

    r23793 r24214  
    1414
    1515#indicate what you want to compute
    16 md.gia.cross_section_shape = 1  # for square-edged x-section
     16md.gia.cross_section_shape = 1  # for square-edged x - section
    1717
    1818#define loading history
  • issm/trunk-jpl/test/NightlyRun/test2081.py

    r23793 r24214  
    1414
    1515#indicate what you want to compute
    16 md.gia.cross_section_shape = 2  # for square-edged x-section
     16md.gia.cross_section_shape = 2  # for square-edged x - section
    1717
    1818#define loading history
  • issm/trunk-jpl/test/NightlyRun/test2082.py

    r23793 r24214  
    1414
    1515#indicate what you want to compute
    16 md.gia.cross_section_shape = 2  # for square-edged x-section
     16md.gia.cross_section_shape = 2  # for square-edged x - section
    1717
    1818#define loading history
  • issm/trunk-jpl/test/NightlyRun/test2083.py

    r23793 r24214  
    1414
    1515#indicate what you want to compute
    16 md.gia.cross_section_shape = 2  # for square-edged x-section
     16md.gia.cross_section_shape = 2  # for square-edged x - section
    1717
    1818#define loading history
  • issm/trunk-jpl/test/NightlyRun/test2084.py

    r23793 r24214  
    11#Test Name: GiaCaron
    22#Forward Love number solution for a viscoelastic earth,
    3 #model M3-L70-V01 from Spada, G., Barletta, V. R., Klemann, V., Riva, R. E. M.,
     3#model M3 - L70 - V01 from Spada, G., Barletta, V. R., Klemann, V., Riva, R. E. M.,
    44#Martinec, Z., Gasperini, P., Lund, B., Wolf, D., Vermeersen, L. L. A.
    55#and King, M. A. (2011), A benchmark study for glacial isostatic
    66#adjustment codes. Geophysical Journal International,
    7 #185: 106-132. doi:10.1111/j.1365-246X.2011.04952.x
     7#185: 106 - 132. doi:10.1111 / j.1365 - 246X.2011.04952.x
    88
    99from model import *
     
    2626md.materials.numlayers = 6
    2727md.materials.radius = np.array([10, 1222.5, 3.4800e+03, 5.7010e+03, 5.9510e+03,
    28                                 6.3010e+03, 6.3710e+03]).reshape(-1, 1) * 1e3
     28                                6.3010e+03, 6.3710e+03]).reshape(- 1, 1) * 1e3
    2929md.materials.density = np.array([1.0750e4, 1.0750e+04, 4.9780e+03, 3.8710e+03,
    30                                 3.4380e+03, 3.0370e+03]).reshape(-1, 1)
     30                                3.4380e+03, 3.0370e+03]).reshape(- 1, 1)
    3131md.materials.lame_mu = np.array([1e-5, 0, 2.2834e+00, 1.0549e+00, 7.0363e-01,
    32                                 5.0605e-01]).reshape(-1, 1) * 1e11
     32                                5.0605e-01]).reshape(- 1, 1) * 1e11
    3333md.materials.viscosity = np.array([0, 0, 2.0000e+00, 1.0000e+00, 1.0000e+00,
    34                                    1.0000e+25]).reshape(-1, 1) * 1e21
     34                                   1.0000e+25]).reshape(- 1, 1) * 1e21
    3535md.materials.lame_lambda = np.array(md.materials.lame_mu) * 0 + 5e14
    36 md.materials.issolid = np.array([1, 0, 1, 1, 1, 1]).reshape(-1, 1)
     36md.materials.issolid = np.array([1, 0, 1, 1, 1, 1]).reshape(- 1, 1)
    3737md.materials.isburgers = np.zeros((md.materials.numlayers, 1))
    3838
    3939md.love.allow_layer_deletion = 1
    40 md.love.frequencies = (np.array([0]) * 2 * pi).reshape(-1, 1) / cst
     40md.love.frequencies = (np.array([0]) * 2 * pi).reshape(- 1, 1) / cst
    4141md.love.nfreq = len(md.love.frequencies)
    4242md.love.sh_nmax = 256
     
    5555                np.array(md.results.LoveSolution.LoveLr)[:, 0]]
    5656
    57 md.love.frequencies = (np.array([1e-3, 1e-2, 1e-1, 1, -1e-3, -1e-2, -1e-1,
    58                                 -1]) * 2 * pi).reshape(-1, 1) / cst
     57md.love.frequencies = (np.array([1e-3, 1e-2, 1e-1, 1, - 1e-3, - 1e-2, - 1e-1, -1]) * 2 * pi).reshape(- 1, 1) / cst
    5958md.love.nfreq = len(md.love.frequencies)
    6059md.love.sh_nmax = 256
     
    7776md.love.forcing_type = 9
    7877md.love.sh_nmin = 2
    79 md.love.frequencies = ((np.array([0, 1e-3, 1e-2, 1e-1, 1, -1e-3,
    80                                   -1e-2, -1e-1, -1]) * 2 * pi).reshape(-1, 1) / cst)
     78md.love.frequencies = ((np.array([0, 1e-3, 1e-2, 1e-1, 1, - 1e-3, -1e-2, - 1e-1, - 1]) * 2 * pi).reshape(- 1, 1) / cst)
    8179md.love.nfreq = len(md.love.frequencies)
    8280
     
    9694                 np.array(md.results.LoveSolution.LoveLi)[:, 1:]]
    9795
    98 #Many layers PREM-based model
     96#Many layers PREM - based model
    9997#data = load('../Data/PREM_500layers')
    10098#md.love.sh_nmin = 1
    101 #md.materials.radius = data(2:end-2, 1)
    102 #md.materials.density = data(3:end-2, 2)
    103 #md.materials.lame_lambda = data(3:end-2, 3)
    104 #md.materials.lame_mu = data(3:end-2, 4)
    105 #md.materials.issolid = data(3:end-2, 4)>0
     99#md.materials.radius = data(2:end - 2, 1)
     100#md.materials.density = data(3:end - 2, 2)
     101#md.materials.lame_lambda = data(3:end - 2, 3)
     102#md.materials.lame_mu = data(3:end - 2, 4)
     103#md.materials.issolid = data(3:end - 2, 4) > 0
    106104#ind = find(md.materials.issolid = 0)
    107 #md.materials.density(ind(1))=sum((md.materials.radius(ind+1).^3-md.materials.radius(ind).^3).*md.materials.density(ind))/(md.materials.radius(ind(end)+1).^3-md.materials.radius(ind(1)+1).^3)
    108 #md.materials.lame_lambda(ind(1))=sum((md.materials.radius(ind+1).^3-md.materials.radius(ind).^3).*md.materials.lame_lambda(ind))/(md.materials.radius(ind(end)+1).^3-md.materials.radius(ind(1)+1).^3)
    109 #md.materials.lame_mu(ind(1))=sum((md.materials.radius(ind+1).^3-md.materials.radius(ind).^3).*md.materials.lame_mu(ind))/(md.materials.radius(ind(end)+1).^3-md.materials.radius(ind(1)).^3)
    110 #md.materials.radius(ind(2:end)+1)=[]
    111 #md.materials.density(ind(2:end))=[]
    112 #md.materials.lame_lambda(ind(2:end))=[]
    113 #md.materials.lame_mu(ind(2:end))=[]
    114 #md.materials.issolid(ind(2:end))=[]
     105#md.materials.density(ind(1))=sum((md.materials.radius(ind + 1).^3 - md.materials.radius(ind).^3). * md.materials.density(ind)) / (md.materials.radius(ind(end) + 1).^3 - md.materials.radius(ind(1) + 1).^3)
     106#md.materials.lame_lambda(ind(1))=sum((md.materials.radius(ind + 1).^3 - md.materials.radius(ind).^3). * md.materials.lame_lambda(ind)) / (md.materials.radius(ind(end) + 1).^3 - md.materials.radius(ind(1) + 1).^3)
     107#md.materials.lame_mu(ind(1))=sum((md.materials.radius(ind + 1).^3 - md.materials.radius(ind).^3). * md.materials.lame_mu(ind)) / (md.materials.radius(ind(end) + 1).^3 - md.materials.radius(ind(1)).^3)
     108#md.materials.radius(ind(2:end) + 1) = []
     109#md.materials.density(ind(2:end)) = []
     110#md.materials.lame_lambda(ind(2:end)) = []
     111#md.materials.lame_mu(ind(2:end)) = []
     112#md.materials.issolid(ind(2:end)) = []
    115113#md.materials.viscosity = 10.^interp1([0 3479e3 3480e3 3680e3 5720e3 5800e3 6270e3 6371e3], log10([1e8 1e8 5e21 1e23 1e22 1e20 1e21 1e40]), md.materials.radius(2:end), 'PCHIP')
    116 #md.materials.viscosity = md.materials.viscosity.*md.materials.issolid
     114#md.materials.viscosity = md.materials.viscosity. * md.materials.issolid
    117115#md.materials.burgers_mu = md.materials.lame_mu
    118116#md.materials.burgers_viscosity = md.materials.viscosity
    119 #md.materials.isburgers = md.materials.issolid*0
     117#md.materials.isburgers = md.materials.issolid * 0
    120118#md.love.forcing_type = 11
    121119#md.materials.numlayers = len(md.materials.viscosity)
     
    135133#       (md.results.LoveSolution.LoveLi[:][1:]),
    136134#       ]
    137 #Model VSS96 from Vermeersen, L.L.A., Sabadini, R. & Spada, G., 1996a. Analytical visco-elastic relaxation models, Geophys. Res. Lett., 23, 697-700.
     135#Model VSS96 from Vermeersen, L.L.A., Sabadini, R. & Spada, G., 1996a. Analytical visco - elastic relaxation models, Geophys. Res. Lett., 23, 697 - 700.
    138136
    139137md.materials.radius = np.array([10, 1222.5, 3480., 3600., 3630.5, 3700., 3900., 4000.,
     
    141139                                5400., 5500., 5600.5, 5650., 5701., 5736., 5771.5,
    142140                                5821., 5951., 5970.5, 6016., 6061., 6150.5, 6151.5,
    143                                 6251., 6371.]).reshape(-1, 1) * 1e3
     141                                6251., 6371.]).reshape(- 1, 1) * 1e3
    144142md.materials.lame_mu = np.array([1e-5, 0., 2.933, 2.8990002, 2.8550003, 2.7340002, 2.675,
    145143                                2.559, 2.502, 2.388, 2.331, 2.215, 2.157, 2.039, 1.979,
    146144                                1.8560001, 1.794, 1.73, 1.639, 1.2390001, 1.224, 1.21,
    147145                                1.128, 0.97700006, 0.906, 0.79, 0.773, 0.741, 0.656, 0.665,
    148                                 0.602]).reshape(-1, 1) * 1e11
     146                                0.602]).reshape(- 1, 1) * 1e11
    149147md.materials.density = np.array([10925., 10925., 5506.42, 5491.45, 5456.57, 5357.06,
    150148                                5307.24, 5207.13, 5156.69, 5054.69, 5002.99, 4897.83,
     
    152150                                4412.41, 3992.14, 3983.99, 3975.84, 3912.82, 3786.78,
    153151                                3723.78, 3516.39, 3489.51, 3435.78, 3359.5, 3367.1,
    154                                 3184.3]).reshape(-1, 1)
    155 md.materials.viscosity = np.array([0., 0., 7.999999999999999E+21, 8.5E+21,
    156                                    8.999999999999999E+21, 3.E+22, 4.E+22,
    157                                    5.0000000000000004E+22, 6.E+22,
    158                                    5.0000000000000004E+22, 4.5E+22, 3.E+22,
    159                                    2.5000000000000002E+22, 1.7999999999999998E+22,
    160                                    1.3E+22, 7.999999999999999E+21, 6.999999999999999E+21,
    161                                    6.5E+21, 6.E+21, 5.5E+21, 5.E+21, 4.4999999999999995E+21,
    162                                    3.9999999999999995E+21, 2.5E+21,
    163                                    1.9999999999999997E+21, 1.5E+21, 9.999999999999999E+20,
    164                                    6.E+20, 5.5000000000000007E+20, 2.E+20,
    165                                    1.E40]).reshape(-1, 1)
     152                                3184.3]).reshape(- 1, 1)
     153md.materials.viscosity = np.array([0., 0., 7.999999999999999e+21, 8.5e+21,
     154                                   8.999999999999999e+21, 3.e+22, 4.e+22,
     155                                   5.0000000000000004e+22, 6.e+22,
     156                                   5.0000000000000004e+22, 4.5e+22, 3.e+22,
     157                                   2.5000000000000002e+22, 1.7999999999999998e+22,
     158                                   1.3e+22, 7.999999999999999e+21, 6.999999999999999e+21,
     159                                   6.5e+21, 6.e+21, 5.5e+21, 5.e+21, 4.4999999999999995e+21,
     160                                   3.9999999999999995e+21, 2.5e+21,
     161                                   1.9999999999999997e+21, 1.5e+21, 9.999999999999999e+20,
     162                                   6.e+20, 5.5000000000000007e+20, 2.e+20,
     163                                   1.E40]).reshape(- 1, 1)
    166164md.materials.lame_lambda = np.array(md.materials.lame_mu) * 0 + 5e14
    167 md.materials.issolid = np.ones(len(md.materials.lame_mu)).reshape(-1, 1)
     165md.materials.issolid = np.ones(len(md.materials.lame_mu)).reshape(- 1, 1)
    168166md.materials.issolid[1] = 0
    169167md.materials.numlayers = len(md.materials.lame_mu)
     
    177175md = solve(md, 'lv')
    178176
    179 md.love.frequencies = (np.array([0, 1e-3, 1e-2, 1, -1e-3, -1e-2,
    180                                  -1]) * 2 * pi).reshape(-1, 1) / cst
     177md.love.frequencies = (np.array([0, 1e-3, 1e-2, 1, - 1e-3, - 1e-2,
     178                                 -1]) * 2 * pi).reshape(- 1, 1) / cst
    181179md.love.nfreq = len(md.love.frequencies)
    182180
  • issm/trunk-jpl/test/NightlyRun/test2085.py

    r23793 r24214  
    11#Test Name: LovenumberstAtDepth.
    2 #Same as test #1 of test2084.m
     2#Same as test  #1 of test2084.m
    33
    44from model import *
     
    2121md.materials.numlayers = 6
    2222md.materials.radius = np.array([10, 1222.5, 3.4800e+03, 5.7010e+03, 5.9510e+03, 6.3010e+03, 6.3710e+03]).reshape(-1, 1) * 1e3
    23 md.materials.density = np.array([1.0750e4, 1.0750e+04, 4.9780e+03, 3.8710e+03, 3.4380e+03, 3.0370e+03]).reshape(-1, 1)
    24 md.materials.lame_mu = np.array([1e-5, 0, 2.2834e+00, 1.0549e+00, 7.0363e-01, 5.0605e-01]).reshape(-1, 1) * 1e11
    25 md.materials.viscosity = np.array([0, 0, 2.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+25]).reshape(-1, 1) * 1e21
     23md.materials.density = np.array([1.0750e4, 1.0750e+04, 4.9780e+03, 3.8710e+03, 3.4380e+03, 3.0370e+03]).reshape(- 1, 1)
     24md.materials.lame_mu = np.array([1e-5, 0, 2.2834e+00, 1.0549e+00, 7.0363e-01, 5.0605e-01]).reshape(- 1, 1) * 1e11
     25md.materials.viscosity = np.array([0, 0, 2.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+25]).reshape(- 1, 1) * 1e21
    2626md.materials.lame_lambda = np.array(md.materials.lame_mu) * 0 + 5e14
    27 md.materials.issolid = np.array([1, 0, 1, 1, 1, 1]).reshape(-1, 1)
    28 md.materials.isburgers = np.zeros((md.materials.numlayers)).reshape(-1, 1)
     27md.materials.issolid = np.array([1, 0, 1, 1, 1, 1]).reshape(- 1, 1)
     28md.materials.isburgers = np.zeros((md.materials.numlayers)).reshape(- 1, 1)
    2929
    3030md.love.love_kernels = 1
    3131md.love.allow_layer_deletion = 1
    32 md.love.frequencies = (np.array([0]) * 2 * pi).reshape(-1, 1) / cst
     32md.love.frequencies = (np.array([0]) * 2 * pi).reshape(- 1, 1) / cst
    3333md.love.nfreq = len(md.love.frequencies)
    3434md.love.sh_nmax = 2
  • issm/trunk-jpl/test/NightlyRun/test2101.py

    r23793 r24214  
    1717
    1818#define load
    19 md.esa.deltathickness = np.zeros((md.mesh.numberofelements,))
     19md.esa.deltathickness = np.zeros((md.mesh.numberofelements, ))
    2020pos = 449
    21 md.esa.deltathickness[pos] = -100   # this is the only "icy" element
     21md.esa.deltathickness[pos] = - 100  # this is the only "icy" element
    2222
    2323#love numbers:
    2424nlov = 10000
    25 md.esa.love_h = np.array(love_numbers('h'))     #Originally had CM arg
     25md.esa.love_h = np.array(love_numbers('h'))  #Originally had CM arg
    2626md.esa.love_h = np.resize(md.esa.love_h, nlov + 1)
    27 md.esa.love_l = np.array(love_numbers('l'))     #Originally had CM arg
     27md.esa.love_l = np.array(love_numbers('l'))  #Originally had CM arg
    2828md.esa.love_l = np.resize(md.esa.love_l, nlov + 1)
    2929
     
    3333
    3434#make sure wherever there is an ice load, that the mask is set to ice:
    35 md.mask.ice_levelset = np.ones((md.mesh.numberofvertices,))
     35md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, ))
    3636pos = np.where(md.esa.deltathickness)
    37 md.mask.ice_levelset[md.mesh.elements[pos, :]] = -1
     37md.mask.ice_levelset[md.mesh.elements[pos, :]] = - 1
    3838
    3939#is ice grounded?
    40 md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices,))
     40md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices, ))
    4141pos = np.where(md.mask.ice_levelset <= 0)
    4242md.mask.groundedice_levelset[pos] = 1
     
    5252#geometry:  {{{
    5353di = md.materials.rho_ice / md.materials.rho_water
    54 md.geometry.thickness = np.ones((md.mesh.numberofvertices,))
    55 md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices,))
     54md.geometry.thickness = np.ones((md.mesh.numberofvertices, ))
     55md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, ))
    5656md.geometry.base = md.geometry.surface - md.geometry.thickness
    5757md.geometry.bed = md.geometry.base
    5858# }}}
    5959#materials:  {{{
    60 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices,))
     60md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))
    6161md.materials.rheology_B = paterson(md.initialization.temperature)
    62 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements,))
     62md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
    6363# }}}
    6464#Miscellaneous: {{{
  • issm/trunk-jpl/test/NightlyRun/test2110.py

    r23793 r24214  
    1212#mesh earth:
    1313md = model()
    14 md = roundmesh(md, 50000, 2000)     # radius and element size (meters)
     14md = roundmesh(md, 50000, 2000)  # radius and element size (meters)
    1515
    1616#define load
    17 md.esa.deltathickness = np.zeros((md.mesh.numberofelements,))
     17md.esa.deltathickness = np.zeros((md.mesh.numberofelements, ))
    1818disc_radius = 20  # km
    1919index = md.mesh.elements
     
    2121y_element = np.mean(md.mesh.y[index - 1], 1)
    2222rad_dist = np.sqrt(x_element**2 + y_element**2) / 1000  # radial distance in km
    23 md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = -1   # 1 m water withdrawl
     23md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = - 1  # 1 m water withdrawl
    2424
    2525#love numbers:
    26 nlov = 10000    # horizontal displacements do not work for low degree truncation, e.g., 101
     26nlov = 10000  # horizontal displacements do not work for low degree truncation, e.g., 101
    2727md.esa.love_h = np.array(love_numbers('h'))
    2828md.esa.love_h = np.resize(md.esa.love_h, nlov + 1)
     
    3232#mask:  {{{
    3333#make sure wherever there is an ice load, that the mask is set to ice:
    34 md.mask.ice_levelset = np.ones((md.mesh.numberofvertices,))
     34md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, ))
    3535pos = np.where(md.esa.deltathickness)
    36 md.mask.ice_levelset[md.mesh.elements[pos, :] - 1] = -1
     36md.mask.ice_levelset[md.mesh.elements[pos, :] - 1] = - 1
    3737
    3838#is ice grounded?
    39 md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices,))
     39md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices, ))
    4040pos = np.where(md.mask.ice_levelset <= 0)
    4141md.mask.groundedice_levelset[pos] = 1
     
    4444#geometry:  {{{
    4545di = md.materials.rho_ice / md.materials.rho_water
    46 md.geometry.thickness = np.ones((md.mesh.numberofvertices,))
    47 md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices,))
     46md.geometry.thickness = np.ones((md.mesh.numberofvertices, ))
     47md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, ))
    4848md.geometry.base = md.geometry.surface - md.geometry.thickness
    4949md.geometry.bed = md.geometry.base
    5050# }}}
    5151#materials:  {{{
    52 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices,))
     52md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))
    5353md.materials.rheology_B = paterson(md.initialization.temperature)
    54 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements,))
     54md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
    5555# }}}
    5656#Miscellaneous: {{{
  • issm/trunk-jpl/test/NightlyRun/test2111.py

    r23793 r24214  
    11#Test Name: Esa2Dsurface
    2 #AIS -- southern hemisphere example for north-south, east-west components of horiz motion
     2#AIS - -     southern hemisphere example for north - south, east - west components of horiz motion
    33
    44import numpy as np
     
    1515# }}}
    1616#define load: {{{
    17 md.esa.deltathickness = np.zeros((md.mesh.numberofelements,))
     17md.esa.deltathickness = np.zeros((md.mesh.numberofelements, ))
    1818disc_radius = 500  # km
    1919index = md.mesh.elements
     
    2121y_element = np.mean(md.mesh.y[index - 1], 1) - 1.0e6
    2222rad_dist = np.sqrt(x_element**2 + y_element**2) / 1000  # radial distance in km
    23 md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = -1   # 1 m water withdrawl
     23md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = - 1  # 1 m water withdrawl
    2424# }}}
    2525#love numbers: {{{
    26 nlov = 10000    # horizontal displacements do not work for low degree truncation, e.g., 101
     26nlov = 10000  # horizontal displacements do not work for low degree truncation, e.g., 101
    2727md.esa.love_h = np.array(love_numbers('h', 'CF'))
    2828md.esa.love_h = np.resize(md.esa.love_h, nlov + 1)
     
    3232#mask:  {{{
    3333#make sure wherever there is an ice load, that the mask is set to ice:
    34 md.mask.ice_levelset = np.ones((md.mesh.numberofvertices,))
     34md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, ))
    3535pos = np.where(md.esa.deltathickness)
    36 md.mask.ice_levelset[md.mesh.elements[pos, :]] = -1
     36md.mask.ice_levelset[md.mesh.elements[pos, :]] = - 1
    3737
    3838#is ice grounded?
    39 md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices,))
     39md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices, ))
    4040pos = np.where(md.mask.ice_levelset <= 0)
    4141md.mask.groundedice_levelset[pos] = 1
     
    4343#geometry:  {{{
    4444di = md.materials.rho_ice / md.materials.rho_water
    45 md.geometry.thickness = np.ones((md.mesh.numberofvertices,))
    46 md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices,))
     45md.geometry.thickness = np.ones((md.mesh.numberofvertices, ))
     46md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, ))
    4747md.geometry.base = md.geometry.surface - md.geometry.thickness
    4848md.geometry.bed = md.geometry.base
    4949# }}}
    5050#materials:  {{{
    51 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices,))
     51md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))
    5252md.materials.rheology_B = paterson(md.initialization.temperature)
    53 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements,))
     53md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
    5454# }}}
    5555#additional parameters, miscellaneous: {{{
    5656md.miscellaneous.name = 'test2111'
    5757md.esa.degacc = 0.01
    58 md.esa.hemisphere = -1
     58md.esa.hemisphere = - 1
    5959# }}}
    6060
  • issm/trunk-jpl/test/NightlyRun/test2112.py

    r23793 r24214  
    11#Test Name: Esa2Dsurface
    2 #AIS 2 -- load centered at the south pole!
     2#AIS 2 - -    load centered at the south pole!
    33import numpy as np
    44from model import *
     
    1414# }}}
    1515#define load: {{{
    16 md.esa.deltathickness = np.zeros((md.mesh.numberofelements,))
     16md.esa.deltathickness = np.zeros((md.mesh.numberofelements, ))
    1717disc_radius = 500  # km
    1818index = md.mesh.elements
     
    2020y_element = np.mean(md.mesh.y[index - 1], 1)
    2121rad_dist = np.sqrt(x_element**2 + y_element**2) / 1000  # radial distance in km
    22 md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = -1   # 1 m water withdrawl
     22md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = - 1  # 1 m water withdrawl
    2323# }}}
    2424#love numbers: {{{
    25 nlov = 10000    # horizontal displacements do not work for low degree truncation, e.g., 101
     25nlov = 10000  # horizontal displacements do not work for low degree truncation, e.g., 101
    2626md.esa.love_h = np.array(love_numbers('h', 'CF'))
    2727md.esa.love_h = np.resize(md.esa.love_h, nlov + 1)
     
    3131#mask:  {{{
    3232#make sure wherever there is an ice load, that the mask is set to ice:
    33 md.mask.ice_levelset = np.ones((md.mesh.numberofvertices,))
     33md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, ))
    3434pos = np.where(md.esa.deltathickness)
    35 md.mask.ice_levelset[md.mesh.elements[pos, :]] = -1
     35md.mask.ice_levelset[md.mesh.elements[pos, :]] = - 1
    3636
    3737#is ice grounded?
    38 md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices,))
     38md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices, ))
    3939pos = np.where(md.mask.ice_levelset <= 0)
    4040md.mask.groundedice_levelset[pos] = 1
     
    4242#geometry:  {{{
    4343di = md.materials.rho_ice / md.materials.rho_water
    44 md.geometry.thickness = np.ones((md.mesh.numberofvertices,))
    45 md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices,))
     44md.geometry.thickness = np.ones((md.mesh.numberofvertices, ))
     45md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, ))
    4646md.geometry.base = md.geometry.surface - md.geometry.thickness
    4747md.geometry.bed = md.geometry.base
    4848# }}}
    4949#materials:  {{{
    50 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices,))
     50md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))
    5151md.materials.rheology_B = paterson(md.initialization.temperature)
    52 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements,))
     52md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
    5353# }}}
    5454#additional parameters, miscellaneous: {{{
    5555md.miscellaneous.name = 'test2112'
    5656md.esa.degacc = 0.01
    57 md.esa.hemisphere = -1
     57md.esa.hemisphere = - 1
    5858# }}}
    5959
  • issm/trunk-jpl/test/NightlyRun/test2113.py

    r23793 r24214  
    11#Test Name: Esa2Dsurface
    2 #Northern hemisphere example for north-south, east-west components of horiz motion
     2#Northern hemisphere example for north - south, east - west components of horiz motion
    33#Same as test2111.m except that AIS is assumed to have located in Northern Hemisphere
    44
     
    1616# }}}
    1717#define load: {{{
    18 md.esa.deltathickness = np.zeros((md.mesh.numberofelements,))
     18md.esa.deltathickness = np.zeros((md.mesh.numberofelements, ))
    1919disc_radius = 500  # km
    2020index = md.mesh.elements
     
    2222y_element = np.mean(md.mesh.y[index - 1], 1) + 1.0e6
    2323rad_dist = np.sqrt(x_element**2 + y_element**2) / 1000  # radial distance in km
    24 md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = -1   # 1 m water withdrawl
     24md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = - 1  # 1 m water withdrawl
    2525# }}}
    2626#love numbers: {{{
    27 nlov = 10000    # horizontal displacements do not work for low degree truncation, e.g., 101
     27nlov = 10000  # horizontal displacements do not work for low degree truncation, e.g., 101
    2828md.esa.love_h = np.array(love_numbers('h', 'CF'))
    2929md.esa.love_h = np.resize(md.esa.love_h, nlov + 1)
     
    3333#mask:  {{{
    3434#make sure wherever there is an ice load, that the mask is set to ice:
    35 md.mask.ice_levelset = np.ones((md.mesh.numberofvertices,))
     35md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, ))
    3636pos = np.where(md.esa.deltathickness)
    37 md.mask.ice_levelset[md.mesh.elements[pos, :]] = -1
     37md.mask.ice_levelset[md.mesh.elements[pos, :]] = - 1
    3838
    3939#is ice grounded?
    40 md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices,))
     40md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices, ))
    4141pos = np.where(md.mask.ice_levelset <= 0)
    4242md.mask.groundedice_levelset[pos] = 1
     
    4444#geometry:  {{{
    4545di = md.materials.rho_ice / md.materials.rho_water
    46 md.geometry.thickness = np.ones((md.mesh.numberofvertices,))
    47 md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices,))
     46md.geometry.thickness = np.ones((md.mesh.numberofvertices, ))
     47md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, ))
    4848md.geometry.base = md.geometry.surface - md.geometry.thickness
    4949md.geometry.bed = md.geometry.base
    5050# }}}
    5151#materials:  {{{
    52 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices,))
     52md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))
    5353md.materials.rheology_B = paterson(md.initialization.temperature)
    54 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements,))
     54md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
    5555# }}}
    5656#additional parameters, miscellaneous: {{{
  • issm/trunk-jpl/test/NightlyRun/test215.py

    r24105 r24214  
    1515md.extrude(3, 1.)
    1616md = setflowequation(md, 'FS', 'all')
    17 md.settings.solver_residue_threshold = 1.e-4;
     17md.settings.solver_residue_threshold = 1.e-4
    1818
    1919# control parameters
  • issm/trunk-jpl/test/NightlyRun/test217.py

    r23793 r24214  
    1919# redo the parameter file for this special shelf.
    2020# constant thickness, constrained (vy = 0) flow into an icefront,
    21 # from 0 m/yr at the grounding line.
     21# from 0 m / yr at the grounding line.
    2222
    2323# tighten
     
    3434h = 1000.
    3535md.geometry.thickness = h * np.ones((md.mesh.numberofvertices))
    36 md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
     36md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
    3737md.geometry.surface = md.geometry.base + md.geometry.thickness
    3838
     
    6767pos = np.where(md.mesh.y == ymax)
    6868nodeonicefront[pos] = 1
    69 md.mask.ice_levelset = -1 + nodeonicefront
     69md.mask.ice_levelset = - 1 + nodeonicefront
    7070
    7171md = solve(md, 'Stressbalance')
    7272
    73 # create analytical solution: strain rate is constant = ((rho_ice*g*h)/4B)^3 (Paterson, 4th Edition, page 292.
    74 # ey_c=(md.materials.rho_ice*md.constants.g*(1-di)*md.geometry.thickness./(4*md.materials.rheology_B)).^3
    75 # vy_c = ey_c.*md.mesh.y*md.constants.yts
     73# create analytical solution: strain rate is constant = ((rho_ice * g * h) / 4B)^3 (Paterson, 4th Edition, page 292.
     74# ey_c=(md.materials.rho_ice * md.constants.g * (1 - di) * md.geometry.thickness. / (4 * md.materials.rheology_B)).^3
     75# vy_c = ey_c. * md.mesh.y * md.constants.yts
    7676
    7777# Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test218.py

    r24174 r24214  
    3030#redo the parameter file for this special shelf.
    3131#constant thickness, constrained (vy = 0) flow into an icefront,
    32 #from 0 m/yr at the grounding line.
     32#from 0 m / yr at the grounding line.
    3333
    3434#needed later
     
    4141
    4242h = 1000.
    43 md.geometry.thickness = h * np.ones((md.mesh.numberofvertices,))
    44 md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
     43md.geometry.thickness = h * np.ones((md.mesh.numberofvertices, ))
     44md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
    4545md.geometry.surface = md.geometry.base + md.geometry.thickness
    4646
    4747#Initial velocity and pressure
    48 md.initialization.vx = np.zeros((md.mesh.numberofvertices,))
    49 md.initialization.vy = np.zeros((md.mesh.numberofvertices,))
    50 md.initialization.vz = np.zeros((md.mesh.numberofvertices,))
    51 md.initialization.pressure = np.zeros((md.mesh.numberofvertices,))
     48md.initialization.vx = np.zeros((md.mesh.numberofvertices, ))
     49md.initialization.vy = np.zeros((md.mesh.numberofvertices, ))
     50md.initialization.vz = np.zeros((md.mesh.numberofvertices, ))
     51md.initialization.pressure = np.zeros((md.mesh.numberofvertices, ))
    5252
    5353#Materials
    54 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices,))
     54md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, ))
    5555md.materials.rheology_B = paterson(md.initialization.temperature)
    56 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements,))
     56md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements, ))
    5757
    5858#Boundary conditions:
    59 md.stressbalance.spcvx = float('Nan') * np.ones((md.mesh.numberofvertices,))
    60 md.stressbalance.spcvy = float('Nan') * np.ones((md.mesh.numberofvertices,))
    61 md.stressbalance.spcvz = float('Nan') * np.ones((md.mesh.numberofvertices,))
     59md.stressbalance.spcvx = float('Nan') * np.ones((md.mesh.numberofvertices, ))
     60md.stressbalance.spcvy = float('Nan') * np.ones((md.mesh.numberofvertices, ))
     61md.stressbalance.spcvz = float('Nan') * np.ones((md.mesh.numberofvertices, ))
    6262
    6363#constrain flanks to 0 normal velocity
     
    8080#dakota version
    8181version = IssmConfig('_DAKOTA_VERSION_')
    82 # returns tuple "(u'6.2',)" -> unicode string '6.2', convert to float
     82# returns tuple "(u'6.2', )" - > unicode string '6.2', convert to float
    8383version = float(version[0])
    8484
     
    106106
    107107#imperative!
    108 md.stressbalance.reltol = 10**-10  #tighten for qmu analysis
     108md.stressbalance.reltol = 10**- 10  #tighten for qmu analysis
    109109md.qmu.isdakota = 1
    110110
     111md.debug.valgrind = True
    111112#solve
    112 md.verbose = verbose('000000000')       # this line is recommended
     113md.verbose = verbose('000000000')  # this line is recommended
    113114md = solve(md, 'Stressbalance', 'overwrite', 'y')
    114115
    115116#Fields and tolerances to track changes
    116117md.qmu.results = md.results.dakota
    117 md.results.dakota.importancefactors = importancefactors(md, 'scaled_MaterialsRheologyB', 'MaxVel').reshape(-1, 1)
     118md.results.dakota.importancefactors = importancefactors(md, 'scaled_MaterialsRheologyB', 'MaxVel').reshape(- 1, 1)
    118119field_names = ['importancefactors']
    119120field_tolerances = [1e-10]
  • issm/trunk-jpl/test/NightlyRun/test228.py

    r23793 r24214  
    2222#Set up transient
    2323smb = np.ones((md.mesh.numberofvertices)) * 3.6
    24 smb = np.vstack((smb, smb * -1.)).T
     24smb = np.vstack((smb, smb * - 1.)).T
    2525
    2626md.smb.mass_balance = np.vstack((smb, [1.5, 3.]))
  • issm/trunk-jpl/test/NightlyRun/test230.py

    r23793 r24214  
    2323#Set up transient
    2424smb = np.ones((md.mesh.numberofvertices)) * 3.6
    25 smb = np.vstack((smb, smb * -1.)).T
     25smb = np.vstack((smb, smb * - 1.)).T
    2626
    2727md.smb.mass_balance = np.vstack((smb, [1.5, 3.]))
  • issm/trunk-jpl/test/NightlyRun/test234.py

    r24174 r24214  
    2424md.timestepping.final_time = 4
    2525
    26 smb = np.ones((md.mesh.numberofvertices,)) * 3.6
    27 smb = np.array([smb, smb * -1]).T
     26smb = np.ones((md.mesh.numberofvertices, )) * 3.6
     27smb = np.array([smb, smb * - 1]).T
    2828
    2929md.smb.mass_balance = smb
     
    8181    md.qmu.params.evaluation_concurrency = 1
    8282
    83 md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
     83md.stressbalance.reltol = 10**- 5  #tighten for qmu analyses
    8484md.transient.requested_outputs = ['IceVolume']
    8585
    8686#solve
    87 md.verbose = verbose('000000000')       # this line is recommended
     87md.verbose = verbose('000000000')  # this line is recommended
    8888md = solve(md, 'Transient', 'overwrite', 'y')
    8989md.qmu.results = md.results.dakota
  • issm/trunk-jpl/test/NightlyRun/test235.py

    r24174 r24214  
    2424md.timestepping.final_time = 4
    2525
    26 smb = np.ones((md.mesh.numberofvertices,)) * 3.6
    27 smb = np.array([smb, smb * -1]).T
     26smb = np.ones((md.mesh.numberofvertices, )) * 3.6
     27smb = np.array([smb, smb * - 1]).T
    2828
    2929md.smb.mass_balance = smb
     
    7777    md.qmu.params.evaluation_concurrency = 1
    7878
    79 md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
     79md.stressbalance.reltol = 10**- 5  #tighten for qmu analyses
    8080md.transient.requested_outputs = ['IceVolume']
    8181
    8282#solve
    83 md.verbose = verbose('000000000')       # this line is recommended
     83md.verbose = verbose('000000000')  # this line is recommended
    8484md = solve(md, 'Transient', 'overwrite', 'y')
    8585md.qmu.results = md.results.dakota
  • issm/trunk-jpl/test/NightlyRun/test236.py

    r23793 r24214  
    3535    md.smb.temperatures_presentday[0:md.mesh.numberofvertices, imonth] = tmonth[imonth]
    3636    md.smb.temperatures_lgm[0:md.mesh.numberofvertices, imonth] = tmonth[imonth] - 20.
    37     # Time for the last line:
     37# Time for the last line:
    3838    md.smb.temperatures_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
    3939    md.smb.temperatures_lgm[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
    4040
    4141# creating initialization and spc temperatures initialization and spc
    42 md.thermal.spctemperature = np.mean(md.smb.temperatures_lgm[0:md.mesh.numberofvertices, :], axis=1)    #-10*ones(md.mesh.numberofvertices, 1)
     42md.thermal.spctemperature = np.mean(md.smb.temperatures_lgm[0:md.mesh.numberofvertices, :], axis=1)  # - 10 * ones(md.mesh.numberofvertices, 1)
    4343md.thermal.spctemperature = np.tile(md.thermal.spctemperature, (int(md.timestepping.final_time / md.timestepping.time_step), 1)).T
    4444itemp = np.arange(0, md.timestepping.final_time, md.timestepping.time_step)
    4545md.thermal.spctemperature = np.vstack((md.thermal.spctemperature, itemp))
    4646
    47 md.initialization.temperature = md.smb.temperatures_lgm[0:md.mesh.numberofvertices, 0]    #*ones(md.mesh.numberofvertices, 1)
     47md.initialization.temperature = md.smb.temperatures_lgm[0:md.mesh.numberofvertices, 0]  # * ones(md.mesh.numberofvertices, 1)
    4848md.smb.initialize(md)
    4949
     
    5252md.smb.precipitations_lgm = np.zeros((md.mesh.numberofvertices + 1, 12))
    5353for imonth in range(0, 12):
    54     md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = -0.4 * 10**(-6) * md.mesh.y + 0.5
     54    md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(- 6) * md.mesh.y + 0.5
    5555    md.smb.precipitations_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
    56     md.smb.precipitations_lgm[0:md.mesh.numberofvertices, imonth] = -0.4 * 10**(-6) * md.mesh.y + 0.5
     56    md.smb.precipitations_lgm[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(- 6) * md.mesh.y + 0.5
    5757    md.smb.precipitations_lgm[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
    5858
  • issm/trunk-jpl/test/NightlyRun/test237.py

    r24102 r24214  
    1111from generic import generic
    1212
    13 md = triangle(model(), '../Exp/Square.exp', 600000)    #180000
     13md = triangle(model(), '../Exp/Square.exp', 600000)  #180000
    1414md = setmask(md, 'all', '')
    1515md = parameterize(md, '../Par/SquareShelf.py')
     
    3333    md.smb.temperatures_presentday[0:md.mesh.numberofvertices, imonth] = tmonth[imonth]
    3434    md.smb.temperatures_lgm[0:md.mesh.numberofvertices, imonth] = tmonth[imonth] - 20.
    35     # Time for the last line:
     35# Time for the last line:
    3636    md.smb.temperatures_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
    3737    md.smb.temperatures_lgm[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
    3838
    3939# creating initialization and spc temperatures initialization and spc
    40 md.thermal.spctemperature = np.mean(md.smb.temperatures_lgm[0:md.mesh.numberofvertices, :], axis=1)    #-10*ones(md.mesh.numberofvertices, 1)
     40md.thermal.spctemperature = np.mean(md.smb.temperatures_lgm[0:md.mesh.numberofvertices, :], axis=1)  # - 10 * ones(md.mesh.numberofvertices, 1)
    4141md.thermal.spctemperature = np.tile(md.thermal.spctemperature, (int(md.timestepping.final_time / md.timestepping.time_step), 1)).T
    4242itemp = np.arange(0, md.timestepping.final_time, md.timestepping.time_step)
    4343md.thermal.spctemperature = np.vstack((md.thermal.spctemperature, itemp))
    4444
    45 md.initialization.temperature = md.smb.temperatures_lgm[0:md.mesh.numberofvertices, 0]   #*ones(md.mesh.numberofvertices, 1)
     45md.initialization.temperature = md.smb.temperatures_lgm[0:md.mesh.numberofvertices, 0]  # * ones(md.mesh.numberofvertices, 1)
    4646md.smb.initialize(md)
    4747
     
    5050md.smb.precipitations_lgm = np.zeros((md.mesh.numberofvertices + 1, 12))
    5151for imonth in range(0, 12):
    52     md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = -0.4 * 10**(-6) * md.mesh.y + 0.5
     52    md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(- 6) * md.mesh.y + 0.5
    5353    md.smb.precipitations_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
    54     md.smb.precipitations_lgm[0:md.mesh.numberofvertices, imonth] = -0.4 * 10**(-6) * md.mesh.y + 0.5
     54    md.smb.precipitations_lgm[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(- 6) * md.mesh.y + 0.5
    5555    md.smb.precipitations_lgm[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
    5656
  • issm/trunk-jpl/test/NightlyRun/test238.py

    r23793 r24214  
    2929for imonth in range(0, 12):
    3030    md.smb.temperatures_presentday[0:md.mesh.numberofvertices, imonth] = tmonth[imonth]
    31     # Time for the last line:
     31# Time for the last line:
    3232    md.smb.temperatures_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
    3333
    3434# creating initialization and spc temperatures initialization and spc
    35 md.thermal.spctemperature = np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices, :], axis=1).reshape(-1, 1)
     35md.thermal.spctemperature = np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices, :], axis=1).reshape(- 1, 1)
    3636md.thermal.spctemperature = md.thermal.spctemperature - 10
    3737md.initialization.temperature = md.thermal.spctemperature
     
    4141md.smb.precipitations_presentday = np.zeros((md.mesh.numberofvertices + 1, 12))
    4242for imonth in range(0, 12):
    43     md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = -0.4 * 10**(-6) * md.mesh.y + 0.5
     43    md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(- 6) * md.mesh.y + 0.5
    4444    md.smb.precipitations_presentday[md.mesh.numberofvertices, imonth] = (float(imonth) / 12.)
    4545
  • issm/trunk-jpl/test/NightlyRun/test239.py

    r23793 r24214  
    2929for imonth in range(0, 12):
    3030    md.smb.temperatures_presentday[0:md.mesh.numberofvertices, imonth] = tmonth[imonth]
    31     # Time for the last line:
     31# Time for the last line:
    3232    md.smb.temperatures_presentday[md.mesh.numberofvertices, imonth] = (float(imonth) / 12.)
    3333
    3434# creating initialization and spc temperatures initialization and spc
    35 md.thermal.spctemperature = np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices, :], axis=1).reshape(-1, 1)
     35md.thermal.spctemperature = np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices, :], axis=1).reshape(- 1, 1)
    3636md.thermal.spctemperature = md.thermal.spctemperature - 10
    3737md.initialization.temperature = md.thermal.spctemperature
     
    4141md.smb.precipitations_presentday = np.zeros((md.mesh.numberofvertices + 1, 12))
    4242for imonth in range(0, 12):
    43     md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = -0.4 * 10**(-6) * md.mesh.y + 0.5
     43    md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(- 6) * md.mesh.y + 0.5
    4444    md.smb.precipitations_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
    4545
  • issm/trunk-jpl/test/NightlyRun/test240.py

    r23793 r24214  
    2929for imonth in range(0, 12):
    3030    md.smb.temperatures_presentday[0:md.mesh.numberofvertices, imonth] = tmonth[imonth]
    31     # Time for the last line:
     31# Time for the last line:
    3232    md.smb.temperatures_presentday[md.mesh.numberofvertices, imonth] = (float(imonth) / 12.)
    3333
    3434# creating initialization and spc temperatures initialization and spc
    35 md.thermal.spctemperature = np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices, :], axis=1).reshape(-1, 1)
     35md.thermal.spctemperature = np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices, :], axis=1).reshape(- 1, 1)
    3636md.thermal.spctemperature = md.thermal.spctemperature - 10
    3737md.initialization.temperature = md.thermal.spctemperature
     
    4141md.smb.precipitations_presentday = np.zeros((md.mesh.numberofvertices + 1, 12))
    4242for imonth in range(0, 12):
    43     md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = -0.4 * 10**(-6) * md.mesh.y + 0.5
     43    md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(- 6) * md.mesh.y + 0.5
    4444    md.smb.precipitations_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
    4545
  • issm/trunk-jpl/test/NightlyRun/test241.py

    r23793 r24214  
    2323#Set up transient
    2424smb = np.ones((md.mesh.numberofvertices)) * 3.6
    25 smb = np.vstack((smb, smb * -1.)).T
     25smb = np.vstack((smb, smb * - 1.)).T
    2626
    2727md.smb.mass_balance = np.vstack((smb, [1.5, 3.]))
  • issm/trunk-jpl/test/NightlyRun/test242.py

    r23793 r24214  
    2424#Set up transient
    2525smb = np.ones((md.mesh.numberofvertices)) * 3.6
    26 smb = np.vstack((smb, smb * -1.)).T
     26smb = np.vstack((smb, smb * - 1.)).T
    2727
    2828md.smb.mass_balance = np.vstack((smb, [1.5, 3.]))
  • issm/trunk-jpl/test/NightlyRun/test2424.py

    r23793 r24214  
    1818md.smb.mass_balance[:] = 0.
    1919
    20 md.geometry.base = -700. - np.abs(md.mesh.y - 500000.) / 1000.
    21 md.geometry.bed = -700. - np.abs(md.mesh.y - 500000.) / 1000.
     20md.geometry.base = - 700. - np.abs(md.mesh.y - 500000.) / 1000.
     21md.geometry.bed = - 700. - np.abs(md.mesh.y - 500000.) / 1000.
    2222md.geometry.thickness[:] = 1000.
    2323md.geometry.surface = md.geometry.base + md.geometry.thickness
     
    3131md.timestepping.time_step = .1
    3232md.slr.sealevel = newforcing(md.timestepping.start_time, md.timestepping.final_time,
    33                              md.timestepping.time_step, -200., 200., md.mesh.numberofvertices)
     33                             md.timestepping.time_step, - 200., 200., md.mesh.numberofvertices)
    3434
    3535md.cluster = generic('name', gethostname(), 'np', 3)
     
    3737
    3838#we are checking that the grounding line position is near the theorical one, which is the 0 contour level
    39 #of surface - sealevel - (1-di)* thickness
     39#of surface-sealevel - (1 - di) * thickness
    4040
    4141nsteps = len(md.results.TransientSolution)
     
    4545#time is off by the year constant
    4646for i in range(nsteps):
    47     field_names.append('Time-' + str(md.results.TransientSolution[i].time) + '-yr-ice_levelset-S-sl-(1-di)*H')
     47    field_names.append('Time-' + str(md.results.TransientSolution[i].time) + ' - yr - ice_levelset - S - sl - (1 - di) * H')
    4848    field_tolerances.append(1e-12)
    49     field_values.append(md.results.TransientSolution[i].MaskGroundediceLevelset.reshape(-1,) - (md.geometry.surface - md.results.TransientSolution[i].Sealevel.reshape(-1,) - (1 - md.materials.rho_ice / md.materials.rho_water) * md.geometry.thickness))
     49    field_values.append(md.results.TransientSolution[i].MaskGroundediceLevelset.reshape(- 1, ) - (md.geometry.surface - md.results.TransientSolution[i].Sealevel.reshape(- 1, ) - (1 - md.materials.rho_ice / md.materials.rho_water) * md.geometry.thickness))
  • issm/trunk-jpl/test/NightlyRun/test2425.py

    r23793 r24214  
    1515md.initialization.vx[:] = 0.
    1616md.initialization.vy[:] = 0.
    17 md.geometry.base = -700. - (md.mesh.y - 500000.) / 1000.
    18 md.geometry.bed = -700. - (md.mesh.y - 500000.) / 1000.
     17md.geometry.base = - 700. - (md.mesh.y - 500000.) / 1000.
     18md.geometry.bed = - 700. - (md.mesh.y - 500000.) / 1000.
    1919md.geometry.thickness[:] = 1300.
    2020md.geometry.surface = md.geometry.base + md.geometry.thickness
     
    3131
    3232#get same results with offset in bed and sea level:
    33 md.geometry.base = -700. - (md.mesh.y - 500000.) / 1000.
    34 md.geometry.bed = -700. - (md.mesh.y - 500000.) / 1000.
     33md.geometry.base = - 700. - (md.mesh.y - 500000.) / 1000.
     34md.geometry.bed = - 700. - (md.mesh.y - 500000.) / 1000.
    3535md.geometry.thickness[:] = 1300.
    3636md.geometry.surface = md.geometry.base + md.geometry.thickness
     
    3939md.geometry.bed = md.geometry.bed + 1000
    4040md.geometry.surface = md.geometry.surface + 1000
    41 md.slr.sealevel = 1000 * np.ones((md.mesh.numberofvertices,))
     41md.slr.sealevel = 1000 * np.ones((md.mesh.numberofvertices, ))
    4242
    4343md = solve(md, 'Transient', 'checkconsistency', 'no')
  • issm/trunk-jpl/test/NightlyRun/test243.py

    r24210 r24214  
    6262#Fields and tolerances to track changes
    6363field_names = ['SmbDz', 'SmbT', 'SmbD', 'SmbRe', 'SmbGdn', 'SmbGsp', 'SmbA', 'SmbEC', 'SmbMassBalance', 'SmbMAdd', 'SmbDzAdd', 'SmbFAC', 'SmbMeanSHF', 'SmbMeanLHF', 'SmbMeanULW', 'SmbNetLW', 'SmbNetSW']
    64 field_tolerances = [8e-10,5e-12,3e-10,8e-10,1e-11,2e-7,4e-11,4e-12,1e-12,1e-12,1e-12,2e-10,2e-11, 2e-11, 1e-11, 9e-10, 2e-11]
     64field_tolerances = [8e-10, 5e-12, 3e-10, 8e-10, 1e-11, 2e-7, 4e-11, 4e-12, 1e-12, 1e-12, 1e-12, 2e-10, 2e-11, 2e-11, 1e-11, 9e-10, 2e-11]
    6565#shape is different in python solution (fixed using reshape) which can cause test failure:
    66 field_values = [md.results.TransientSolution[-1].SmbDz[0, 0:240].reshape(1, -1),
    67                 md.results.TransientSolution[-1].SmbT[0, 0:240].reshape(1, -1),
    68                 md.results.TransientSolution[-1].SmbD[0, 0:240].reshape(1, -1),
    69                 md.results.TransientSolution[-1].SmbRe[0, 0:240].reshape(1, -1),
    70                 md.results.TransientSolution[-1].SmbGdn[0, 0:240].reshape(1, -1),
    71                 md.results.TransientSolution[-1].SmbGsp[0, 0:240].reshape(1, -1),
    72                 md.results.TransientSolution[-1].SmbA[0, 0:240].reshape(1, -1),
     66field_values = [md.results.TransientSolution[-1].SmbDz[0, 0:240].reshape(1, - 1),
     67                md.results.TransientSolution[-1].SmbT[0, 0:240].reshape(1, - 1),
     68                md.results.TransientSolution[-1].SmbD[0, 0:240].reshape(1, - 1),
     69                md.results.TransientSolution[-1].SmbRe[0, 0:240].reshape(1, - 1),
     70                md.results.TransientSolution[-1].SmbGdn[0, 0:240].reshape(1, - 1),
     71                md.results.TransientSolution[-1].SmbGsp[0, 0:240].reshape(1, - 1),
     72                md.results.TransientSolution[-1].SmbA[0, 0:240].reshape(1, - 1),
    7373                md.results.TransientSolution[-1].SmbEC[0],
    7474                md.results.TransientSolution[-1].SmbMassBalance[0],
  • issm/trunk-jpl/test/NightlyRun/test244.py

    r24187 r24214  
    6969#partitioning
    7070md.qmu.numberofpartitions = md.mesh.numberofelements
    71 md = partitioner(md, 'package', 'linear','type','element')
     71md = partitioner(md, 'package', 'linear', 'type', 'element')
    7272md.qmu.epartition = (md.qmu.epartition - 1)
    7373
     
    7575md.qmu.variables.surface_mass_balanceC = normal_uncertain.normal_uncertain('scaled_SmbC', 1, 0.5)
    7676Tmin = 273.
    77 telms = np.atleast_2d(np.min(md.smb.Ta[0:-1, :], 1))
     77telms = np.atleast_2d(np.min(md.smb.Ta[0: - 1, :], 1))
    7878mint_on_partition = telms.flatten()
    7979for pa in range(np.size(mint_on_partition)):
    8080    vi = np.where(md.qmu.epartition == pa)
    81     mint = telms[0,vi] * 1.05
     81    mint = telms[0, vi] * 1.05
    8282    pos = np.where(mint < Tmin)
    8383    mint[pos] = Tmin
    84     mint_on_partition[pa] = max(mint / telms[0,vi])
     84    mint_on_partition[pa] = max(mint / telms[0, vi])
    8585
    86 mint_on_partition[np.where(np.isnan(mint_on_partition))] = 10**-10
     86mint_on_partition[np.where(np.isnan(mint_on_partition))] = 10**- 10
    8787md.qmu.variables.surface_mass_balanceTa = uniform_uncertain.uniform_uncertain('scaled_SmbTa', 1, 0.05)
    8888md.qmu.variables.surface_mass_balanceTa[0].lower = 0.95
     
    117117
    118118
    119 md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
     119md.stressbalance.reltol = 10**- 5  #tighten for qmu analyses
    120120md.transient.requested_outputs = ['IceVolume', 'TotalSmb', 'IceMass']
    121121
    122122#solve
    123 md.verbose = verbose('000000000')       # this line is recommended
     123md.verbose = verbose('000000000')  # this line is recommended
    124124md = solve(md, 'Transient', 'overwrite', 'y')
    125125md.qmu.results = md.results.dakota
  • issm/trunk-jpl/test/NightlyRun/test245.py

    r23793 r24214  
    1919# initalize pdd fields
    2020md.smb.initialize(md)
    21 md.smb.s0p = md.geometry.surface.reshape(-1, 1)
    22 md.smb.s0t = md.geometry.surface.reshape(-1, 1)
     21md.smb.s0p = md.geometry.surface.reshape(- 1, 1)
     22md.smb.s0t = md.geometry.surface.reshape(- 1, 1)
    2323
    2424
    2525md.smb.monthlytemperatures = np.empty((md.mesh.numberofvertices + 1, 12))
    2626md.smb.precipitation = np.empty((md.mesh.numberofvertices + 1, 12))
    27 temp_ma_present = -10. * np.ones((md.mesh.numberofvertices,)) - md.smb.rlaps * md.geometry.surface / 1000.
    28 temp_mj_present = 10. * np.ones((md.mesh.numberofvertices,)) - md.smb.rlaps * md.geometry.surface / 1000.
    29 precipitation = 5. * np.ones((md.mesh.numberofvertices,))
     27temp_ma_present = - 10. * np.ones((md.mesh.numberofvertices, )) - md.smb.rlaps * md.geometry.surface / 1000.
     28temp_mj_present = 10. * np.ones((md.mesh.numberofvertices, )) - md.smb.rlaps * md.geometry.surface / 1000.
     29precipitation = 5. * np.ones((md.mesh.numberofvertices, ))
    3030for imonth in range(12):
    3131    md.smb.monthlytemperatures[0:md.mesh.numberofvertices, imonth] = md.materials.meltingpoint + temp_ma_present + (temp_mj_present - temp_ma_present) * np.sin((imonth + 1. - 4.) * np.pi / 6.0)
  • issm/trunk-jpl/test/NightlyRun/test250.py

    r24174 r24214  
    2323md.timestepping.final_time = 4
    2424
    25 smb = np.ones((md.mesh.numberofvertices,)) * 3.6
    26 smb = np.array([smb, smb * -1]).T
     25smb = np.ones((md.mesh.numberofvertices, )) * 3.6
     26smb = np.array([smb, smb * - 1]).T
    2727
    2828md.smb.mass_balance = smb
     
    7979    md.qmu.params.evaluation_concurrency = 1
    8080
    81 md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
     81md.stressbalance.reltol = 10**- 5  #tighten for qmu analyses
    8282md.transient.requested_outputs = ['IceVolume']
    8383
    8484#solve
    85 md.verbose = verbose('000000000')       # this line is recommended
     85md.verbose = verbose('000000000')  # this line is recommended
    8686md = solve(md, 'Transient', 'overwrite', 'y')
    8787md.qmu.results = md.results.dakota
  • issm/trunk-jpl/test/NightlyRun/test251.py

    r24174 r24214  
    2323md.timestepping.final_time = 4
    2424
    25 smb = np.ones((md.mesh.numberofvertices,)) * 3.6
    26 smb = np.array([smb, smb * -1]).T
     25smb = np.ones((md.mesh.numberofvertices, )) * 3.6
     26smb = np.array([smb, smb * - 1]).T
    2727
    2828md.smb.mass_balance = smb
     
    7676    md.qmu.params.evaluation_concurrency = 1
    7777
    78 md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
     78md.stressbalance.reltol = 10**- 5  #tighten for qmu analyses
    7979md.transient.requested_outputs = ['IceVolume']
    8080
    8181#solve
    82 md.verbose = verbose('000000000')       # this line is recommended
     82md.verbose = verbose('000000000')  # this line is recommended
    8383md = solve(md, 'Transient', 'overwrite', 'y')
    8484md.qmu.results = md.results.dakota
  • issm/trunk-jpl/test/NightlyRun/test252.py

    r24210 r24214  
    4242md.smb.C = np.tile(np.conjugate(inputs[b'LP']['C']), (md.mesh.numberofelements, 1)).flatten()
    4343
    44 md.smb.Ta = md.smb.Ta[:,0:365*8]
    45 md.smb.V = md.smb.V[:,0:365*8]
    46 md.smb.dswrf = md.smb.dswrf[:,0:365*8]
    47 md.smb.dlwrf = md.smb.dlwrf[:,0:365*8]
    48 md.smb.P = md.smb.P[:,0:365*8]
    49 md.smb.eAir = md.smb.eAir[:,0:365*8]
    50 md.smb.pAir = md.smb.pAir[:,0:365*8]
     44md.smb.Ta = md.smb.Ta[:, 0:365 * 8]
     45md.smb.V = md.smb.V[:, 0:365 * 8]
     46md.smb.dswrf = md.smb.dswrf[:, 0:365 * 8]
     47md.smb.dlwrf = md.smb.dlwrf[:, 0:365 * 8]
     48md.smb.P = md.smb.P[:, 0:365 * 8]
     49md.smb.eAir = md.smb.eAir[:, 0:365 * 8]
     50md.smb.pAir = md.smb.pAir[:, 0:365 * 8]
    5151
    5252md.smb.isclimatology = 1
     
    7070
    7171#Fields and tolerances to track changes
    72 field_names = ['SmbDz1','SmbT1' ,'SmbD1' ,'SmbRe1','SmbGdn1','SmbGsp1','SmbA1' ,'SmbEC1','SmbMassBalance1','SmbMAdd1','SmbDzAdd1','SmbFAC1','SmbDz2','SmbT2','SmbD2' ,'SmbRe2','SmbGdn2','SmbGsp2','SmbA2','SmbEC2','SmbMassBalance2','SmbMAdd2','SmbDzAdd2','SmbFAC2','SmbDz3','SmbT3','SmbD3','SmbRe3','SmbGdn3','SmbGsp3','SmbA3','SmbEC3','SmbMassBalance3','SmbMAdd3','SmbDzAdd3','SmbFAC3','SmbDz4','SmbT4' ,'SmbD4' ,'SmbRe4','SmbGdn4','SmbGsp4','SmbA4','SmbEC4','SmbMassBalance4','SmbMAdd4','SmbDzAdd4','SmbFAC4']
    73 field_tolerances = [1e-11,1e-12,1e-11,2e-11,1e-11,1e-11,1e-12,1e-12,1e-12,1e-12,1e-12,1e-11,
    74                    1e-11,1e-12,1e-11,8e-10,1e-11,4e-11,1e-12,4e-12,1e-12,1e-12,1e-12,2e-11,
    75                    1e-11,1e-12,1e-11,8e-10,1e-11,4e-11,1e-12,6e-12,6e-12,1e-12,1e-12,2e-11,
    76                    2e-9,1e-11,3e-9,1e-9,1e-11,2e-7,7e-11,2e-12,3e-9,1e-12,1e-12,9e-11]
     72
     73field_names = ['SmbDz1', 'SmbT1', 'SmbD1', 'SmbRe1', 'SmbGdn1', 'SmbGsp1', 'SmbA1', 'SmbEC1', 'SmbMassBalance1', 'SmbMAdd1', 'SmbDzAdd1', 'SmbFAC1',
     74               'SmbDz2', 'SmbT2', 'SmbD2', 'SmbRe2', 'SmbGdn2', 'SmbGsp2', 'SmbA2', 'SmbEC2', 'SmbMassBalance2', 'SmbMAdd2', 'SmbDzAdd2', 'SmbFAC2',
     75               'SmbDz3', 'SmbT3', 'SmbD3', 'SmbRe3', 'SmbGdn3', 'SmbGsp3', 'SmbA3', 'SmbEC3', 'SmbMassBalance3', 'SmbMAdd3', 'SmbDzAdd3', 'SmbFAC3',
     76               'SmbDz4', 'SmbT4', 'SmbD4', 'SmbRe4', 'SmbGdn4', 'SmbGsp4', 'SmbA4', 'SmbEC4', 'SmbMassBalance4', 'SmbMAdd4', 'SmbDzAdd4', 'SmbFAC4']
     77field_tolerances = [1e-11, 1e-12, 1e-11, 2e-11, 1e-11, 1e-11, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-11,
     78                    1e-11, 1e-12, 1e-11, 8e-10, 1e-11, 4e-11, 1e-12, 4e-12, 1e-12, 1e-12, 1e-12, 2e-11,
     79                    1e-11, 1e-12, 1e-11, 8e-10, 1e-11, 4e-11, 1e-12, 6e-12, 6e-12, 1e-12, 1e-12, 2e-11,
     80                    2e-9, 1e-11, 3e-9, 1e-9, 1e-11, 2e-7, 7e-11, 2e-12, 3e-9, 1e-12, 1e-12, 9e-11]
    7781
    7882#shape is different in python solution (fixed using reshape) which can cause test failure:
    79 field_values = [md.results.TransientSolution[0].SmbDz[0, 0:230].reshape(1, -1),
    80                 md.results.TransientSolution[0].SmbT[0, 0:230].reshape(1, -1),
    81                 md.results.TransientSolution[0].SmbD[0, 0:230].reshape(1, -1),
    82                 md.results.TransientSolution[0].SmbRe[0, 0:230].reshape(1, -1),
    83                 md.results.TransientSolution[0].SmbGdn[0, 0:230].reshape(1, -1),
    84                 md.results.TransientSolution[0].SmbGsp[0, 0:230].reshape(1, -1),
    85                 md.results.TransientSolution[0].SmbA[0, 0:230].reshape(1, -1),
     83field_values = [md.results.TransientSolution[0].SmbDz[0, 0:230].reshape(1, - 1),
     84                md.results.TransientSolution[0].SmbT[0, 0:230].reshape(1, - 1),
     85                md.results.TransientSolution[0].SmbD[0, 0:230].reshape(1, - 1),
     86                md.results.TransientSolution[0].SmbRe[0, 0:230].reshape(1, - 1),
     87                md.results.TransientSolution[0].SmbGdn[0, 0:230].reshape(1, - 1),
     88                md.results.TransientSolution[0].SmbGsp[0, 0:230].reshape(1, - 1),
     89                md.results.TransientSolution[0].SmbA[0, 0:230].reshape(1, - 1),
    8690                md.results.TransientSolution[0].SmbEC[0],
    8791                md.results.TransientSolution[0].SmbMassBalance[0],
     
    8993                md.results.TransientSolution[0].SmbDzAdd[0],
    9094                md.results.TransientSolution[0].SmbFAC[0],
    91                 md.results.TransientSolution[145].SmbDz[0, 0:230].reshape(1, -1),
    92                 md.results.TransientSolution[145].SmbT[0, 0:230].reshape(1, -1),
    93                 md.results.TransientSolution[145].SmbD[0, 0:230].reshape(1, -1),
    94                 md.results.TransientSolution[145].SmbRe[0, 0:230].reshape(1, -1),
    95                 md.results.TransientSolution[145].SmbGdn[0, 0:230].reshape(1, -1),
    96                 md.results.TransientSolution[145].SmbGsp[0, 0:230].reshape(1, -1),
    97                 md.results.TransientSolution[145].SmbA[0, 0:230].reshape(1, -1),
     95                md.results.TransientSolution[145].SmbDz[0, 0:230].reshape(1, - 1),
     96                md.results.TransientSolution[145].SmbT[0, 0:230].reshape(1, - 1),
     97                md.results.TransientSolution[145].SmbD[0, 0:230].reshape(1, - 1),
     98                md.results.TransientSolution[145].SmbRe[0, 0:230].reshape(1, - 1),
     99                md.results.TransientSolution[145].SmbGdn[0, 0:230].reshape(1, - 1),
     100                md.results.TransientSolution[145].SmbGsp[0, 0:230].reshape(1, - 1),
     101                md.results.TransientSolution[145].SmbA[0, 0:230].reshape(1, - 1),
    98102                md.results.TransientSolution[145].SmbEC[0],
    99103                md.results.TransientSolution[145].SmbMassBalance[0],
     
    101105                md.results.TransientSolution[145].SmbDzAdd[0],
    102106                md.results.TransientSolution[145].SmbFAC[0],
    103                 md.results.TransientSolution[146].SmbDz[0, 0:230].reshape(1, -1),
    104                 md.results.TransientSolution[146].SmbT[0, 0:230].reshape(1, -1),
    105                 md.results.TransientSolution[146].SmbD[0, 0:230].reshape(1, -1),
    106                 md.results.TransientSolution[146].SmbRe[0, 0:230].reshape(1, -1),
    107                 md.results.TransientSolution[146].SmbGdn[0, 0:230].reshape(1, -1),
    108                 md.results.TransientSolution[146].SmbGsp[0, 0:230].reshape(1, -1),
    109                 md.results.TransientSolution[146].SmbA[0, 0:230].reshape(1, -1),
     107                md.results.TransientSolution[146].SmbDz[0, 0:230].reshape(1, - 1),
     108                md.results.TransientSolution[146].SmbT[0, 0:230].reshape(1, - 1),
     109                md.results.TransientSolution[146].SmbD[0, 0:230].reshape(1, - 1),
     110                md.results.TransientSolution[146].SmbRe[0, 0:230].reshape(1, - 1),
     111                md.results.TransientSolution[146].SmbGdn[0, 0:230].reshape(1, - 1),
     112                md.results.TransientSolution[146].SmbGsp[0, 0:230].reshape(1, - 1),
     113                md.results.TransientSolution[146].SmbA[0, 0:230].reshape(1, - 1),
    110114                md.results.TransientSolution[146].SmbEC[0],
    111115                md.results.TransientSolution[146].SmbMassBalance[0],
     
    113117                md.results.TransientSolution[146].SmbDzAdd[0],
    114118                md.results.TransientSolution[146].SmbFAC[0],
    115                 md.results.TransientSolution[-1].SmbDz[0, 0:230].reshape(1, -1),
    116                 md.results.TransientSolution[-1].SmbT[0, 0:230].reshape(1, -1),
    117                 md.results.TransientSolution[-1].SmbD[0, 0:230].reshape(1, -1),
    118                 md.results.TransientSolution[-1].SmbRe[0, 0:230].reshape(1, -1),
    119                 md.results.TransientSolution[-1].SmbGdn[0, 0:230].reshape(1, -1),
    120                 md.results.TransientSolution[-1].SmbGsp[0, 0:230].reshape(1, -1),
    121                 md.results.TransientSolution[-1].SmbA[0, 0:230].reshape(1, -1),
     119                md.results.TransientSolution[-1].SmbDz[0, 0:230].reshape(1, - 1),
     120                md.results.TransientSolution[-1].SmbT[0, 0:230].reshape(1, - 1),
     121                md.results.TransientSolution[-1].SmbD[0, 0:230].reshape(1, - 1),
     122                md.results.TransientSolution[-1].SmbRe[0, 0:230].reshape(1, - 1),
     123                md.results.TransientSolution[-1].SmbGdn[0, 0:230].reshape(1, - 1),
     124                md.results.TransientSolution[-1].SmbGsp[0, 0:230].reshape(1, - 1),
     125                md.results.TransientSolution[-1].SmbA[0, 0:230].reshape(1, - 1),
    122126                md.results.TransientSolution[-1].SmbEC[0],
    123127                md.results.TransientSolution[-1].SmbMassBalance[0],
  • issm/trunk-jpl/test/NightlyRun/test260.py

    r23793 r24214  
    1313md = setmask(md, 'all', '')
    1414md.materials = matenhancedice()
    15 md.materials.rheology_B = 3.15e8 * np.ones(md.mesh.numberofvertices,)
    16 md.materials.rheology_n = 3 * np.ones(md.mesh.numberofelements,)
    17 md.materials.rheology_E = np.ones(md.mesh.numberofvertices,)
     15md.materials.rheology_B = 3.15e8 * np.ones(md.mesh.numberofvertices, )
     16md.materials.rheology_n = 3 * np.ones(md.mesh.numberofelements, )
     17md.materials.rheology_E = np.ones(md.mesh.numberofvertices, )
    1818md = parameterize(md, '../Par/SquareShelf.py')
    1919md = setflowequation(md, 'SSA', 'all')
  • issm/trunk-jpl/test/NightlyRun/test261.py

    r24149 r24214  
    1717md.cluster = generic('name', gethostname(), 'np', 3)
    1818md.materials = matenhancedice()
    19 md.materials.rheology_B = 3.15e8 * np.ones(md.mesh.numberofvertices,)
    20 md.materials.rheology_n = 3 * np.ones(md.mesh.numberofelements,)
    21 md.materials.rheology_E = np.ones(md.mesh.numberofvertices,)
     19md.materials.rheology_B = 3.15e8 * np.ones(md.mesh.numberofvertices, )
     20md.materials.rheology_n = 3 * np.ones(md.mesh.numberofelements, )
     21md.materials.rheology_E = np.ones(md.mesh.numberofvertices, )
    2222md.transient.isstressbalance = 1
    2323md.transient.ismasstransport = 0
  • issm/trunk-jpl/test/NightlyRun/test272.py

    r23793 r24214  
    2525md.inversion.iscontrol = 1
    2626md.inversion.control_parameters = ['DamageDbar']
    27 md.inversion.min_parameters = 10**-13 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
     27md.inversion.min_parameters = 10**- 13 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
    2828md.inversion.max_parameters = np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
    2929md.inversion.nsteps = 2
  • issm/trunk-jpl/test/NightlyRun/test293.py

    r23793 r24214  
    1919md.basalforcings = md.basalforcings.initialize(md)
    2020md.transient.isgroundingline = 1
    21 md.geometry.bed = min(md.geometry.base) * np.ones(md.mesh.numberofvertices,)
     21md.geometry.bed = min(md.geometry.base) * np.ones(md.mesh.numberofvertices, )
    2222md.transient.requested_outputs = ['default', 'BasalforcingsFloatingiceMeltingRate']
    2323
  • issm/trunk-jpl/test/NightlyRun/test3015.py

    r23793 r24214  
    1414
    1515#This test runs test3005 with autodiff on, and checks that
    16 #the value of the scalar forward difference match a step-wise differential
     16#the value of the scalar forward difference match a step - wise differential
    1717
    1818#First configure
     
    3434index = index - 1
    3535
    36 #parameters for the step-wise derivative
     36#parameters for the step - wise derivative
    3737delta = 0.001
    3838h1 = md.geometry.thickness[index]
     
    4949md.autodiff.isautodiff = False
    5050md.geometry.thickness[index] = h0
    51 md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
     51md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
    5252md.geometry.surface = md.geometry.base + md.geometry.thickness
    5353md = SetIceShelfBC(md)
     
    6060md.autodiff.isautodiff = False
    6161md.geometry.thickness[index] = h2
    62 md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
     62md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
    6363md.geometry.surface = md.geometry.base + md.geometry.thickness
    6464md = SetIceShelfBC(md)
     
    7474md.autodiff.isautodiff = True
    7575md.geometry.thickness[index] = h1
    76 md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
     76md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
    7777md.geometry.surface = md.geometry.base + md.geometry.thickness
    7878md = SetIceShelfBC(md)
     
    8282dVdh_ad = md.results.MasstransportSolution.AutodiffJacobian
    8383
    84 print("dV/dh: analytical:  %16.16g\n       using adolc:  %16.16g\n" % (dVdh_an, dVdh_ad))
     84print("dV / dh: analytical:  %16.16g\n       using adolc:  %16.16g\n" % (dVdh_an, dVdh_ad))
    8585
    8686#Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test3020.py

    r23793 r24214  
    1414
    1515#This test runs test3020 with autodiff on, and checks that
    16 #the value of the scalar forward difference match a step-wise differential
     16#the value of the scalar forward difference match a step - wise differential
    1717
    1818#First configure
     
    3636index = index - 1
    3737
    38 #parameters for the step-wise derivative
     38#parameters for the step - wise derivative
    3939delta = 0.00001
    4040h1 = md.geometry.thickness[index]
     
    5151md.autodiff.isautodiff = False
    5252md.geometry.thickness[index] = h0
    53 md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
     53md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
    5454md.geometry.surface = md.geometry.base + md.geometry.thickness
    5555md = SetIceShelfBC(md)
     
    6363md.autodiff.isautodiff = False
    6464md.geometry.thickness[index] = h2
    65 md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
     65md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
    6666md.geometry.surface = md.geometry.base + md.geometry.thickness
    6767md = SetIceShelfBC(md)
     
    7979md.autodiff.isautodiff = True
    8080md.geometry.thickness[index] = h1
    81 md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
     81md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
    8282md.geometry.surface = md.geometry.base + md.geometry.thickness
    8383md = SetIceShelfBC(md)
     
    8888dMaxVdh_ad = md.results.TransientSolution[0].AutodiffJacobian[1]
    8989
    90 print("dV/dh: analytical:  %16.16g\n       using adolc:  %16.16g\n" % (dVdh_an, dVdh_ad))
    91 print("dMaxV/dh: analytical:  %16.16g\n       using adolc:  %16.16g\n" % (dMaxVdh_an, dMaxVdh_ad))
     90print("dV / dh: analytical:  %16.16g\n       using adolc:  %16.16g\n" % (dVdh_an, dVdh_ad))
     91print("dMaxV / dh: analytical:  %16.16g\n       using adolc:  %16.16g\n" % (dMaxVdh_an, dMaxVdh_ad))
    9292
    9393#Fields and tolerances to track changes
    94 field_names = ['dV/dh-dV/dh0', 'dMaxV/dh-dMaxV/dh0']
     94field_names = ['dV/dh - dV / dh0', 'dMaxV/dh - dMaxV / dh0']
    9595field_tolerances = [1e-13, 1e-13]
    9696field_values = [dVdh_ad - dVdh_an, dMaxVdh_an - dMaxVdh_ad]
  • issm/trunk-jpl/test/NightlyRun/test319.py

    r23793 r24214  
    2424md.inversion.cost_functions = [103, 501]
    2525md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
    26 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**-7
     26md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 7
    2727md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
    2828md.inversion.maxiter_per_step = 2 * np.ones(md.inversion.nsteps)
  • issm/trunk-jpl/test/NightlyRun/test320.py

    r23793 r24214  
    2424md.inversion.cost_functions = [103, 501]
    2525md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
    26 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**-7
     26md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 7
    2727md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
    2828md.inversion.maxiter_per_step = 2 * np.ones(md.inversion.nsteps)
  • issm/trunk-jpl/test/NightlyRun/test321.py

    r23793 r24214  
    2424md.inversion.cost_functions = [102, 501]
    2525md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
    26 md.inversion.cost_functions_coefficients[:, 1] = 2 * 10**-7
     26md.inversion.cost_functions_coefficients[:, 1] = 2 * 10**- 7
    2727md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
    2828md.inversion.maxiter_per_step = 2 * np.ones(md.inversion.nsteps)
  • issm/trunk-jpl/test/NightlyRun/test322.py

    r23793 r24214  
    2424md.inversion.cost_functions = [104, 501]
    2525md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
    26 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**-7
     26md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 7
    2727md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
    2828md.inversion.maxiter_per_step = 2 * np.ones(md.inversion.nsteps)
  • issm/trunk-jpl/test/NightlyRun/test328.py

    r23793 r24214  
    1414md = setflowequation(md, 'SSA', 'all')
    1515md.smb = SMBgradients()
    16 md.smb.b_pos = -100. + 0.00005 * md.mesh.x - 0.0001 * md.mesh.y
     16md.smb.b_pos = - 100. + 0.00005 * md.mesh.x - 0.0001 * md.mesh.y
    1717md.smb.b_neg = 250. + 0.000051 * md.mesh.x - 0.00011 * md.mesh.y
    1818md.transient.requested_outputs = ['default', 'TotalSmb']
  • issm/trunk-jpl/test/NightlyRun/test330.py

    r23793 r24214  
    3838md.hydrology.sediment_transmitivity = (1.0e-3 * md.hydrology.sediment_thickness) * np.ones((md.mesh.numberofvertices))
    3939#init
    40 md.initialization.sediment_head = -5.0 * np.ones((md.mesh.numberofvertices))
     40md.initialization.sediment_head = - 5.0 * np.ones((md.mesh.numberofvertices))
    4141#BC
    4242md.hydrology.spcsediment_head = np.nan * np.ones((md.mesh.numberofvertices))
  • issm/trunk-jpl/test/NightlyRun/test3300.py

    r23793 r24214  
    5050md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices + 1, len(times)))
    5151
    52 md.basalforcings.groundedice_melting_rate[:, np.where(times <= 6.0)] = -0.2
     52md.basalforcings.groundedice_melting_rate[:, np.where(times <= 6.0)] = - 0.2
    5353md.basalforcings.groundedice_melting_rate[:, np.where(times <= 1.0)] = 1.0
    5454md.basalforcings.groundedice_melting_rate[-1, :] = times
     
    6363# totvol = np.zeros(4001)
    6464# time = np.arange(0.002, 8.001, 0.002)
    65 # store = md.constants.g*md.hydrology.sediment_porosity*md.materials.rho_freshwater*((md.hydrology.sediment_compressibility/md.hydrology.sediment_porosity)+md.hydrology.water_compressibility)
    66 # sedstore = 20.0*store
     65# store = md.constants.g * md.hydrology.sediment_porosity * md.materials.rho_freshwater * ((md.hydrology.sediment_compressibility / md.hydrology.sediment_porosity) + md.hydrology.water_compressibility)
     66# sedstore = 20.0 * store
    6767# for i in range(0, 4000):
    68 #       sedvol[i]=np.mean(md.results.TransientSolution[i].SedimentHead)*sedstore
    69 #       eplvol[i]=np.mean(md.results.TransientSolution[i].EplHead)*store*np.mean(md.results.TransientSolution[i].HydrologydcEplThicknessHydrostep)
    70 #       totvol[i+1]=totvol[i]+md.basalforcings.groundedice_melting_rate[0, i]*0.002
     68#       sedvol[i] = np.mean(md.results.TransientSolution[i].SedimentHead) * sedstore
     69#       eplvol[i] = np.mean(md.results.TransientSolution[i].EplHead) * store * np.mean(md.results.TransientSolution[i].HydrologydcEplThicknessHydrostep)
     70#       totvol[i + 1] = totvol[i] + md.basalforcings.groundedice_melting_rate[0, i] * 0.002
    7171
    7272field_names = ['SedimentWaterHead5', 'EplWaterHead5', 'SedimentWaterHead40', 'EplWaterHead40']
  • issm/trunk-jpl/test/NightlyRun/test332.py

    r23793 r24214  
    4343#you can also compare with an analitic solution, but it is exact
    4444#only if no limits are applied
    45 #analitic=(md.mesh.y**2-2*md.mesh.y*1.0e6)*(-2.0/(2*md.constants.yts*md.hydrology.sediment_transmitivity))
     45#analitic=(md.mesh.y**2 - 2 * md.mesh.y * 1.0e6) * (- 2.0 / (2 * md.constants.yts * md.hydrology.sediment_transmitivity))
    4646field_names = ['SedimentWaterHead', 'SedimentHeadResidual']
    4747field_tolerances = [1e-13, 3e-10]
  • issm/trunk-jpl/test/NightlyRun/test334.py

    r23793 r24214  
    4343#you can also compare with an analitic solution, but it is exact
    4444#only if no limits are applied
    45 #analitic=(md.mesh.y.^2-2*md.mesh.y*1.0e6)*(-2.0/(2*md.constants.yts*md.hydrology.sediment_transmitivity))
     45#analitic=(md.mesh.y.^2 - 2 * md.mesh.y * 1.0e6) * (- 2.0 / (2 * md.constants.yts * md.hydrology.sediment_transmitivity))
    4646field_names = ['SedimentWaterHead', 'SedimentHeadResidual']
    4747field_tolerances = [1e-13, 3e-10]
  • issm/trunk-jpl/test/NightlyRun/test336.py

    r23793 r24214  
    2222#Set up transient
    2323smb = np.ones((md.mesh.numberofvertices)) * 3.6
    24 smb = np.vstack((smb, smb * -1.)).T
     24smb = np.vstack((smb, smb * - 1.)).T
    2525
    2626md.smb = SMBcomponents()
  • issm/trunk-jpl/test/NightlyRun/test337.py

    r23793 r24214  
    2323#Set up transient
    2424smb = np.ones((md.mesh.numberofvertices)) * 3.6
    25 smb = np.vstack((smb, smb * -1.)).T
     25smb = np.vstack((smb, smb * - 1.)).T
    2626
    2727md.smb = SMBcomponents()
  • issm/trunk-jpl/test/NightlyRun/test338.py

    r23793 r24214  
    2222#Set up transient
    2323smb = np.ones((md.mesh.numberofvertices)) * 3.6
    24 smb = np.vstack((smb, smb * -1.)).T
     24smb = np.vstack((smb, smb * - 1.)).T
    2525
    2626md.smb = SMBmeltcomponents()
  • issm/trunk-jpl/test/NightlyRun/test341.py

    r23793 r24214  
    2727md.inversion.cost_functions = [102, 501]
    2828md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
    29 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**-7
     29md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 7
    3030md.inversion.vx_obs = md.initialization.vx
    3131md.inversion.vy_obs = md.initialization.vy
  • issm/trunk-jpl/test/NightlyRun/test342.py

    r23793 r24214  
    1515md.basalforcings = plumebasalforcings()
    1616md.basalforcings = md.basalforcings.setdefaultparameters()
    17 md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices,))
    18 md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices,))
     17md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
     18md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
    1919md.basalforcings.plumex = 500000
    2020md.basalforcings.plumey = 500000
  • issm/trunk-jpl/test/NightlyRun/test343.py

    r23793 r24214  
    1515md = setflowequation(md, 'SSA', 'all')
    1616md.smb = SMBgradientsela()
    17 md.smb.ela = 1500. * np.ones((md.mesh.numberofvertices + 1,))
    18 md.smb.b_pos = 0.002 * np.ones((md.mesh.numberofvertices + 1,))
    19 md.smb.b_neg = 0.005 * np.ones((md.mesh.numberofvertices + 1,))
    20 md.smb.b_max = 4. * (md.materials.rho_freshwater / md.materials.rho_ice) * np.ones((md.mesh.numberofvertices + 1,))
    21 md.smb.b_min = -4. * (md.materials.rho_freshwater / md.materials.rho_ice) * np.ones((md.mesh.numberofvertices + 1,))
     17md.smb.ela = 1500. * np.ones((md.mesh.numberofvertices + 1, ))
     18md.smb.b_pos = 0.002 * np.ones((md.mesh.numberofvertices + 1, ))
     19md.smb.b_neg = 0.005 * np.ones((md.mesh.numberofvertices + 1, ))
     20md.smb.b_max = 4. * (md.materials.rho_freshwater / md.materials.rho_ice) * np.ones((md.mesh.numberofvertices + 1, ))
     21md.smb.b_min = - 4. * (md.materials.rho_freshwater / md.materials.rho_ice) * np.ones((md.mesh.numberofvertices + 1, ))
    2222
    2323#Change geometry
  • issm/trunk-jpl/test/NightlyRun/test344.py

    r23793 r24214  
    2121md = setflowequation(md, 'HO', 'all')
    2222md.smb = SMBgradientsela()
    23 md.smb.ela = 1500. * np.ones((md.mesh.numberofvertices + 1,))
    24 md.smb.b_pos = 0.002 * np.ones((md.mesh.numberofvertices + 1,))
    25 md.smb.b_neg = 0.005 * np.ones((md.mesh.numberofvertices + 1,))
    26 md.smb.b_max = 4. * (md.materials.rho_freshwater / md.materials.rho_ice) * np.ones((md.mesh.numberofvertices + 1,))
    27 md.smb.b_min = -4. * (md.materials.rho_freshwater / md.materials.rho_ice) * np.ones((md.mesh.numberofvertices + 1,))
     23md.smb.ela = 1500. * np.ones((md.mesh.numberofvertices + 1, ))
     24md.smb.b_pos = 0.002 * np.ones((md.mesh.numberofvertices + 1, ))
     25md.smb.b_neg = 0.005 * np.ones((md.mesh.numberofvertices + 1, ))
     26md.smb.b_max = 4. * (md.materials.rho_freshwater / md.materials.rho_ice) * np.ones((md.mesh.numberofvertices + 1, ))
     27md.smb.b_min = - 4. * (md.materials.rho_freshwater / md.materials.rho_ice) * np.ones((md.mesh.numberofvertices + 1, ))
    2828
    2929
  • issm/trunk-jpl/test/NightlyRun/test346.py

    r24096 r24214  
    1 #Test Name: SquareSheetConstrainedTherTranNyeCO2
    2 import numpy as np
     1#Test Name: SquareSheetConstrainedTherTranNyeCO2
    32from model import *
    43from socket import gethostname
     
    1817#Transient options
    1918md.cluster = generic('name', gethostname(), 'np', 3)
    20 md.materials.rheology_law='NyeCO2'
    21 md.transient.isstressbalance=0
    22 md.transient.ismasstransport=0
    23 md.transient.issmb=1
    24 md.transient.isthermal=1
    25 md.transient.isgroundingline=0
     19md.materials.rheology_law = 'NyeCO2'
     20md.transient.isstressbalance = 0
     21md.transient.ismasstransport = 0
     22md.transient.issmb = 1
     23md.transient.isthermal = 1
     24md.transient.isgroundingline = 0
    2625md = solve(md, 'Transient')
    2726
    2827#Fields and tolerances to track changes
    29 field_names = ['Temperature1','BasalforcingsGroundediceMeltingRate1',
    30                'Temperature3','BasalforcingsGroundediceMeltingRate3']
     28field_names = ['Temperature1', 'BasalforcingsGroundediceMeltingRate1',
     29               'Temperature3', 'BasalforcingsGroundediceMeltingRate3']
    3130field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
    3231field_values = [md.results.TransientSolution[0].Temperature,
  • issm/trunk-jpl/test/NightlyRun/test347.py

    r24096 r24214  
    1 #Test Name: SquareSheetConstrainedTherTranNyeH2O
    2 import numpy as np
     1#Test Name: SquareSheetConstrainedTherTranNyeH2O
    32from model import *
    43from socket import gethostname
     
    1918#Transient options
    2019md.cluster = generic('name', gethostname(), 'np', 3)
    21 md.materials.rheology_law='NyeH2O'
    22 md.materials.rheology_B=nye(md.initialization.temperature,2)
     20md.materials.rheology_law = 'NyeH2O'
     21md.materials.rheology_B = nye(md.initialization.temperature, 2)
    2322
    24 md.transient.isstressbalance=0
    25 md.transient.ismasstransport=0
    26 md.transient.issmb=1
    27 md.transient.isthermal=1
    28 md.transient.isgroundingline=0
     23md.transient.isstressbalance = 0
     24md.transient.ismasstransport = 0
     25md.transient.issmb = 1
     26md.transient.isthermal = 1
     27md.transient.isgroundingline = 0
    2928md = solve(md, 'Transient')
    3029
    3130#Fields and tolerances to track changes
    32 field_names = ['Temperature1','BasalforcingsGroundediceMeltingRate1',
    33                'Temperature3','BasalforcingsGroundediceMeltingRate3']
     31field_names = ['Temperature1', 'BasalforcingsGroundediceMeltingRate1',
     32               'Temperature3', 'BasalforcingsGroundediceMeltingRate3']
    3433field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
    3534field_values = [md.results.TransientSolution[0].Temperature,
  • issm/trunk-jpl/test/NightlyRun/test350.py

    r23793 r24214  
    3030
    3131#Change geometry
    32 md.geometry.base = -.02 * md.mesh.x + 20.
    33 md.geometry.thickness = 300. * np.ones((md.mesh.numberofvertices,))
     32md.geometry.base = - .02 * md.mesh.x + 20.
     33md.geometry.thickness = 300. * np.ones((md.mesh.numberofvertices, ))
    3434md.geometry.bed = md.geometry.base
    3535md.geometry.surface = md.geometry.bed + md.geometry.thickness
     
    3737#define the initial water head as being such that the water pressure is 50% of the ice overburden pressure
    3838md.hydrology.head = 0.5 * md.materials.rho_ice / md.materials.rho_freshwater * md.geometry.thickness + md.geometry.base
    39 md.hydrology.gap_height = 0.01 * np.ones((md.mesh.numberofelements,))
    40 md.hydrology.bump_spacing = 2 * np.ones((md.mesh.numberofelements,))
    41 md.hydrology.bump_height = 0.05 * np.ones((md.mesh.numberofelements,))
    42 md.hydrology.englacial_input = 0.5 * np.ones((md.mesh.numberofvertices,))
    43 md.hydrology.reynolds = 1000. * np.ones((md.mesh.numberofelements,))
    44 md.hydrology.spchead = float('NaN') * np.ones((md.mesh.numberofvertices,))
     39md.hydrology.gap_height = 0.01 * np.ones((md.mesh.numberofelements, ))
     40md.hydrology.bump_spacing = 2 * np.ones((md.mesh.numberofelements, ))
     41md.hydrology.bump_height = 0.05 * np.ones((md.mesh.numberofelements, ))
     42md.hydrology.englacial_input = 0.5 * np.ones((md.mesh.numberofvertices, ))
     43md.hydrology.reynolds = 1000. * np.ones((md.mesh.numberofelements, ))
     44md.hydrology.spchead = float('NaN') * np.ones((md.mesh.numberofvertices, ))
    4545pos = np.intersect1d(np.array(np.where(md.mesh.vertexonboundary)), np.array(np.where(md.mesh.x == 1000)))
    4646md.hydrology.spchead[pos] = md.geometry.base[pos]
    4747
    4848#Define velocity
    49 md.initialization.vx = 1e-6 * md.constants.yts * np.ones((md.mesh.numberofvertices,))
    50 md.initialization.vy = np.zeros((md.mesh.numberofvertices,))
     49md.initialization.vx = 1e-6 * md.constants.yts * np.ones((md.mesh.numberofvertices, ))
     50md.initialization.vy = np.zeros((md.mesh.numberofvertices, ))
    5151
    5252md.timestepping.time_step = 3. * 3600. / md.constants.yts
    5353md.timestepping.final_time = .5 / 365.
    54 md.materials.rheology_B = (5e-25)**(-1. / 3.) * np.ones((md.mesh.numberofvertices,))
     54md.materials.rheology_B = (5e-25)**(- 1. / 3.) * np.ones((md.mesh.numberofvertices, ))
    5555
    5656#Add one moulin and Neumann BC, varying in time
  • issm/trunk-jpl/test/NightlyRun/test352.py

    r23816 r24214  
    2222#Set up transient
    2323smb = np.ones((md.mesh.numberofvertices)) * 3.6
    24 smb = np.vstack((smb, smb * -1.)).T
     24smb = np.vstack((smb, smb * - 1.)).T
    2525md.smb.mass_balance = np.vstack((smb, [1.5, 3.]))
    2626md.transient.isthermal = False
  • issm/trunk-jpl/test/NightlyRun/test353.py

    r23816 r24214  
    2222#Set up transient
    2323smb = np.ones((md.mesh.numberofvertices)) * 3.6
    24 smb = np.vstack((smb, smb * -1.)).T
     24smb = np.vstack((smb, smb * - 1.)).T
    2525
    2626md.smb = SMBcomponents()
  • issm/trunk-jpl/test/NightlyRun/test354.py

    r23816 r24214  
    2222#Set up transient
    2323smb = np.ones((md.mesh.numberofvertices)) * 3.6
    24 smb = np.vstack((smb, smb * -1.)).T
     24smb = np.vstack((smb, smb * - 1.)).T
    2525
    2626md.smb = SMBmeltcomponents()
  • issm/trunk-jpl/test/NightlyRun/test404.py

    r23869 r24214  
    1919#Fields and tolerances to track changes
    2020field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
    21 field_tolerances = [2e-06,4e-06,2e-06,1e-06,8e-07]
     21field_tolerances = [2e-06, 4e-06, 2e-06, 1e-06, 8e-07]
    2222field_values = [md.results.StressbalanceSolution.Vx,
    2323                md.results.StressbalanceSolution.Vy,
  • issm/trunk-jpl/test/NightlyRun/test412.py

    r24174 r24214  
    5353
    5454#imperative!
    55 md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
     55md.stressbalance.reltol = 10**- 5  #tighten for qmu analyses
    5656
    5757#solve
    58 md.verbose = verbose('000000000')       # this line is recommended
     58md.verbose = verbose('000000000')  # this line is recommended
    5959md = solve(md, 'Stressbalance', 'overwrite', 'y')
    6060
  • issm/trunk-jpl/test/NightlyRun/test413.py

    r24174 r24214  
    5151
    5252#imperative!
    53 md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
     53md.stressbalance.reltol = 10**- 5  #tighten for qmu analyses
    5454md.qmu.isdakota = 1
    5555
    5656#solve
    57 md.verbose = verbose('000000000')       # this line is recommended
     57md.verbose = verbose('000000000')  # this line is recommended
    5858md = solve(md, 'Stressbalance', 'overwrite', 'y')
    5959
  • issm/trunk-jpl/test/NightlyRun/test414.py

    r24174 r24214  
    2020md.geometry.surface = md.geometry.base + md.geometry.thickness
    2121
    22 #constrain all velocities to 1 m/yr, in the y-direction
    23 md.stressbalance.spcvx = np.zeros((md.mesh.numberofvertices,))
    24 md.stressbalance.spcvy = np.ones((md.mesh.numberofvertices,))
    25 md.stressbalance.spcvz = np.zeros((md.mesh.numberofvertices,))
     22#constrain all velocities to 1 m / yr, in the y - direction
     23md.stressbalance.spcvx = np.zeros((md.mesh.numberofvertices, ))
     24md.stressbalance.spcvy = np.ones((md.mesh.numberofvertices, ))
     25md.stressbalance.spcvz = np.zeros((md.mesh.numberofvertices, ))
    2626
    2727#Dakota options
     
    6060md.qmu.params.interval_type = 'forward'
    6161md.qmu.isdakota = 1
    62 md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
     62md.stressbalance.reltol = 10**- 5  #tighten for qmu analyses
    6363
    6464if version >= 6:
     
    7171
    7272#solve
    73 md.verbose = verbose('000000000')       # this line is recommended
     73md.verbose = verbose('000000000')  # this line is recommended
    7474md = solve(md, 'Stressbalance', 'overwrite', 'y')
    7575md.qmu.results = md.results.dakota
    7676
    7777#Fields and tolerances to track changes
    78 #ok, mass flux of 3 profiles should be -3 Gt/yr -3 Gt/yr and the sum, which is -6 Gt/yr
     78#ok, mass flux of 3 profiles should be-3 Gt / yr - 3 Gt / yr and the sum, which is - 6 Gt / yr
    7979#we recover those mass fluxes through the mean of the response.
    80 #also, we recover the max velo, which should be 1m/yr.
     80#also, we recover the max velo, which should be 1m / yr.
    8181#we put all that data in the moments, which we will use to test for success.
    8282#also, check that the stddev are 0.
  • issm/trunk-jpl/test/NightlyRun/test415.py

    r23793 r24214  
    2424md.inversion.cost_functions = [103, 501]
    2525md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
    26 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**-7
     26md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 7
    2727md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
    2828md.inversion.maxiter_per_step = 2 * np.ones((md.inversion.nsteps))
  • issm/trunk-jpl/test/NightlyRun/test416.py

    r23793 r24214  
    2424md.inversion.cost_functions = [102, 501]
    2525md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
    26 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**-7
     26md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 7
    2727md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
    2828md.inversion.maxiter_per_step = 2 * np.ones((md.inversion.nsteps))
  • issm/trunk-jpl/test/NightlyRun/test417.py

    r24183 r24214  
    2020md.geometry.surface = md.geometry.base + md.geometry.thickness
    2121
    22 #constrain all velocities to 1 m/yr, in the y-direction
     22#constrain all velocities to 1 m / yr, in the y - direction
    2323md.stressbalance.spcvx[:] = 0
    2424md.stressbalance.spcvy[:] = 1
     
    7676md.qmu.isdakota = 1
    7777
    78 md.stressbalance.reltol = 10**-5        #tighten for qmu analyses
     78md.stressbalance.reltol = 10**- 5  #tighten for qmu analyses
    7979
    8080#solve
    81 md.verbose = verbose('000000000')       # this line is recommended
     81md.verbose = verbose('000000000')  # this line is recommended
    8282
    8383# There may be a pair of numpy warnings in the function true_divide,
    8484#       this is normal and will not affect the results
    85 #       See src/m/qmu/dakota_out_parse.py, function "dak_tab_out" for details
     85#       See src / m / qmu / dakota_out_parse.py, function "dak_tab_out" for details
    8686md = solve(md, 'Stressbalance', 'overwrite', 'y')
    8787
     
    8989md.qmu.results = md.results.dakota
    9090
    91 #ok, mass flux of 3 profiles should be -3 Gt/yr -3 Gt/yr and the sum, which is -6 Gt/yr
     91#ok, mass flux of 3 profiles should be-3 Gt / yr - 3 Gt / yr and the sum, which is - 6 Gt / yr
    9292#we recover those mass fluxes through the mean of the response.
    93 #also, we recover the max velo, which should be 1m/yr.
     93#also, we recover the max velo, which should be 1m / yr.
    9494#we put all that data in the montecarlo field, which we will use to test for success.
    9595#also, check that the stddev are 0.
  • issm/trunk-jpl/test/NightlyRun/test418.py

    r24180 r24214  
    11#Test Name: SquareSheetShelfDiadSSA3dDakotaAreaAverage
    2 
    32# this test may crash
    4 
    53import numpy as np
    64from model import *
     
    2523#partitioning
    2624md.qmu.numberofpartitions = 100
    27 
     25#partitioner seamd to generate the following message:
    2826#corrupted size vs. prev_size
    2927#Aborted (core dumped)
    3028md = partitioner(md, 'package', 'chaco', 'npart', md.qmu.numberofpartitions)
    31 
    3229md.qmu.vpartition = md.qmu.vpartition - 1
    3330
    34 vector = np.arange(1, 1 + md.mesh.numberofvertices, 1).reshape(-1, 1)
     31vector = np.arange(1, 1 + md.mesh.numberofvertices, 1).reshape(- 1, 1)
    3532# double check this before committing:
    36 #print 'before AreaAverageOntoPartition'
    3733vector_on_partition = AreaAverageOntoPartition(md, vector)
    3834vector_on_nodes = vector_on_partition[md.qmu.vpartition]
  • issm/trunk-jpl/test/NightlyRun/test420.py

    r24174 r24214  
    5050
    5151#imperative!
    52 md.stressbalance.reltol = 10**-5  #tighten for qmu analysese
     52md.stressbalance.reltol = 10**- 5  #tighten for qmu analysese
    5353
    5454#solve
    55 md.verbose = verbose('000000000')       # this line is recommended
     55md.verbose = verbose('000000000')  # this line is recommended
    5656md = solve(md, 'Stressbalance', 'overwrite', 'y')
    5757md.qmu.results = md.results.dakota
    5858
    5959#test on thickness
    60 h = np.zeros((md.qmu.numberofpartitions,))
     60h = np.zeros((md.qmu.numberofpartitions, ))
    6161for i in range(md.qmu.numberofpartitions):
    6262    h[i] = md.qmu.results.dresp_out[i].mean
  • issm/trunk-jpl/test/NightlyRun/test423.py

    r23793 r24214  
    1818pos = np.argmin(rad)
    1919md.mesh.x[pos] = 0.
    20 md.mesh.y[pos] = 0.    #the closest node to the center is changed to be exactly at the center
     20md.mesh.y[pos] = 0.  #the closest node to the center is changed to be exactly at the center
    2121xelem = np.mean(md.mesh.x[md.mesh.elements.astype(int) - 1], axis=1)
    2222yelem = np.mean(md.mesh.y[md.mesh.elements.astype(int) - 1], axis=1)
  • issm/trunk-jpl/test/NightlyRun/test424.py

    r23793 r24214  
    1414md.initialization.vx[:] = 0.
    1515md.initialization.vy[:] = 0.
    16 md.geometry.base = -700. - abs(md.mesh.y - 500000.) / 1000.
    17 md.geometry.bed = -700. - abs(md.mesh.y - 500000.) / 1000.
     16md.geometry.base = - 700. - abs(md.mesh.y - 500000.) / 1000.
     17md.geometry.bed = - 700. - abs(md.mesh.y - 500000.) / 1000.
    1818md.geometry.thickness[:] = 1000.
    1919md.geometry.surface = md.geometry.base + md.geometry.thickness
  • issm/trunk-jpl/test/NightlyRun/test425.py

    r23793 r24214  
    1414md.initialization.vx[:] = 0.
    1515md.initialization.vy[:] = 0.
    16 md.geometry.base = -700. - abs(md.mesh.y - 500000.) / 1000.
    17 md.geometry.bed = -700. - abs(md.mesh.y - 500000.) / 1000.
     16md.geometry.base = - 700. - abs(md.mesh.y - 500000.) / 1000.
     17md.geometry.bed = - 700. - abs(md.mesh.y - 500000.) / 1000.
    1818md.geometry.thickness[:] = 1300.
    1919md.geometry.surface = md.geometry.base + md.geometry.thickness
    20 md.smb.mass_balance[:] = -150.
     20md.smb.mass_balance[:] = - 150.
    2121md.transient.isstressbalance = False
    2222md.transient.isgroundingline = True
  • issm/trunk-jpl/test/NightlyRun/test426.py

    r23793 r24214  
    1313md.initialization.vx[:] = 0.
    1414md.initialization.vy[:] = 0.
    15 md.geometry.base = -700. - abs(md.mesh.y - 500000.) / 1000.
    16 md.geometry.bed = -700. - abs(md.mesh.y - 500000.) / 1000.
     15md.geometry.base = - 700. - abs(md.mesh.y - 500000.) / 1000.
     16md.geometry.bed = - 700. - abs(md.mesh.y - 500000.) / 1000.
    1717md.geometry.thickness[:] = 1000.
    1818md.geometry.surface = md.geometry.base + md.geometry.thickness
  • issm/trunk-jpl/test/NightlyRun/test427.py

    r23793 r24214  
    1313md.initialization.vx[:] = 0.
    1414md.initialization.vy[:] = 0.
    15 md.geometry.base = -700. - abs(md.mesh.y - 500000.) / 1000.
    16 md.geometry.bed = -700. - abs(md.mesh.y - 500000.) / 1000.
     15md.geometry.base = - 700. - abs(md.mesh.y - 500000.) / 1000.
     16md.geometry.bed = - 700. - abs(md.mesh.y - 500000.) / 1000.
    1717md.geometry.thickness[:] = 1300
    1818md.geometry.surface = md.geometry.base + md.geometry.thickness
     
    2020md.extrude(3, 1.)
    2121
    22 md.smb.mass_balance[:] = -150
     22md.smb.mass_balance[:] = - 150
    2323md.transient.isstressbalance = False
    2424md.transient.isgroundingline = True
  • issm/trunk-jpl/test/NightlyRun/test430.py

    r23793 r24214  
    1515md.initialization.vy[:] = 1.
    1616md.geometry.thickness[:] = 500. - md.mesh.x / 10000.
    17 md.geometry.bed = -100. - md.mesh.x / 1000.
    18 md.geometry.base = -md.geometry.thickness * md.materials.rho_ice / md.materials.rho_water
     17md.geometry.bed = - 100. - md.mesh.x / 1000.
     18md.geometry.base = - md.geometry.thickness * md.materials.rho_ice / md.materials.rho_water
    1919md.mask.groundedice_levelset = md.geometry.thickness + md.materials.rho_water / md.materials.rho_ice * md.geometry.bed
    2020pos = np.where(md.mask.groundedice_levelset >= 0.)
     
    2424
    2525#Boundary conditions:
    26 md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices,))
     26md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices, ))
    2727md.mask.ice_levelset[np.where(md.mesh.x == max(md.mesh.x))] = 0.
    2828md.stressbalance.spcvx[:] = float('NaN')
     
    3030md.stressbalance.spcvz[:] = float('NaN')
    3131posA = np.intersect1d(np.array(np.where(md.mesh.y < 1000000.1)), np.array(np.where(md.mesh.y > 999999.9)))
    32 posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)), np.array(np.where(md.mesh.y > -0.1)))
     32posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)), np.array(np.where(md.mesh.y > - 0.1)))
    3333pos = np.unique(np.concatenate((posA, posB)))
    3434md.stressbalance.spcvy[pos] = 0.
    35 pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > -0.1)))
     35pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > - 0.1)))
    3636md.stressbalance.spcvx[pos2] = 0.
    3737md.stressbalance.spcvy[pos2] = 0.
    3838
    39 md.materials.rheology_B = 1. / ((10**-25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices,))
     39md.materials.rheology_B = 1. / ((10**- 25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices, ))
    4040md.materials.rheology_law = 'None'
    41 md.friction.coefficient[:] = np.sqrt(10**7) * np.ones((md.mesh.numberofvertices,))
    42 md.friction.p = 3. * np.ones((md.mesh.numberofelements,))
     41md.friction.coefficient[:] = np.sqrt(10**7) * np.ones((md.mesh.numberofvertices, ))
     42md.friction.p = 3. * np.ones((md.mesh.numberofelements, ))
    4343md.smb.mass_balance[:] = 1.
    4444md.basalforcings.groundedice_melting_rate[:] = 0.
  • issm/trunk-jpl/test/NightlyRun/test433.py

    r23793 r24214  
    1818pos = np.argmin(rad)
    1919md.mesh.x[pos] = 0.
    20 md.mesh.y[pos] = 0.    #the closest node to the center is changed to be exactly at the center
     20md.mesh.y[pos] = 0.  #the closest node to the center is changed to be exactly at the center
    2121xelem = np.mean(md.mesh.x[md.mesh.elements.astype(int) - 1], axis=1)
    2222yelem = np.mean(md.mesh.y[md.mesh.elements.astype(int) - 1], axis=1)
  • issm/trunk-jpl/test/NightlyRun/test435.py

    r23793 r24214  
    1515md.initialization.vy[:] = 1.
    1616md.geometry.thickness[:] = 500. - md.mesh.x / 10000.
    17 md.geometry.bed = -100. - md.mesh.x / 1000.
    18 md.geometry.base = -md.geometry.thickness * md.materials.rho_ice / md.materials.rho_water
     17md.geometry.bed = - 100. - md.mesh.x / 1000.
     18md.geometry.base = - md.geometry.thickness * md.materials.rho_ice / md.materials.rho_water
    1919md.mask.groundedice_levelset = md.geometry.thickness + md.materials.rho_water / md.materials.rho_ice * md.geometry.bed
    2020pos = np.where(md.mask.groundedice_levelset >= 0)
     
    2525
    2626#Boundary conditions:
    27 md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices,))
     27md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices, ))
    2828md.mask.ice_levelset[np.where(md.mesh.x == max(md.mesh.x))] = 0.
    2929md.stressbalance.spcvx[:] = float('Nan')
     
    3131md.stressbalance.spcvz[:] = float('Nan')
    3232posA = np.intersect1d(np.array(np.where(md.mesh.y < 1000000.1)), np.array(np.where(md.mesh.y > 999999.9)))
    33 posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)), np.array(np.where(md.mesh.y > -0.1)))
     33posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)), np.array(np.where(md.mesh.y > - 0.1)))
    3434pos = np.unique(np.concatenate((posA, posB)))
    3535md.stressbalance.spcvy[pos] = 0.
    36 pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > -0.1)))
     36pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > - 0.1)))
    3737md.stressbalance.spcvx[pos2] = 0.
    3838md.stressbalance.spcvy[pos2] = 0.
    3939
    40 md.materials.rheology_B = 1. / ((10**-25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices,))
     40md.materials.rheology_B = 1. / ((10**- 25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices, ))
    4141md.materials.rheology_law = 'None'
    42 md.friction.coefficient[:] = np.sqrt(1e7) * np.ones((md.mesh.numberofvertices,))
    43 md.friction.p = 3. * np.ones((md.mesh.numberofelements,))
     42md.friction.coefficient[:] = np.sqrt(1e7) * np.ones((md.mesh.numberofvertices, ))
     43md.friction.p = 3. * np.ones((md.mesh.numberofelements, ))
    4444md.smb.mass_balance[:] = 1.
    4545md.basalforcings.groundedice_melting_rate[:] = 0.
  • issm/trunk-jpl/test/NightlyRun/test436.py

    r23793 r24214  
    1717md.timestepping.time_step = 0.
    1818md.thermal.isenthalpy = 1
    19 md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices,))
    20 md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices,))
     19md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices, ))
     20md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices, ))
    2121
    2222#Go solve
     
    2626for i in ['LliboutryDuval', 'CuffeyTemperate']:
    2727    print(' ')
    28     print('====== Testing rheology law: ' + i + ' =')
     28    print(' == == == Testing rheology law: ' + i + ' = ')
    2929
    3030    md.materials.rheology_law = i
  • issm/trunk-jpl/test/NightlyRun/test437.py

    r23793 r24214  
    1414
    1515h = 100.
    16 md.geometry.thickness = h * np.ones((md.mesh.numberofvertices,))
    17 md.geometry.base = -h * np.ones((md.mesh.numberofvertices,))
     16md.geometry.thickness = h * np.ones((md.mesh.numberofvertices, ))
     17md.geometry.base = - h * np.ones((md.mesh.numberofvertices, ))
    1818md.geometry.surface = md.geometry.base + md.geometry.thickness
    1919
     
    2727Tb = 273.15 - 1.
    2828Tsw = Tb
    29 qgeo = md.materials.thermalconductivity / max(md.geometry.thickness) * (Tb - Ts)  #qgeo = kappa*(Tb-Ts)/H
     29qgeo = md.materials.thermalconductivity / max(md.geometry.thickness) * (Tb - Ts)  #qgeo = kappa * (Tb - Ts) / H
    3030md.basalforcings.geothermalflux[np.where(md.mesh.vertexonbase)] = qgeo
    3131md.initialization.temperature = qgeo / md.materials.thermalconductivity * (md.geometry.surface - md.mesh.z) + Ts
     
    3333#Surface forcing
    3434pos = np.where(md.mesh.vertexonsurface)
    35 SPC_cold = float('NaN') * np.ones((md.mesh.numberofvertices,))
    36 SPC_warm = float('NaN') * np.ones((md.mesh.numberofvertices,))
     35SPC_cold = float('NaN') * np.ones((md.mesh.numberofvertices, ))
     36SPC_warm = float('NaN') * np.ones((md.mesh.numberofvertices, ))
    3737SPC_cold[pos] = Ts
    3838SPC_warm[pos] = Tsw
  • issm/trunk-jpl/test/NightlyRun/test440.py

    r24174 r24214  
    5151
    5252#imperative!
    53 md.stressbalance.reltol = 10**-5  #tighten for qmu analysese
     53md.stressbalance.reltol = 10**- 5  #tighten for qmu analysese
    5454
    5555#solve
    56 md.verbose = verbose('000000000')       # this line is recommended
     56md.verbose = verbose('000000000')  # this line is recommended
    5757md = solve(md, 'Stressbalance', 'overwrite', 'y')
    5858md.qmu.results = md.results.dakota
  • issm/trunk-jpl/test/NightlyRun/test441.py

    r23793 r24214  
    1515md.initialization.vy[:] = 1.
    1616md.geometry.thickness[:] = 500. - md.mesh.x / 10000.
    17 md.geometry.bed = -100. - md.mesh.x / 1000.
    18 md.geometry.base = -md.geometry.thickness * md.materials.rho_ice / md.materials.rho_water
     17md.geometry.bed = - 100. - md.mesh.x / 1000.
     18md.geometry.base = - md.geometry.thickness * md.materials.rho_ice / md.materials.rho_water
    1919md.mask.groundedice_levelset = md.geometry.thickness + md.materials.rho_water / md.materials.rho_ice * md.geometry.bed
    2020pos = np.array(np.where(md.mask.groundedice_levelset >= 0.))
     
    2424
    2525#Boundary conditions:
    26 md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices,))
     26md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices, ))
    2727md.mask.ice_levelset[np.where(md.mesh.x == max(md.mesh.x))] = 0.
    2828md.stressbalance.spcvx[:] = float('Nan')
     
    3030md.stressbalance.spcvz[:] = float('Nan')
    3131posA = np.intersect1d(np.array(np.where(md.mesh.y < 1000000.1)), np.array(np.where(md.mesh.y > 999999.9)))
    32 posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)), np.array(np.where(md.mesh.y > -0.1)))
     32posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)), np.array(np.where(md.mesh.y > - 0.1)))
    3333pos = np.unique(np.concatenate((posA, posB)))
    3434md.stressbalance.spcvy[pos] = 0.
    35 pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > -0.1)))
     35pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > - 0.1)))
    3636md.stressbalance.spcvx[pos2] = 0.
    3737md.stressbalance.spcvy[pos2] = 0.
    3838
    39 md.materials.rheology_B = 1. / ((10**-25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices,))
     39md.materials.rheology_B = 1. / ((10**- 25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices, ))
    4040md.materials.rheology_law = 'None'
    41 md.friction.coefficient[:] = np.sqrt(1e7) * np.ones((md.mesh.numberofvertices,))
    42 md.friction.p = 3. * np.ones((md.mesh.numberofelements,))
     41md.friction.coefficient[:] = np.sqrt(1e7) * np.ones((md.mesh.numberofvertices, ))
     42md.friction.p = 3. * np.ones((md.mesh.numberofelements, ))
    4343md.smb.mass_balance[:] = 1.
    4444md.basalforcings.groundedice_melting_rate[:] = 0.
  • issm/trunk-jpl/test/NightlyRun/test442.py

    r23793 r24214  
    1515md.initialization.vy[:] = 1.
    1616md.geometry.thickness[:] = 500. - md.mesh.x / 10000.
    17 md.geometry.bed = -100. - md.mesh.x / 1000.
    18 md.geometry.base = -md.geometry.thickness * md.materials.rho_ice / md.materials.rho_water
     17md.geometry.bed = - 100. - md.mesh.x / 1000.
     18md.geometry.base = - md.geometry.thickness * md.materials.rho_ice / md.materials.rho_water
    1919md.mask.groundedice_levelset = md.geometry.thickness + md.materials.rho_water / md.materials.rho_ice * md.geometry.bed
    2020pos = np.where(md.mask.groundedice_levelset >= 0.)
     
    2525
    2626#Boundary conditions:
    27 md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices,))
     27md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices, ))
    2828md.mask.ice_levelset[np.where(md.mesh.x == max(md.mesh.x))] = 0.
    2929md.stressbalance.spcvx[:] = float('Nan')
     
    3131md.stressbalance.spcvz[:] = float('Nan')
    3232posA = np.intersect1d(np.array(np.where(md.mesh.y < 1000000.1)), np.array(np.where(md.mesh.y > 999999.9)))
    33 posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)), np.array(np.where(md.mesh.y > -0.1)))
     33posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)), np.array(np.where(md.mesh.y > - 0.1)))
    3434pos = np.unique(np.concatenate((posA, posB)))
    3535md.stressbalance.spcvy[pos] = 0.
    36 pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > -0.1)))
     36pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > - 0.1)))
    3737md.stressbalance.spcvx[pos2] = 0.
    3838md.stressbalance.spcvy[pos2] = 0.
    3939
    40 md.materials.rheology_B = 1. / ((10**-25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices,))
     40md.materials.rheology_B = 1. / ((10**- 25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices, ))
    4141md.materials.rheology_law = 'None'
    42 md.friction.coefficient[:] = np.sqrt(1e7) * np.ones((md.mesh.numberofvertices,))
    43 md.friction.p = 3. * np.ones((md.mesh.numberofelements,))
     42md.friction.coefficient[:] = np.sqrt(1e7) * np.ones((md.mesh.numberofvertices, ))
     43md.friction.p = 3. * np.ones((md.mesh.numberofelements, ))
    4444md.smb.mass_balance[:] = 1.
    4545md.basalforcings.groundedice_melting_rate[:] = 0.
  • issm/trunk-jpl/test/NightlyRun/test444.py

    r24174 r24214  
    2121pos = np.where(md.mask.groundedice_levelset < 0)
    2222md.geometry.bed[pos] = md.geometry.base[pos] - 10
    23 md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices,))
    24 md.friction.p = np.ones((md.mesh.numberofelements,))
    25 md.friction.q = np.ones((md.mesh.numberofelements,))
     23md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices, ))
     24md.friction.p = np.ones((md.mesh.numberofelements, ))
     25md.friction.q = np.ones((md.mesh.numberofelements, ))
    2626md.transient.isthermal = 0
    2727md.transient.isgroundingline = 1
     
    3232md.cluster = generic('name', oshostname(), 'np', 3)
    3333
    34 regionalmask = np.zeros((md.mesh.numberofvertices,))
     34regionalmask = np.zeros((md.mesh.numberofvertices, ))
    3535c_in = ContourToMesh(md.mesh.elements, md.mesh.x, md.mesh.y, '../Exp/SquareHalfRight.exp', 'node', 1)
    3636regionalmask[np.where(c_in)] = 1
     
    104104md.qmu.isdakota = 1
    105105
    106 md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
     106md.stressbalance.reltol = 10**- 5  #tighten for qmu analyses
    107107
    108108#solve
    109 md.verbose = verbose('000000000')       # this line is recommended
     109md.verbose = verbose('000000000')  # this line is recommended
    110110md = solve(md, 'Transient', 'overwrite', 'y')
    111111
  • issm/trunk-jpl/test/NightlyRun/test445.py

    r24174 r24214  
    7575md.qmu.isdakota = 1
    7676
    77 md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
     77md.stressbalance.reltol = 10**- 5  #tighten for qmu analyses
    7878
    7979
    8080#solve
    81 md.verbose = verbose('000000000')       # this line is recommended
     81md.verbose = verbose('000000000')  # this line is recommended
    8282md = solve(md, 'Steadystate', 'overwrite', 'y')
    8383
  • issm/trunk-jpl/test/NightlyRun/test460.py

    r24025 r24214  
    1515md = md.extrude(3, 1.)
    1616md.materials = matestar()
    17 md.materials.rheology_B = 3.15e8 * np.ones((md.mesh.numberofvertices,))
    18 md.materials.rheology_Ec = np.ones((md.mesh.numberofvertices,))
    19 md.materials.rheology_Es = 3 * np.ones((md.mesh.numberofvertices,))
     17md.materials.rheology_B = 3.15e8 * np.ones((md.mesh.numberofvertices, ))
     18md.materials.rheology_Ec = np.ones((md.mesh.numberofvertices, ))
     19md.materials.rheology_Es = 3 * np.ones((md.mesh.numberofvertices, ))
    2020md.cluster = generic('name', gethostname(), 'np', 3)
    2121
     
    2424field_tolerances = []
    2525field_values = []
    26 #md.initialization.pressure = md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.y);
     26#md.initialization.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface - md.mesh.y)
    2727for i in ['SSA', 'HO', 'FS']:
    2828    md = setflowequation(md, i, 'all')
    2929    md = solve(md, 'Stressbalance')
    3030    field_names = field_names + ['Vx' + i, 'Vy' + i, 'Vz' + i, 'Vel' + i, 'Pressure' + i]
    31     field_tolerances = field_tolerances + [7e-06,2e-05,2e-06,5e-06,8e-07]
     31    field_tolerances = field_tolerances + [7e-06, 2e-05, 2e-06, 5e-06, 8e-07]
    3232    field_values = field_values + [md.results.StressbalanceSolution.Vx,
    3333                                   md.results.StressbalanceSolution.Vy,
  • issm/trunk-jpl/test/NightlyRun/test461.py

    r23793 r24214  
    1515md = md.extrude(3, 1.)
    1616md.materials = matestar()
    17 md.materials.rheology_B = 3.15e8 * np.ones((md.mesh.numberofvertices,))
    18 md.materials.rheology_Ec = np.ones((md.mesh.numberofvertices,))
    19 md.materials.rheology_Es = 3. * np.ones((md.mesh.numberofvertices,))
     17md.materials.rheology_B = 3.15e8 * np.ones((md.mesh.numberofvertices, ))
     18md.materials.rheology_Ec = np.ones((md.mesh.numberofvertices, ))
     19md.materials.rheology_Es = 3. * np.ones((md.mesh.numberofvertices, ))
    2020
    2121md = setflowequation(md, 'FS', 'all')
    22 md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices,))
    23 md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices,))
     22md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices, ))
     23md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices, ))
    2424md.transient.isstressbalance = 0
    2525md.transient.ismasstransport = 0
  • issm/trunk-jpl/test/NightlyRun/test507.py

    r23919 r24214  
    2121field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'BasalforcingsGroundediceMeltingRate1',
    2222               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'BasalforcingsGroundediceMeltingRate2']
    23 field_tolerances = [1e-08,1e-08,1e-08,1e-08,1e-08,7e-08,4e-07,2e-07,1e-08,1e-08,4e-06,4e-06,5e-06,5e-06,1e-06,1e-06,2e-06,1e-06,3e-06,1e-06]
     23field_tolerances = [1e-08, 1e-08, 1e-08, 1e-08, 1e-08, 7e-08, 4e-07, 2e-07, 1e-08, 1e-08, 4e-06, 4e-06, 5e-06, 5e-06, 1e-06, 1e-06, 2e-06, 1e-06, 3e-06, 1e-06]
    2424field_values = [md.results.TransientSolution[0].Vx,
    2525                md.results.TransientSolution[0].Vy,
  • issm/trunk-jpl/test/NightlyRun/test511.py

    r23793 r24214  
    1414
    1515#impose hydrostatic equilibrium (required by Stokes)
    16 md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
     16md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
    1717md.geometry.surface = md.geometry.base + md.geometry.thickness
    1818md.extrude(3, 1.)
  • issm/trunk-jpl/test/NightlyRun/test512.py

    r23793 r24214  
    2525md.inversion.cost_functions = [103, 501]
    2626md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
    27 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**-7
     27md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 7
    2828md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
    2929md.inversion.maxiter_per_step = 2. * np.ones((md.inversion.nsteps))
  • issm/trunk-jpl/test/NightlyRun/test513.py

    r23793 r24214  
    2323md.inversion.cost_functions = [103, 501]
    2424md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
    25 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**-7
     25md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 7
    2626md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
    2727md.inversion.maxiter_per_step = 2. * np.ones((md.inversion.nsteps))
  • issm/trunk-jpl/test/NightlyRun/test540.py

    r23829 r24214  
    1919md.mask.ice_levelset = 1e4 * (md.mask.ice_levelset + 0.5)
    2020md.calving = calvingvonmises()
    21 md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices,))
     21md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices, ))
    2222md.transient.ismovingfront = 1
    2323md.transient.isgroundingline = 1
    24 md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices,))
     24md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices, ))
    2525pos = np.where(md.mesh.vertexonboundary)
    2626md.levelset.spclevelset[pos] = md.mask.ice_levelset[pos]
  • issm/trunk-jpl/test/NightlyRun/test541.py

    r23793 r24214  
    2020md.mask.ice_levelset = 1e4 * (md.mask.ice_levelset + 0.5)
    2121md.calving = calvingvonmises()
    22 md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices,))
     22md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices, ))
    2323md.transient.ismovingfront = 1
    24 md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices,))
     24md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices, ))
    2525pos = np.where(md.mesh.vertexonboundary)
    2626md.levelset.spclevelset[pos] = md.mask.ice_levelset[pos]
  • issm/trunk-jpl/test/NightlyRun/test611.py

    r23793 r24214  
    2020md.inversion.control_parameters = ['BalancethicknessThickeningRate']
    2121md.inversion.thickness_obs = md.geometry.thickness
    22 md.inversion.min_parameters = -50. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
     22md.inversion.min_parameters = - 50. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
    2323md.inversion.max_parameters = 50. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
    2424md.inversion.cost_functions = [201]
  • issm/trunk-jpl/test/NightlyRun/test613.py

    r23793 r24214  
    3030md.balancethickness.stabilization = 1
    3131md.inversion.gradient_scaling = np.vstack((10. / md.constants.yts * np.ones((md.inversion.nsteps)), 10. / md.constants.yts * np.ones((md.inversion.nsteps)))).T
    32 md.inversion.min_parameters = np.vstack((-2000. * np.ones((md.mesh.numberofvertices)), - 2000. * np.ones((md.mesh.numberofvertices)))).T
    33 md.inversion.max_parameters = np.vstack((+2000. * np.ones((md.mesh.numberofvertices)), + 2000. * np.ones((md.mesh.numberofvertices)))).T
     32md.inversion.min_parameters = np.vstack((- 2000. * np.ones((md.mesh.numberofvertices)), - 2000. * np.ones((md.mesh.numberofvertices)))).T
     33md.inversion.max_parameters = np.vstack((+ 2000. * np.ones((md.mesh.numberofvertices)), + 2000. * np.ones((md.mesh.numberofvertices)))).T
    3434md.inversion.cost_functions = [201]
    3535md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, len(md.inversion.cost_functions)))
  • issm/trunk-jpl/test/NightlyRun/test701.py

    r23793 r24214  
    99x = np.arange(1, 3001, 100).T
    1010h = np.linspace(1000, 300, np.size(x)).T
    11 b = -917. / 1023. * h
     11b = - 917. / 1023. * h
    1212
    1313md = bamgflowband(model(), x, b + h, b, 'hmax', 80.)
    1414
    15 #Geometry           #interp1d returns a function to be called on md.mesh.x
     15print(isinstance(md, model))
     16
     17#Geometry  #interp1d returns a function to be called on md.mesh.x
    1618md.geometry.surface = np.interp(md.mesh.x, x, b + h)
    1719md.geometry.base = np.interp(md.mesh.x, x, b)
     
    1921
    2022#mask
    21 md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices,))
     23md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices, ))
    2224md.mask.ice_levelset[np.where(md.mesh.vertexflags(2))] = 0.
    23 md.mask.groundedice_levelset = np.zeros((md.mesh.numberofvertices,)) - 0.5
     25md.mask.groundedice_levelset = np.zeros((md.mesh.numberofvertices, )) - 0.5
    2426
    2527#materials
    26 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices,))
     28md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, ))
    2729md.materials.rheology_B = paterson(md.initialization.temperature)
    28 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements,))
     30md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements, ))
    2931
    3032#friction
    31 md.friction.coefficient = np.zeros((md.mesh.numberofvertices,))
     33md.friction.coefficient = np.zeros((md.mesh.numberofvertices, ))
    3234md.friction.coefficient[np.where(md.mesh.vertexflags(1))] = 20.
    33 md.friction.p = np.ones((md.mesh.numberofelements,))
    34 md.friction.q = np.ones((md.mesh.numberofelements,))
     35md.friction.p = np.ones((md.mesh.numberofelements, ))
     36md.friction.q = np.ones((md.mesh.numberofelements, ))
    3537
    3638#Boundary conditions
    3739md.stressbalance.referential = np.nan * np.ones((md.mesh.numberofvertices, 6))
    3840md.stressbalance.loadingforce = 0. * np.ones((md.mesh.numberofvertices, 3))
    39 md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices,))
    40 md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices,))
    41 md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices,))
     41md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices, ))
     42md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices, ))
     43md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices, ))
    4244md.stressbalance.spcvx[np.where(md.mesh.vertexflags(4))] = 0.
    4345md.stressbalance.spcvy[np.where(md.mesh.vertexflags(4))] = 0.
    44 md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices,))
     46md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
    4547
    4648#Misc
     49print(isinstance(md, model))
     50print(type(md))
    4751md = setflowequation(md, 'FS', 'all')
    4852md.stressbalance.abstol = np.nan
    49 #md.stressbalance.reltol = 10**-16
     53#md.stressbalance.reltol = 10**- 16
    5054md.stressbalance.FSreconditioning = 1.
    5155md.stressbalance.maxiter = 20
     
    6064field_tolerances = []
    6165field_values = []
    62 #md.initialization.pressure = md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.y)
     66#md.initialization.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface - md.mesh.y)
    6367for i in ['MINI', 'MINIcondensed', 'TaylorHood', 'LATaylorHood', 'CrouzeixRaviart', 'LACrouzeixRaviart']:
    6468    print(' ')
    65     print('======Testing ' + i + ' Full-Stokes Finite element=====')
     69    print(' == == == Testing ' + i + ' Full - Stokes Finite element == == = ')
    6670    md.flowequation.fe_FS = i
    6771    md = solve(md, 'Stressbalance')
  • issm/trunk-jpl/test/NightlyRun/test702.py

    r23793 r24214  
    1010
    1111#mesh parameters
    12 x = np.arange(-5, 5.5, .5).T
     12x = np.arange(- 5, 5.5, .5).T
    1313[b, h, sea] = NowickiProfile(x)
    1414x = x * 10**3
     
    2525
    2626#mask
    27 md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices,))
     27md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices, ))
    2828md.mask.ice_levelset[np.where(md.mesh.vertexflags(2))] = 0
    29 md.mask.groundedice_levelset = -0.5 * np.ones((md.mesh.numberofvertices))
     29md.mask.groundedice_levelset = - 0.5 * np.ones((md.mesh.numberofvertices))
    3030md.mask.groundedice_levelset[np.where(md.mesh.x < 0)] = 0.5
    3131
    3232#materials
    33 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices,))
     33md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, ))
    3434md.materials.rheology_B = paterson(md.initialization.temperature)
    35 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements,))
     35md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
    3636
    3737#damage
    38 md.damage.D = np.zeros((md.mesh.numberofvertices,))
    39 md.damage.spcdamage = float('NaN') * np.ones((md.mesh.numberofvertices,))
     38md.damage.D = np.zeros((md.mesh.numberofvertices, ))
     39md.damage.spcdamage = float('NaN') * np.ones((md.mesh.numberofvertices, ))
    4040
    4141#friciton
    42 md.friction.coefficient = np.zeros((md.mesh.numberofvertices,))
     42md.friction.coefficient = np.zeros((md.mesh.numberofvertices, ))
    4343md.friction.coefficient[np.where(md.mesh.vertexflags(1))] = 20
    44 md.friction.p = np.ones((md.mesh.numberofelements,))
    45 md.friction.q = np.ones((md.mesh.numberofelements,))
     44md.friction.p = np.ones((md.mesh.numberofelements, ))
     45md.friction.q = np.ones((md.mesh.numberofelements, ))
    4646
    4747#boundary conditions
    48 md.stressbalance.spcvx = float('NaN') * np.ones((md.mesh.numberofvertices,))
    49 md.stressbalance.spcvy = float('NaN') * np.ones((md.mesh.numberofvertices,))
    50 md.stressbalance.spcvz = float('NaN') * np.ones((md.mesh.numberofvertices,))
     48md.stressbalance.spcvx = float('NaN') * np.ones((md.mesh.numberofvertices, ))
     49md.stressbalance.spcvy = float('NaN') * np.ones((md.mesh.numberofvertices, ))
     50md.stressbalance.spcvz = float('NaN') * np.ones((md.mesh.numberofvertices, ))
    5151md.stressbalance.referential = float('NaN') * np.ones((md.mesh.numberofvertices, 6))
    5252md.stressbalance.loadingforce = np.zeros((md.mesh.numberofvertices, 3))
    5353md.stressbalance.spcvx[np.where(md.mesh.vertexflags(4))] = 800.
    5454md.stressbalance.spcvy[np.where(md.mesh.vertexflags(4))] = 0.
    55 md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices,))
     55md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
    5656
    5757#misc
     
    7373for i in ['MINI', 'MINIcondensed', 'TaylorHood', 'XTaylorHood', 'LATaylorHood']:
    7474    print(' ')
    75     print('======Testing ' + i + ' Full-Stokes Finite element=====')
     75    print(' == == == Testing ' + i + ' Full - Stokes Finite element == == = ')
    7676    md.flowequation.fe_FS = i
    7777    md = solve(md, 'Stressbalance')
  • issm/trunk-jpl/test/NightlyRun/test703.py

    r23793 r24214  
    99
    1010#mesh parameters
    11 x = np.arange(-5, 5.5, .5).T
     11x = np.arange(- 5, 5.5, .5).T
    1212[b, h, sea] = NowickiProfile(x)
    1313x = x * 10**3
     
    3838
    3939#mask
    40 md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices))
     40md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices))
    4141md.mask.ice_levelset[np.where(md.mesh.vertexflags(2))] = 0
    42 md.mask.groundedice_levelset = -0.5 * np.ones((md.mesh.numberofvertices))
     42md.mask.groundedice_levelset = - 0.5 * np.ones((md.mesh.numberofvertices))
    4343md.mask.groundedice_levelset[np.where(md.mesh.x < 0)] = 0.5
    4444
  • issm/trunk-jpl/test/NightlyRun/test806.py

    r24043 r24214  
    2424
    2525#Do not kill ice bergs as all is floating
    26 md.levelset.kill_icebergs=0
     26md.levelset.kill_icebergs = 0
    2727
    2828md.timestepping.time_step = 10
  • issm/trunk-jpl/test/NightlyRun/test807.py

    r24043 r24214  
    2424
    2525#Do not kill ice bergs as all is floating
    26 md.levelset.kill_icebergs=0
     26md.levelset.kill_icebergs = 0
    2727
    2828md.timestepping.time_step = 10
  • issm/trunk-jpl/test/NightlyRun/test808.py

    r24043 r24214  
    1717
    1818#Do not kill ice bergs as all is floating
    19 md.levelset.kill_icebergs=0
     19md.levelset.kill_icebergs = 0
    2020
    2121x = md.mesh.x
     
    2424Lx = (xmax - xmin)
    2525alpha = 2. / 3.
    26 md.mask.ice_levelset = -1 + 2 * (md.mesh.y > 9e5)
     26md.mask.ice_levelset = - 1 + 2 * (md.mesh.y > 9e5)
    2727
    2828md.timestepping.time_step = 1
     
    4040md.calving = calvingminthickness()
    4141md.calving.min_thickness = 400
    42 md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices,))
    43 md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices,))
     42md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices, ))
     43md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices, ))
    4444md.levelset.reinit_frequency = 1
    4545
  • issm/trunk-jpl/test/Par/79North.py

    r22993 r24214  
    1111
    1212#Geometry and observation
    13 x         = numpy.array(archread('../Data/79North.arch','x'))
    14 y         = numpy.array(archread('../Data/79North.arch','y'))
    15 vx        = numpy.array(archread('../Data/79North.arch','vx'));
    16 vy        = numpy.array(archread('../Data/79North.arch','vy'));
    17 index     = numpy.array(archread('../Data/79North.arch','index')).astype(int);
    18 surface   = numpy.array(archread('../Data/79North.arch','surface'));
    19 thickness = numpy.array(archread('../Data/79North.arch','thickness'));
     13x = numpy.array(archread('../Data/79North.arch', 'x'))
     14y = numpy.array(archread('../Data/79North.arch', 'y'))
     15vx = numpy.array(archread('../Data/79North.arch', 'vx'))
     16vy = numpy.array(archread('../Data/79North.arch', 'vy'))
     17index = numpy.array(archread('../Data/79North.arch', 'index')).astype(int)
     18surface = numpy.array(archread('../Data/79North.arch', 'surface'))
     19thickness = numpy.array(archread('../Data/79North.arch', 'thickness'))
    2020
    21 md.initialization.vx  = InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)[0][:,0]
    22 md.initialization.vy  = InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)[0][:,0]
    23 md.geometry.surface   = InterpFromMeshToMesh2d(index,x,y,surface,md.mesh.x,md.mesh.y)[0][:,0]
    24 md.geometry.thickness = InterpFromMeshToMesh2d(index,x,y,thickness,md.mesh.x,md.mesh.y)[0][:,0]
    25 md.geometry.base      = md.geometry.surface-md.geometry.thickness
     21md.initialization.vx = InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)[0][:, 0]
     22md.initialization.vy = InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)[0][:, 0]
     23md.geometry.surface = InterpFromMeshToMesh2d(index, x, y, surface, md.mesh.x, md.mesh.y)[0][:, 0]
     24md.geometry.thickness = InterpFromMeshToMesh2d(index, x, y, thickness, md.mesh.x, md.mesh.y)[0][:, 0]
     25md.geometry.base = md.geometry.surface - md.geometry.thickness
    2626
    2727#Materials
    28 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
    29 md.materials.rheology_B=paterson(md.initialization.temperature)
    30 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
    31 md.initialization.temperature=md.initialization.temperature
     28md.initialization.temperature = (273. - 20.) * numpy.ones((md.mesh.numberofvertices))
     29md.materials.rheology_B = paterson(md.initialization.temperature)
     30md.materials.rheology_n = 3. * numpy.ones((md.mesh.numberofelements))
     31md.initialization.temperature = md.initialization.temperature
    3232
    3333#Friction
    34 md.friction.coefficient=50.*numpy.ones((md.mesh.numberofvertices))
    35 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    36 md.friction.p=numpy.ones((md.mesh.numberofelements))
    37 md.friction.q=numpy.ones((md.mesh.numberofelements))
     34md.friction.coefficient = 50. * numpy.ones((md.mesh.numberofvertices))
     35md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
     36md.friction.p = numpy.ones((md.mesh.numberofelements))
     37md.friction.q = numpy.ones((md.mesh.numberofelements))
    3838
    3939#Ice shelf melting and surface mass balance
    40 md.basalforcings.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices))
    41 md.basalforcings.floatingice_melting_rate[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    42 md.basalforcings.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices))
    43 md.smb.mass_balance=15*numpy.ones((md.mesh.numberofvertices))
     40md.basalforcings.floatingice_melting_rate = numpy.zeros((md.mesh.numberofvertices))
     41md.basalforcings.floatingice_melting_rate[numpy.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
     42md.basalforcings.groundedice_melting_rate = numpy.zeros((md.mesh.numberofvertices))
     43md.smb.mass_balance = 15 * numpy.ones((md.mesh.numberofvertices))
    4444
    4545#Numerical parameters
    46 md.masstransport.stabilization=1
    47 md.thermal.stabilization=1
    48 md.verbose=verbose(0)
    49 md.settings.waitonlock=30
    50 md.timestepping.time_step=1.
    51 md.timestepping.final_time=3.
    52 md.stressbalance.restol=0.05
    53 md.stressbalance.reltol=0.005
    54 md.steadystate.reltol=0.005
    55 md.stressbalance.abstol=float('NaN')
    56 md.groundingline.migration='None'
     46md.masstransport.stabilization = 1
     47md.thermal.stabilization = 1
     48md.verbose = verbose(0)
     49md.settings.waitonlock = 30
     50md.timestepping.time_step = 1.
     51md.timestepping.final_time = 3.
     52md.stressbalance.restol = 0.05
     53md.stressbalance.reltol = 0.005
     54md.steadystate.reltol = 0.005
     55md.stressbalance.abstol = float('NaN')
     56md.groundingline.migration = 'None'
    5757
    5858#Boundary conditions:
    59 md=SetMarineIceSheetBC(md)
    60 pos=numpy.nonzero(md.mesh.vertexonboundary)
    61 md.balancethickness.spcthickness[pos]=md.geometry.thickness[pos]
    62 md.masstransport.spcthickness[pos]=md.geometry.thickness[pos]
     59md = SetMarineIceSheetBC(md)
     60pos = numpy.nonzero(md.mesh.vertexonboundary)
     61md.balancethickness.spcthickness[pos] = md.geometry.thickness[pos]
     62md.masstransport.spcthickness[pos] = md.geometry.thickness[pos]
    6363
    6464#Change name so that no test have the same name
    6565if len(inspect.stack()) > 2:
    66         md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
     66    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
  • issm/trunk-jpl/test/Par/GiaIvinsBenchmarksAB.py

    r23017 r24214  
    1313nv = md.mesh.numberofvertices
    1414if (np.isnan(md.geometry.thickness)):
    15         md.geometry.thickness = np.zeros((md.mesh.numberofvertices,))
     15    md.geometry.thickness = np.zeros((md.mesh.numberofvertices, ))
    1616for i in range(nv):
    17         dist = np.sqrt(md.mesh.x[i]**2 + md.mesh.y[i]**2)
    18         if (dist <= rad):
    19                 md.geometry.thickness[i] = 2000.0
    20         else:
    21                 md.geometry.thickness[i] = 1.0 # non-zero thickness
     17    dist = np.sqrt(md.mesh.x[i]**2 + md.mesh.y[i]**2)
     18    if (dist <= rad):
     19        md.geometry.thickness[i] = 2000.0
     20    else:
     21        md.geometry.thickness[i] = 1.0  # non - zero thickness
    2222
    23 md.geometry.thickness = md.geometry.thickness.reshape(-1,1)
    24 md.geometry.base = np.zeros((md.mesh.numberofvertices,))
    25 md.geometry.surface = md.geometry.thickness + md.geometry.base.reshape(-1,1) #would otherwise create a 91x91 matrix
     23md.geometry.thickness = md.geometry.thickness.reshape(- 1, 1)
     24md.geometry.base = np.zeros((md.mesh.numberofvertices, ))
     25md.geometry.surface = md.geometry.thickness + md.geometry.base.reshape(- 1, 1) #would otherwise create a 91x91 matrix
    2626
    27 #Ice density used for benchmarking, not 917 kg/m^3
    28 md.materials.rho_ice = 1000 #kg m^3
     27#Ice density used for benchmarking, not 917 kg / m^3
     28md.materials.rho_ice = 1000  #kg m^3
    2929
    3030#GIA parameters specific to Experiments A  and B
    31 md.gia.mantle_viscosity = 1e21 * np.ones((md.mesh.numberofvertices,))           #in Pa.s
    32 md.gia.lithosphere_thickness = 100 * np.ones((md.mesh.numberofvertices,))       #in km
    33 md.materials.lithosphere_shear_modulus = 6.7*1e10                               #in Pa
    34 md.materials.lithosphere_density = 3.36                                         #in g/cm^3
    35 md.materials.mantle_shear_modulus = 1.45*1e11                                   #in Pa
    36 md.materials.mantle_density = 3.38                                              #in g/cm^3
     31md.gia.mantle_viscosity = 1e21 * np.ones((md.mesh.numberofvertices, ))  #in Pa.s
     32md.gia.lithosphere_thickness = 100 * np.ones((md.mesh.numberofvertices, ))  #in km
     33md.materials.lithosphere_shear_modulus = 6.7 * 1e10  #in Pa
     34md.materials.lithosphere_density = 3.36  #in g / cm^3
     35md.materials.mantle_shear_modulus = 1.45 * 1e11  #in Pa
     36md.materials.mantle_density = 3.38  #in g / cm^3
    3737
    38 #Initial velocity 
    39 x     = archread('../Data/SquareSheetConstrained.arch','x')
    40 y     = archread('../Data/SquareSheetConstrained.arch','y')
    41 vx    = archread('../Data/SquareSheetConstrained.arch','vx')
    42 vy    = archread('../Data/SquareSheetConstrained.arch','vy')
    43 index = archread('../Data/SquareSheetConstrained.arch','index').astype(int)
     38#Initial velocity
     39x = archread('../Data/SquareSheetConstrained.arch', 'x')
     40y = archread('../Data/SquareSheetConstrained.arch', 'y')
     41vx = archread('../Data/SquareSheetConstrained.arch', 'vx')
     42vy = archread('../Data/SquareSheetConstrained.arch', 'vy')
     43index = archread('../Data/SquareSheetConstrained.arch', 'index').astype(int)
    4444
    45 md.initialization.vx = np.array(InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)).reshape(-1,1)
    46 md.initialization.vy = np.array(InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)).reshape(-1,1)
    47 vx    = None
    48 vy    = None
    49 x     = None
    50 y     = None
     45md.initialization.vx = np.array(InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)).reshape(- 1, 1)
     46md.initialization.vy = np.array(InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)).reshape(- 1, 1)
     47vx = None
     48vy = None
     49x = None
     50y = None
    5151index = None
    52 md.initialization.vz = np.zeros((md.mesh.numberofvertices,))
    53 md.initialization.pressure = np.zeros((md.mesh.numberofvertices,))
     52md.initialization.vz = np.zeros((md.mesh.numberofvertices, ))
     53md.initialization.pressure = np.zeros((md.mesh.numberofvertices, ))
    5454
    5555#Materials
    56 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices,))
     56md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, ))
    5757md.materials.rheology_B = paterson(md.initialization.temperature)
    58 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements,))
     58md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements, ))
    5959
    6060#Friction
    61 md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices,))
     61md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices, ))
    6262md.friction.coefficient[np.where(md.mask.groundedice_levelset < 0.)] = 0.
    63 md.friction.p = np.ones((md.mesh.numberofelements,))
    64 md.friction.q = np.ones((md.mesh.numberofelements,))
     63md.friction.p = np.ones((md.mesh.numberofelements, ))
     64md.friction.q = np.ones((md.mesh.numberofelements, ))
    6565
    6666#Numerical parameters
    67 md.groundingline.migration='None'
     67md.groundingline.migration = 'None'
    6868md.masstransport.stabilization = 1
    6969md.thermal.stabilization = 1.
     
    8282#Change name so that no test have the same name
    8383if len(inspect.stack()) > 2:
    84         md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
     84    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
  • issm/trunk-jpl/test/Par/GiaIvinsBenchmarksCD.py

    r23017 r24214  
    1313nv = md.mesh.numberofvertices
    1414if (np.isnan(md.geometry.thickness)):
    15         md.geometry.thickness = np.zeros((md.mesh.numberofvertices,))
     15    md.geometry.thickness = np.zeros((md.mesh.numberofvertices, ))
    1616for i in range(nv):
    17         dist = np.sqrt(md.mesh.x[i]**2 + md.mesh.y[i]**2)
    18         if (dist <= rad):
    19                 md.geometry.thickness[i] = 3000.0
    20         else:
    21                 md.geometry.thickness[i] = 1.0 # non-zero thickness
     17    dist = np.sqrt(md.mesh.x[i]**2 + md.mesh.y[i]**2)
     18    if (dist <= rad):
     19        md.geometry.thickness[i] = 3000.0
     20    else:
     21        md.geometry.thickness[i] = 1.0  # non - zero thickness
    2222
    23 md.geometry.thickness = md.geometry.thickness.reshape(-1,1)
    24 md.geometry.base = np.zeros((md.mesh.numberofvertices,))
    25 md.geometry.surface = md.geometry.thickness + md.geometry.base.reshape(-1,1) #would otherwise create a 91x91 matrix
     23md.geometry.thickness = md.geometry.thickness.reshape(- 1, 1)
     24md.geometry.base = np.zeros((md.mesh.numberofvertices, ))
     25md.geometry.surface = md.geometry.thickness + md.geometry.base.reshape(- 1, 1) #would otherwise create a 91x91 matrix
    2626
    27 #Ice density used for benchmarking, not 917 kg/m^3
    28 md.materials.rho_ice = 1000 #kg m^3
     27#Ice density used for benchmarking, not 917 kg / m^3
     28md.materials.rho_ice = 1000  #kg m^3
    2929
    3030#GIA parameters specific to Experiments A  and B
    31 md.gia.mantle_viscosity = 1e21 * np.ones((md.mesh.numberofvertices,))           #in Pa.s
    32 md.gia.lithosphere_thickness = 100 * np.ones((md.mesh.numberofvertices,))       #in km
    33 md.materials.lithosphere_shear_modulus = 6.7*1e10                               #in Pa
    34 md.materials.lithosphere_density = 3.32                                         #in g/cm^3
    35 md.materials.mantle_shear_modulus = 1.45*1e11                                   #in Pa
    36 md.materials.mantle_density = 3.34                                              #in g/cm^3
     31md.gia.mantle_viscosity = 1e21 * np.ones((md.mesh.numberofvertices, ))  #in Pa.s
     32md.gia.lithosphere_thickness = 100 * np.ones((md.mesh.numberofvertices, ))  #in km
     33md.materials.lithosphere_shear_modulus = 6.7 * 1e10  #in Pa
     34md.materials.lithosphere_density = 3.32  #in g / cm^3
     35md.materials.mantle_shear_modulus = 1.45 * 1e11  #in Pa
     36md.materials.mantle_density = 3.34  #in g / cm^3
    3737
    38 #Initial velocity 
    39 x     = archread('../Data/SquareSheetConstrained.arch','x')
    40 y     = archread('../Data/SquareSheetConstrained.arch','y')
    41 vx    = archread('../Data/SquareSheetConstrained.arch','vx')
    42 vy    = archread('../Data/SquareSheetConstrained.arch','vy')
    43 index = archread('../Data/SquareSheetConstrained.arch','index').astype(int)
     38#Initial velocity
     39x = archread('../Data/SquareSheetConstrained.arch', 'x')
     40y = archread('../Data/SquareSheetConstrained.arch', 'y')
     41vx = archread('../Data/SquareSheetConstrained.arch', 'vx')
     42vy = archread('../Data/SquareSheetConstrained.arch', 'vy')
     43index = archread('../Data/SquareSheetConstrained.arch', 'index').astype(int)
    4444
    45 md.initialization.vx = np.array(InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)).reshape(-1,1)
    46 md.initialization.vy = np.array(InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)).reshape(-1,1)
    47 vx    = None
    48 vy    = None
    49 x     = None
    50 y     = None
     45md.initialization.vx = np.array(InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)).reshape(- 1, 1)
     46md.initialization.vy = np.array(InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)).reshape(- 1, 1)
     47vx = None
     48vy = None
     49x = None
     50y = None
    5151index = None
    52 md.initialization.vz = np.zeros((md.mesh.numberofvertices,))
    53 md.initialization.pressure = np.zeros((md.mesh.numberofvertices,))
     52md.initialization.vz = np.zeros((md.mesh.numberofvertices, ))
     53md.initialization.pressure = np.zeros((md.mesh.numberofvertices, ))
    5454
    5555#Materials
    56 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices,))
     56md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, ))
    5757md.materials.rheology_B = paterson(md.initialization.temperature)
    58 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements,))
     58md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements, ))
    5959
    6060#Friction
    61 md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices,))
     61md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices, ))
    6262md.friction.coefficient[np.where(md.mask.groundedice_levelset < 0.)] = 0.
    63 md.friction.p = np.ones((md.mesh.numberofelements,))
    64 md.friction.q = np.ones((md.mesh.numberofelements,))
     63md.friction.p = np.ones((md.mesh.numberofelements, ))
     64md.friction.q = np.ones((md.mesh.numberofelements, ))
    6565
    6666#Numerical parameters
    67 md.groundingline.migration='None'
     67md.groundingline.migration = 'None'
    6868md.masstransport.stabilization = 1.
    6969md.thermal.stabilization = 1.
     
    8282#Change name so that no test have the same name
    8383if len(inspect.stack()) > 2:
    84         md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
     84    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
  • issm/trunk-jpl/test/Par/ISMIPA.py

    r23707 r24214  
    1 import numpy
     1import numpy as np
    22from SetIceSheetBC import SetIceSheetBC
    33
     
    55
    66print("      creating thickness")
    7 md.geometry.surface=-md.mesh.x*numpy.tan(0.5*numpy.pi/180.)
    8 md.geometry.base=md.geometry.surface-1000.+500.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x))*numpy.sin(md.mesh.y*2.*numpy.pi/numpy.max(md.mesh.x))
    9 md.geometry.thickness=md.geometry.surface-md.geometry.base
     7md.geometry.surface = -md.mesh.x * np.tan(0.5 * np.pi / 180.)
     8md.geometry.base = md.geometry.surface - 1000. + 500. * np.sin(md.mesh.x * 2. * np.pi / np.max(md.mesh.x)) * np.sin(md.mesh.y * 2. * np.pi / np.max(md.mesh.x))
     9md.geometry.thickness = md.geometry.surface - md.geometry.base
    1010
    1111print("      creating drag")
    12 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices))
    13 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    14 md.friction.p=numpy.ones((md.mesh.numberofelements))
    15 md.friction.q=numpy.ones((md.mesh.numberofelements))
     12md.friction.coefficient = 200. * np.ones((md.mesh.numberofvertices))
     13md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
     14md.friction.p = np.ones((md.mesh.numberofelements))
     15md.friction.q = np.ones((md.mesh.numberofelements))
    1616
    1717print("      creating flow law parameter")
    18 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices))
    19 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
     18md.materials.rheology_B = 6.8067 * 10**7 * np.ones((md.mesh.numberofvertices))
     19md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
    2020
    2121print("      boundary conditions for stressbalance model")
    2222#Create node on boundary first (because we cannot use mesh)
    23 md=SetIceSheetBC(md)
     23md = SetIceSheetBC(md)
  • issm/trunk-jpl/test/Par/ISMIPB.py

    r23707 r24214  
    1 import numpy
     1import numpy as np
    22from SetIceSheetBC import SetIceSheetBC
    33
     
    55
    66print("      creating thickness")
    7 md.geometry.surface=-md.mesh.x*numpy.tan(0.5*numpy.pi/180.)
    8 md.geometry.base=md.geometry.surface-1000.+500.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x))
    9 md.geometry.thickness=md.geometry.surface-md.geometry.base
     7md.geometry.surface = -md.mesh.x * np.tan(0.5 * np.pi / 180.)
     8md.geometry.base = md.geometry.surface - 1000. + 500. * np.sin(md.mesh.x * 2. * np.pi / np.max(md.mesh.x))
     9md.geometry.thickness = md.geometry.surface - md.geometry.base
    1010
    1111print("      creating drag")
    12 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices))
    13 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    14 md.friction.p=numpy.ones((md.mesh.numberofelements))
    15 md.friction.q=numpy.ones((md.mesh.numberofelements))
     12md.friction.coefficient = 200. * np.ones((md.mesh.numberofvertices))
     13md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
     14md.friction.p = np.ones((md.mesh.numberofelements))
     15md.friction.q = np.ones((md.mesh.numberofelements))
    1616
    1717print("      creating flow law parameter")
    18 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices))
    19 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
     18md.materials.rheology_B = 6.8067 * 10**7 * np.ones((md.mesh.numberofvertices))
     19md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
    2020
    2121print("      boundary conditions for stressbalance model")
    2222#Create node on boundary first (because we cannot use mesh)
    23 md=SetIceSheetBC(md)
     23md = SetIceSheetBC(md)
  • issm/trunk-jpl/test/Par/ISMIPC.py

    r23707 r24214  
    1 import numpy
     1import numpy as np
    22from SetIceSheetBC import SetIceSheetBC
    33
     
    55
    66print("      creating thickness")
    7 md.geometry.surface=2000.-md.mesh.x*numpy.tan(0.1*numpy.pi/180.)    #to have z>0
    8 md.geometry.base=md.geometry.surface-1000.
    9 md.geometry.thickness=md.geometry.surface-md.geometry.base
     7md.geometry.surface = 2000. - md.mesh.x * np.tan(0.1 * np.pi / 180.)  #to have z > 0
     8md.geometry.base = md.geometry.surface - 1000.
     9md.geometry.thickness = md.geometry.surface - md.geometry.base
    1010
    1111print("      creating drag")
    12 #md.friction.coefficient=sqrt(md.constants.yts.*(1000.+1000.*sin(md.mesh.x*2.*pi/max(md.mesh.x/2.)).*sin(md.mesh.y*2.*pi/max(md.mesh.x/2.)))./(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.base)));
    13 md.friction.coefficient=numpy.sqrt(md.constants.yts*(1000.+1000.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x))*numpy.sin(md.mesh.y*2.*numpy.pi/numpy.max(md.mesh.x))))
    14 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    15 md.friction.p=numpy.ones((md.mesh.numberofelements))
    16 md.friction.q=numpy.zeros((md.mesh.numberofelements))
     12#md.friction.coefficient = sqrt(md.constants.yts. * (1000. + 1000. * sin(md.mesh.x * 2. * pi / max(md.mesh.x / 2.)). * sin(md.mesh.y * 2. * pi / max(md.mesh.x / 2.))). / (md.constants.g * (md.materials.rho_ice * md.geometry.thickness + md.materials.rho_water * md.geometry.base)))
     13md.friction.coefficient = np.sqrt(md.constants.yts * (1000. + 1000. * np.sin(md.mesh.x * 2. * np.pi / np.max(md.mesh.x)) * np.sin(md.mesh.y * 2. * np.pi / np.max(md.mesh.x))))
     14md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
     15md.friction.p = np.ones((md.mesh.numberofelements))
     16md.friction.q = np.zeros((md.mesh.numberofelements))
    1717
    1818print("      creating flow law parameter")
    19 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices))
    20 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
     19md.materials.rheology_B = 6.8067 * 10**7 * np.ones((md.mesh.numberofvertices))
     20md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
    2121
    2222print("      boundary conditions for stressbalance model:")
    2323#Create node on boundary first (because we can not use mesh)
    24 md=SetIceSheetBC(md)
     24md = SetIceSheetBC(md)
  • issm/trunk-jpl/test/Par/ISMIPD.py

    r23707 r24214  
    1 import numpy
     1import numpy as np
    22from SetIceSheetBC import SetIceSheetBC
    33
     
    55
    66print("      creating thickness")
    7 md.geometry.surface=2000.-md.mesh.x*numpy.tan(0.1*numpy.pi/180.)    #to have z>0
    8 md.geometry.base=md.geometry.surface-1000.
    9 md.geometry.thickness=md.geometry.surface-md.geometry.base
     7md.geometry.surface = 2000. - md.mesh.x * np.tan(0.1 * np.pi / 180.)  #to have z > 0
     8md.geometry.base = md.geometry.surface - 1000.
     9md.geometry.thickness = md.geometry.surface - md.geometry.base
    1010
    1111print("      creating drag")
    12 md.friction.coefficient=numpy.sqrt(md.constants.yts*(1000.+1000.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x))))
    13 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    14 md.friction.p=numpy.ones((md.mesh.numberofelements))
    15 md.friction.q=numpy.zeros((md.mesh.numberofelements))
     12md.friction.coefficient = np.sqrt(md.constants.yts * (1000. + 1000. * np.sin(md.mesh.x * 2. * np.pi / np.max(md.mesh.x))))
     13md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
     14md.friction.p = np.ones((md.mesh.numberofelements))
     15md.friction.q = np.zeros((md.mesh.numberofelements))
    1616
    1717print("      creating flow law parameter")
    18 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices))
    19 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
     18md.materials.rheology_B = 6.8067 * 10**7 * np.ones((md.mesh.numberofvertices))
     19md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
    2020
    2121print("      boundary conditions for stressbalance model:")
    2222#Create node on boundary first (because we can not use mesh)
    23 md=SetIceSheetBC(md)
     23md = SetIceSheetBC(md)
  • issm/trunk-jpl/test/Par/ISMIPE.py

    r23707 r24214  
    1 import numpy
     1import numpy as np
    22from arch import *
    33from SetIceSheetBC import SetIceSheetBC
     
    66
    77print("      creating thickness")
    8 data = numpy.array(archread('../Data/ISMIPE.arch','data'));
    9 md.geometry.surface=numpy.zeros((md.mesh.numberofvertices))
    10 md.geometry.base=numpy.zeros((md.mesh.numberofvertices))
    11 for i in range(0,md.mesh.numberofvertices):
    12         y=md.mesh.y[i]
    13         point1=numpy.floor(y/100.)
    14         point2=numpy.minimum(point1+1,50)
    15         coeff=(y-(point1)*100.)/100.
    16         md.geometry.base[i]=(1.-coeff)*data[point1,1]+coeff*data[point2,1]
    17         md.geometry.surface[i]=(1.-coeff)*data[point1,2]+coeff*data[point2,2]
     8data = np.array(archread('../Data/ISMIPE.arch', 'data'))
     9md.geometry.surface = np.zeros((md.mesh.numberofvertices))
     10md.geometry.base = np.zeros((md.mesh.numberofvertices))
     11for i in range(0, md.mesh.numberofvertices):
     12    y = md.mesh.y[i]
     13    point1 = int(np.floor(y / 100.))
     14    point2 = int(np.minimum(point1 + 1, 50))
     15    coeff = int((y - (point1) * 100.) / 100.)
     16    md.geometry.base[i] = (1. - coeff) * data[point1, 1] + coeff * data[point2, 1]
     17    md.geometry.surface[i] = (1. - coeff) * data[point1, 2] + coeff * data[point2, 2]
    1818
    19 md.geometry.thickness=md.geometry.surface-md.geometry.base
    20 md.geometry.thickness[numpy.nonzero(numpy.logical_not(md.geometry.thickness))]=0.01
    21 md.geometry.base=md.geometry.surface-md.geometry.thickness
     19md.geometry.thickness = md.geometry.surface - md.geometry.base
     20md.geometry.thickness[np.nonzero(np.logical_not(md.geometry.thickness))] = 0.01
     21md.geometry.base = md.geometry.surface - md.geometry.thickness
    2222
    2323print("      creating drag")
    24 md.friction.coefficient=numpy.zeros((md.mesh.numberofvertices))
    25 md.friction.p=numpy.ones((md.mesh.numberofelements))
    26 md.friction.q=numpy.ones((md.mesh.numberofelements))
     24md.friction.coefficient = np.zeros((md.mesh.numberofvertices))
     25md.friction.p = np.ones((md.mesh.numberofelements))
     26md.friction.q = np.ones((md.mesh.numberofelements))
    2727
    2828print("      creating flow law parameter")
    29 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices))
    30 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
     29md.materials.rheology_B = 6.8067 * 10**7 * np.ones((md.mesh.numberofvertices))
     30md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
    3131
    3232print("      boundary conditions for stressbalance model:")
    3333#Create node on boundary first (because we can not use mesh)
    34 md=SetIceSheetBC(md)
     34md = SetIceSheetBC(md)
  • issm/trunk-jpl/test/Par/ISMIPF.py

    r23707 r24214  
    1 import numpy
     1import numpy as np
    22from SetIceSheetBC import SetIceSheetBC
    33
    44#Ok, start defining model parameters here
    5 md.verbose=2
     5md.verbose = 2
    66
    77print("      creating thickness")
    8 md.geometry.surface=-md.mesh.x*numpy.tan(3.*numpy.pi/180.)
    9 #md.geometry.base=md.geometry.surface-1000.
    10 md.geometry.base=md.geometry.surface-1000.+100.*numpy.exp(-((md.mesh.x-numpy.max(md.mesh.x)/2.)**2+(md.mesh.y-numpy.max(md.mesh.y)/2.)**2)/(10000.**2))
    11 md.geometry.thickness=md.geometry.surface-md.geometry.base
     8md.geometry.surface = -md.mesh.x * np.tan(3. * np.pi / 180.)
     9#md.geometry.base = md.geometry.surface-1000.
     10md.geometry.base = md.geometry.surface - 1000. + 100. * np.exp(- ((md.mesh.x - np.max(md.mesh.x) / 2.)**2 + (md.mesh.y - np.max(md.mesh.y) / 2.)**2) / (10000.**2))
     11md.geometry.thickness = md.geometry.surface - md.geometry.base
    1212
    1313print("      creating drag")
    14 md.friction.coefficient=numpy.sqrt(md.constants.yts/(2.140373*10**-7*1000.))*numpy.ones((md.mesh.numberofvertices))
    15 md.friction.p=numpy.ones((md.mesh.numberofelements))
    16 md.friction.q=numpy.zeros((md.mesh.numberofelements))
     14md.friction.coefficient = np.sqrt(md.constants.yts / (2.140373 * 10**- 7 * 1000.)) * np.ones((md.mesh.numberofvertices))
     15md.friction.p = np.ones((md.mesh.numberofelements))
     16md.friction.q = np.zeros((md.mesh.numberofelements))
    1717
    1818print("      creating flow law parameter")
    19 md.materials.rheology_B=1.4734*10**14*numpy.ones((md.mesh.numberofvertices))
    20 md.materials.rheology_n=1.*numpy.ones((md.mesh.numberofelements))
    21 md.materials.rheology_law='None'
     19md.materials.rheology_B = 1.4734 * 10**14 * np.ones((md.mesh.numberofvertices))
     20md.materials.rheology_n = 1. * np.ones((md.mesh.numberofelements))
     21md.materials.rheology_law = 'None'
    2222
    2323print("      boundary conditions for stressbalance model")
    2424#Create node on boundary first (because we cannot use mesh)
    25 md=SetIceSheetBC(md)
    26 md.stressbalance.spcvx=100.*numpy.ones((md.mesh.numberofvertices))
    27 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
    28 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
    29 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
    30 md.initialization.vel=numpy.zeros((md.mesh.numberofvertices))
    31 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
    32 md.initialization.temperature=255.*numpy.ones((md.mesh.numberofvertices))
    33 pos=numpy.nonzero(numpy.logical_or(numpy.logical_or(md.mesh.x==numpy.min(md.mesh.x),md.mesh.x==numpy.max(md.mesh.x)),numpy.logical_or(md.mesh.y==numpy.min(md.mesh.y),md.mesh.y==numpy.max(md.mesh.y))))
    34 md.balancethickness.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices))
    35 md.balancethickness.spcthickness[pos]=md.geometry.thickness[pos]
    36 md.masstransport.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices))
    37 md.masstransport.spcthickness[pos]=md.geometry.thickness[pos]
    38 md.thermal.spctemperature=255.*numpy.ones((md.mesh.numberofvertices))
    39 md.basalforcings.geothermalflux=0.4*numpy.ones((md.mesh.numberofvertices))
     25md = SetIceSheetBC(md)
     26md.stressbalance.spcvx = 100. * np.ones((md.mesh.numberofvertices))
     27md.initialization.vx = np.zeros((md.mesh.numberofvertices))
     28md.initialization.vy = np.zeros((md.mesh.numberofvertices))
     29md.initialization.vz = np.zeros((md.mesh.numberofvertices))
     30md.initialization.vel = np.zeros((md.mesh.numberofvertices))
     31md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
     32md.initialization.temperature = 255. * np.ones((md.mesh.numberofvertices))
     33pos = np.nonzero(np.logical_or(np.logical_or(md.mesh.x == np.min(md.mesh.x), md.mesh.x == np.max(md.mesh.x)), np.logical_or(md.mesh.y == np.min(md.mesh.y), md.mesh.y == np.max(md.mesh.y))))
     34md.balancethickness.spcthickness = float('NaN') * np.ones((md.mesh.numberofvertices))
     35md.balancethickness.spcthickness[pos] = md.geometry.thickness[pos]
     36md.masstransport.spcthickness = float('NaN') * np.ones((md.mesh.numberofvertices))
     37md.masstransport.spcthickness[pos] = md.geometry.thickness[pos]
     38md.thermal.spctemperature = 255. * np.ones((md.mesh.numberofvertices))
     39md.basalforcings.geothermalflux = 0.4 * np.ones((md.mesh.numberofvertices))
    4040
    4141#Parallel options
    42 md.mesh.average_vertex_connectivity=200
     42md.mesh.average_vertex_connectivity = 200
    4343
    4444#Transient options
    45 md.timestepping.time_step=1.
    46 md.timestepping.final_time=10.
    47 md.masstransport.stabilization=1
    48 md.thermal.stabilization=1
    49 md.thermal.penalty_threshold=10**5
    50 md.transient.isthermal=0
     45md.timestepping.time_step = 1.
     46md.timestepping.final_time = 10.
     47md.masstransport.stabilization = 1
     48md.thermal.stabilization = 1
     49md.thermal.penalty_threshold = 10**5
     50md.transient.isthermal = 0
  • issm/trunk-jpl/test/Par/IceCube.py

    r22993 r24214  
    33import inspect
    44from verbose import verbose
    5 from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
    65from paterson import paterson
    76from SetIceSheetBC import SetIceSheetBC
     
    1110
    1211#Geometry
    13 md.geometry.thickness=1000.0*np.ones((md.mesh.numberofvertices))
    14 md.geometry.base=np.zeros((md.mesh.numberofvertices))
    15 md.geometry.surface=md.geometry.base+md.geometry.thickness
     12md.geometry.thickness = 1000.0 * np.ones((md.mesh.numberofvertices))
     13md.geometry.base = np.zeros((md.mesh.numberofvertices))
     14md.geometry.surface = md.geometry.base + md.geometry.thickness
    1615
    17 md.initialization.vx=np.zeros((md.mesh.numberofvertices))
    18 md.initialization.vy=np.zeros((md.mesh.numberofvertices))
    19 md.initialization.vz=np.zeros((md.mesh.numberofvertices))
    20 md.initialization.pressure=np.zeros((md.mesh.numberofvertices))
     16md.initialization.vx = np.zeros((md.mesh.numberofvertices))
     17md.initialization.vy = np.zeros((md.mesh.numberofvertices))
     18md.initialization.vz = np.zeros((md.mesh.numberofvertices))
     19md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
    2120
    2221#Materials
    23 md.initialization.temperature=(273.-20.)*np.ones((md.mesh.numberofvertices))
    24 md.materials.rheology_B=paterson(md.initialization.temperature)
    25 md.materials.rheology_n=3.*np.ones((md.mesh.numberofelements))
     22md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
     23md.materials.rheology_B = paterson(md.initialization.temperature)
     24md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
    2625
    2726#Calving
    28 md.calving.calvingrate=np.zeros((md.mesh.numberofvertices))
    29 md.levelset.spclevelset=np.nan*np.ones((md.mesh.numberofvertices))
     27md.calving.calvingrate = np.zeros((md.mesh.numberofvertices))
     28md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices))
    3029
    3130#Friction
    32 md.friction.coefficient=20.*np.ones((md.mesh.numberofvertices))
    33 md.friction.coefficient[np.where(md.mask.groundedice_levelset<0.)[0]]=0.
    34 md.friction.p=np.ones((md.mesh.numberofelements))
    35 md.friction.q=np.ones((md.mesh.numberofelements))
     31md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
     32md.friction.coefficient[np.where(md.mask.groundedice_levelset < 0.)[0]] = 0.
     33md.friction.p = np.ones((md.mesh.numberofelements))
     34md.friction.q = np.ones((md.mesh.numberofelements))
    3635
    3736#Numerical parameters
    38 md.masstransport.stabilization=1.
    39 md.thermal.stabilization=1.
    40 md.verbose=verbose(0)
    41 md.settings.waitonlock=30
    42 md.stressbalance.restol=0.05
    43 md.steadystate.reltol=0.05
    44 md.stressbalance.reltol=0.05
    45 md.stressbalance.abstol=float('NaN')
    46 md.timestepping.time_step=1.
    47 md.timestepping.final_time=3.
    48 md.groundingline.migration='None'
     37md.masstransport.stabilization = 1.
     38md.thermal.stabilization = 1.
     39md.verbose = verbose(0)
     40md.settings.waitonlock = 30
     41md.stressbalance.restol = 0.05
     42md.steadystate.reltol = 0.05
     43md.stressbalance.reltol = 0.05
     44md.stressbalance.abstol = float('NaN')
     45md.timestepping.time_step = 1.
     46md.timestepping.final_time = 3.
     47md.groundingline.migration = 'None'
    4948
    5049#Boundary conditions:
    51 md=SetIceSheetBC(md)
     50md = SetIceSheetBC(md)
    5251
    5352#Change name so that no test have the same name
    5453if len(inspect.stack()) > 2:
    55         md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
     54    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
  • issm/trunk-jpl/test/Par/Pig.py

    r23838 r24214  
    22import inspect
    33from arch import *
    4 import numpy
     4import numpy as np
    55from verbose import verbose
    66from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
     
    1111
    1212#Geometry and observation
    13 x         = numpy.array(archread('../Data/Pig.arch','x'))
    14 y         = numpy.array(archread('../Data/Pig.arch','y'))
    15 vx_obs    = numpy.array(archread('../Data/Pig.arch','vx_obs'))
    16 vy_obs    = numpy.array(archread('../Data/Pig.arch','vy_obs'))
    17 index     = numpy.array(archread('../Data/Pig.arch','index')).astype(int)
    18 surface   = numpy.array(archread('../Data/Pig.arch','surface'))
    19 thickness = numpy.array(archread('../Data/Pig.arch','thickness'))
    20 bed       = numpy.array(archread('../Data/Pig.arch','bed'))
     13x = np.array(archread('../Data/Pig.arch', 'x'))
     14y = np.array(archread('../Data/Pig.arch', 'y'))
     15vx_obs = np.array(archread('../Data/Pig.arch', 'vx_obs'))
     16vy_obs = np.array(archread('../Data/Pig.arch', 'vy_obs'))
     17index = np.array(archread('../Data/Pig.arch', 'index')).astype(int)
     18surface = np.array(archread('../Data/Pig.arch', 'surface'))
     19thickness = np.array(archread('../Data/Pig.arch', 'thickness'))
     20bed = np.array(archread('../Data/Pig.arch', 'bed'))
    2121
    22 md.inversion.vx_obs   =InterpFromMeshToMesh2d(index,x,y,vx_obs,md.mesh.x,md.mesh.y)[0][:,0]
    23 md.inversion.vy_obs   =InterpFromMeshToMesh2d(index,x,y,vy_obs,md.mesh.x,md.mesh.y)[0][:,0]
    24 md.geometry.surface  =InterpFromMeshToMesh2d(index,x,y,surface,md.mesh.x,md.mesh.y)[0][:,0]
    25 md.geometry.thickness=InterpFromMeshToMesh2d(index,x,y,thickness,md.mesh.x,md.mesh.y)[0][:,0]
    26 md.geometry.base=md.geometry.surface-md.geometry.thickness
    27 md.geometry.bed =numpy.array(md.geometry.base)
    28 pos = np.where(md.mask.groundedice_levelset<0.)
    29 md.geometry.bed[pos] =InterpFromMeshToMesh2d(index,x,y,bed,md.mesh.x[pos],md.mesh.y[pos])[0][:,0]
    30 md.initialization.vx=md.inversion.vx_obs
    31 md.initialization.vy=md.inversion.vy_obs
    32 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
    33 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
     22md.inversion.vx_obs = InterpFromMeshToMesh2d(index, x, y, vx_obs, md.mesh.x, md.mesh.y)[0][:, 0]
     23md.inversion.vy_obs = InterpFromMeshToMesh2d(index, x, y, vy_obs, md.mesh.x, md.mesh.y)[0][:, 0]
     24md.geometry.surface = InterpFromMeshToMesh2d(index, x, y, surface, md.mesh.x, md.mesh.y)[0][:, 0]
     25md.geometry.thickness = InterpFromMeshToMesh2d(index, x, y, thickness, md.mesh.x, md.mesh.y)[0][:, 0]
     26md.geometry.base = md.geometry.surface - md.geometry.thickness
     27md.geometry.bed = np.array(md.geometry.base)
     28pos = np.where(md.mask.groundedice_levelset < 0.)
     29md.geometry.bed[pos] = InterpFromMeshToMesh2d(index, x, y, bed, md.mesh.x[pos], md.mesh.y[pos])[0][:, 0]
     30md.initialization.vx = md.inversion.vx_obs
     31md.initialization.vy = md.inversion.vy_obs
     32md.initialization.vz = np.zeros((md.mesh.numberofvertices))
     33md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
    3434
    3535#Materials
    36 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
    37 md.materials.rheology_B=paterson(md.initialization.temperature)
    38 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
    39 md.initialization.temperature=md.initialization.temperature
     36md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
     37md.materials.rheology_B = paterson(md.initialization.temperature)
     38md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
     39md.initialization.temperature = md.initialization.temperature
    4040
    4141#Friction
    42 md.friction.coefficient=50.*numpy.ones((md.mesh.numberofvertices))
    43 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    44 md.friction.p=numpy.ones((md.mesh.numberofelements))
    45 md.friction.q=numpy.ones((md.mesh.numberofelements))
     42md.friction.coefficient = 50. * np.ones((md.mesh.numberofvertices))
     43md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
     44md.friction.p = np.ones((md.mesh.numberofelements))
     45md.friction.q = np.ones((md.mesh.numberofelements))
    4646
    4747#Numerical parameters
    48 md.masstransport.stabilization=1.
    49 md.verbose=verbose(0)
    50 md.settings.waitonlock=30
    51 md.timestepping.time_step=1.
    52 md.timestepping.final_time=2.
    53 md.stressbalance.restol=0.05
    54 md.stressbalance.reltol=1.
    55 md.steadystate.reltol=1.
    56 md.stressbalance.abstol=float('nan')
    57 md.groundingline.migration='None'
     48md.masstransport.stabilization = 1.
     49md.verbose = verbose(0)
     50md.settings.waitonlock = 30
     51md.timestepping.time_step = 1.
     52md.timestepping.final_time = 2.
     53md.stressbalance.restol = 0.05
     54md.stressbalance.reltol = 1.
     55md.steadystate.reltol = 1.
     56md.stressbalance.abstol = float('nan')
     57md.groundingline.migration = 'None'
    5858
    5959#Boundary conditions:
    60 md=SetMarineIceSheetBC(md)
     60md = SetMarineIceSheetBC(md)
    6161
    6262#Change name so that no test have the same name
    6363if len(inspect.stack()) > 2:
    64         md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
     64    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
  • issm/trunk-jpl/test/Par/RoundSheetEISMINT.py

    r23707 r24214  
    44#Ok, start defining model parameters here
    55print("      creating thickness")
    6 md.geometry.thickness=10.*numpy.ones((md.mesh.numberofvertices))
    7 md.geometry.base=numpy.zeros((md.mesh.numberofvertices))
    8 md.geometry.surface=md.geometry.base+md.geometry.thickness
     6md.geometry.thickness = 10. * numpy.ones((md.mesh.numberofvertices))
     7md.geometry.base = numpy.zeros((md.mesh.numberofvertices))
     8md.geometry.surface = md.geometry.base + md.geometry.thickness
    99
    1010print("      creating drag")
    11 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices))
    12 md.friction.p=numpy.ones((md.mesh.numberofelements))
    13 md.friction.q=numpy.ones((md.mesh.numberofelements))
     11md.friction.coefficient = 20. * numpy.ones((md.mesh.numberofvertices))
     12md.friction.p = numpy.ones((md.mesh.numberofelements))
     13md.friction.q = numpy.ones((md.mesh.numberofelements))
    1414
    1515print("      creating temperatures")
    16 tmin=238.15    #K
    17 st=1.67*10**-2/1000.    #k/m
    18 radius=numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2)
    19 md.initialization.temperature=tmin+st*radius
    20 md.basalforcings.geothermalflux=4.2*10**-2*numpy.ones((md.mesh.numberofvertices))
     16tmin = 238.15  #K
     17st = 1.67 * 10**- 2 / 1000.  #k / m
     18radius = numpy.sqrt((md.mesh.x)**2 + (md.mesh.y)**2)
     19md.initialization.temperature = tmin + st * radius
     20md.basalforcings.geothermalflux = 4.2 * 10**- 2 * numpy.ones((md.mesh.numberofvertices))
    2121
    2222print("      creating flow law parameter")
    23 md.materials.rheology_B=6.81*10**7*numpy.ones((md.mesh.numberofvertices))    #to have the same B as the analytical solution
    24 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
     23md.materials.rheology_B = 6.81 * 10**7 * numpy.ones((md.mesh.numberofvertices))  #to have the same B as the analytical solution
     24md.materials.rheology_n = 3. * numpy.ones((md.mesh.numberofelements))
    2525
    2626print("      creating surface mass balance")
    27 smb_max=0.5    #m/yr
    28 sb=10**-2/1000.    #m/yr/m
    29 rel=450.*1000.    #m
    30 md.smb.mass_balance=numpy.minimum(smb_max*numpy.ones_like(radius),sb*(rel-radius))
     27smb_max = 0.5  #m / yr
     28sb = 10**- 2 / 1000.  #m / yr / m
     29rel = 450. * 1000.  #m
     30md.smb.mass_balance = numpy.minimum(smb_max * numpy.ones_like(radius), sb * (rel - radius))
    3131
    3232print("      creating velocities")
    33 constant=0.3
    34 md.inversion.vx_obs=constant/2.*md.mesh.x*(md.geometry.thickness)**-1
    35 md.inversion.vy_obs=constant/2.*md.mesh.y*(md.geometry.thickness)**-1
    36 md.inversion.vel_obs=numpy.sqrt((md.inversion.vx_obs)**2+(md.inversion.vy_obs)**2)
    37 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
    38 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
    39 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
    40 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
     33constant = 0.3
     34md.inversion.vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**- 1
     35md.inversion.vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**- 1
     36md.inversion.vel_obs = numpy.sqrt((md.inversion.vx_obs)**2 + (md.inversion.vy_obs)**2)
     37md.initialization.vx = numpy.zeros((md.mesh.numberofvertices))
     38md.initialization.vy = numpy.zeros((md.mesh.numberofvertices))
     39md.initialization.vz = numpy.zeros((md.mesh.numberofvertices))
     40md.initialization.pressure = numpy.zeros((md.mesh.numberofvertices))
    4141
    4242#Deal with boundary conditions:
    4343print("      boundary conditions for stressbalance model:")
    44 md=SetMarineIceSheetBC(md,'../Exp/RoundFrontEISMINT.exp')
     44md = SetMarineIceSheetBC(md, '../Exp/RoundFrontEISMINT.exp')
    4545
    46 radius=numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2)
    47 pos=numpy.nonzero(radius==numpy.min(radius))[0]
    48 md.mesh.x[pos]=0.
    49 md.mesh.y[pos]=0.    #the closest node to the center is changed to be exactly at the center
     46radius = numpy.sqrt((md.mesh.x)**2 + (md.mesh.y)**2)
     47pos = numpy.nonzero(radius == numpy.min(radius))[0]
     48md.mesh.x[pos] = 0.
     49md.mesh.y[pos] = 0.  #the closest node to the center is changed to be exactly at the center
    5050
    51 md.stressbalance.spcvx[pos]=0.
    52 md.stressbalance.spcvy[pos]=0.
    53 md.stressbalance.spcvz[pos]=0.
     51md.stressbalance.spcvx[pos] = 0.
     52md.stressbalance.spcvy[pos] = 0.
     53md.stressbalance.spcvz[pos] = 0.
    5454
    5555#parallel options
    56 md.timestepping.final_time=50000.
     56md.timestepping.final_time = 50000.
    5757
    5858#Constants
    59 md.materials.rho_ice=910.
    60 md.materials.thermalconductivity=2.1
    61 md.materials.latentheat=3.35*10**5
    62 md.materials.beta=8.66*10**-4/(md.materials.rho_ice*md.constants.g)    #conversion from K/m to K/Pa
    63 md.constants.yts=31556926.
     59md.materials.rho_ice = 910.
     60md.materials.thermalconductivity = 2.1
     61md.materials.latentheat = 3.35 * 10**5
     62md.materials.beta = 8.66 * 10**- 4 / (md.materials.rho_ice * md.constants.g)  #conversion from K / m to K / Pa
     63md.constants.yts = 31556926.
  • issm/trunk-jpl/test/Par/RoundSheetShelf.py

    r22575 r24214  
    11import os.path
    2 import numpy
     2import numpy as np
    33import copy
    44import inspect
     
    88#Start defining model parameters here
    99
    10 di=md.materials.rho_ice/md.materials.rho_water
    11 rad=1.e6
    12 shelfextent=2.e5
     10di = md.materials.rho_ice / md.materials.rho_water
     11rad = 1.e6
     12shelfextent = 2.e5
    1313#Geometry
    14 hmin=300.
    15 hmax=1000.
    16 radius=numpy.sqrt(md.mesh.x*md.mesh.x+md.mesh.y*md.mesh.y.reshape(-1))
    17 ymin=numpy.min(radius)
    18 ymax=numpy.max(radius)
    19 md.geometry.thickness=hmax+(hmin-hmax)*(radius-ymin)/(ymax-ymin)
    20 md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
     14hmin = 300.
     15hmax = 1000.
     16radius = np.sqrt(md.mesh.x * md.mesh.x + md.mesh.y * md.mesh.y.reshape(- 1))
     17ymin = np.min(radius)
     18ymax = np.max(radius)
     19md.geometry.thickness = hmax + (hmin - hmax) * (radius - ymin) / (ymax - ymin)
     20md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
    2121
    22 pos=numpy.nonzero(md.mask.groundedice_levelset>0.)[0]
    23 md.geometry.base[pos]=md.geometry.base[pos]-300.*(radius[pos]-(rad-shelfextent))/(rad-shelfextent)
    24 md.geometry.surface=md.geometry.base+md.geometry.thickness
     22pos = np.nonzero(md.mask.groundedice_levelset > 0.)[0]
     23md.geometry.base[pos] = md.geometry.base[pos] - 300. * (radius[pos] - (rad - shelfextent)) / (rad - shelfextent)
     24md.geometry.surface = md.geometry.base + md.geometry.thickness
    2525
    26 pos=numpy.nonzero(radius<200000.)
    27 md.geometry.thickness[pos]=100.
    28 md.geometry.base[pos]=-di*md.geometry.thickness[pos]-20.
    29 md.geometry.surface[pos]=md.geometry.base[pos]+md.geometry.thickness[pos]
     26pos = np.nonzero(radius < 200000.)
     27md.geometry.thickness[pos] = 100.
     28md.geometry.base[pos] = -di * md.geometry.thickness[pos] - 20.
     29md.geometry.surface[pos] = md.geometry.base[pos] + md.geometry.thickness[pos]
    3030
    31 pos=numpy.nonzero(numpy.logical_and(numpy.logical_and(md.mesh.x<0.2*1.e6,md.mesh.x>-0.2*1.e6),md.mesh.y>0.))
    32 md.geometry.thickness[pos]=100.
    33 md.geometry.base[pos]=-di*md.geometry.thickness[pos]-20.
    34 md.geometry.surface[pos]=md.geometry.base[pos]+md.geometry.thickness[pos]
     31pos = np.nonzero(np.logical_and(np.logical_and(md.mesh.x < 0.2 * 1.e6, md.mesh.x > - 0.2 * 1.e6), md.mesh.y > 0.))
     32md.geometry.thickness[pos] = 100.
     33md.geometry.base[pos] = -di * md.geometry.thickness[pos] - 20.
     34md.geometry.surface[pos] = md.geometry.base[pos] + md.geometry.thickness[pos]
    3535
    36 pos=numpy.nonzero(numpy.logical_and(numpy.logical_and(md.mesh.x<0.1*1.e6,md.mesh.x>-0.1*1.e6),numpy.logical_and(md.mesh.y<-0.5*1.e6,md.mesh.y>-0.6*1.e6)))
    37 md.geometry.thickness[pos]=100.
    38 md.geometry.base[pos]=-di*md.geometry.thickness[pos]-20.
    39 md.geometry.surface[pos]=md.geometry.base[pos]+md.geometry.thickness[pos]
     36pos = np.nonzero(np.logical_and(np.logical_and(md.mesh.x < 0.1 * 1.e6, md.mesh.x > - 0.1 * 1.e6), np.logical_and(md.mesh.y < - 0.5 * 1.e6, md.mesh.y > - 0.6 * 1.e6)))
     37md.geometry.thickness[pos] = 100.
     38md.geometry.base[pos] = -di * md.geometry.thickness[pos] - 20.
     39md.geometry.surface[pos] = md.geometry.base[pos] + md.geometry.thickness[pos]
    4040
    41 #plug holes into the ice sheet, to test for grounding line migration. 
    42 di=md.materials.rho_ice/md.materials.rho_water
    43 rad=numpy.sqrt(md.mesh.x**2+md.mesh.y**2)
    44 pos=numpy.nonzero(rad<200000.)
    45 md.geometry.thickness[pos]=100.
    46 md.geometry.base[pos]=-di*md.geometry.thickness[pos]-20.
    47 md.geometry.surface[pos]=md.geometry.base[pos]+md.geometry.thickness[pos]
     41#plug holes into the ice sheet, to test for grounding line migration.
     42di = md.materials.rho_ice / md.materials.rho_water
     43rad = np.sqrt(md.mesh.x**2 + md.mesh.y**2)
     44pos = np.nonzero(rad < 200000.)
     45md.geometry.thickness[pos] = 100.
     46md.geometry.base[pos] = -di * md.geometry.thickness[pos] - 20.
     47md.geometry.surface[pos] = md.geometry.base[pos] + md.geometry.thickness[pos]
    4848
    49 pos=numpy.nonzero(numpy.logical_and(numpy.logical_and(md.mesh.x<0.2*1.e6,md.mesh.x>-0.2*1.e6),md.mesh.y>0.))
    50 md.geometry.thickness[pos]=100.
    51 md.geometry.base[pos]=-di*md.geometry.thickness[pos]-20.
    52 md.geometry.surface[pos]=md.geometry.base[pos]+md.geometry.thickness[pos]
     49pos = np.nonzero(np.logical_and(np.logical_and(md.mesh.x < 0.2 * 1.e6, md.mesh.x > - 0.2 * 1.e6), md.mesh.y > 0.))
     50md.geometry.thickness[pos] = 100.
     51md.geometry.base[pos] = -di * md.geometry.thickness[pos] - 20.
     52md.geometry.surface[pos] = md.geometry.base[pos] + md.geometry.thickness[pos]
    5353
    54 pos=numpy.nonzero(numpy.logical_and(numpy.logical_and(md.mesh.x<0.1*1.e6,md.mesh.x>-0.1*1.e6),numpy.logical_and(md.mesh.y<-0.5*1.e6,md.mesh.y>-0.6*1.e6)))
    55 md.geometry.thickness[pos]=100.
    56 md.geometry.base[pos]=-di*md.geometry.thickness[pos]-20.
    57 md.geometry.surface[pos]=md.geometry.base[pos]+md.geometry.thickness[pos]
     54pos = np.nonzero(np.logical_and(np.logical_and(md.mesh.x < 0.1 * 1.e6, md.mesh.x > - 0.1 * 1.e6), np.logical_and(md.mesh.y < - 0.5 * 1.e6, md.mesh.y > - 0.6 * 1.e6)))
     55md.geometry.thickness[pos] = 100.
     56md.geometry.base[pos] = -di * md.geometry.thickness[pos] - 20.
     57md.geometry.surface[pos] = md.geometry.base[pos] + md.geometry.thickness[pos]
    5858
    59 #Initial velocity 
    60 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
    61 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
    62 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
    63 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
     59#Initial velocity
     60md.initialization.vx = np.zeros((md.mesh.numberofvertices))
     61md.initialization.vy = np.zeros((md.mesh.numberofvertices))
     62md.initialization.vz = np.zeros((md.mesh.numberofvertices))
     63md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
    6464
    6565#Materials
    66 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
    67 md.materials.rheology_B=paterson(md.initialization.temperature)
    68 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
     66md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
     67md.materials.rheology_B = paterson(md.initialization.temperature)
     68md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
    6969
    7070#Surface mass balance and basal melting
    71 md.smb.mass_balance=-10.*numpy.ones((md.mesh.numberofvertices))
    72 md.basalforcings.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices))
    73 pos=numpy.nonzero(md.mask.groundedice_levelset>0.)[0]
    74 md.basalforcings.groundedice_melting_rate[pos]=10.
    75 md.basalforcings.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices))
    76 md.basalforcings.geothermalflux=numpy.ones((md.mesh.numberofvertices))
     71md.smb.mass_balance = -10. * np.ones((md.mesh.numberofvertices))
     72md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices))
     73pos = np.nonzero(md.mask.groundedice_levelset > 0.)[0]
     74md.basalforcings.groundedice_melting_rate[pos] = 10.
     75md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices))
     76md.basalforcings.geothermalflux = np.ones((md.mesh.numberofvertices))
    7777
    7878#Friction
    79 radius=1.e6
    80 shelfextent=2.e5
    81 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices))
    82 xelem=numpy.mean(md.mesh.x[md.mesh.elements.astype(int)-1],axis=1)
    83 yelem=numpy.mean(md.mesh.y[md.mesh.elements.astype(int)-1],axis=1)
    84 rad=numpy.sqrt(xelem**2+yelem**2)
    85 flags=numpy.zeros(md.mesh.numberofelements)
    86 pos=numpy.nonzero(rad>=(radius-shelfextent))
    87 md.friction.coefficient[md.mesh.elements[pos,:]-1]=0.
    88 md.friction.p=numpy.ones((md.mesh.numberofelements))
    89 md.friction.q=numpy.ones((md.mesh.numberofelements))
     79radius = 1.e6
     80shelfextent = 2.e5
     81md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
     82xelem = np.mean(md.mesh.x[md.mesh.elements.astype(int) - 1], axis=1)
     83yelem = np.mean(md.mesh.y[md.mesh.elements.astype(int) - 1], axis=1)
     84rad = np.sqrt(xelem**2 + yelem**2)
     85flags = np.zeros(md.mesh.numberofelements)
     86pos = np.nonzero(rad >= (radius - shelfextent))
     87md.friction.coefficient[md.mesh.elements[pos, :] - 1] = 0.
     88md.friction.p = np.ones((md.mesh.numberofelements))
     89md.friction.q = np.ones((md.mesh.numberofelements))
    9090
    9191#Numerical parameters
    92 md.masstransport.stabilization=1
    93 md.thermal.stabilization=1
    94 md.verbose=verbose(0)
    95 md.settings.waitonlock=30
    96 md.stressbalance.restol=0.05
    97 md.stressbalance.reltol=0.05
    98 md.steadystate.reltol=0.05
    99 md.stressbalance.abstol=float('nan')
    100 md.timestepping.time_step=5.
    101 md.timestepping.final_time=5.
     92md.masstransport.stabilization = 1
     93md.thermal.stabilization = 1
     94md.verbose = verbose(0)
     95md.settings.waitonlock = 30
     96md.stressbalance.restol = 0.05
     97md.stressbalance.reltol = 0.05
     98md.steadystate.reltol = 0.05
     99md.stressbalance.abstol = float('nan')
     100md.timestepping.time_step = 5.
     101md.timestepping.final_time = 5.
    102102
    103103#bathymetry and grounding line migration:
    104 md.groundingline.migration='AggressiveMigration'
    105 md.geometry.bed=copy.deepcopy(md.geometry.base)
    106 pos=numpy.nonzero(md.mask.groundedice_levelset<0.)[0]
    107 md.geometry.bed[pos]=md.geometry.base[pos]-900.
     104md.groundingline.migration = 'AggressiveMigration'
     105md.geometry.bed = copy.deepcopy(md.geometry.base)
     106pos = np.nonzero(md.mask.groundedice_levelset < 0.)[0]
     107md.geometry.bed[pos] = md.geometry.base[pos] - 900.
    108108
    109109#Deal with boundary conditions:
    110 md.stressbalance.spcvx=float('nan')*numpy.ones((md.mesh.numberofvertices))
    111 md.stressbalance.spcvy=float('nan')*numpy.ones((md.mesh.numberofvertices))
    112 md.stressbalance.spcvz=float('nan')*numpy.ones((md.mesh.numberofvertices))
     110md.stressbalance.spcvx = float('nan') * np.ones((md.mesh.numberofvertices))
     111md.stressbalance.spcvy = float('nan') * np.ones((md.mesh.numberofvertices))
     112md.stressbalance.spcvz = float('nan') * np.ones((md.mesh.numberofvertices))
    113113
    114 pos=numpy.nonzero(numpy.logical_and(md.mesh.x==0,md.mesh.y==0))
    115 md.stressbalance.spcvx[pos]=0
    116 md.stressbalance.spcvy[pos]=0
     114pos = np.nonzero(np.logical_and(md.mesh.x == 0, md.mesh.y == 0))
     115md.stressbalance.spcvx[pos] = 0
     116md.stressbalance.spcvy[pos] = 0
    117117
    118 pos=numpy.nonzero(md.mesh.vertexonboundary)
    119 md.mask.ice_levelset[pos]=0
    120 md.balancethickness.spcthickness=float('nan')*numpy.ones((md.mesh.numberofvertices))
    121 md.masstransport.spcthickness=float('nan')*numpy.ones((md.mesh.numberofvertices))
    122 md.stressbalance.referential=float('nan')*numpy.ones((md.mesh.numberofvertices,6))
    123 md.stressbalance.loadingforce=0*numpy.ones((md.mesh.numberofvertices,3))
    124 md.thermal.spctemperature=737.*numpy.ones((md.mesh.numberofvertices))
     118pos = np.nonzero(md.mesh.vertexonboundary)
     119md.mask.ice_levelset[pos] = 0
     120md.balancethickness.spcthickness = float('nan') * np.ones((md.mesh.numberofvertices))
     121md.masstransport.spcthickness = float('nan') * np.ones((md.mesh.numberofvertices))
     122md.stressbalance.referential = float('nan') * np.ones((md.mesh.numberofvertices, 6))
     123md.stressbalance.loadingforce = 0 * np.ones((md.mesh.numberofvertices, 3))
     124md.thermal.spctemperature = 737. * np.ones((md.mesh.numberofvertices))
    125125
    126126#Change name so that no test have the same name
    127127if len(inspect.stack()) > 2:
    128         md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
     128    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
  • issm/trunk-jpl/test/Par/RoundSheetStaticEISMINT.py

    r23707 r24214  
    33
    44print("      creating thickness")
    5 hmin=0.01
    6 hmax=2756.7
    7 radius=numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2)
    8 radiusmax=numpy.max(radius)
    9 radius[numpy.nonzero(radius>(1.-10**-9)*radiusmax)]=radiusmax    #eliminate roundoff issues in next statement
    10 md.geometry.thickness=hmin*numpy.ones((numpy.size(md.mesh.x)))+hmax*(4.*((1./2.)**(4./3.)*numpy.ones((numpy.size(md.mesh.x)))-((radius)/(2.*radiusmax))**(4./3.)))**(3./8.)
    11 md.geometry.base=0.*md.geometry.thickness
    12 md.geometry.surface=md.geometry.base+md.geometry.thickness
     5hmin = 0.01
     6hmax = 2756.7
     7radius = numpy.sqrt((md.mesh.x)**2 + (md.mesh.y)**2)
     8radiusmax = numpy.max(radius)
     9radius[numpy.nonzero(radius > (1. - 10**- 9) * radiusmax)] = radiusmax  #eliminate roundoff issues in next statement
     10md.geometry.thickness = hmin * numpy.ones((numpy.size(md.mesh.x))) + hmax * (4. * ((1. / 2.)**(4. / 3.) * numpy.ones((numpy.size(md.mesh.x))) - ((radius) / (2. * radiusmax))**(4. / 3.)))**(3. / 8.)
     11md.geometry.base = 0. * md.geometry.thickness
     12md.geometry.surface = md.geometry.base + md.geometry.thickness
    1313
    1414print("      creating drag")
    15 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices))
    16 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    17 md.friction.p=numpy.ones((md.mesh.numberofelements))
    18 md.friction.q=numpy.ones((md.mesh.numberofelements))
     15md.friction.coefficient = 20. * numpy.ones((md.mesh.numberofvertices))
     16md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
     17md.friction.p = numpy.ones((md.mesh.numberofelements))
     18md.friction.q = numpy.ones((md.mesh.numberofelements))
    1919
    2020print("      creating temperatures")
    21 tmin=238.15    #K
    22 st=1.67*10**-2/1000.    #k/m
    23 md.initialization.temperature=tmin+st*radius
    24 md.basalforcings.geothermalflux=4.2*10**-2*numpy.ones((md.mesh.numberofvertices))
     21tmin = 238.15  #K
     22st = 1.67 * 10**- 2 / 1000.  #k / m
     23md.initialization.temperature = tmin + st * radius
     24md.basalforcings.geothermalflux = 4.2 * 10**- 2 * numpy.ones((md.mesh.numberofvertices))
    2525
    2626print("      creating flow law parameter")
    27 md.materials.rheology_B=6.81*10**7*numpy.ones((md.mesh.numberofvertices))    #to have the same B as the analytical solution
    28 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
     27md.materials.rheology_B = 6.81 * 10**7 * numpy.ones((md.mesh.numberofvertices))  #to have the same B as the analytical solution
     28md.materials.rheology_n = 3. * numpy.ones((md.mesh.numberofelements))
    2929
    3030print("      creating surface mass balance")
    31 smb_max=0.5    #m/yr
    32 sb=10**-2/1000.    #m/yr/m
    33 rel=450.*1000.    #m
    34 md.smb.mass_balance=numpy.minimum(smb_max*numpy.ones_like(radius),sb*(rel-radius))
     31smb_max = 0.5  #m / yr
     32sb = 10**- 2 / 1000.  #m / yr / m
     33rel = 450. * 1000.  #m
     34md.smb.mass_balance = numpy.minimum(smb_max * numpy.ones_like(radius), sb * (rel - radius))
    3535
    3636print("      creating velocities")
    37 constant=0.3
    38 md.inversion.vx_obs=constant/2.*md.mesh.x*(md.geometry.thickness)**-1
    39 md.inversion.vy_obs=constant/2.*md.mesh.y*(md.geometry.thickness)**-1
    40 md.inversion.vel_obs=numpy.sqrt((md.inversion.vx_obs)**2+(md.inversion.vy_obs)**2)
    41 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
    42 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
    43 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
    44 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
     37constant = 0.3
     38md.inversion.vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**- 1
     39md.inversion.vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**- 1
     40md.inversion.vel_obs = numpy.sqrt((md.inversion.vx_obs)**2 + (md.inversion.vy_obs)**2)
     41md.initialization.vx = numpy.zeros((md.mesh.numberofvertices))
     42md.initialization.vy = numpy.zeros((md.mesh.numberofvertices))
     43md.initialization.vz = numpy.zeros((md.mesh.numberofvertices))
     44md.initialization.pressure = numpy.zeros((md.mesh.numberofvertices))
    4545
    4646#Deal with boundary conditions:
    4747print("      boundary conditions for stressbalance model:")
    48 md=SetMarineIceSheetBC(md,'../Exp/RoundFrontEISMINT.exp')
     48md = SetMarineIceSheetBC(md, '../Exp/RoundFrontEISMINT.exp')
    4949
    50 radius=numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2)
    51 pos=numpy.nonzero(radius==numpy.min(radius))[0]
    52 md.mesh.x[pos]=0.
    53 md.mesh.y[pos]=0.    #the closest node to the center is changed to be exactly at the center
     50radius = numpy.sqrt((md.mesh.x)**2 + (md.mesh.y)**2)
     51pos = numpy.nonzero(radius == numpy.min(radius))[0]
     52md.mesh.x[pos] = 0.
     53md.mesh.y[pos] = 0.  #the closest node to the center is changed to be exactly at the center
    5454
    55 md.stressbalance.spcvx[pos]=0.
    56 md.stressbalance.spcvy[pos]=0.
    57 md.stressbalance.spcvz[pos]=0.
     55md.stressbalance.spcvx[pos] = 0.
     56md.stressbalance.spcvy[pos] = 0.
     57md.stressbalance.spcvz[pos] = 0.
  • issm/trunk-jpl/test/Par/SquareEISMINT.py

    r23707 r24214  
    1 import numpy
     1import numpy as np
    22from SetMarineIceSheetBC import SetMarineIceSheetBC
    33
     
    55
    66print("      creating thickness")
    7 ymin=numpy.min(md.mesh.y)
    8 ymax=numpy.max(md.mesh.y)
    9 md.geometry.thickness=500.*numpy.ones((md.mesh.numberofvertices))
    10 md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
    11 md.geometry.surface=md.geometry.base+md.geometry.thickness
     7ymin = np.min(md.mesh.y)
     8ymax = np.max(md.mesh.y)
     9md.geometry.thickness = 500. * np.ones((md.mesh.numberofvertices))
     10md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
     11md.geometry.surface = md.geometry.base + md.geometry.thickness
    1212
    1313print("      creating drag")
    14 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices))
    15 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    16 md.friction.p=numpy.ones((md.mesh.numberofelements))
    17 md.friction.q=numpy.ones((md.mesh.numberofelements))
     14md.friction.coefficient = 200. * np.ones((md.mesh.numberofvertices))
     15md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
     16md.friction.p = np.ones((md.mesh.numberofelements))
     17md.friction.q = np.ones((md.mesh.numberofelements))
    1818
    1919print("      creating initial values")
    20 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
    21 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
    22 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
    23 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
    24 md.initialization.vel=numpy.zeros((md.mesh.numberofvertices))
    25 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
     20md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
     21md.initialization.vx = np.zeros((md.mesh.numberofvertices))
     22md.initialization.vy = np.zeros((md.mesh.numberofvertices))
     23md.initialization.vz = np.zeros((md.mesh.numberofvertices))
     24md.initialization.vel = np.zeros((md.mesh.numberofvertices))
     25md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
    2626
    2727print("      creating flow law parameter")
    28 md.materials.rheology_B=1.7687*10**8*numpy.ones((md.mesh.numberofvertices))
    29 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
     28md.materials.rheology_B = 1.7687 * 10**8 * np.ones((md.mesh.numberofvertices))
     29md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
    3030
    3131print("      creating surface mass balance")
    32 md.smb.mass_balance=0.2*numpy.ones((md.mesh.numberofvertices))    #0m/a
    33 md.basalforcings.floatingice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices))    #0m/a
    34 md.basalforcings.groundedice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices))    #0m/a
     32md.smb.mass_balance = 0.2 * np.ones((md.mesh.numberofvertices))  #0m / a
     33md.basalforcings.floatingice_melting_rate = 0. * np.ones((md.mesh.numberofvertices))  #0m / a
     34md.basalforcings.groundedice_melting_rate = 0. * np.ones((md.mesh.numberofvertices))  #0m / a
    3535
    3636print("      boundary conditions")
    37 md=SetMarineIceSheetBC(md,'../Exp/SquareFrontEISMINT.exp')
     37md = SetMarineIceSheetBC(md, '../Exp/SquareFrontEISMINT.exp')
    3838
    3939#Evolution of the ice shelf
    40 pos=numpy.nonzero(md.mesh.y==200000.)    #nodes on the upper boundary condition
    41 md.balancethickness.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices))
    42 md.balancethickness.spcthickness[pos]=500.
    43 md.masstransport.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices))
    44 md.masstransport.spcthickness[pos]=500.
    45 md.masstransport.stabilization=0    #Better result with no artificial diffusivity
    46 md.thermal.stabilization=0
    47 md.timestepping.final_time=500.
    48 md.timestepping.time_step=1
     40pos = np.nonzero(md.mesh.y == 200000.)  #nodes on the upper boundary condition
     41md.balancethickness.spcthickness = float('NaN') * np.ones((md.mesh.numberofvertices))
     42md.balancethickness.spcthickness[pos] = 500.
     43md.masstransport.spcthickness = float('NaN') * np.ones((md.mesh.numberofvertices))
     44md.masstransport.spcthickness[pos] = 500.
     45md.masstransport.stabilization = 0  #Better result with no artificial diffusivity
     46md.thermal.stabilization = 0
     47md.timestepping.final_time = 500.
     48md.timestepping.time_step = 1
  • issm/trunk-jpl/test/Par/SquareSheetConstrained.py

    r24096 r24214  
    1111
    1212#Geometry
    13 hmin=300.
    14 hmax=1000.
    15 ymin=np.min(md.mesh.y)
    16 ymax=np.max(md.mesh.y)
    17 xmin=np.min(md.mesh.x)
    18 xmax=np.max(md.mesh.x)
    19 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin)
    20 md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness+20.
    21 md.geometry.surface=md.geometry.base+md.geometry.thickness
     13hmin = 300.
     14hmax = 1000.
     15ymin = np.min(md.mesh.y)
     16ymax = np.max(md.mesh.y)
     17xmin = np.min(md.mesh.x)
     18xmax = np.max(md.mesh.x)
     19md.geometry.thickness = hmax + (hmin - hmax) * (md.mesh.y - ymin) / (ymax - ymin) + 0.1 * (hmin - hmax) * (md.mesh.x - xmin) / (xmax - xmin)
     20md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness + 20.
     21md.geometry.surface = md.geometry.base + md.geometry.thickness
    2222
    23 #Initial velocity 
    24 x         = np.array(archread('../Data/SquareSheetConstrained.arch','x'))
    25 y         = np.array(archread('../Data/SquareSheetConstrained.arch','y'))
    26 vx        = np.array(archread('../Data/SquareSheetConstrained.arch','vx'))
    27 vy        = np.array(archread('../Data/SquareSheetConstrained.arch','vy'))
    28 index     = archread('../Data/SquareSheetConstrained.arch','index').astype(int)
     23#Initial velocity
     24x = np.array(archread('../Data/SquareSheetConstrained.arch', 'x'))
     25y = np.array(archread('../Data/SquareSheetConstrained.arch', 'y'))
     26vx = np.array(archread('../Data/SquareSheetConstrained.arch', 'vx'))
     27vy = np.array(archread('../Data/SquareSheetConstrained.arch', 'vy'))
     28index = archread('../Data/SquareSheetConstrained.arch', 'index').astype(int)
    2929
    30 md.initialization.vx=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)[0]
    31 md.initialization.vy=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)[0]
    32 md.initialization.vz=np.zeros((md.mesh.numberofvertices))
    33 md.initialization.pressure=np.zeros((md.mesh.numberofvertices))
     30md.initialization.vx = InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)[0]
     31md.initialization.vy = InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)[0]
     32md.initialization.vz = np.zeros((md.mesh.numberofvertices))
     33md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
    3434
    3535#Materials
    36 md.initialization.temperature=(273.-20.)*np.ones((md.mesh.numberofvertices))
    37 md.materials.rheology_B=paterson(md.initialization.temperature)
    38 md.materials.rheology_n=3.*np.ones((md.mesh.numberofelements))
     36md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
     37md.materials.rheology_B = paterson(md.initialization.temperature)
     38md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
    3939
    4040#Calving
    41 md.calving.calvingrate=np.zeros((md.mesh.numberofvertices))
    42 md.levelset.spclevelset=np.nan*np.ones((md.mesh.numberofvertices))
     41md.calving.calvingrate = np.zeros((md.mesh.numberofvertices))
     42md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices))
    4343
    4444#Friction
    45 md.friction.coefficient=20.*np.ones((md.mesh.numberofvertices))
    46 md.friction.coefficient[np.where(md.mask.groundedice_levelset<0.)[0]]=0.
    47 md.friction.p=np.ones((md.mesh.numberofelements))
    48 md.friction.q=np.ones((md.mesh.numberofelements))
     45md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
     46md.friction.coefficient[np.where(md.mask.groundedice_levelset < 0.)[0]] = 0.
     47md.friction.p = np.ones((md.mesh.numberofelements))
     48md.friction.q = np.ones((md.mesh.numberofelements))
    4949
    5050#Numerical parameters
    51 md.masstransport.stabilization=1.
    52 md.thermal.stabilization=1.
    53 md.verbose=verbose(0)
    54 md.settings.waitonlock=30
    55 md.stressbalance.restol=0.05
    56 md.steadystate.reltol=0.05
    57 md.stressbalance.reltol=0.05
    58 md.stressbalance.abstol=np.nan
    59 md.timestepping.time_step=1.
    60 md.timestepping.final_time=3.
    61 md.groundingline.migration='None'
     51md.masstransport.stabilization = 1.
     52md.thermal.stabilization = 1.
     53md.verbose = verbose(0)
     54md.settings.waitonlock = 30
     55md.stressbalance.restol = 0.05
     56md.steadystate.reltol = 0.05
     57md.stressbalance.reltol = 0.05
     58md.stressbalance.abstol = np.nan
     59md.timestepping.time_step = 1.
     60md.timestepping.final_time = 3.
     61md.groundingline.migration = 'None'
    6262
    6363#GIA:
    64 md.gia.lithosphere_thickness=100.*np.ones((md.mesh.numberofvertices)); # in km
    65 md.gia.mantle_viscosity=1.*10**21*np.ones((md.mesh.numberofvertices)); # in Pa.s
    66 md.materials.lithosphere_shear_modulus=6.7*10**10;                          # in Pa
    67 md.materials.lithosphere_density=3.32;                                      # in g/cm^-3
    68 md.materials.mantle_shear_modulus=1.45*10**11;                              # in Pa
    69 md.materials.mantle_density=3.34;                                           # in g/cm^-3
     64md.gia.lithosphere_thickness = 100. * np.ones((md.mesh.numberofvertices)) # in km
     65md.gia.mantle_viscosity = 1. * 10**21 * np.ones((md.mesh.numberofvertices)) # in Pa.s
     66md.materials.lithosphere_shear_modulus = 6.7 * 10**10  # in Pa
     67md.materials.lithosphere_density = 3.32  # in g / cm^ - 3
     68md.materials.mantle_shear_modulus = 1.45 * 10**11  # in Pa
     69md.materials.mantle_density = 3.34  # in g / cm^ - 3
    7070
    7171#Boundary conditions:
    72 md=SetIceSheetBC(md)
     72md = SetIceSheetBC(md)
    7373
    7474#Change name so that no test have the same name
    7575if len(inspect.stack()) > 2:
    76         md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
     76    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
  • issm/trunk-jpl/test/Par/SquareSheetConstrainedCO2.py

    r24096 r24214  
    1616CO2_heatCapacity = 700.
    1717CO2_thermalCond = 0.5
    18 CO2_dynViscosity =  13.72*10**-6
     18CO2_dynViscosity = 13.72 * 10**- 6
    1919CO2_rhoLiquidZeroDeg = 929.
    2020md.materials.rho_ice = CO2_rhoIce
     
    2727
    2828#Geometry
    29 hmin=300.
    30 hmax=1000.
    31 ymin=np.min(md.mesh.y)
    32 ymax=np.max(md.mesh.y)
    33 xmin=min(md.mesh.x)
    34 xmax=max(md.mesh.x)
    35 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin)
    36 md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness+20.
    37 md.geometry.surface=md.geometry.base+md.geometry.thickness
     29hmin = 300.
     30hmax = 1000.
     31ymin = np.min(md.mesh.y)
     32ymax = np.max(md.mesh.y)
     33xmin = min(md.mesh.x)
     34xmax = max(md.mesh.x)
     35md.geometry.thickness = hmax + (hmin - hmax) * (md.mesh.y - ymin) / (ymax - ymin) + 0.1 * (hmin - hmax) * (md.mesh.x - xmin) / (xmax - xmin)
     36md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness + 20.
     37md.geometry.surface = md.geometry.base + md.geometry.thickness
    3838
    3939#Initial velocity
    40 x         = np.array(archread('../Data/SquareSheetConstrained.arch','x'))
    41 y         = np.array(archread('../Data/SquareSheetConstrained.arch','y'))
    42 vx        = np.array(archread('../Data/SquareSheetConstrained.arch','vx'))
    43 vy        = np.array(archread('../Data/SquareSheetConstrained.arch','vy'))
    44 index     = archread('../Data/SquareSheetConstrained.arch','index').astype(int)
     40x = np.array(archread('../Data/SquareSheetConstrained.arch', 'x'))
     41y = np.array(archread('../Data/SquareSheetConstrained.arch', 'y'))
     42vx = np.array(archread('../Data/SquareSheetConstrained.arch', 'vx'))
     43vy = np.array(archread('../Data/SquareSheetConstrained.arch', 'vy'))
     44index = archread('../Data/SquareSheetConstrained.arch', 'index').astype(int)
    4545
    46 [md.initialization.vx]=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
    47 [md.initialization.vy]=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
    48 md.initialization.vz=np.zeros((md.mesh.numberofvertices))
    49 md.initialization.pressure=np.zeros((md.mesh.numberofvertices))
     46[md.initialization.vx] = InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)
     47[md.initialization.vy] = InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)
     48md.initialization.vz = np.zeros((md.mesh.numberofvertices))
     49md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
    5050
    5151#Materials
    52 md.initialization.temperature=CO2_temp*np.ones((md.mesh.numberofvertices))
    53 md.materials.rheology_B=nye(md.initialization.temperature,1)
    54 md.materials.rheology_n=CO2_n*np.ones((md.mesh.numberofelements))
     52md.initialization.temperature = CO2_temp * np.ones((md.mesh.numberofvertices))
     53md.materials.rheology_B = nye(md.initialization.temperature, 1)
     54md.materials.rheology_n = CO2_n * np.ones((md.mesh.numberofelements))
    5555
    5656#Surface mass balance and basal melting
    57 md.smb.mass_balance=10.*np.ones((md.mesh.numberofvertices))
    58 md.basalforcings.groundedice_melting_rate=5.*np.ones((md.mesh.numberofvertices))
    59 md.basalforcings.floatingice_melting_rate=5.*np.ones((md.mesh.numberofvertices))
     57md.smb.mass_balance = 10. * np.ones((md.mesh.numberofvertices))
     58md.basalforcings.groundedice_melting_rate = 5. * np.ones((md.mesh.numberofvertices))
     59md.basalforcings.floatingice_melting_rate = 5. * np.ones((md.mesh.numberofvertices))
    6060
    6161#Friction
    62 md.friction.coefficient=20.*np.ones((md.mesh.numberofvertices))
    63 md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    64 md.friction.p=np.ones((md.mesh.numberofelements))
    65 md.friction.q=np.ones((md.mesh.numberofelements))
     62md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
     63md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
     64md.friction.p = np.ones((md.mesh.numberofelements))
     65md.friction.q = np.ones((md.mesh.numberofelements))
    6666
    6767#Numerical parameters
    68 md.masstransport.stabilization=1
    69 md.thermal.stabilization=1
     68md.masstransport.stabilization = 1
     69md.thermal.stabilization = 1
    7070md.verbose = verbose(0)
    71 md.settings.waitonlock=30
    72 md.stressbalance.restol=0.05
    73 md.stressbalance.reltol=0.05
    74 md.steadystate.reltol=0.05
    75 md.stressbalance.abstol=float('nan')
    76 md.timestepping.time_step=1.
    77 md.timestepping.final_time=3.
    78 md.groundingline.migration='None'
     71md.settings.waitonlock = 30
     72md.stressbalance.restol = 0.05
     73md.stressbalance.reltol = 0.05
     74md.steadystate.reltol = 0.05
     75md.stressbalance.abstol = float('nan')
     76md.timestepping.time_step = 1.
     77md.timestepping.final_time = 3.
     78md.groundingline.migration = 'None'
    7979
    8080#Deal with boundary conditions:
     
    8383#Change name so that no tests have the same name
    8484if len(inspect.stack()) > 2:
    85         md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
     85    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
  • issm/trunk-jpl/test/Par/SquareSheetShelf.py

    r22993 r24214  
    22import inspect
    33from arch import *
    4 import numpy
     4import numpy as np
    55from verbose import verbose
    66from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
    7 from paterson import paterson 
     7from paterson import paterson
    88from SetMarineIceSheetBC import SetMarineIceSheetBC
    99
     
    1111
    1212#Geometry
    13 hmin=300.
    14 hmax=1000.
    15 ymin=min(md.mesh.y)
    16 ymax=max(md.mesh.y)
    17 xmin=min(md.mesh.x)
    18 xmax=max(md.mesh.x)
    19 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin)
    20 md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
    21 bed_sheet=-md.materials.rho_ice/md.materials.rho_water*(hmax+(hmin-hmax)*(ymax/2-ymin)/(ymax-ymin))
    22 pos=numpy.nonzero(md.mesh.y<=ymax/2.)
    23 md.geometry.base[pos]=bed_sheet
    24 md.geometry.surface=md.geometry.base+md.geometry.thickness
     13hmin = 300.
     14hmax = 1000.
     15ymin = min(md.mesh.y)
     16ymax = max(md.mesh.y)
     17xmin = min(md.mesh.x)
     18xmax = max(md.mesh.x)
     19md.geometry.thickness = hmax + (hmin - hmax) * (md.mesh.y - ymin) / (ymax - ymin) + 0.1 * (hmin - hmax) * (md.mesh.x - xmin) / (xmax - xmin)
     20md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
     21bed_sheet = - md.materials.rho_ice / md.materials.rho_water * (hmax + (hmin - hmax) * (ymax / 2 - ymin) / (ymax - ymin))
     22pos = np.nonzero(md.mesh.y <= ymax / 2.)
     23md.geometry.base[pos] = bed_sheet
     24md.geometry.surface = md.geometry.base + md.geometry.thickness
    2525
    26 #Initial velocity 
    27 x         = numpy.array(archread('../Data/SquareSheetShelf.arch','x'))
    28 y         = numpy.array(archread('../Data/SquareSheetShelf.arch','y'))
    29 vx        = numpy.array(archread('../Data/SquareSheetShelf.arch','vx'));
    30 vy        = numpy.array(archread('../Data/SquareSheetShelf.arch','vy'));
    31 index     = numpy.array(archread('../Data/SquareSheetShelf.arch','index')).astype(int);
     26#Initial velocity
     27x = np.array(archread('../Data/SquareSheetShelf.arch', 'x'))
     28y = np.array(archread('../Data/SquareSheetShelf.arch', 'y'))
     29vx = np.array(archread('../Data/SquareSheetShelf.arch', 'vx'))
     30vy = np.array(archread('../Data/SquareSheetShelf.arch', 'vy'))
     31index = np.array(archread('../Data/SquareSheetShelf.arch', 'index')).astype(int)
    3232
    33 [md.initialization.vx]  = InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
    34 [md.initialization.vy]  = InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
    35 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
    36 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
     33[md.initialization.vx] = InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)
     34[md.initialization.vy] = InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)
     35md.initialization.vz = np.zeros((md.mesh.numberofvertices))
     36md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
    3737
    3838#Materials
    39 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
    40 md.materials.rheology_B=paterson(md.initialization.temperature)
    41 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
     39md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
     40md.materials.rheology_B = paterson(md.initialization.temperature)
     41md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
    4242
    4343#Accumulation and melting
    44 md.smb.mass_balance=10.*numpy.ones((md.mesh.numberofvertices))
    45 md.basalforcings.groundedice_melting_rate=5.*numpy.ones((md.mesh.numberofvertices))
    46 md.basalforcings.floatingice_melting_rate=5.*numpy.ones((md.mesh.numberofvertices))
     44md.smb.mass_balance = 10. * np.ones((md.mesh.numberofvertices))
     45md.basalforcings.groundedice_melting_rate = 5. * np.ones((md.mesh.numberofvertices))
     46md.basalforcings.floatingice_melting_rate = 5. * np.ones((md.mesh.numberofvertices))
    4747
    4848#Friction
    49 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices))
    50 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    51 md.friction.p=numpy.ones((md.mesh.numberofelements))
    52 md.friction.q=numpy.ones((md.mesh.numberofelements))
     49md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
     50md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
     51md.friction.p = np.ones((md.mesh.numberofelements))
     52md.friction.q = np.ones((md.mesh.numberofelements))
    5353
    5454#Numerical parameters
    55 md.masstransport.stabilization=1
    56 md.thermal.stabilization=1
    57 md.verbose=verbose(0)
    58 md.settings.waitonlock=30
    59 md.stressbalance.restol=0.05
    60 md.steadystate.reltol=0.05
    61 md.stressbalance.reltol=0.05
    62 md.stressbalance.abstol=float('NaN')
    63 md.timestepping.time_step=1.
    64 md.timestepping.final_time=3.
    65 md.groundingline.migration='None'
     55md.masstransport.stabilization = 1
     56md.thermal.stabilization = 1
     57md.verbose = verbose(0)
     58md.settings.waitonlock = 30
     59md.stressbalance.restol = 0.05
     60md.steadystate.reltol = 0.05
     61md.stressbalance.reltol = 0.05
     62md.stressbalance.abstol = float('NaN')
     63md.timestepping.time_step = 1.
     64md.timestepping.final_time = 3.
     65md.groundingline.migration = 'None'
    6666
    6767#Deal with boundary conditions:
    68 md=SetMarineIceSheetBC(md,'../Exp/SquareFront.exp')
     68md = SetMarineIceSheetBC(md, '../Exp/SquareFront.exp')
    6969
    7070#Change name so that no test have the same name
    7171if len(inspect.stack()) > 2:
    72         md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
     72    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
  • issm/trunk-jpl/test/Par/SquareShelf.py

    r23836 r24214  
    22import inspect
    33from arch import *
    4 import numpy
     4import numpy as np
    55from verbose import verbose
    66from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
     
    1010#Start defining model parameters here
    1111#Geometry
    12 hmin=300.
    13 hmax=1000.
    14 ymin=min(md.mesh.y)
    15 ymax=max(md.mesh.y)
    16 xmin=min(md.mesh.x)
    17 xmax=max(md.mesh.x)
    18 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin)
    19 md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
    20 md.geometry.surface=md.geometry.base+md.geometry.thickness
    21 md.geometry.bed = md.geometry.base-500.;
     12hmin = 300.
     13hmax = 1000.
     14ymin = min(md.mesh.y)
     15ymax = max(md.mesh.y)
     16xmin = min(md.mesh.x)
     17xmax = max(md.mesh.x)
     18md.geometry.thickness = hmax + (hmin - hmax) * (md.mesh.y - ymin) / (ymax - ymin) + 0.1 * (hmin - hmax) * (md.mesh.x - xmin) / (xmax - xmin)
     19md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
     20md.geometry.surface = md.geometry.base + md.geometry.thickness
     21md.geometry.bed = md.geometry.base - 500.
    2222
    2323#Initial velocity and pressure
    24 x         = numpy.array(archread('../Data/SquareShelf.arch','x'))
    25 y         = numpy.array(archread('../Data/SquareShelf.arch','y'))
    26 vx        = numpy.array(archread('../Data/SquareShelf.arch','vx'));
    27 vy        = numpy.array(archread('../Data/SquareShelf.arch','vy'));
    28 index     = archread('../Data/SquareShelf.arch','index').astype(int);
     24x = np.array(archread('../Data/SquareShelf.arch', 'x'))
     25y = np.array(archread('../Data/SquareShelf.arch', 'y'))
     26vx = np.array(archread('../Data/SquareShelf.arch', 'vx'))
     27vy = np.array(archread('../Data/SquareShelf.arch', 'vy'))
     28index = archread('../Data/SquareShelf.arch', 'index').astype(int)
    2929
    3030#dbg - begin
    31 # #print 'vars in SquareShelf.nc:'
    32 # #for v in iVelF.variables:
    33 # #     print v
    34 #dbg - end 
     31#  #print 'vars in SquareShelf.nc:'
     32#  #for v in iVelF.variables:
     33#  #    print v
     34#dbg - end
    3535
    36 [md.initialization.vx]=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
    37 [md.initialization.vy]=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
    38 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
    39 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
     36[md.initialization.vx] = InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)
     37[md.initialization.vy] = InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)
     38md.initialization.vz = np.zeros((md.mesh.numberofvertices))
     39md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
    4040
    4141#dbg - begin
     
    4444#print '...vy:'
    4545#print md.initialization.vy
    46 ##print '...vz:'
    47 ##print md.initialization.vz
    48 ##print '...pressure:'
    49 ##print md.initialization.pressure
    50 #dbg - end 
     46#  #print '...vz:'
     47#  #print md.initialization.vz
     48#  #print '...pressure:'
     49#  #print md.initialization.pressure
     50#dbg - end
    5151
    5252
    5353#Materials
    54 md.initialization.temperature = (273.-20.)*numpy.ones((md.mesh.numberofvertices))
     54md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
    5555md.materials.rheology_B = paterson(md.initialization.temperature)
    56 md.materials.rheology_n = 3.*numpy.ones((md.mesh.numberofelements))
     56md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
    5757
    5858#Friction
    59 md.friction.coefficient = 20.*numpy.ones((md.mesh.numberofvertices))
    60 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    61 md.friction.p = numpy.ones((md.mesh.numberofelements))
    62 md.friction.q = numpy.ones((md.mesh.numberofelements))
     59md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
     60md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
     61md.friction.p = np.ones((md.mesh.numberofelements))
     62md.friction.q = np.ones((md.mesh.numberofelements))
    6363
    6464#Numerical parameters
     
    6666md.thermal.stabilization = 1.
    6767md.settings.waitonlock = 30
    68 md.verbose=verbose()
     68md.verbose = verbose()
    6969md.stressbalance.restol = 0.10
    7070md.steadystate.reltol = 0.02
     
    7676
    7777#Boundary conditions:
    78 # #md=SetIceShelfBC(md)
    79 md=SetIceShelfBC(md,'../Exp/SquareFront.exp')
     78#  #md = SetIceShelfBC(md)
     79md = SetIceShelfBC(md, '../Exp/SquareFront.exp')
    8080
    8181#Change name so that no test have the same name
    8282if len(inspect.stack()) > 2:
    83         md.miscellaneous.name=os.path.basename(inspect.stack()[2][1]).split('.')[0]
     83    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
  • issm/trunk-jpl/test/Par/SquareShelf2.py

    r22993 r24214  
    22import inspect
    33from arch import *
    4 import numpy
     4import numpy as np
    55from verbose import verbose
    66from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
     
    1010#Start defining model parameters here
    1111#Geometry
    12 hmin=300.
    13 hmax=1000.
    14 ymin=min(md.mesh.y)
    15 ymax=max(md.mesh.y)
    16 xmin=min(md.mesh.x)
    17 xmax=max(md.mesh.x)
    18 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin)
    19 md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
    20 md.geometry.surface=md.geometry.base+md.geometry.thickness
     12hmin = 300.
     13hmax = 1000.
     14ymin = min(md.mesh.y)
     15ymax = max(md.mesh.y)
     16xmin = min(md.mesh.x)
     17xmax = max(md.mesh.x)
     18md.geometry.thickness = hmax + (hmin - hmax) * (md.mesh.y - ymin) / (ymax - ymin) + 0.1 * (hmin - hmax) * (md.mesh.x - xmin) / (xmax - xmin)
     19md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
     20md.geometry.surface = md.geometry.base + md.geometry.thickness
    2121
    2222#Initial velocity and pressure
    23 x         = numpy.array(archread('../Data/SquareShelf.arch','x'))
    24 y         = numpy.array(archread('../Data/SquareShelf.arch','y'))
    25 vx        = numpy.array(archread('../Data/SquareShelf.arch','vx'));
    26 vy        = numpy.array(archread('../Data/SquareShelf.arch','vy'));
    27 index     = archread('../Data/SquareShelf.arch','index').astype(int);
     23x = np.array(archread('../Data/SquareShelf.arch', 'x'))
     24y = np.array(archread('../Data/SquareShelf.arch', 'y'))
     25vx = np.array(archread('../Data/SquareShelf.arch', 'vx'))
     26vy = np.array(archread('../Data/SquareShelf.arch', 'vy'))
     27index = archread('../Data/SquareShelf.arch', 'index').astype(int)
    2828#dbg - begin
    29 # #print 'vars in SquareShelf.nc:'
    30 # #for v in iVelF.variables:
    31 # #     print v
    32 #dbg - end 
     29#  #print 'vars in SquareShelf.nc:'
     30#  #for v in iVelF.variables:
     31#  #    print v
     32#dbg - end
    3333
    34 [md.initialization.vx]=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
    35 [md.initialization.vy]=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
    36 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
    37 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
     34[md.initialization.vx] = InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)
     35[md.initialization.vy] = InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)
     36md.initialization.vz = np.zeros((md.mesh.numberofvertices))
     37md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
    3838
    3939#dbg - begin
     
    4242#print '...vy:'
    4343#print md.initialization.vy
    44 ##print '...vz:'
    45 ##print md.initialization.vz
    46 ##print '...pressure:'
    47 ##print md.initialization.pressure
    48 #dbg - end 
     44#  #print '...vz:'
     45#  #print md.initialization.vz
     46#  #print '...pressure:'
     47#  #print md.initialization.pressure
     48#dbg - end
    4949
    5050
    5151#Materials
    52 md.initialization.temperature = (273.-20.)*numpy.ones((md.mesh.numberofvertices))
     52md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
    5353md.materials.rheology_B = paterson(md.initialization.temperature)
    54 md.materials.rheology_n = 3.*numpy.ones((md.mesh.numberofelements))
     54md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
    5555
    5656#Friction
    57 md.friction.coefficient = 20.*numpy.ones((md.mesh.numberofvertices))
    58 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    59 md.friction.p = numpy.ones((md.mesh.numberofelements))
    60 md.friction.q = numpy.ones((md.mesh.numberofelements))
     57md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
     58md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
     59md.friction.p = np.ones((md.mesh.numberofelements))
     60md.friction.q = np.ones((md.mesh.numberofelements))
    6161
    6262#Numerical parameters
     
    6464md.thermal.stabilization = 1.
    6565md.settings.waitonlock = 30
    66 md.verbose=verbose()
     66md.verbose = verbose()
    6767md.stressbalance.restol = 0.10
    6868md.steadystate.reltol = 0.02
     
    7171md.timestepping.time_step = 1.
    7272md.timestepping.final_time = 3.
    73 md.groundingline.migration= 'None'
     73md.groundingline.migration = 'None'
    7474
    7575#Boundary conditions:
    76 # #md=SetIceShelfBC(md)
    77 md=SetIceShelfBC(md,'../Exp/SquareFront2.exp')
     76#  #md = SetIceShelfBC(md)
     77md = SetIceShelfBC(md, '../Exp/SquareFront2.exp')
    7878
    7979#Change name so that no test have the same name
    8080if len(inspect.stack()) > 2:
    81         md.miscellaneous.name=os.path.basename(inspect.stack()[2][1]).split('.')[0]
     81    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
  • issm/trunk-jpl/test/Par/SquareShelfConstrained.py

    r23707 r24214  
    1010#Start defining model parameters here
    1111#Geometry
    12 hmin=300.
    13 hmax=1000.
    14 ymin=np.min(md.mesh.y)
    15 ymax=np.max(md.mesh.y)
    16 xmin=min(md.mesh.x)
    17 xmax=max(md.mesh.x)
    18 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin)
    19 md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
    20 md.geometry.surface=md.geometry.base+md.geometry.thickness
    21 md.geometry.bed=md.geometry.base-10;
     12hmin = 300.
     13hmax = 1000.
     14ymin = np.min(md.mesh.y)
     15ymax = np.max(md.mesh.y)
     16xmin = min(md.mesh.x)
     17xmax = max(md.mesh.x)
     18md.geometry.thickness = hmax + (hmin - hmax) * (md.mesh.y - ymin) / (ymax - ymin) + 0.1 * (hmin - hmax) * (md.mesh.x - xmin) / (xmax - xmin)
     19md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
     20md.geometry.surface = md.geometry.base + md.geometry.thickness
     21md.geometry.bed = md.geometry.base - 10
    2222
    2323#Initial velocity
    24 x         = np.array(archread('../Data/SquareShelfConstrained.arch','x'))
    25 y         = np.array(archread('../Data/SquareShelfConstrained.arch','y'))
    26 vx        = np.array(archread('../Data/SquareShelfConstrained.arch','vx'))
    27 vy        = np.array(archread('../Data/SquareShelfConstrained.arch','vy'))
    28 index     = np.array(archread('../Data/SquareShelfConstrained.arch','index').astype(int))
     24x = np.array(archread('../Data/SquareShelfConstrained.arch', 'x'))
     25y = np.array(archread('../Data/SquareShelfConstrained.arch', 'y'))
     26vx = np.array(archread('../Data/SquareShelfConstrained.arch', 'vx'))
     27vy = np.array(archread('../Data/SquareShelfConstrained.arch', 'vy'))
     28index = np.array(archread('../Data/SquareShelfConstrained.arch', 'index').astype(int))
    2929
    30 [md.initialization.vx]=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
    31 [md.initialization.vy]=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
    32 md.initialization.vz=np.zeros((md.mesh.numberofvertices))
    33 md.initialization.pressure=np.zeros((md.mesh.numberofvertices))
     30[md.initialization.vx] = InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)
     31[md.initialization.vy] = InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)
     32md.initialization.vz = np.zeros((md.mesh.numberofvertices))
     33md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
    3434
    3535#Materials
    36 md.initialization.temperature=(273.-20.)*np.ones((md.mesh.numberofvertices))
    37 md.materials.rheology_B=paterson(md.initialization.temperature)
    38 md.materials.rheology_n=3.*np.ones((md.mesh.numberofelements))
     36md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
     37md.materials.rheology_B = paterson(md.initialization.temperature)
     38md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
    3939
    4040#Surface mass balance and basal melting
    41 md.smb.mass_balance=10.*np.ones((md.mesh.numberofvertices))
    42 md.basalforcings.groundedice_melting_rate=5.*np.ones((md.mesh.numberofvertices))
    43 md.basalforcings.floatingice_melting_rate=5.*np.ones((md.mesh.numberofvertices))
     41md.smb.mass_balance = 10. * np.ones((md.mesh.numberofvertices))
     42md.basalforcings.groundedice_melting_rate = 5. * np.ones((md.mesh.numberofvertices))
     43md.basalforcings.floatingice_melting_rate = 5. * np.ones((md.mesh.numberofvertices))
    4444
    4545#Friction
    46 md.friction.coefficient=20.*np.ones((md.mesh.numberofvertices))
    47 md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    48 md.friction.p=np.ones((md.mesh.numberofelements))
    49 md.friction.q=np.ones((md.mesh.numberofelements))
     46md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
     47md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
     48md.friction.p = np.ones((md.mesh.numberofelements))
     49md.friction.q = np.ones((md.mesh.numberofelements))
    5050
    5151#Numerical parameters
    52 md.masstransport.stabilization=1
    53 md.thermal.stabilization=1
     52md.masstransport.stabilization = 1
     53md.thermal.stabilization = 1
    5454md.verbose = verbose(0)
    55 md.settings.waitonlock=30
    56 md.stressbalance.restol=0.05
    57 md.stressbalance.reltol=0.05
    58 md.steadystate.reltol=0.05
    59 md.stressbalance.abstol=float('nan')
    60 md.timestepping.time_step=1.
    61 md.timestepping.final_time=3.
     55md.settings.waitonlock = 30
     56md.stressbalance.restol = 0.05
     57md.stressbalance.reltol = 0.05
     58md.steadystate.reltol = 0.05
     59md.stressbalance.abstol = float('nan')
     60md.timestepping.time_step = 1.
     61md.timestepping.final_time = 3.
    6262
    6363#Deal with boundary conditions:
     
    6666#Change name so that no tests have the same name
    6767if len(inspect.stack()) > 2:
    68         md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
     68    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
  • issm/trunk-jpl/test/Par/SquareThermal.py

    r23707 r24214  
    1 import numpy
     1import numpy as np
    22from paterson import paterson
    33from SetMarineIceSheetBC import SetMarineIceSheetBC
     
    55#Ok, start defining model parameters here
    66
    7 md.timestepping.time_step=0
    8 md.groundingline.migration='None'
     7md.timestepping.time_step = 0
     8md.groundingline.migration = 'None'
    99
    1010print("      creating thickness")
    11 h=1000.
    12 md.geometry.thickness=h*numpy.ones((md.mesh.numberofvertices))
    13 md.geometry.base=-1000.*numpy.ones((md.mesh.numberofvertices))
    14 md.geometry.surface=md.geometry.base+md.geometry.thickness;
     11h = 1000.
     12md.geometry.thickness = h * np.ones((md.mesh.numberofvertices))
     13md.geometry.base = - 1000. * np.ones((md.mesh.numberofvertices))
     14md.geometry.surface = md.geometry.base + md.geometry.thickness
    1515
    1616print("      creating velocities")
    17 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
    18 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
    19 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
     17md.initialization.vx = np.zeros((md.mesh.numberofvertices))
     18md.initialization.vy = np.zeros((md.mesh.numberofvertices))
     19md.initialization.vz = np.zeros((md.mesh.numberofvertices))
    2020
    2121print("      creating drag")
    22 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices))
    23 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    24 md.friction.p=numpy.ones((md.mesh.numberofelements))
    25 md.friction.q=numpy.ones((md.mesh.numberofelements))
     22md.friction.coefficient = 200. * np.ones((md.mesh.numberofvertices))
     23md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
     24md.friction.p = np.ones((md.mesh.numberofelements))
     25md.friction.q = np.ones((md.mesh.numberofelements))
    2626
    2727print("      creating temperatures")
    28 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
    29 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,))
    30 md.initialization.waterfraction=numpy.zeros((md.mesh.numberofvertices,))
    31 md.initialization.watercolumn=numpy.zeros((md.mesh.numberofvertices,))
     28md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
     29md.initialization.pressure = np.zeros((md.mesh.numberofvertices, ))
     30md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices, ))
     31md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices, ))
    3232
    3333print("      creating flow law parameter")
    34 md.materials.rheology_B=paterson(md.initialization.temperature)
    35 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
     34md.materials.rheology_B = paterson(md.initialization.temperature)
     35md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
    3636
    3737print("      creating surface mass balance")
    38 md.smb.mass_balance=numpy.ones((md.mesh.numberofvertices))/md.constants.yts    #1m/a
    39 #md.basalforcings.melting_rate=0.*numpy.ones((md.mesh.numberofvertices))/md.constants.yts    #1m/a
    40 md.basalforcings.groundedice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices))/md.constants.yts    #1m/a
    41 md.basalforcings.floatingice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices))/md.constants.yts    #1m/a
     38md.smb.mass_balance = np.ones((md.mesh.numberofvertices)) / md.constants.yts  #1m / a
     39#md.basalforcings.melting_rate = 0. * np.ones((md.mesh.numberofvertices)) / md.constants.yts  #1m / a
     40md.basalforcings.groundedice_melting_rate = 0. * np.ones((md.mesh.numberofvertices)) / md.constants.yts  #1m / a
     41md.basalforcings.floatingice_melting_rate = 0. * np.ones((md.mesh.numberofvertices)) / md.constants.yts  #1m / a
    4242
    4343#Deal with boundary conditions:
    4444
    4545print("      boundary conditions for stressbalance model")
    46 md=SetMarineIceSheetBC(md,'../Exp/SquareFront.exp')
     46md = SetMarineIceSheetBC(md, '../Exp/SquareFront.exp')
    4747
    4848print("      boundary conditions for thermal model")
    49 md.thermal.spctemperature[:]=md.initialization.temperature
    50 md.basalforcings.geothermalflux=numpy.zeros((md.mesh.numberofvertices))
    51 md.basalforcings.geothermalflux[numpy.nonzero(md.mask.groundedice_levelset>0.)[0]]=1.*10**-3    #1 mW/m^2
     49md.thermal.spctemperature[:] = md.initialization.temperature
     50md.basalforcings.geothermalflux = np.zeros((md.mesh.numberofvertices))
     51md.basalforcings.geothermalflux[np.nonzero(md.mask.groundedice_levelset > 0.)[0]] = 1. * 10**- 3  #1 mW / m^2
  • issm/trunk-jpl/test/Par/ValleyGlacierShelf.py

    r23656 r24214  
    11import os.path
    22from arch import *
    3 import numpy
     3import numpy as np
    44import inspect
    5 import math
    65from verbose import verbose
    7 from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
    86from paterson import paterson
    97from SetIceShelfBC import SetIceShelfBC
    108
    119#Start defining model parameters here
    12 x=md.mesh.x
    13 y=md.mesh.y
     10x = md.mesh.x
     11y = md.mesh.y
    1412xmin, xmax = min(x), max(x)
    1513ymin, ymax = min(y), max(y)
    16 Lx=(xmax-xmin)
    17 Ly=(ymax-ymin)
    18 xm,ym = (xmin+xmax)/2., (ymin+ymax)/2.
     14Lx = (xmax - xmin)
     15Ly = (ymax - ymin)
     16xm, ym = (xmin + xmax) / 2., (ymin + ymax) / 2.
    1917
    20 #Geometry: U-shaped valley in y direction
     18#Geometry: U - shaped valley in y direction
    2119thk_center = 1000.
    22 thk_margin = 0.5*thk_center
    23 bmax=0.
    24 bmin=-thk_center*md.materials.rho_ice/md.materials.rho_water
     20thk_margin = 0.5 * thk_center
     21bmax = 0.
     22bmin = -thk_center * md.materials.rho_ice / md.materials.rho_water
    2523
    26 alpha=2./3.
    27 slope = 0.9*(bmin-bmax)*(x-xmin)/(Lx*alpha) + 0.1*(bmin-bmax)*(y-ymin)/(Ly) + bmax
    28 md.geometry.surface= (thk_center+bmax) + slope
    29 md.geometry.base=bmax + slope + 4./Ly**2*(thk_center-thk_margin)*(numpy.power(y-ym,2))
    30 md.geometry.thickness=md.geometry.surface - md.geometry.base
     24alpha = 2. / 3.
     25slope = 0.9 * (bmin - bmax) * (x - xmin) / (Lx * alpha) + 0.1 * (bmin - bmax) * (y - ymin) / (Ly) + bmax
     26md.geometry.surface = (thk_center + bmax) + slope
     27md.geometry.base = bmax + slope + 4. / Ly**2 * (thk_center - thk_margin) * (np.power(y - ym, 2))
     28md.geometry.thickness = md.geometry.surface - md.geometry.base
    3129md.geometry.bed = md.geometry.base
    3230
    3331#Mask
    34 md.mask.ice_levelset=x - alpha*Lx
    35 md.mask.groundedice_levelset= numpy.ones((md.mesh.numberofvertices))
     32md.mask.ice_levelset = x - alpha * Lx
     33md.mask.groundedice_levelset = np.ones((md.mesh.numberofvertices))
    3634
    37 #Initial velocity 
    38 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
    39 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
    40 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
    41 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
     35#Initial velocity
     36md.initialization.vx = np.zeros((md.mesh.numberofvertices))
     37md.initialization.vy = np.zeros((md.mesh.numberofvertices))
     38md.initialization.vz = np.zeros((md.mesh.numberofvertices))
     39md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
    4240
    4341#Materials
    44 md.initialization.temperature=(273.15-5.)*numpy.ones((md.mesh.numberofvertices))
    45 md.initialization.waterfraction=numpy.zeros((md.mesh.numberofvertices))
    46 md.initialization.watercolumn=numpy.zeros((md.mesh.numberofvertices))
    47 md.materials.rheology_B=paterson(md.initialization.temperature)
    48 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
     42md.initialization.temperature = (273.15 - 5.) * np.ones((md.mesh.numberofvertices))
     43md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices))
     44md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices))
     45md.materials.rheology_B = paterson(md.initialization.temperature)
     46md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
    4947
    5048#Thermal
    51 md.thermal.isenthalpy=False
    52 md.thermal.spctemperature=float('nan')*numpy.ones((md.mesh.numberofvertices))
     49md.thermal.isenthalpy = False
     50md.thermal.spctemperature = float('nan') * np.ones((md.mesh.numberofvertices))
    5351
    5452#Groundingline
    55 md.groundingline.migration='SubelementMigration'
     53md.groundingline.migration = 'SubelementMigration'
    5654
    5755#Surface mass balance and basal melting
    58 md.smb.mass_balance=0.3*numpy.ones((md.mesh.numberofvertices))
    59 md.basalforcings.groundedice_melting_rate=md.smb.mass_balance
    60 md.basalforcings.floatingice_melting_rate=md.smb.mass_balance
     56md.smb.mass_balance = 0.3 * np.ones((md.mesh.numberofvertices))
     57md.basalforcings.groundedice_melting_rate = md.smb.mass_balance
     58md.basalforcings.floatingice_melting_rate = md.smb.mass_balance
    6159
    6260#Friction
    63 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices))
    64 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    65 md.friction.p=numpy.ones((md.mesh.numberofelements))
    66 md.friction.q=numpy.ones((md.mesh.numberofelements))
     61md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
     62md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
     63md.friction.p = np.ones((md.mesh.numberofelements))
     64md.friction.q = np.ones((md.mesh.numberofelements))
    6765
    6866#Transient
    69 md.transient.isstressbalance=True
    70 md.transient.ismovingfront=True
    71 md.transient.ismasstransport=False
    72 md.transient.isthermal=False
    73 md.transient.isgroundingline=True
    74 md.transient.isgia=False
     67md.transient.isstressbalance = True
     68md.transient.ismovingfront = True
     69md.transient.ismasstransport = False
     70md.transient.isthermal = False
     71md.transient.isgroundingline = True
     72md.transient.isgia = False
    7573
    7674#Stressbalance
    77 md.stressbalance.maxiter=100
    78 md.stressbalance.restol=0.05
    79 md.stressbalance.reltol=0.05
    80 md.stressbalance.abstol=float('nan')
     75md.stressbalance.maxiter = 100
     76md.stressbalance.restol = 0.05
     77md.stressbalance.reltol = 0.05
     78md.stressbalance.abstol = float('nan')
    8179
    8280#Masstransport
    83 md.calving.calvingrate=0.*numpy.ones((md.mesh.numberofvertices))
    84 md.frontalforcings.meltingrate = 0.*numpy.ones((md.mesh.numberofvertices))
    85 md.levelset.spclevelset=float('NaN')*numpy.ones((md.mesh.numberofvertices))
    86 md.masstransport.stabilization=1.
     81md.calving.calvingrate = 0. * np.ones((md.mesh.numberofvertices))
     82md.frontalforcings.meltingrate = 0. * np.ones((md.mesh.numberofvertices))
     83md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices))
     84md.masstransport.stabilization = 1.
    8785
    8886#Numerical parameters
    89 md.thermal.stabilization=1.
    90 md.settings.waitonlock=30
    91 md.steadystate.reltol=0.05
    92 md.timestepping.time_step=1.
    93 md.timestepping.final_time=3.
     87md.thermal.stabilization = 1.
     88md.settings.waitonlock = 30
     89md.steadystate.reltol = 0.05
     90md.timestepping.time_step = 1.
     91md.timestepping.final_time = 3.
    9492
    9593#Verbose
     
    10199#Change name so that no tests have the same name
    102100if len(inspect.stack()) > 2:
    103         md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
     101    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
Note: See TracChangeset for help on using the changeset viewer.