Changeset 24214
- Timestamp:
- 10/11/19 00:27:00 (5 years ago)
- 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 python1 #! / usr / bin / env python 2 2 from IdToName import * 3 3 from IdFromString import * … … 9 9 GetIds - output ids from a given array of IDs and test names 10 10 11 the test names can be any string or sub -string present11 the test names can be any string or sub - string present 12 12 in the test's name (first line of corresponding file) 13 13 … … 18 18 ids = GetIds('Dakota') 19 19 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\'...]]) 22 22 """ 23 23 … … 30 30 # fail silently 31 31 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"') 33 33 34 34 if type(ids_names) == int: … … 37 37 # fail silently 38 38 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"') 40 40 41 # many inputs of either ids or test names41 # many inputs of either ids or test names 42 42 if type(ids_names) == list and len(ids_names) > 0: 43 43 # is everything a string or int? … … 49 49 raise RuntimeError('runme.py: GetIds.py: No tests with names matching "' + ids_names + '" were found. Note that name checking is case sensitive.') 50 50 51 # many inputs of both ids and test names52 # ids_names[0] -> ids_names by id53 # ids_names[1] -> ids_names by test name51 # 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 54 54 if type(ids_names) == list and len(ids_names) == 2: 55 55 if type(ids_names[0]) == list and len(ids_names[0]) > 0 and type(ids_names[0][0]) == int: … … 60 60 raise RuntimeError('runme.py: GetIds.py: No tests with names matching "' + ids_names + '" were found. Note that name checking is case sensitive.') 61 61 62 # no recognizable ids or id formats62 # no recognizable ids or id formats 63 63 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__) 65 65 66 66 return np.array(ids).astype(int) -
issm/trunk-jpl/test/NightlyRun/IdFromString.py
r23793 r24214 1 #! / usr/bin/env python1 #! / usr / bin / env python 2 2 from IdToName import IdToName 3 3 import os … … 14 14 ids = IdFromString('Parallel') 15 15 ids = IdFromString('79North') 16 ids = IdFromString(' *')16 ids = IdFromString(' * ') 17 17 """ 18 18 19 19 #Check input 20 20 if not isinstance(string, str): 21 21 raise TypeError('IdFromString error message: input argument is not a string.') … … 23 23 string = string.replace('"', '') 24 24 25 25 #Get the test ids and names and scan for matches 26 26 27 27 ids = [] … … 30 30 if f.endswith('.py') and f.startswith('test'): 31 31 # 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]) 33 33 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): 35 35 ids.append(s) 36 36 idnames.append(name) 37 37 38 38 #Return if no test found 39 39 if not ids: 40 40 print("No test matches '%s'." % string) 41 41 return ids 42 42 43 43 #Display names 44 44 if verbose: 45 45 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 python1 #! / usr / bin / env python 2 2 3 3 4 4 def IdToName(test_id): 5 5 """ 6 IDTONAME - return name of test6 IDTONAME - return name of test 7 7 8 8 Usage: … … 12 12 file_text = infile.readline() 13 13 14 string = ' #Test Name:'15 name = file_text[len(string) + 1: -1]14 string = ' #Test Name:' 15 name = file_text[len(string) + 1: - 1] 16 16 return name -
issm/trunk-jpl/test/NightlyRun/runme.py
r23833 r24214 1 #! /usr/bin/env python1 #! / usr / bin / env python 2 2 import os 3 3 import argparse … … 18 18 19 19 def runme(id=None, exclude=None, benchmark='nightly', procedure='check', output='none', rank=1, numprocs=1): 20 21 20 """ 22 21 RUNME - test deck for ISSM nightly runs 23 22 24 In a test deck directory (tests /Vertification/NightlyRun for example)23 In a test deck directory (tests / Vertification / NightlyRun for example) 25 24 The following command will launch all the existing tests: 26 >>runme()25 >> runme() 27 26 To run the tests 101 and 102: 28 >>runme(id = [101, 102])27 >> runme(id = [101, 102]) 29 28 etc... 30 29 … … 37 36 38 37 'benchmark' 'all' (all of the tests) 39 'nightly' (nightly run / daily run)40 'ismip' : validation of ismip -hom tests38 'nightly' (nightly run / daily run) 39 'ismip' : validation of ismip - hom tests 41 40 'eismint': validation of eismint tests 42 41 'thermal': validation of thermal tests … … 56 55 runme('SquareShelf') 57 56 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']]) 60 59 """ 61 60 #Get ISSM_DIR variable … … 69 68 print(("runme warning: benchmark '{}' not supported, defaulting to test 'nightly'.".format(benchmark))) 70 69 benchmark = 'nightly' 71 # }}}72 #GET procedure {{{70 # }}} 71 #GET procedure {{{ 73 72 if procedure not in ['check', 'update']: 74 73 print(("runme warning: procedure '{}' not supported, defaulting to test 'check'.".format(procedure))) 75 74 procedure = 'check' 76 # }}}77 #GET output {{{75 # }}} 76 #GET output {{{ 78 77 if output not in ['nightly', 'none']: 79 78 print(("runme warning: output '{}' not supported, defaulting to test 'none'.".format(output))) 80 79 output = 'none' 81 # }}}82 #GET RANK and NUMPROCS for multithreaded runs {{{80 # }}} 81 #GET RANK and NUMPROCS for multithreaded runs {{{ 83 82 if (numprocs < rank): 84 83 numprocs = 1 85 # }}}86 #GET ids {{{87 flist = glob('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)) 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 91 90 list_ids = list_ids[i1:i2 + 1] 92 93 91 if np.size(id) > 0 and id is not None: 94 92 test_ids = set(GetIds(id)).intersection(set(list_ids)) … … 101 99 #GET exclude {{{ 102 100 exclude_ids = GetIds(exclude) 103 104 101 test_ids = test_ids.difference(exclude_ids) 105 102 # }}} … … 131 128 #Loop over tests and launch sequence 132 129 root = os.getcwd() 130 errorcount = 0 131 erroredtest_list = [] 133 132 for id in test_ids: 134 print(("----------------starting:{}----------------------- ".format(id)))133 print(("----------------starting:{}----------------------- ".format(id))) 135 134 try: 136 135 #Execute test … … 154 153 elif len(field.shape) == 0: 155 154 field = field.reshape(1, 1) 156 # Matlab uses base 1, so use base 1 in labels155 # Matlab uses base 1, so use base 1 in labels 157 156 archwrite(archive_file, archive_name + '_field' + str(k + 1), field) 158 157 print(("File {} saved. \n".format(os.path.join('..', 'Archives', archive_name + '.arch')))) 159 158 160 #ELSE: CHECK TEST159 #ELSE: CHECK TEST 161 160 else: 162 161 #load archive … … 192 191 error_diff = error_diff[0] 193 192 194 #disp test result193 #disp test result 195 194 if (np.any(error_diff > tolerance) or np.isnan(error_diff)): 196 195 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) 197 198 else: 198 199 print(('SUCCESS difference: {} < {} test id: {} test name: {} field: {}'.format(error_diff, tolerance, id, id_string, fieldname))) … … 204 205 fid = open(os.path.join(ISSM_DIR, 'nightlylog', 'pythonerror.log'), 'a') 205 206 fid.write('%s' % message) 206 fid.write('\n------------------------------------------------------------------ \n')207 fid.write('\n------------------------------------------------------------------ \n') 207 208 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))) 209 210 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))) 211 212 raise RuntimeError(message) 212 213 … … 217 218 fid = open(os.path.join(ISSM_DIR, 'nightlylog', 'pythonerror.log'), 'a') 218 219 fid.write('%s' % message) 219 fid.write('\n------------------------------------------------------------------ \n')220 fid.write('\n------------------------------------------------------------------ \n') 220 221 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'))) 222 223 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'))) 224 225 raise RuntimeError(message) 225 226 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)) 227 231 return 228 232 … … 231 235 if 'PYTHONSTARTUP' in os.environ: 232 236 PYTHONSTARTUP = os.environ['PYTHONSTARTUP'] 233 #print 'PYTHONSTARTUP =', PYTHONSTARTUP237 #print 'PYTHONSTARTUP = ', PYTHONSTARTUP 234 238 if os.path.exists(PYTHONSTARTUP): 235 239 try: … … 241 245 242 246 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) 252 256 args = parser.parse_args() 253 257 -
issm/trunk-jpl/test/NightlyRun/test1101.py
r23793 r24214 10 10 11 11 """ 12 This test is a test from the ISMP -HOM Intercomparison project.12 This test is a test from the ISMP - HOM Intercomparison project. 13 13 Pattyn and Payne 2006 14 14 """ … … 22 22 23 23 for L in L_list: 24 nx = 20 24 nx = 20 #numberof nodes in x direction 25 25 ny = 20 26 26 md = model() 27 27 md = squaremesh(md, L, L, nx, ny) 28 md = setmask(md, '', '') 28 md = setmask(md, '', '') #ice sheet test 29 29 md = parameterize(md, '../Par/ISMIPA.py') 30 30 md.extrude(9, 1.) … … 32 32 md = setflowequation(md, 'HO', 'all') 33 33 34 34 #Create dirichlet on the bed only 35 35 md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices)) 36 36 md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices)) … … 41 41 md.stressbalance.spcvy[pos] = 0. 42 42 43 43 #Create MPCs to have periodic boundary conditions 44 44 posx = np.where(md.mesh.x == 0.)[0] 45 45 posx2 = np.where(md.mesh.x == np.max(md.mesh.x))[0] … … 50 50 md.stressbalance.vertex_pairing = np.vstack((np.vstack((posx + 1, posx2 + 1)).T, np.vstack((posy + 1, posy2 + 1)).T)) 51 51 52 52 #Compute the stressbalance 53 53 md.cluster = generic('name', gethostname(), 'np', 8) 54 54 md = solve(md, 'Stressbalance') 55 55 56 56 #Plot the results and save them 57 57 vx = md.results.StressbalanceSolution.Vx 58 58 vy = md.results.StressbalanceSolution.Vy … … 62 62 maxvx.append(np.max(vx[-md.mesh.numberofvertices2d:])) 63 63 64 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') 66 66 if printingflag: 67 67 pass 68 68 # set(gcf, 'Color', 'w') 69 69 # 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') 72 72 if printingflag: 73 73 pass 74 74 # set(gcf, 'Color', 'w') 75 75 # 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') 78 78 if printingflag: 79 79 pass 80 80 # set(gcf, 'Color', 'w') 81 81 # 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') 83 83 84 84 if (L == 5000.): 85 85 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', '') 88 88 elif (L == 10000.): 89 89 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', '') 92 92 elif (L == 20000.): 93 93 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', '') 96 96 elif (L == 40000.): 97 97 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', '') 100 100 elif (L == 80000.): 101 101 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', '') 104 104 elif (L == 160000.): 105 105 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', '') 108 108 if printingflag: 109 109 pass 110 110 # set(gcf, 'Color', 'w') 111 111 # 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') 113 113 114 114 #Now plot the min and max values of vx for each size of the square … … 118 118 # set(gcf, 'Color', 'w') 119 119 # 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') 121 121 #plot([5 10 20 40 80 160], maxvx)ylim([0 120])xlim([0 160]) 122 122 if printingflag: … … 124 124 # set(gcf, 'Color', 'w') 125 125 # 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') 127 127 128 128 #Fields and tolerances to track changes -
issm/trunk-jpl/test/NightlyRun/test1102.py
r23793 r24214 10 10 11 11 """ 12 This test is a test from the ISMP -HOM Intercomparison project.12 This test is a test from the ISMP - HOM Intercomparison project. 13 13 Pattyn and Payne 2006 14 14 """ … … 22 22 23 23 for L in L_list: 24 nx = 20 24 nx = 20 #numberof nodes in x direction 25 25 ny = 20 26 26 md = model() 27 27 md = squaremesh(md, L, L, nx, ny) 28 md = setmask(md, '', '') 28 md = setmask(md, '', '') #ice sheet test 29 29 30 ##Find elements at the corner and extract model31 # 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]=035 # 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) 36 36 37 37 md = parameterize(md, '../Par/ISMIPA.py') … … 52 52 md = solve(md, 'Stressbalance') 53 53 54 54 #Plot the results and save them 55 55 vx = md.results.StressbalanceSolution.Vx 56 56 vy = md.results.StressbalanceSolution.Vy … … 62 62 63 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', '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) 65 65 if printingflag: 66 66 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) 71 71 if printingflag: 72 72 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) 77 77 if printingflag: 78 78 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') 82 82 83 83 if (L == 5000.): 84 84 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', '') 87 87 elif (L == 10000.): 88 88 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', '') 91 91 elif (L == 20000.): 92 92 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', '') 95 95 elif (L == 40000.): 96 96 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', '') 99 99 elif (L == 80000.): 100 100 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', '') 103 103 elif (L == 160000.): 104 104 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', '') 107 107 if printingflag: 108 108 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') 112 112 113 #Now plot the min and max values of vx for each size of the square114 #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]) 115 115 if printingflag: 116 116 pass 117 117 # set(gcf, 'Color', 'w') 118 118 # 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') 120 120 #plot([5 10 20 40 80 160], maxvx)ylim([0 120]) 121 121 if printingflag: … … 123 123 # set(gcf, 'Color', 'w') 124 124 # 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') 126 126 127 127 #Fields and tolerances to track changes -
issm/trunk-jpl/test/NightlyRun/test1103.py
r23793 r24214 10 10 11 11 """ 12 This test is a test from the ISMP -HOM Intercomparison project.12 This test is a test from the ISMP - HOM Intercomparison project. 13 13 Pattyn and Payne 2006 14 14 """ … … 22 22 23 23 for L in L_list: 24 nx = 20 24 nx = 20 #numberof nodes in x direction 25 25 ny = 20 26 26 md = model() 27 27 md = squaremesh(md, L, L, nx, ny) 28 md = setmask(md, '', '') 28 md = setmask(md, '', '') #ice sheet test 29 29 md = parameterize(md, '../Par/ISMIPB.py') 30 30 md.extrude(10, 1.) … … 32 32 md = setflowequation(md, 'HO', 'all') 33 33 34 34 #Create dirichlet on the bed only 35 35 md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices)) 36 36 md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices)) … … 40 40 md.stressbalance.spcvy[pos] = 0. 41 41 42 42 #Create MPCs to have periodic boundary conditions 43 43 posx = np.where(md.mesh.x == 0.)[0] 44 44 posx2 = np.where(md.mesh.x == np.max(md.mesh.x))[0] 45 45 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] 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 47 47 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] 48 48 49 49 md.stressbalance.vertex_pairing = np.vstack((np.vstack((posx + 1, posx2 + 1)).T, np.vstack((posy + 1, posy2 + 1)).T)) 50 50 51 51 #Compute the stressbalance 52 52 md.cluster = generic('name', gethostname(), 'np', 8) 53 53 md = solve(md, 'Stressbalance') 54 54 55 55 #Plot the results and save them 56 56 vx = md.results.StressbalanceSolution.Vx 57 57 vy = md.results.StressbalanceSolution.Vy … … 61 61 maxvx.append(np.max(vx[md.mesh.numberofvertices2d:])) 62 62 63 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') 65 65 if printingflag: 66 66 pass 67 67 # set(gcf, 'Color', 'w') 68 68 # 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') 71 71 if printingflag: 72 72 pass 73 73 # set(gcf, 'Color', 'w') 74 74 # 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') 76 76 77 77 if (L == 5000.): 78 78 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', '') 81 81 elif (L == 10000.): 82 82 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', '') 85 85 elif (L == 20000.): 86 86 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', '') 89 89 elif (L == 40000.): 90 90 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', '') 93 93 elif (L == 80000.): 94 94 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', '') 97 97 elif (L == 160000.): 98 98 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', '') 101 101 if printingflag: 102 102 pass 103 103 # set(gcf, 'Color', 'w') 104 104 # 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') 106 106 107 107 #Now plot the min and max values of vx for each size of the square … … 111 111 # set(gcf, 'Color', 'w') 112 112 # 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') 114 114 #plot([5 10 20 40 80 160], maxvx)ylim([0 120])xlim([0 160]) 115 115 if printingflag: … … 117 117 # set(gcf, 'Color', 'w') 118 118 # 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') 120 120 121 121 #Fields and tolerances to track changes -
issm/trunk-jpl/test/NightlyRun/test1104.py
r23793 r24214 10 10 11 11 """ 12 This test is a test from the ISMP -HOM Intercomparison project.12 This test is a test from the ISMP - HOM Intercomparison project. 13 13 Pattyn and Payne 2006 14 14 """ … … 18 18 19 19 for L in L_list: 20 nx = 20 20 nx = 20 #numberof nodes in x direction 21 21 ny = 20 22 22 md = model() 23 23 md = squaremesh(md, L, L, nx, ny) 24 md = setmask(md, '', '') 24 md = setmask(md, '', '') #ice sheet test 25 25 md = parameterize(md, '../Par/ISMIPB.py') 26 26 md.extrude(10, 1.) 27 27 md = setflowequation(md, 'HO', 'all') 28 28 29 29 #Create dirichlet on the bed only 30 30 md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices)) 31 31 md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices)) … … 36 36 md.stressbalance.spcvy[pos] = 0. 37 37 38 38 #Create MPCs to have periodic boundary conditions 39 39 posx = np.where(md.mesh.x == 0.)[0] 40 40 posx2 = np.where(md.mesh.x == np.max(md.mesh.x))[0] 41 41 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] 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 43 43 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] 44 44 45 45 md.stressbalance.vertex_pairing = np.vstack((np.vstack((posx + 1, posx2 + 1)).T, np.vstack((posy + 1, posy2 + 1)).T)) 46 46 print(np.shape(md.stressbalance.vertex_pairing)) 47 47 #Compute the stressbalance 48 48 md.stressbalance.abstol = np.nan 49 49 md.cluster = generic('name', gethostname(), 'np', 8) … … 56 56 md = solve(md, 'Stressbalance') 57 57 58 58 #Plot the results and save them 59 59 vx = md.results.StressbalanceSolution.Vx 60 60 vy = md.results.StressbalanceSolution.Vy … … 62 62 results.append(md.results.StressbalanceSolution) 63 63 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) 65 65 66 66 #Fields and tolerances to track changes -
issm/trunk-jpl/test/NightlyRun/test1105.py
r23793 r24214 10 10 11 11 """ 12 This test is a test from the ISMP -HOM Intercomparison project.12 This test is a test from the ISMP - HOM Intercomparison project. 13 13 Pattyn and Payne 2006 14 14 """ … … 21 21 maxvx = [] 22 22 23 for L in L_list: 24 nx = 30 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 25 25 ny = 30 26 26 md = model() 27 27 md = squaremesh(md, L, L, nx, ny) 28 md = setmask(md, '', '') 28 md = setmask(md, '', '') #ice sheet test 29 29 md = parameterize(md, '../Par/ISMIPC.py') 30 30 md.extrude(10, 1.) … … 32 32 md = setflowequation(md, 'HO', 'all') 33 33 34 34 #Create MPCs to have periodic boundary conditions 35 35 md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices)) 36 36 md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices)) … … 40 40 posx2 = np.where(np.logical_and.reduce((md.mesh.x == L, md.mesh.y != 0., md.mesh.y != L)))[0] 41 41 42 posy = np.where(np.logical_and.reduce((md.mesh.y == 0., md.mesh.x != 0., md.mesh.x != L)))[0] 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 43 43 posy2 = np.where(np.logical_and.reduce((md.mesh.y == L, md.mesh.x != 0., md.mesh.x != L)))[0] 44 44 45 45 md.stressbalance.vertex_pairing = np.vstack((np.vstack((posx + 1, posx2 + 1)).T, np.vstack((posy + 1, posy2 + 1)).T)) 46 46 47 47 #Add spc on the corners 48 48 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))) 49 49 md.stressbalance.spcvx[pos] = 0. … … 51 51 if (L == 5000.): 52 52 md.stressbalance.spcvx[pos] = 15.66 53 md.stressbalance.spcvy[pos] = - 0.196753 md.stressbalance.spcvy[pos] = - 0.1967 54 54 elif (L == 10000.): 55 55 md.stressbalance.spcvx[pos] = 16.04 56 md.stressbalance.spcvy[pos] = - 0.197756 md.stressbalance.spcvy[pos] = - 0.1977 57 57 elif (L == 20000.): 58 58 md.stressbalance.spcvx[pos] = 16.53 59 md.stressbalance.spcvy[pos] = - 1.2759 md.stressbalance.spcvy[pos] = - 1.27 60 60 elif (L == 40000.): 61 61 md.stressbalance.spcvx[pos] = 17.23 62 md.stressbalance.spcvy[pos] = - 3.1762 md.stressbalance.spcvy[pos] = - 3.17 63 63 elif (L == 80000.): 64 64 md.stressbalance.spcvx[pos] = 16.68 65 md.stressbalance.spcvy[pos] = - 2.6965 md.stressbalance.spcvy[pos] = - 2.69 66 66 elif (L == 160000.): 67 67 md.stressbalance.spcvx[pos] = 16.03 68 md.stressbalance.spcvy[pos] = - 1.2768 md.stressbalance.spcvy[pos] = - 1.27 69 69 70 70 #Spc the bed at zero for vz 71 71 pos = np.where(md.mesh.vertexonbase) 72 72 md.stressbalance.spcvz[pos] = 0. 73 73 74 74 #Compute the stressbalance 75 75 md.cluster = generic('name', gethostname(), 'np', 8) 76 76 md = solve(md, 'Stressbalance') 77 77 78 78 #Plot the results and save them 79 79 vx = md.results.StressbalanceSolution.Vx 80 80 vy = md.results.StressbalanceSolution.Vy … … 84 84 maxvx.append(np.max(vx[-md.mesh.numberofvertices2d:])) 85 85 86 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) 88 88 if printingflag: 89 89 pass 90 90 # set(gcf, 'Color', 'w') 91 91 # 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) 94 94 if printingflag: 95 95 pass 96 96 # set(gcf, 'Color', 'w') 97 97 # 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) 100 100 if printingflag: 101 101 pass 102 102 # set(gcf, 'Color', 'w') 103 103 # 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') 105 105 106 106 if (L == 5000.): 107 107 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) 110 110 elif (L == 10000.): 111 111 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', '') 114 114 elif (L == 20000.): 115 115 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', '') 118 118 elif (L == 40000.): 119 119 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', '') 122 122 elif (L == 80000.): 123 123 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', '') 126 126 elif (L == 160000.): 127 127 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', '') 130 130 if printingflag: 131 131 pass 132 132 # set(gcf, 'Color', 'w') 133 133 # 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') 135 135 136 136 #Now plot the min and max values of vx for each size of the square … … 140 140 # set(gcf, 'Color', 'w') 141 141 # 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') 143 143 #plot([5 10 20 40 80 160], maxvx)ylim([0 200]) xlim([0 160]) 144 144 if printingflag: … … 146 146 # set(gcf, 'Color', 'w') 147 147 # 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') 149 149 150 150 #Fields and tolerances to track changes -
issm/trunk-jpl/test/NightlyRun/test1106.py
r23793 r24214 10 10 11 11 """ 12 This test is a test from the ISMP -HOM Intercomparison project.12 This test is a test from the ISMP - HOM Intercomparison project. 13 13 Pattyn and Payne 2006 14 14 """ 15 15 16 L_list = [80000 .]16 L_list = [80000] 17 17 results = [] 18 18 19 19 for L in L_list: 20 md = triangle(model(), "../Exp/Square_{}.exp".format(L), L / 10.) #size 3*L21 md = setmask(md, '', '') 20 md = triangle(model(), "../Exp/Square_{}.exp".format(L), L / 10.) #size 3 * L 21 md = setmask(md, '', '') #ice sheet test 22 22 md = parameterize(md, '../Par/ISMIPC.py') 23 23 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))) 24 24 md.extrude(10, 1.) 25 25 26 26 #Add spc on the borders 27 27 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)))) 28 28 md.stressbalance.spcvx[pos] = 0. … … 30 30 if (L == 5000.): 31 31 md.stressbalance.spcvx[pos] = 15.66 32 md.stressbalance.spcvy[pos] = - 0.196732 md.stressbalance.spcvy[pos] = - 0.1967 33 33 elif (L == 10000.): 34 34 md.stressbalance.spcvx[pos] = 16.04 35 md.stressbalance.spcvy[pos] = - 0.197735 md.stressbalance.spcvy[pos] = - 0.1977 36 36 elif (L == 20000.): 37 37 md.stressbalance.spcvx[pos] = 16.53 38 md.stressbalance.spcvy[pos] = - 1.2738 md.stressbalance.spcvy[pos] = - 1.27 39 39 elif (L == 40000.): 40 40 md.stressbalance.spcvx[pos] = 17.23 41 md.stressbalance.spcvy[pos] = - 3.1741 md.stressbalance.spcvy[pos] = - 3.17 42 42 elif (L == 80000.): 43 43 md.stressbalance.spcvx[pos] = 16.68 44 md.stressbalance.spcvy[pos] = - 2.6944 md.stressbalance.spcvy[pos] = - 2.69 45 45 elif (L == 160000.): 46 46 md.stressbalance.spcvx[pos] = 16.03 47 md.stressbalance.spcvy[pos] = - 1.2747 md.stressbalance.spcvy[pos] = - 1.27 48 48 49 49 md = setflowequation(md, 'FS', 'all') 50 50 51 51 #Compute the stressbalance 52 52 md.cluster = generic('name', gethostname(), 'np', 8) 53 53 md = solve(md, 'Stressbalance') 54 54 55 55 #Plot the results and save them 56 56 vx = md.results.StressbalanceSolution.Vx 57 57 vy = md.results.StressbalanceSolution.Vy … … 59 59 results.append(md.results.StressbalanceSolution) 60 60 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) 62 62 63 63 #Fields and tolerances to track changes -
issm/trunk-jpl/test/NightlyRun/test1107.py
r23793 r24214 10 10 11 11 """ 12 This test is a test from the ISMP -HOM Intercomparison project.12 This test is a test from the ISMP - HOM Intercomparison project. 13 13 Pattyn and Payne 2006 14 14 """ … … 22 22 23 23 for L in L_list: 24 nx = 30 24 nx = 30 #numberof nodes in x direction 25 25 ny = 30 26 26 md = model() 27 27 md = squaremesh(md, L, L, nx, ny) 28 md = setmask(md, '', '') 28 md = setmask(md, '', '') #ice sheet test 29 29 md = parameterize(md, '../Par/ISMIPD.py') 30 30 md.extrude(10, 1.) … … 32 32 md = setflowequation(md, 'HO', 'all') 33 33 34 34 #We need one grd on dirichlet: the 4 corners are set to zero 35 35 md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices)) 36 36 md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices)) 37 37 md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices)) 38 38 39 39 #Create MPCs to have periodic boundary conditions 40 40 # posx = find(md.mesh.x = 0. & ~(md.mesh.y = 0. & md.mesh.vertexonbase) & ~(md.mesh.y = L & md.mesh.vertexonbase)) 41 41 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] … … 43 43 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] 44 44 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] 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 46 46 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] 47 47 48 48 md.stressbalance.vertex_pairing = np.vstack((np.vstack((posx + 1, posx2 + 1)).T, np.vstack((posy + 1, posy2 + 1)).T)) 49 49 50 50 #Add spc on the corners 51 51 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))) 52 52 md.stressbalance.spcvy[:] = 0. … … 65 65 md.stressbalance.spcvx[pos] = 16.91 66 66 67 67 #Spc the bed at zero for vz 68 68 pos = np.where(md.mesh.vertexonbase) 69 69 md.stressbalance.spcvz[pos] = 0. 70 70 71 71 #Compute the stressbalance 72 72 md.cluster = generic('name', gethostname(), 'np', 8) 73 73 md = solve(md, 'Stressbalance') 74 74 75 75 #Plot the results and save them 76 76 vx = md.results.StressbalanceSolution.Vx 77 77 vy = md.results.StressbalanceSolution.Vy … … 81 81 maxvx.append(np.max(vx[-md.mesh.numberofvertices2d:])) 82 82 83 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) 85 85 if printingflag: 86 86 pass 87 87 # set(gcf, 'Color', 'w') 88 88 # 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) 91 91 if printingflag: 92 92 pass 93 93 # set(gcf, 'Color', 'w') 94 94 # 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') 96 96 97 97 if (L == 5000.): 98 98 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) 101 101 elif (L == 10000.): 102 102 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) 105 105 elif (L == 20000.): 106 106 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) 109 109 elif (L == 40000.): 110 110 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) 113 113 elif (L == 80000.): 114 114 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) 117 117 elif (L == 160000.): 118 118 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) 121 121 if printingflag: 122 122 pass 123 123 # set(gcf, 'Color', 'w') 124 124 # 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') 126 126 127 127 #Now plot the min and max values of vx for each size of the square … … 131 131 # set(gcf, 'Color', 'w') 132 132 # 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') 134 134 #plot([5 10 20 40 80 160], maxvx)ylim([0 300])xlim([0 160]) 135 135 if printingflag: … … 137 137 # set(gcf, 'Color', 'w') 138 138 # 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') 140 140 141 141 #Fields and tolerances to track changes -
issm/trunk-jpl/test/NightlyRun/test1108.py
r23793 r24214 13 13 14 14 """ 15 This test is a test from the ISMP -HOM Intercomparison project.15 This test is a test from the ISMP - HOM Intercomparison project. 16 16 Pattyn and Payne 2006 17 17 """ … … 22 22 23 23 for L in L_list: 24 nx = 30 24 nx = 30 #numberof nodes in x direction 25 25 ny = 30 26 26 md = model() 27 27 md = squaremesh(md, L, L, nx, ny) 28 md = setmask(md, '', '') 28 md = setmask(md, '', '') #ice sheet test 29 29 md = parameterize(md, '../Par/ISMIPD.py') 30 30 md.extrude(10, 1.) … … 32 32 md = setflowequation(md, 'HO', 'all') 33 33 34 34 #We need one grd on dirichlet: the 4 corners are set to zero 35 35 md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices)) 36 36 md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices)) … … 48 48 md.stressbalance.spcvz[pos] = 0. 49 49 50 50 #Create MPCs to have periodic boundary conditions 51 51 posx = np.nonzero(md.mesh.x == 0.)[0] 52 52 posx2 = np.nonzero(md.mesh.x == np.max(md.mesh.x))[0] 53 53 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] 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 55 55 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] 56 56 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)))) 58 58 59 59 #Compute the stressbalance 60 60 md.cluster = generic('name', gethostname(), 'np', 8) 61 61 md.verbose = verbose('convergence', True) … … 64 64 md.stressbalance.abstol = np.nan 65 65 md.stressbalance.vertex_pairing = np.empty((0, 2)) 66 66 #We need one grid on dirichlet: the 4 corners are set to zero 67 67 md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices)) 68 68 md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices)) 69 69 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 times71 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]) 73 73 md = setflowequation(md, 'FS', 'all') 74 74 md = solve(md, 'Stressbalance') 75 75 76 76 #Plot the results and save them 77 77 vx = md.results.StressbalanceSolution.Vx 78 78 vy = md.results.StressbalanceSolution.Vy … … 80 80 results.append(md.results.StressbalanceSolution) 81 81 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) 83 83 84 84 #Fields and tolerances to track changes -
issm/trunk-jpl/test/NightlyRun/test1109.py
r23793 r24214 10 10 from squaremesh import * 11 11 12 #This test is a test from the ISMP -HOM Intercomparison project.12 #This test is a test from the ISMP - HOM Intercomparison project. 13 13 #TestE 14 14 #Four tests to run: - Pattyn frozen 15 # 16 # 17 # 15 # - Stokes frozen 16 # - Pattyn with some sliding 17 # - Stokes with some sliding 18 18 printingflag = False 19 19 results = [] … … 35 35 md = setflowequation(md, 'FS', 'all') 36 36 37 37 #Create MPCs to have periodic boundary conditions 38 38 posx = np.where(md.mesh.x == 0.)[0] 39 39 posx2 = np.where(md.mesh.x == max(md.mesh.x))[0] 40 40 md.stressbalance.vertex_pairing = np.column_stack((posx, posx2)) 41 41 42 42 #Create spcs on the bed 43 43 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, )) 47 47 md.stressbalance.spcvx[pos] = 0. 48 48 md.stressbalance.spcvy[pos] = 0. 49 49 md.stressbalance.spcvz[pos] = 0. 50 50 51 51 #Remove the spc where there is some sliding (case 3 and 4): 52 52 if i == 2 or i == 3: 53 53 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] … … 56 56 md.stressbalance.spcvz[pos] = float('NaN') 57 57 58 58 #Compute the stressbalance 59 59 md.cluster = generic('name', gethostname(), 'np', 8) 60 60 md = solve(md, 'Stressbalance') -
issm/trunk-jpl/test/NightlyRun/test1110.py
r23793 r24214 10 10 from squaremesh import * 11 11 12 #This test is a test from the ISMP -HOM Intercomparison project.12 #This test is a test from the ISMP - HOM Intercomparison project. 13 13 #TestF 14 14 printingflag = False … … 16 16 17 17 for i in range(4): 18 L = =100000. #in m18 L = 100000. #in m 19 19 nx = 30 #numberof nodes in x direction 20 20 ny = 30 21 21 md = model() 22 22 md = squaremesh(md, L, L, nx, ny) 23 # md = triangle(md, '../Exp/SquareISMIP.exp', 5500.)23 # md = triangle(md, '../Exp/SquareISMIP.exp', 5500.) 24 24 md = setmask(md, '', '') #ice sheet test 25 25 md = parameterize(md, '../Par/ISMIPF.py') … … 31 31 md = setflowequation(md, 'FS', 'all') 32 32 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, )) 36 36 if (i == 0 or i == 2): 37 37 #Create dirichlet on the bed if no slip … … 83 83 'title', '', 84 84 'xlabel', '', 85 'ylabel', 'Velocity (m /yr)',85 'ylabel', 'Velocity (m / yr)', 86 86 'linewidth', 3, 87 87 'grid', 'on', … … 94 94 'title', '', 95 95 'xlabel', '', 96 'ylabel', 'Velocity (m /yr)',96 'ylabel', 'Velocity (m / yr)', 97 97 'linewidth', 3, 98 98 'grid', 'on', … … 115 115 #system(['mv ismipfFSvxsliding.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF']) 116 116 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]) 118 127 if printingflag: 119 128 #set(gcf, 'Color', 'w') -
issm/trunk-jpl/test/NightlyRun/test119.py
r23793 r24214 12 12 13 13 #hVertices 14 md = bamg(model(), 'domain', '../Exp/Square.exp', 'hmax', 300000., 'hVertices', np.array([10000., 100000., 400000., 100000.]).reshape(- 1, 1))14 md = bamg(model(), 'domain', '../Exp/Square.exp', 'hmax', 300000., 'hVertices', np.array([10000., 100000., 400000., 100000.]).reshape(- 1, 1)) 15 15 x2 = md.mesh.x 16 16 y2 = md.mesh.y -
issm/trunk-jpl/test/NightlyRun/test1201.py
r23793 r24214 28 28 print(" initial velocity") 29 29 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)) 31 31 32 32 #Stabilization 33 33 if stabilization == 2: 34 34 md.masstransport.stabilization = 0 … … 36 36 md.masstransport.stabilization = stabilization 37 37 38 38 #spc thickness 39 39 pos = np.where(md.mesh.y > 199999.9)[0] 40 40 times = np.arange(0, 501) … … 44 44 if stabilization == 3: 45 45 pos = np.nonzero(np.isnan(md.masstransport.spcthickness)) 46 md.masstransport.spcthickness[pos] = 500. 46 md.masstransport.spcthickness[pos] = 500. #No NaN for DG 47 47 48 48 #solve 49 49 md.transient.isstressbalance = False 50 md.settings.output_frequency = 500 50 md.settings.output_frequency = 500 #keep only last step 51 51 md.verbose = verbose() 52 52 md = solve(md, 'Transient') … … 54 54 55 55 #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.) 60 60 #plot(s, h1, 'r', s, h2, 'b', s, h3, 'g', s, hth, 'k') 61 61 #legend('Art. diff.', 'No Art. diff.', 'D.G.', 'Theoretical') -
issm/trunk-jpl/test/NightlyRun/test1202.py
r23793 r24214 20 20 md = setmask(md, 'all', '') 21 21 md = parameterize(md, '../Par/SquareEISMINT.py') 22 md = setflowequation(md, 'SSA', 'all') 22 md = setflowequation(md, 'SSA', 'all') #SSA's model and 2d 23 23 24 24 #Compute solution for SSA's model … … 30 30 vy = md.results.StressbalanceSolution.Vy 31 31 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}, ... 33 33 # 'contourcolor', 'k') 34 34 if printingflag: … … 38 38 # system(['mv eismintdiag1vx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf ']) 39 39 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}, ... 41 41 # 'contourcolor', 'k') 42 42 if printingflag: -
issm/trunk-jpl/test/NightlyRun/test1203.py
r23793 r24214 19 19 #test 5 and 6: 20 20 md = model() 21 md = triangle(md, '../Exp/SquareEISMINT.exp', 5100.) 21 md = triangle(md, '../Exp/SquareEISMINT.exp', 5100.) #test3 22 22 md = setmask(md, 'all', '') 23 23 md = parameterize(md, '../Par/SquareEISMINT.py') 24 md = setflowequation(md, 'SSA', 'all') 24 md = setflowequation(md, 'SSA', 'all') #SSA's model and 2d 25 25 26 26 #Impose a non zero velocity on the upper boundary condition (y = max(y)) … … 38 38 39 39 #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}, ... 41 41 # 'contourcolor', 'k') 42 42 if printingflag: … … 45 45 # printmodel('eismintdiag2vx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 2, 'hardcopy', 'off') 46 46 # 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}, ... 48 48 # 'contourcolor', 'k') 49 49 if printingflag: -
issm/trunk-jpl/test/NightlyRun/test1204.py
r23793 r24214 22 22 md = setmask(md, 'all', '') 23 23 md = parameterize(md, '../Par/SquareEISMINT.py') 24 md = setflowequation(md, 'SSA', 'all') 24 md = setflowequation(md, 'SSA', 'all') #SSA's model and 2d 25 25 26 26 #Impose a non zero velocity on the upper boundary condition (y = max(y)) … … 43 43 md = solve(md, 'Transient') 44 44 45 #plotmodel(md, 'data', (md.results.TransientSolution(end).Vx))45 #plotmodel(md, 'data', (md.results.TransientSolution(end).Vx)) 46 46 if printingflag: 47 47 pass … … 50 50 # system(['mv eisminttrans2vx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf ']) 51 51 52 #plotmodel(md, 'data', (md.results.TransientSolution(end).Vy))52 #plotmodel(md, 'data', (md.results.TransientSolution(end).Vy)) 53 53 if printingflag: 54 54 pass … … 57 57 # system(['mv eisminttrans2vy.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf ']) 58 58 59 #plotmodel(md, 'data', (md.results.TransientSolution(end).Thickness))59 #plotmodel(md, 'data', (md.results.TransientSolution(end).Thickness)) 60 60 if printingflag: 61 61 pass -
issm/trunk-jpl/test/NightlyRun/test1205.py
r23793 r24214 22 22 md = model() 23 23 md = roundmesh(md, 750000., resolution) 24 md = setmask(md, '', '') 24 md = setmask(md, '', '') #We can not test iceshelves nor ice rises with this analytical solution 25 25 md = parameterize(md, '../Par/RoundSheetStaticEISMINT.py') 26 26 27 27 #Calculation of the analytical 2d velocity field 28 28 constant = 0.3 29 vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**- 130 vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**- 129 vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**- 1 30 vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**- 1 31 31 vel_obs = np.sqrt((md.inversion.vx_obs)**2 + (md.inversion.vy_obs)**2) 32 32 … … 58 58 #Plot of the velocity from the exact and calculated solutions 59 59 #figure(1) 60 #set(gcf, 'Position', [1 1 1580 1150])60 #set(gcf, 'Position', [1 1 1580 1150]) 61 61 #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', ... 63 63 #vel, 'FaceColor', 'interp', 'EdgeColor', 'none') 64 64 #title('Modelled velocity', 'FontSize', 14, 'FontWeight', 'bold') … … 67 67 68 68 #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', ... 70 70 #vel_obs, 'FaceColor', 'interp', 'EdgeColor', 'none') 71 71 #title('Analytical velocity', 'FontSize', 14, 'FontWeight', 'bold') … … 75 75 #subplot(2, 2, 3) 76 76 #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.') 79 79 #title('Analytical vs calculated velocity', 'FontSize', 14, 'FontWeight', 'bold') 80 80 #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') 82 82 #legend('calculated velocity', 'exact velocity') 83 83 #axis([0 750000 0 200]) … … 85 85 86 86 #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') 89 89 #title('Relative misfit [%]', 'FontSize', 14, 'FontWeight', 'bold') 90 90 #colorbar -
issm/trunk-jpl/test/NightlyRun/test1206.py
r23793 r24214 22 22 md = model() 23 23 md = roundmesh(md, 750000., resolution) 24 md = setmask(md, '', '') 24 md = setmask(md, '', '') #We can not test iceshelves nor ice rises with this analytical solution 25 25 md = parameterize(md, '../Par/RoundSheetStaticEISMINT.py') 26 26 27 27 #Calculation of the analytical 2d velocity field 28 28 constant = 0.3 29 vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**- 130 vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**- 129 vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**- 1 30 vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**- 1 31 31 vel_obs = np.sqrt((md.inversion.vx_obs)**2 + (md.inversion.vy_obs)**2) 32 32 … … 59 59 #figure(1) 60 60 #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', ... 62 62 #vel, 'FaceColor', 'interp', 'EdgeColor', 'none') 63 63 #title('Modelled velocity', 'FontSize', 14, 'FontWeight', 'bold') … … 66 66 67 67 #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', ... 69 69 #vel_obs, 'FaceColor', 'interp', 'EdgeColor', 'none') 70 70 #title('Analytical velocity', 'FontSize', 14, 'FontWeight', 'bold') … … 74 74 #subplot(2, 2, 3) 75 75 #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.') 78 78 #title('Analytical vs calculated velocity', 'FontSize', 14, 'FontWeight', 'bold') 79 79 #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') 81 81 #legend('calculated velocity', 'exact velocity') 82 82 #axis([0 750000 0 200]) … … 84 84 85 85 #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') 88 88 #title('Relative misfit [%]', 'FontSize', 14, 'FontWeight', 'bold') 89 89 #colorbar -
issm/trunk-jpl/test/NightlyRun/test1207.py
r23793 r24214 22 22 md = model() 23 23 md = roundmesh(md, 750000., resolution) 24 md = setmask(md, '', '') 24 md = setmask(md, '', '') #We can not test iceshelves nor ice rises with this analytical solution 25 25 md = parameterize(md, '../Par/RoundSheetStaticEISMINT.py') 26 26 27 27 #Calculation of the analytical 2d velocity field 28 28 constant = 0.3 29 vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**- 130 vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**- 129 vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**- 1 30 vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**- 1 31 31 vel_obs = np.sqrt((md.inversion.vx_obs)**2 + (md.inversion.vy_obs)**2) 32 32 … … 59 59 #figure(1) 60 60 #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', ... 62 62 #vel, 'FaceColor', 'interp', 'EdgeColor', 'none') 63 63 #title('Modelled velocity', 'FontSize', 14, 'FontWeight', 'bold') … … 66 66 67 67 #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', ... 69 69 #vel_obs, 'FaceColor', 'interp', 'EdgeColor', 'none') 70 70 #title('Analytical velocity', 'FontSize', 14, 'FontWeight', 'bold') … … 74 74 #subplot(2, 2, 3) 75 75 #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.') 78 78 #title('Analytical vs calculated velocity', 'FontSize', 14, 'FontWeight', 'bold') 79 79 #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') 81 81 #legend('calculated velocity', 'exact velocity') 82 82 #axis([0 750000 0 200]) … … 84 84 85 85 #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') 88 88 #title('Relative misfit [%]', 'FontSize', 14, 'FontWeight', 'bold') 89 89 #colorbar -
issm/trunk-jpl/test/NightlyRun/test1301.py
r23793 r24214 36 36 #analytical results 37 37 #melting heat = geothermal flux 38 #Mb *L*rho = G => Mb = G/L*rho38 #Mb * L * rho = G = > Mb = G / L * rho 39 39 melting = md.basalforcings.geothermalflux / (md.materials.rho_ice * md.materials.latentheat) * md.constants.yts 40 40 … … 47 47 relative = np.abs((comp_melting - melting) / melting) * 100. 48 48 relative[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') 52 52 if printingflag: 53 53 pass -
issm/trunk-jpl/test/NightlyRun/test1302.py
r23793 r24214 11 11 12 12 """ 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 temperature13 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 15 15 at upper surface and an impose flux at its base. 16 16 """ … … 22 22 md = setmask(md, '', '') 23 23 md = 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%)24 md.extrude(30, 1.) #NB: the more one extrudes, the better (10 - > relative~0.35%, 20 - > 0.1%, 30 - > 0.05%) 25 25 md = setflowequation(md, 'HO', 'all') 26 26 … … 36 36 md.thermal.stabilization = 2 37 37 #analytical results 38 #d2T /dz2-w*rho_ice*c/k*dT/dz = 0 T(surface)=0 T(bed)=10 => T = A exp(alpha z)+B39 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/an40 A = 10. / (np.exp(alpha * (- 1000.)) - 1.) #A = T(bed)/(exp(alpha*bed)-1) with bed=-1000 T(bed)=1041 B = - A38 #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 42 42 md.initialization.temperature = A * np.exp(alpha * md.mesh.z) + B 43 43 … … 50 50 relative = np.abs((comp_temp - md.initialization.temperature) / md.initialization.temperature) * 100. 51 51 relative[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) 56 56 if printingflag: 57 57 pass -
issm/trunk-jpl/test/NightlyRun/test1303.py
r23793 r24214 34 34 35 35 #analytical results 36 #d2T /dz2 = 0 T(bed)=10 T(surface)=0 => T = 0*(z-bed)/thickness+10*(surface-z)/thickness36 #d2T / dz2 = 0 T(bed)=10 T(surface)=0 = > T = 0 * (z - bed) / thickness + 10 * (surface-z) / thickness 37 37 #each layer of the 3d mesh must have a constant value 38 38 md.initialization.temperature = 10. * (md.geometry.surface - md.mesh.z) / md.geometry.thickness … … 46 46 relative = np.abs((comp_temp - md.initialization.temperature) / md.initialization.temperature) * 100. 47 47 relative[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) 52 52 if printingflag: 53 53 pass -
issm/trunk-jpl/test/NightlyRun/test1304.py
r23793 r24214 29 29 md.thermal.spctemperature[md.mesh.elements[pos2, 3:6] - 1] = 0. 30 30 md.initialization.pressure = np.zeros((md.mesh.numberofvertices), int) 31 md.basalforcings.geothermalflux[:] = 0.1 #100mW/m^231 md.basalforcings.geothermalflux[:] = 0.1 #100mW / m^2 32 32 33 33 #analytical results 34 34 #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/m235 #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 37 37 38 38 #modeled results … … 44 44 relative = np.abs((comp_temp - md.initialization.temperature) / md.initialization.temperature) * 100. 45 45 relative[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) 50 50 if printingflag: 51 51 pass -
issm/trunk-jpl/test/NightlyRun/test1501.py
r23793 r24214 23 23 md.timestepping.final_time = 2000. 24 24 25 #Solve for thinning rate -> -1 * surface mass balance25 #Solve for thinning rate-> - 1 * surface mass balance 26 26 smb = 2. * np.ones((md.mesh.numberofvertices)) 27 27 md.smb.mass_balance = smb … … 37 37 smb = md.smb.mass_balance 38 38 39 #tooth= [ [ones(400, 1) *(smb') - 10.]' [ones(400, 1)*(smb')]' ]39 #tooth= [ [ones(400, 1) * (smb') - 10.]' [ones(400, 1) * (smb')]' ] 40 40 tooth = 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] 42 42 smb = np.hstack((np.tile(smb, (1, 399)), smb, tooth, tooth)) 43 43 44 44 #md.smb.mass_balance= smb 45 #md.smb.mass_balance(end +1,:)=[1.:2000.]45 #md.smb.mass_balance(end + 1, :) = [1.:2000.] 46 46 md.smb.mass_balance = np.vstack((smb, np.arange(1, 2001))) 47 47 … … 112 112 x1 = md.mesh.x(index(:)) x2 = md.mesh.x(index(:, 2)) x3 = md.mesh.x(index(:, 3)) 113 113 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))) 115 115 116 116 thickness = [] … … 120 120 for t = starttime:endtime 121 121 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] 123 123 massbal = [massbal (md.results.TransientSolution(t).SmbMassBalance)] 124 124 velocity = [velocity (md.results.TransientSolution(t).Vel)] … … 135 135 for i = ts 136 136 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]) 139 139 field = 'Thickness' 140 140 141 141 %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'] 146 146 plot_unit(x, y, z, elements, data, is2d, isplanet, datatype, options) 147 147 options = changefieldvalue(options, 'title', titlestring) 148 148 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]) 154 154 field = 'Vel' 155 155 156 156 %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'] 161 161 plot_unit(x, y, z, elements, data, is2d, isplanet, datatype, options) 162 162 options = changefieldvalue(options, 'title', titlestring) 163 163 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) 166 166 167 167 subplot(5, 4, 1:4) 168 168 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]) 170 170 plot(starttime:endtime, mean(massbal), 'k', 'LineWidth', 4) 171 171 hold on … … 178 178 subplot(5, 4, 5:8) 179 179 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) 182 182 hold on 183 183 ya = ylim … … 189 189 subplot(5, 4, 9:12) 190 190 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) 193 193 hold on 194 194 ya = ylim … … 203 203 %initialize images and frame 204 204 frame = getframe(gcf) 205 [images, map] =rgb2ind(frame.cdata, 256, 'nodither')205 [images, map] = rgb2ind(frame.cdata, 256, 'nodither') 206 206 images(1, 1, 1, length(ts))=0 207 207 else 208 208 frame = getframe(gcf) 209 images(:, :, 1, count) = rgb2ind(frame.cdata, map, 'nodither')209 images(:, :, 1, count) = rgb2ind(frame.cdata, map, 'nodither') 210 210 end 211 211 212 count = count +1212 count = count + 1 213 213 214 214 end 215 215 216 filename ='transawtooth2d.gif'216 filename = 'transawtooth2d.gif' 217 217 imwrite(images, map, filename, 'DelayTime', 1.0, 'LoopCount', inf) 218 218 """ -
issm/trunk-jpl/test/NightlyRun/test1502.py
r23793 r24214 24 24 md.timestepping.final_time = 2000. 25 25 26 #Solve for thinning rate -> -1 * surface mass balance26 #Solve for thinning rate-> - 1 * surface mass balance 27 27 smb = 2. * np.ones((md.mesh.numberofvertices)) 28 28 md.smb.mass_balance = smb … … 38 38 smb = md.smb.mass_balance 39 39 40 #tooth= [ [ones(400, 1) *(smb') - 10.]' [ones(400, 1)*(smb')]' ]40 #tooth= [ [ones(400, 1) * (smb') - 10.]' [ones(400, 1) * (smb')]' ] 41 41 tooth = 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] 43 43 smb = np.hstack((np.tile(smb, (1, 399)), smb, tooth, tooth)) 44 44 45 45 #md.smb.mass_balance= smb 46 #md.smb.mass_balance(end +1,:)=[1.:2000.]46 #md.smb.mass_balance(end + 1, :) = [1.:2000.] 47 47 md.smb.mass_balance = np.vstack((smb, np.arange(1, 2001))) 48 48 … … 118 118 x1 = md.mesh.x(index(:)) x2 = md.mesh.x(index(:, 2)) x3 = md.mesh.x(index(:, 3)) 119 119 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))) 121 121 122 122 thickness = [] … … 126 126 for t = starttime:endtime 127 127 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] 129 129 massbal = [massbal (md.results.TransientSolution(t).SmbMassBalance)] 130 130 velocity = [velocity (md.results.TransientSolution(t).Vel)] … … 142 142 for i = ts 143 143 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]) 146 146 field = 'Thickness' 147 147 148 148 %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'] 153 153 plot_unit(x, y, z, elements, data, is2d, isplanet, datatype, options) 154 154 options = changefieldvalue(options, 'title', titlestring) 155 155 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]) 161 161 field = 'Vel' 162 162 163 163 %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'] 168 168 plot_unit(x, y, z, elements, data, is2d, isplanet, datatype, options) 169 169 options = changefieldvalue(options, 'title', titlestring) 170 170 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) 173 173 174 174 subplot(5, 4, 1:4) 175 175 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]) 177 177 plot(starttime:endtime, mean(massbal), 'k', 'LineWidth', 4) 178 178 hold on … … 185 185 subplot(5, 4, 5:8) 186 186 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) 189 189 hold on 190 190 ya = ylim … … 196 196 subplot(5, 4, 9:12) 197 197 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) 200 200 hold on 201 201 ya = ylim … … 210 210 %initialize images and frame 211 211 frame = getframe(gcf) 212 [images, map] =rgb2ind(frame.cdata, 256, 'nodither')212 [images, map] = rgb2ind(frame.cdata, 256, 'nodither') 213 213 images(1, 1, 1, length(ts))=0 214 214 else 215 215 frame = getframe(gcf) 216 images(:, :, 1, count) = rgb2ind(frame.cdata, map, 'nodither')216 images(:, :, 1, count) = rgb2ind(frame.cdata, map, 'nodither') 217 217 end 218 218 219 count = count +1219 count = count + 1 220 220 221 221 end 222 222 223 filename ='transawtooth3d.gif'223 filename = 'transawtooth3d.gif' 224 224 imwrite(images, map, filename, 'DelayTime', 1.0, 'LoopCount', inf) 225 225 """ -
issm/trunk-jpl/test/NightlyRun/test1601.py
r23793 r24214 34 34 md = solve(md, 'Stressbalance') 35 35 vel1 = 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') 37 37 print("Error between Cartesian and rotated CS: {}".format(np.max(np.abs(vel0 - vel1)) / (np.max(np.abs(vel0)) + sys.float_info.epsilon))) 38 38 … … 45 45 vel2 = md.results.StressbalanceSolution.Vel 46 46 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') 48 48 print("Error between Cartesian and rotated CS: {}".format(np.max(np.abs(vel0 - vel2)) / (np.max(np.abs(vel0)) + sys.float_info.epsilon))) 49 49 -
issm/trunk-jpl/test/NightlyRun/test1602.py
r23793 r24214 36 36 vel1 = md.results.StressbalanceSolution.Vel 37 37 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) 39 39 print("Error between Cartesian and rotated CS: {}".format(np.max(np.abs(vel0 - vel1)) / (np.max(np.abs(vel0)) + sys.float_info.epsilon))) 40 40 -
issm/trunk-jpl/test/NightlyRun/test2001.py
r23793 r24214 17 17 18 18 #Indicate what you want to compute 19 md.gia.cross_section_shape = 1 # for square-edged x-section19 md.gia.cross_section_shape = 1 # for square-edged x - section 20 20 21 21 #Define loading history (see test2001.m for the description) -
issm/trunk-jpl/test/NightlyRun/test2002.py
r23793 r24214 23 23 late = np.sum(md.mesh.lat[md.mesh.elements - 1], axis=1) / 3 24 24 longe = np.sum(md.mesh.long[md.mesh.elements - 1], axis=1) / 3 25 pos = np.where(late < - 80)26 md.slr.deltathickness[pos] = - 10025 pos = np.where(late < - 80) 26 md.slr.deltathickness[pos] = - 100 27 27 #greenland 28 pos = np.where(np.logical_and.reduce((late > 70, late < 80, longe > - 60, longe < -30)))29 md.slr.deltathickness[pos] = - 10028 pos = np.where(np.logical_and.reduce((late > 70, late < 80, longe > - 60, longe < - 30))) 29 md.slr.deltathickness[pos] = - 100 30 30 31 31 #elastic loading from love numbers: … … 41 41 icemask = np.ones((md.mesh.numberofvertices)) 42 42 pos = np.where(mask == 0)[0] 43 icemask[pos] = - 143 icemask[pos] = - 1 44 44 pos = np.where(np.sum(mask[md.mesh.elements.astype(int) - 1], axis=1) < 3)[0] 45 icemask[md.mesh.elements[pos, :].astype(int) - 1] = - 145 icemask[md.mesh.elements[pos, :].astype(int) - 1] = - 1 46 46 md.mask.ice_levelset = icemask 47 47 md.mask.ocean_levelset = np.zeros((md.mesh.numberofvertices)) … … 51 51 #make sure that the ice level set is all inclusive: 52 52 md.mask.land_levelset = np.zeros((md.mesh.numberofvertices)) 53 md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices))53 md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices)) 54 54 55 55 #make sure that the elements that have loads are fully grounded: … … 58 58 59 59 #make sure wherever there is an ice load, that the mask is set to ice: 60 icemask[md.mesh.elements[pos, :] - 1] = - 160 icemask[md.mesh.elements[pos, :] - 1] = - 1 61 61 md.mask.ice_levelset = icemask 62 62 … … 76 76 77 77 #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, ))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, )) 81 81 82 82 #Miscellaneous -
issm/trunk-jpl/test/NightlyRun/test2003.py
r23793 r24214 16 16 #parameterize slr solution: 17 17 #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, ))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, )) 21 21 22 22 #antarctica 23 23 #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 rows24 # - 1 to convert to base 0 indexing, 1 (not 2, in matlab) to sum over rows 25 25 late = sum(md.mesh.lat[md.mesh.elements - 1], 1) / 3 26 26 longe = 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] = - 127 pos = np.intersect1d(np.array(np.where(late < - 75)), np.array(np.where(longe < 0))) 28 md.slr.deltathickness[pos] = - 1 29 29 30 30 #elastic loading from love numbers: … … 42 42 mask = gmtmask(md.mesh.lat, md.mesh.long) 43 43 44 icemask = np.ones((md.mesh.numberofvertices, ))44 icemask = np.ones((md.mesh.numberofvertices, )) 45 45 pos = 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 0s47 icemask[pos[0]] = - 146 #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 48 48 pos = np.where(sum(mask[md.mesh.elements - 1], 1) < 3) 49 icemask[md.mesh.elements[pos, :] - 1] = - 149 icemask[md.mesh.elements[pos, :] - 1] = - 1 50 50 md.mask.ice_levelset = icemask 51 md.mask.ocean_levelset = np.zeros((md.mesh.numberofvertices, ))51 md.mask.ocean_levelset = np.zeros((md.mesh.numberofvertices, )) 52 52 pos = np.where(md.mask.ice_levelset == 1) 53 53 md.mask.ocean_levelset[pos] = 1 54 54 55 55 #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,))56 md.mask.land_levelset = np.zeros((md.mesh.numberofvertices, )) 57 md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices, )) 58 58 59 59 #make sure that the elements that have loads are fully grounded: … … 62 62 63 63 #make sure wherever there is an ice load, that the mask is set to ice: 64 icemask[md.mesh.elements[pos, :] - 1] = - 164 icemask[md.mesh.elements[pos, :] - 1] = - 1 65 65 md.mask.ice_levelset = icemask 66 66 # }}} … … 71 71 #geometry 72 72 di = 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, ))73 md.geometry.thickness = np.ones((md.mesh.numberofvertices, )) 74 md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, )) 75 75 md.geometry.base = md.geometry.surface - md.geometry.thickness 76 76 md.geometry.bed = md.geometry.base 77 77 78 78 #materials 79 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))79 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, )) 80 80 md.materials.rheology_B = paterson(md.initialization.temperature) 81 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))81 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, )) 82 82 83 83 #Miscellaneous … … 85 85 86 86 #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, ))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, )) 90 90 91 91 #Solution parameters -
issm/trunk-jpl/test/NightlyRun/test2010.py
r23793 r24214 20 20 longe = sum(md.mesh.long[md.mesh.elements - 1], 1) / 3 21 21 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]] = - 122 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 26 26 27 md.slr.sealevel = np.zeros((md.mesh.numberofvertices, ))28 md.slr.steric_rate = np.zeros((md.mesh.numberofvertices, ))27 md.slr.sealevel = np.zeros((md.mesh.numberofvertices, )) 28 md.slr.steric_rate = np.zeros((md.mesh.numberofvertices, )) 29 29 md.slr.ocean_area_scaling = 1 30 30 … … 43 43 mask = gmtmask(md.mesh.lat, md.mesh.long) 44 44 45 icemask = np.ones((md.mesh.numberofvertices, ))45 icemask = np.ones((md.mesh.numberofvertices, )) 46 46 pos = np.where(mask == 0) 47 icemask[pos[0]] = - 147 icemask[pos[0]] = - 1 48 48 pos = np.where(sum(mask[md.mesh.elements - 1], 1) < 3) 49 icemask[md.mesh.elements[pos, :] - 1] = - 149 icemask[md.mesh.elements[pos, :] - 1] = - 1 50 50 md.mask.ice_levelset = icemask 51 md.mask.ocean_levelset = np.zeros((md.mesh.numberofvertices, ))51 md.mask.ocean_levelset = np.zeros((md.mesh.numberofvertices, )) 52 52 pos = np.where(md.mask.ice_levelset == 1) 53 53 md.mask.ocean_levelset[pos] = 1 54 54 55 55 #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,))56 md.mask.land_levelset = np.zeros((md.mesh.numberofvertices, )) 57 md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices, )) 58 58 59 59 #make sure that the elements that have loads are fully grounded: … … 62 62 63 63 #make sure wherever there is an ice load, that the mask is set to ice: 64 icemask[md.mesh.elements[pos, :] - 1] = - 164 icemask[md.mesh.elements[pos, :] - 1] = - 1 65 65 md.mask.ice_levelset = icemask 66 66 # }}} 67 67 #geometry {{{ 68 68 di = 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, ))69 md.geometry.thickness = np.ones((md.mesh.numberofvertices, )) 70 md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, )) 71 71 md.geometry.base = md.geometry.surface - md.geometry.thickness 72 72 md.geometry.bed = md.geometry.base 73 73 # }}} 74 74 #materials {{{ 75 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))75 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, )) 76 76 md.materials.rheology_B = paterson(md.initialization.temperature) 77 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))77 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, )) 78 78 # }}} 79 79 #Miscellaneous {{{ … … 87 87 88 88 #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, ))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, )) 92 92 93 93 #eustatic + rigid + elastic run: … … 105 105 moizz = md.results.SealevelriseSolution.SealevelInertiaTensorZZ 106 106 107 # analytical moi = > just checking FOR ICE only!!! {{{108 # ...have to mute ** slr induced MOI in Tria.cpp **prior to the comparison109 #rad_e = rad_e *1e3# now in meters107 # 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 110 110 #areas = GetAreasSphericalTria(md.mesh.elements, md.mesh.lat, md.mesh.long, rad_e) 111 #lat = late *pi/180 lon = longe*pi/180112 #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)) 114 114 # }}} 115 115 -
issm/trunk-jpl/test/NightlyRun/test2051.py
r23793 r24214 14 14 15 15 # indicate what you want to compute 16 md.gia.cross_section_shape = 1 # for square-edged x -section16 md.gia.cross_section_shape = 1 # for square-edged x - section 17 17 18 18 # define loading history -
issm/trunk-jpl/test/NightlyRun/test2052.py
r23793 r24214 14 14 15 15 #indicate what you want to compute 16 md.gia.cross_section_shape = 1 # for square-edged x -section16 md.gia.cross_section_shape = 1 # for square-edged x - section 17 17 18 18 #define loading history -
issm/trunk-jpl/test/NightlyRun/test2053.py
r23793 r24214 14 14 15 15 #indicate what you want to compute 16 md.gia.cross_section_shape = 1 # for square-edged x-section16 md.gia.cross_section_shape = 1 # for square-edged x - section 17 17 18 18 #define loading history -
issm/trunk-jpl/test/NightlyRun/test2071.py
r23793 r24214 14 14 15 15 #indicate what you want to compute 16 md.gia.cross_section_shape = 1 # for square-edged x -section16 md.gia.cross_section_shape = 1 # for square-edged x - section 17 17 18 18 #define loading history -
issm/trunk-jpl/test/NightlyRun/test2072.py
r23793 r24214 14 14 15 15 #indicate what you want to compute 16 md.gia.cross_section_shape = 1 # for square-edged x -section16 md.gia.cross_section_shape = 1 # for square-edged x - section 17 17 18 18 #define loading history -
issm/trunk-jpl/test/NightlyRun/test2073.py
r23793 r24214 14 14 15 15 #indicate what you want to compute 16 md.gia.cross_section_shape = 1 # for square-edged x -section16 md.gia.cross_section_shape = 1 # for square-edged x - section 17 17 18 18 #define loading history -
issm/trunk-jpl/test/NightlyRun/test2081.py
r23793 r24214 14 14 15 15 #indicate what you want to compute 16 md.gia.cross_section_shape = 2 # for square-edged x -section16 md.gia.cross_section_shape = 2 # for square-edged x - section 17 17 18 18 #define loading history -
issm/trunk-jpl/test/NightlyRun/test2082.py
r23793 r24214 14 14 15 15 #indicate what you want to compute 16 md.gia.cross_section_shape = 2 # for square-edged x -section16 md.gia.cross_section_shape = 2 # for square-edged x - section 17 17 18 18 #define loading history -
issm/trunk-jpl/test/NightlyRun/test2083.py
r23793 r24214 14 14 15 15 #indicate what you want to compute 16 md.gia.cross_section_shape = 2 # for square-edged x -section16 md.gia.cross_section_shape = 2 # for square-edged x - section 17 17 18 18 #define loading history -
issm/trunk-jpl/test/NightlyRun/test2084.py
r23793 r24214 1 1 #Test Name: GiaCaron 2 2 #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., 4 4 #Martinec, Z., Gasperini, P., Lund, B., Wolf, D., Vermeersen, L. L. A. 5 5 #and King, M. A. (2011), A benchmark study for glacial isostatic 6 6 #adjustment codes. Geophysical Journal International, 7 #185: 106 -132. doi:10.1111/j.1365-246X.2011.04952.x7 #185: 106 - 132. doi:10.1111 / j.1365 - 246X.2011.04952.x 8 8 9 9 from model import * … … 26 26 md.materials.numlayers = 6 27 27 md.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) * 1e328 6.3010e+03, 6.3710e+03]).reshape(- 1, 1) * 1e3 29 29 md.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) 31 31 md.materials.lame_mu = np.array([1e-5, 0, 2.2834e+00, 1.0549e+00, 7.0363e-01, 32 5.0605e-01]).reshape(- 1, 1) * 1e1132 5.0605e-01]).reshape(- 1, 1) * 1e11 33 33 md.materials.viscosity = np.array([0, 0, 2.0000e+00, 1.0000e+00, 1.0000e+00, 34 1.0000e+25]).reshape(- 1, 1) * 1e2134 1.0000e+25]).reshape(- 1, 1) * 1e21 35 35 md.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)36 md.materials.issolid = np.array([1, 0, 1, 1, 1, 1]).reshape(- 1, 1) 37 37 md.materials.isburgers = np.zeros((md.materials.numlayers, 1)) 38 38 39 39 md.love.allow_layer_deletion = 1 40 md.love.frequencies = (np.array([0]) * 2 * pi).reshape(- 1, 1) / cst40 md.love.frequencies = (np.array([0]) * 2 * pi).reshape(- 1, 1) / cst 41 41 md.love.nfreq = len(md.love.frequencies) 42 42 md.love.sh_nmax = 256 … … 55 55 np.array(md.results.LoveSolution.LoveLr)[:, 0]] 56 56 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 57 md.love.frequencies = (np.array([1e-3, 1e-2, 1e-1, 1, - 1e-3, - 1e-2, - 1e-1, -1]) * 2 * pi).reshape(- 1, 1) / cst 59 58 md.love.nfreq = len(md.love.frequencies) 60 59 md.love.sh_nmax = 256 … … 77 76 md.love.forcing_type = 9 78 77 md.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) 78 md.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) 81 79 md.love.nfreq = len(md.love.frequencies) 82 80 … … 96 94 np.array(md.results.LoveSolution.LoveLi)[:, 1:]] 97 95 98 #Many layers PREM -based model96 #Many layers PREM - based model 99 97 #data = load('../Data/PREM_500layers') 100 98 #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)>099 #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 106 104 #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)) = [] 115 113 #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.issolid114 #md.materials.viscosity = md.materials.viscosity. * md.materials.issolid 117 115 #md.materials.burgers_mu = md.materials.lame_mu 118 116 #md.materials.burgers_viscosity = md.materials.viscosity 119 #md.materials.isburgers = md.materials.issolid *0117 #md.materials.isburgers = md.materials.issolid * 0 120 118 #md.love.forcing_type = 11 121 119 #md.materials.numlayers = len(md.materials.viscosity) … … 135 133 # (md.results.LoveSolution.LoveLi[:][1:]), 136 134 # ] 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. 138 136 139 137 md.materials.radius = np.array([10, 1222.5, 3480., 3600., 3630.5, 3700., 3900., 4000., … … 141 139 5400., 5500., 5600.5, 5650., 5701., 5736., 5771.5, 142 140 5821., 5951., 5970.5, 6016., 6061., 6150.5, 6151.5, 143 6251., 6371.]).reshape(- 1, 1) * 1e3141 6251., 6371.]).reshape(- 1, 1) * 1e3 144 142 md.materials.lame_mu = np.array([1e-5, 0., 2.933, 2.8990002, 2.8550003, 2.7340002, 2.675, 145 143 2.559, 2.502, 2.388, 2.331, 2.215, 2.157, 2.039, 1.979, 146 144 1.8560001, 1.794, 1.73, 1.639, 1.2390001, 1.224, 1.21, 147 145 1.128, 0.97700006, 0.906, 0.79, 0.773, 0.741, 0.656, 0.665, 148 0.602]).reshape(- 1, 1) * 1e11146 0.602]).reshape(- 1, 1) * 1e11 149 147 md.materials.density = np.array([10925., 10925., 5506.42, 5491.45, 5456.57, 5357.06, 150 148 5307.24, 5207.13, 5156.69, 5054.69, 5002.99, 4897.83, … … 152 150 4412.41, 3992.14, 3983.99, 3975.84, 3912.82, 3786.78, 153 151 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.999999999999999 E+21, 8.5E+21,156 8.999999999999999 E+21, 3.E+22, 4.E+22,157 5.0000000000000004 E+22, 6.E+22,158 5.0000000000000004 E+22, 4.5E+22, 3.E+22,159 2.5000000000000002 E+22, 1.7999999999999998E+22,160 1.3 E+22, 7.999999999999999E+21, 6.999999999999999E+21,161 6.5 E+21, 6.E+21, 5.5E+21, 5.E+21, 4.4999999999999995E+21,162 3.9999999999999995 E+21, 2.5E+21,163 1.9999999999999997 E+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) 153 md.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) 166 164 md.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)165 md.materials.issolid = np.ones(len(md.materials.lame_mu)).reshape(- 1, 1) 168 166 md.materials.issolid[1] = 0 169 167 md.materials.numlayers = len(md.materials.lame_mu) … … 177 175 md = solve(md, 'lv') 178 176 179 md.love.frequencies = (np.array([0, 1e-3, 1e-2, 1, - 1e-3, -1e-2,180 -1]) * 2 * pi).reshape(- 1, 1) / cst177 md.love.frequencies = (np.array([0, 1e-3, 1e-2, 1, - 1e-3, - 1e-2, 178 -1]) * 2 * pi).reshape(- 1, 1) / cst 181 179 md.love.nfreq = len(md.love.frequencies) 182 180 -
issm/trunk-jpl/test/NightlyRun/test2085.py
r23793 r24214 1 1 #Test Name: LovenumberstAtDepth. 2 #Same as test #1 of test2084.m2 #Same as test #1 of test2084.m 3 3 4 4 from model import * … … 21 21 md.materials.numlayers = 6 22 22 md.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) * 1e1125 md.materials.viscosity = np.array([0, 0, 2.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+25]).reshape(- 1, 1) * 1e2123 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 26 26 md.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)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) 29 29 30 30 md.love.love_kernels = 1 31 31 md.love.allow_layer_deletion = 1 32 md.love.frequencies = (np.array([0]) * 2 * pi).reshape(- 1, 1) / cst32 md.love.frequencies = (np.array([0]) * 2 * pi).reshape(- 1, 1) / cst 33 33 md.love.nfreq = len(md.love.frequencies) 34 34 md.love.sh_nmax = 2 -
issm/trunk-jpl/test/NightlyRun/test2101.py
r23793 r24214 17 17 18 18 #define load 19 md.esa.deltathickness = np.zeros((md.mesh.numberofelements, ))19 md.esa.deltathickness = np.zeros((md.mesh.numberofelements, )) 20 20 pos = 449 21 md.esa.deltathickness[pos] = - 100# this is the only "icy" element21 md.esa.deltathickness[pos] = - 100 # this is the only "icy" element 22 22 23 23 #love numbers: 24 24 nlov = 10000 25 md.esa.love_h = np.array(love_numbers('h')) 25 md.esa.love_h = np.array(love_numbers('h')) #Originally had CM arg 26 26 md.esa.love_h = np.resize(md.esa.love_h, nlov + 1) 27 md.esa.love_l = np.array(love_numbers('l')) 27 md.esa.love_l = np.array(love_numbers('l')) #Originally had CM arg 28 28 md.esa.love_l = np.resize(md.esa.love_l, nlov + 1) 29 29 … … 33 33 34 34 #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, ))35 md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, )) 36 36 pos = np.where(md.esa.deltathickness) 37 md.mask.ice_levelset[md.mesh.elements[pos, :]] = - 137 md.mask.ice_levelset[md.mesh.elements[pos, :]] = - 1 38 38 39 39 #is ice grounded? 40 md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices,))40 md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices, )) 41 41 pos = np.where(md.mask.ice_levelset <= 0) 42 42 md.mask.groundedice_levelset[pos] = 1 … … 52 52 #geometry: {{{ 53 53 di = 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, ))54 md.geometry.thickness = np.ones((md.mesh.numberofvertices, )) 55 md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, )) 56 56 md.geometry.base = md.geometry.surface - md.geometry.thickness 57 57 md.geometry.bed = md.geometry.base 58 58 # }}} 59 59 #materials: {{{ 60 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))60 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, )) 61 61 md.materials.rheology_B = paterson(md.initialization.temperature) 62 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))62 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, )) 63 63 # }}} 64 64 #Miscellaneous: {{{ -
issm/trunk-jpl/test/NightlyRun/test2110.py
r23793 r24214 12 12 #mesh earth: 13 13 md = model() 14 md = roundmesh(md, 50000, 2000) 14 md = roundmesh(md, 50000, 2000) # radius and element size (meters) 15 15 16 16 #define load 17 md.esa.deltathickness = np.zeros((md.mesh.numberofelements, ))17 md.esa.deltathickness = np.zeros((md.mesh.numberofelements, )) 18 18 disc_radius = 20 # km 19 19 index = md.mesh.elements … … 21 21 y_element = np.mean(md.mesh.y[index - 1], 1) 22 22 rad_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 withdrawl23 md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = - 1 # 1 m water withdrawl 24 24 25 25 #love numbers: 26 nlov = 10000 26 nlov = 10000 # horizontal displacements do not work for low degree truncation, e.g., 101 27 27 md.esa.love_h = np.array(love_numbers('h')) 28 28 md.esa.love_h = np.resize(md.esa.love_h, nlov + 1) … … 32 32 #mask: {{{ 33 33 #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, ))34 md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, )) 35 35 pos = np.where(md.esa.deltathickness) 36 md.mask.ice_levelset[md.mesh.elements[pos, :] - 1] = - 136 md.mask.ice_levelset[md.mesh.elements[pos, :] - 1] = - 1 37 37 38 38 #is ice grounded? 39 md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices,))39 md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices, )) 40 40 pos = np.where(md.mask.ice_levelset <= 0) 41 41 md.mask.groundedice_levelset[pos] = 1 … … 44 44 #geometry: {{{ 45 45 di = 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, ))46 md.geometry.thickness = np.ones((md.mesh.numberofvertices, )) 47 md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, )) 48 48 md.geometry.base = md.geometry.surface - md.geometry.thickness 49 49 md.geometry.bed = md.geometry.base 50 50 # }}} 51 51 #materials: {{{ 52 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))52 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, )) 53 53 md.materials.rheology_B = paterson(md.initialization.temperature) 54 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))54 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, )) 55 55 # }}} 56 56 #Miscellaneous: {{{ -
issm/trunk-jpl/test/NightlyRun/test2111.py
r23793 r24214 1 1 #Test Name: Esa2Dsurface 2 #AIS - - southern hemisphere example for north-south, east-west components of horiz motion2 #AIS - - southern hemisphere example for north - south, east - west components of horiz motion 3 3 4 4 import numpy as np … … 15 15 # }}} 16 16 #define load: {{{ 17 md.esa.deltathickness = np.zeros((md.mesh.numberofelements, ))17 md.esa.deltathickness = np.zeros((md.mesh.numberofelements, )) 18 18 disc_radius = 500 # km 19 19 index = md.mesh.elements … … 21 21 y_element = np.mean(md.mesh.y[index - 1], 1) - 1.0e6 22 22 rad_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 withdrawl23 md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = - 1 # 1 m water withdrawl 24 24 # }}} 25 25 #love numbers: {{{ 26 nlov = 10000 26 nlov = 10000 # horizontal displacements do not work for low degree truncation, e.g., 101 27 27 md.esa.love_h = np.array(love_numbers('h', 'CF')) 28 28 md.esa.love_h = np.resize(md.esa.love_h, nlov + 1) … … 32 32 #mask: {{{ 33 33 #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, ))34 md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, )) 35 35 pos = np.where(md.esa.deltathickness) 36 md.mask.ice_levelset[md.mesh.elements[pos, :]] = - 136 md.mask.ice_levelset[md.mesh.elements[pos, :]] = - 1 37 37 38 38 #is ice grounded? 39 md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices,))39 md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices, )) 40 40 pos = np.where(md.mask.ice_levelset <= 0) 41 41 md.mask.groundedice_levelset[pos] = 1 … … 43 43 #geometry: {{{ 44 44 di = 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, ))45 md.geometry.thickness = np.ones((md.mesh.numberofvertices, )) 46 md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, )) 47 47 md.geometry.base = md.geometry.surface - md.geometry.thickness 48 48 md.geometry.bed = md.geometry.base 49 49 # }}} 50 50 #materials: {{{ 51 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))51 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, )) 52 52 md.materials.rheology_B = paterson(md.initialization.temperature) 53 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))53 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, )) 54 54 # }}} 55 55 #additional parameters, miscellaneous: {{{ 56 56 md.miscellaneous.name = 'test2111' 57 57 md.esa.degacc = 0.01 58 md.esa.hemisphere = - 158 md.esa.hemisphere = - 1 59 59 # }}} 60 60 -
issm/trunk-jpl/test/NightlyRun/test2112.py
r23793 r24214 1 1 #Test Name: Esa2Dsurface 2 #AIS 2 - -load centered at the south pole!2 #AIS 2 - - load centered at the south pole! 3 3 import numpy as np 4 4 from model import * … … 14 14 # }}} 15 15 #define load: {{{ 16 md.esa.deltathickness = np.zeros((md.mesh.numberofelements, ))16 md.esa.deltathickness = np.zeros((md.mesh.numberofelements, )) 17 17 disc_radius = 500 # km 18 18 index = md.mesh.elements … … 20 20 y_element = np.mean(md.mesh.y[index - 1], 1) 21 21 rad_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 withdrawl22 md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = - 1 # 1 m water withdrawl 23 23 # }}} 24 24 #love numbers: {{{ 25 nlov = 10000 25 nlov = 10000 # horizontal displacements do not work for low degree truncation, e.g., 101 26 26 md.esa.love_h = np.array(love_numbers('h', 'CF')) 27 27 md.esa.love_h = np.resize(md.esa.love_h, nlov + 1) … … 31 31 #mask: {{{ 32 32 #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, ))33 md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, )) 34 34 pos = np.where(md.esa.deltathickness) 35 md.mask.ice_levelset[md.mesh.elements[pos, :]] = - 135 md.mask.ice_levelset[md.mesh.elements[pos, :]] = - 1 36 36 37 37 #is ice grounded? 38 md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices,))38 md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices, )) 39 39 pos = np.where(md.mask.ice_levelset <= 0) 40 40 md.mask.groundedice_levelset[pos] = 1 … … 42 42 #geometry: {{{ 43 43 di = 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, ))44 md.geometry.thickness = np.ones((md.mesh.numberofvertices, )) 45 md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, )) 46 46 md.geometry.base = md.geometry.surface - md.geometry.thickness 47 47 md.geometry.bed = md.geometry.base 48 48 # }}} 49 49 #materials: {{{ 50 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))50 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, )) 51 51 md.materials.rheology_B = paterson(md.initialization.temperature) 52 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))52 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, )) 53 53 # }}} 54 54 #additional parameters, miscellaneous: {{{ 55 55 md.miscellaneous.name = 'test2112' 56 56 md.esa.degacc = 0.01 57 md.esa.hemisphere = - 157 md.esa.hemisphere = - 1 58 58 # }}} 59 59 -
issm/trunk-jpl/test/NightlyRun/test2113.py
r23793 r24214 1 1 #Test Name: Esa2Dsurface 2 #Northern hemisphere example for north -south, east-west components of horiz motion2 #Northern hemisphere example for north - south, east - west components of horiz motion 3 3 #Same as test2111.m except that AIS is assumed to have located in Northern Hemisphere 4 4 … … 16 16 # }}} 17 17 #define load: {{{ 18 md.esa.deltathickness = np.zeros((md.mesh.numberofelements, ))18 md.esa.deltathickness = np.zeros((md.mesh.numberofelements, )) 19 19 disc_radius = 500 # km 20 20 index = md.mesh.elements … … 22 22 y_element = np.mean(md.mesh.y[index - 1], 1) + 1.0e6 23 23 rad_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 withdrawl24 md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = - 1 # 1 m water withdrawl 25 25 # }}} 26 26 #love numbers: {{{ 27 nlov = 10000 27 nlov = 10000 # horizontal displacements do not work for low degree truncation, e.g., 101 28 28 md.esa.love_h = np.array(love_numbers('h', 'CF')) 29 29 md.esa.love_h = np.resize(md.esa.love_h, nlov + 1) … … 33 33 #mask: {{{ 34 34 #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, ))35 md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, )) 36 36 pos = np.where(md.esa.deltathickness) 37 md.mask.ice_levelset[md.mesh.elements[pos, :]] = - 137 md.mask.ice_levelset[md.mesh.elements[pos, :]] = - 1 38 38 39 39 #is ice grounded? 40 md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices,))40 md.mask.groundedice_levelset = - np.ones((md.mesh.numberofvertices, )) 41 41 pos = np.where(md.mask.ice_levelset <= 0) 42 42 md.mask.groundedice_levelset[pos] = 1 … … 44 44 #geometry: {{{ 45 45 di = 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, ))46 md.geometry.thickness = np.ones((md.mesh.numberofvertices, )) 47 md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, )) 48 48 md.geometry.base = md.geometry.surface - md.geometry.thickness 49 49 md.geometry.bed = md.geometry.base 50 50 # }}} 51 51 #materials: {{{ 52 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))52 md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, )) 53 53 md.materials.rheology_B = paterson(md.initialization.temperature) 54 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))54 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, )) 55 55 # }}} 56 56 #additional parameters, miscellaneous: {{{ -
issm/trunk-jpl/test/NightlyRun/test215.py
r24105 r24214 15 15 md.extrude(3, 1.) 16 16 md = setflowequation(md, 'FS', 'all') 17 md.settings.solver_residue_threshold = 1.e-4 ;17 md.settings.solver_residue_threshold = 1.e-4 18 18 19 19 # control parameters -
issm/trunk-jpl/test/NightlyRun/test217.py
r23793 r24214 19 19 # redo the parameter file for this special shelf. 20 20 # 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. 22 22 23 23 # tighten … … 34 34 h = 1000. 35 35 md.geometry.thickness = h * np.ones((md.mesh.numberofvertices)) 36 md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness36 md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness 37 37 md.geometry.surface = md.geometry.base + md.geometry.thickness 38 38 … … 67 67 pos = np.where(md.mesh.y == ymax) 68 68 nodeonicefront[pos] = 1 69 md.mask.ice_levelset = - 1 + nodeonicefront69 md.mask.ice_levelset = - 1 + nodeonicefront 70 70 71 71 md = solve(md, 'Stressbalance') 72 72 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)).^375 # vy_c = ey_c. *md.mesh.y*md.constants.yts73 # 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 76 76 77 77 # Fields and tolerances to track changes -
issm/trunk-jpl/test/NightlyRun/test218.py
r24174 r24214 30 30 #redo the parameter file for this special shelf. 31 31 #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. 33 33 34 34 #needed later … … 41 41 42 42 h = 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.thickness43 md.geometry.thickness = h * np.ones((md.mesh.numberofvertices, )) 44 md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness 45 45 md.geometry.surface = md.geometry.base + md.geometry.thickness 46 46 47 47 #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, ))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, )) 52 52 53 53 #Materials 54 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, ))54 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, )) 55 55 md.materials.rheology_B = paterson(md.initialization.temperature) 56 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements, ))56 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements, )) 57 57 58 58 #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, ))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, )) 62 62 63 63 #constrain flanks to 0 normal velocity … … 80 80 #dakota version 81 81 version = IssmConfig('_DAKOTA_VERSION_') 82 # returns tuple "(u'6.2', )" -> unicode string '6.2', convert to float82 # returns tuple "(u'6.2', )" - > unicode string '6.2', convert to float 83 83 version = float(version[0]) 84 84 … … 106 106 107 107 #imperative! 108 md.stressbalance.reltol = 10**- 10 #tighten for qmu analysis108 md.stressbalance.reltol = 10**- 10 #tighten for qmu analysis 109 109 md.qmu.isdakota = 1 110 110 111 md.debug.valgrind = True 111 112 #solve 112 md.verbose = verbose('000000000') 113 md.verbose = verbose('000000000') # this line is recommended 113 114 md = solve(md, 'Stressbalance', 'overwrite', 'y') 114 115 115 116 #Fields and tolerances to track changes 116 117 md.qmu.results = md.results.dakota 117 md.results.dakota.importancefactors = importancefactors(md, 'scaled_MaterialsRheologyB', 'MaxVel').reshape(- 1, 1)118 md.results.dakota.importancefactors = importancefactors(md, 'scaled_MaterialsRheologyB', 'MaxVel').reshape(- 1, 1) 118 119 field_names = ['importancefactors'] 119 120 field_tolerances = [1e-10] -
issm/trunk-jpl/test/NightlyRun/test228.py
r23793 r24214 22 22 #Set up transient 23 23 smb = np.ones((md.mesh.numberofvertices)) * 3.6 24 smb = np.vstack((smb, smb * - 1.)).T24 smb = np.vstack((smb, smb * - 1.)).T 25 25 26 26 md.smb.mass_balance = np.vstack((smb, [1.5, 3.])) -
issm/trunk-jpl/test/NightlyRun/test230.py
r23793 r24214 23 23 #Set up transient 24 24 smb = np.ones((md.mesh.numberofvertices)) * 3.6 25 smb = np.vstack((smb, smb * - 1.)).T25 smb = np.vstack((smb, smb * - 1.)).T 26 26 27 27 md.smb.mass_balance = np.vstack((smb, [1.5, 3.])) -
issm/trunk-jpl/test/NightlyRun/test234.py
r24174 r24214 24 24 md.timestepping.final_time = 4 25 25 26 smb = np.ones((md.mesh.numberofvertices, )) * 3.627 smb = np.array([smb, smb * - 1]).T26 smb = np.ones((md.mesh.numberofvertices, )) * 3.6 27 smb = np.array([smb, smb * - 1]).T 28 28 29 29 md.smb.mass_balance = smb … … 81 81 md.qmu.params.evaluation_concurrency = 1 82 82 83 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses83 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses 84 84 md.transient.requested_outputs = ['IceVolume'] 85 85 86 86 #solve 87 md.verbose = verbose('000000000') 87 md.verbose = verbose('000000000') # this line is recommended 88 88 md = solve(md, 'Transient', 'overwrite', 'y') 89 89 md.qmu.results = md.results.dakota -
issm/trunk-jpl/test/NightlyRun/test235.py
r24174 r24214 24 24 md.timestepping.final_time = 4 25 25 26 smb = np.ones((md.mesh.numberofvertices, )) * 3.627 smb = np.array([smb, smb * - 1]).T26 smb = np.ones((md.mesh.numberofvertices, )) * 3.6 27 smb = np.array([smb, smb * - 1]).T 28 28 29 29 md.smb.mass_balance = smb … … 77 77 md.qmu.params.evaluation_concurrency = 1 78 78 79 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses79 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses 80 80 md.transient.requested_outputs = ['IceVolume'] 81 81 82 82 #solve 83 md.verbose = verbose('000000000') 83 md.verbose = verbose('000000000') # this line is recommended 84 84 md = solve(md, 'Transient', 'overwrite', 'y') 85 85 md.qmu.results = md.results.dakota -
issm/trunk-jpl/test/NightlyRun/test236.py
r23793 r24214 35 35 md.smb.temperatures_presentday[0:md.mesh.numberofvertices, imonth] = tmonth[imonth] 36 36 md.smb.temperatures_lgm[0:md.mesh.numberofvertices, imonth] = tmonth[imonth] - 20. 37 37 # Time for the last line: 38 38 md.smb.temperatures_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.) 39 39 md.smb.temperatures_lgm[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.) 40 40 41 41 # 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)42 md.thermal.spctemperature = np.mean(md.smb.temperatures_lgm[0:md.mesh.numberofvertices, :], axis=1) # - 10 * ones(md.mesh.numberofvertices, 1) 43 43 md.thermal.spctemperature = np.tile(md.thermal.spctemperature, (int(md.timestepping.final_time / md.timestepping.time_step), 1)).T 44 44 itemp = np.arange(0, md.timestepping.final_time, md.timestepping.time_step) 45 45 md.thermal.spctemperature = np.vstack((md.thermal.spctemperature, itemp)) 46 46 47 md.initialization.temperature = md.smb.temperatures_lgm[0:md.mesh.numberofvertices, 0] #*ones(md.mesh.numberofvertices, 1)47 md.initialization.temperature = md.smb.temperatures_lgm[0:md.mesh.numberofvertices, 0] # * ones(md.mesh.numberofvertices, 1) 48 48 md.smb.initialize(md) 49 49 … … 52 52 md.smb.precipitations_lgm = np.zeros((md.mesh.numberofvertices + 1, 12)) 53 53 for imonth in range(0, 12): 54 md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(-6) * md.mesh.y + 0.554 md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(- 6) * md.mesh.y + 0.5 55 55 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.556 md.smb.precipitations_lgm[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(- 6) * md.mesh.y + 0.5 57 57 md.smb.precipitations_lgm[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.) 58 58 -
issm/trunk-jpl/test/NightlyRun/test237.py
r24102 r24214 11 11 from generic import generic 12 12 13 md = triangle(model(), '../Exp/Square.exp', 600000) 13 md = triangle(model(), '../Exp/Square.exp', 600000) #180000 14 14 md = setmask(md, 'all', '') 15 15 md = parameterize(md, '../Par/SquareShelf.py') … … 33 33 md.smb.temperatures_presentday[0:md.mesh.numberofvertices, imonth] = tmonth[imonth] 34 34 md.smb.temperatures_lgm[0:md.mesh.numberofvertices, imonth] = tmonth[imonth] - 20. 35 35 # Time for the last line: 36 36 md.smb.temperatures_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.) 37 37 md.smb.temperatures_lgm[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.) 38 38 39 39 # 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)40 md.thermal.spctemperature = np.mean(md.smb.temperatures_lgm[0:md.mesh.numberofvertices, :], axis=1) # - 10 * ones(md.mesh.numberofvertices, 1) 41 41 md.thermal.spctemperature = np.tile(md.thermal.spctemperature, (int(md.timestepping.final_time / md.timestepping.time_step), 1)).T 42 42 itemp = np.arange(0, md.timestepping.final_time, md.timestepping.time_step) 43 43 md.thermal.spctemperature = np.vstack((md.thermal.spctemperature, itemp)) 44 44 45 md.initialization.temperature = md.smb.temperatures_lgm[0:md.mesh.numberofvertices, 0] #*ones(md.mesh.numberofvertices, 1)45 md.initialization.temperature = md.smb.temperatures_lgm[0:md.mesh.numberofvertices, 0] # * ones(md.mesh.numberofvertices, 1) 46 46 md.smb.initialize(md) 47 47 … … 50 50 md.smb.precipitations_lgm = np.zeros((md.mesh.numberofvertices + 1, 12)) 51 51 for imonth in range(0, 12): 52 md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(-6) * md.mesh.y + 0.552 md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(- 6) * md.mesh.y + 0.5 53 53 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.554 md.smb.precipitations_lgm[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(- 6) * md.mesh.y + 0.5 55 55 md.smb.precipitations_lgm[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.) 56 56 -
issm/trunk-jpl/test/NightlyRun/test238.py
r23793 r24214 29 29 for imonth in range(0, 12): 30 30 md.smb.temperatures_presentday[0:md.mesh.numberofvertices, imonth] = tmonth[imonth] 31 31 # Time for the last line: 32 32 md.smb.temperatures_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.) 33 33 34 34 # 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)35 md.thermal.spctemperature = np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices, :], axis=1).reshape(- 1, 1) 36 36 md.thermal.spctemperature = md.thermal.spctemperature - 10 37 37 md.initialization.temperature = md.thermal.spctemperature … … 41 41 md.smb.precipitations_presentday = np.zeros((md.mesh.numberofvertices + 1, 12)) 42 42 for imonth in range(0, 12): 43 md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(-6) * md.mesh.y + 0.543 md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(- 6) * md.mesh.y + 0.5 44 44 md.smb.precipitations_presentday[md.mesh.numberofvertices, imonth] = (float(imonth) / 12.) 45 45 -
issm/trunk-jpl/test/NightlyRun/test239.py
r23793 r24214 29 29 for imonth in range(0, 12): 30 30 md.smb.temperatures_presentday[0:md.mesh.numberofvertices, imonth] = tmonth[imonth] 31 31 # Time for the last line: 32 32 md.smb.temperatures_presentday[md.mesh.numberofvertices, imonth] = (float(imonth) / 12.) 33 33 34 34 # 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)35 md.thermal.spctemperature = np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices, :], axis=1).reshape(- 1, 1) 36 36 md.thermal.spctemperature = md.thermal.spctemperature - 10 37 37 md.initialization.temperature = md.thermal.spctemperature … … 41 41 md.smb.precipitations_presentday = np.zeros((md.mesh.numberofvertices + 1, 12)) 42 42 for imonth in range(0, 12): 43 md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(-6) * md.mesh.y + 0.543 md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(- 6) * md.mesh.y + 0.5 44 44 md.smb.precipitations_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.) 45 45 -
issm/trunk-jpl/test/NightlyRun/test240.py
r23793 r24214 29 29 for imonth in range(0, 12): 30 30 md.smb.temperatures_presentday[0:md.mesh.numberofvertices, imonth] = tmonth[imonth] 31 31 # Time for the last line: 32 32 md.smb.temperatures_presentday[md.mesh.numberofvertices, imonth] = (float(imonth) / 12.) 33 33 34 34 # 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)35 md.thermal.spctemperature = np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices, :], axis=1).reshape(- 1, 1) 36 36 md.thermal.spctemperature = md.thermal.spctemperature - 10 37 37 md.initialization.temperature = md.thermal.spctemperature … … 41 41 md.smb.precipitations_presentday = np.zeros((md.mesh.numberofvertices + 1, 12)) 42 42 for imonth in range(0, 12): 43 md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(-6) * md.mesh.y + 0.543 md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = - 0.4 * 10**(- 6) * md.mesh.y + 0.5 44 44 md.smb.precipitations_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.) 45 45 -
issm/trunk-jpl/test/NightlyRun/test241.py
r23793 r24214 23 23 #Set up transient 24 24 smb = np.ones((md.mesh.numberofvertices)) * 3.6 25 smb = np.vstack((smb, smb * - 1.)).T25 smb = np.vstack((smb, smb * - 1.)).T 26 26 27 27 md.smb.mass_balance = np.vstack((smb, [1.5, 3.])) -
issm/trunk-jpl/test/NightlyRun/test242.py
r23793 r24214 24 24 #Set up transient 25 25 smb = np.ones((md.mesh.numberofvertices)) * 3.6 26 smb = np.vstack((smb, smb * - 1.)).T26 smb = np.vstack((smb, smb * - 1.)).T 27 27 28 28 md.smb.mass_balance = np.vstack((smb, [1.5, 3.])) -
issm/trunk-jpl/test/NightlyRun/test2424.py
r23793 r24214 18 18 md.smb.mass_balance[:] = 0. 19 19 20 md.geometry.base = - 700. - np.abs(md.mesh.y - 500000.) / 1000.21 md.geometry.bed = - 700. - np.abs(md.mesh.y - 500000.) / 1000.20 md.geometry.base = - 700. - np.abs(md.mesh.y - 500000.) / 1000. 21 md.geometry.bed = - 700. - np.abs(md.mesh.y - 500000.) / 1000. 22 22 md.geometry.thickness[:] = 1000. 23 23 md.geometry.surface = md.geometry.base + md.geometry.thickness … … 31 31 md.timestepping.time_step = .1 32 32 md.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) 34 34 35 35 md.cluster = generic('name', gethostname(), 'np', 3) … … 37 37 38 38 #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)* thickness39 #of surface-sealevel - (1 - di) * thickness 40 40 41 41 nsteps = len(md.results.TransientSolution) … … 45 45 #time is off by the year constant 46 46 for 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') 48 48 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 15 15 md.initialization.vx[:] = 0. 16 16 md.initialization.vy[:] = 0. 17 md.geometry.base = - 700. - (md.mesh.y - 500000.) / 1000.18 md.geometry.bed = - 700. - (md.mesh.y - 500000.) / 1000.17 md.geometry.base = - 700. - (md.mesh.y - 500000.) / 1000. 18 md.geometry.bed = - 700. - (md.mesh.y - 500000.) / 1000. 19 19 md.geometry.thickness[:] = 1300. 20 20 md.geometry.surface = md.geometry.base + md.geometry.thickness … … 31 31 32 32 #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.33 md.geometry.base = - 700. - (md.mesh.y - 500000.) / 1000. 34 md.geometry.bed = - 700. - (md.mesh.y - 500000.) / 1000. 35 35 md.geometry.thickness[:] = 1300. 36 36 md.geometry.surface = md.geometry.base + md.geometry.thickness … … 39 39 md.geometry.bed = md.geometry.bed + 1000 40 40 md.geometry.surface = md.geometry.surface + 1000 41 md.slr.sealevel = 1000 * np.ones((md.mesh.numberofvertices, ))41 md.slr.sealevel = 1000 * np.ones((md.mesh.numberofvertices, )) 42 42 43 43 md = solve(md, 'Transient', 'checkconsistency', 'no') -
issm/trunk-jpl/test/NightlyRun/test243.py
r24210 r24214 62 62 #Fields and tolerances to track changes 63 63 field_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]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] 65 65 #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),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), 73 73 md.results.TransientSolution[-1].SmbEC[0], 74 74 md.results.TransientSolution[-1].SmbMassBalance[0], -
issm/trunk-jpl/test/NightlyRun/test244.py
r24187 r24214 69 69 #partitioning 70 70 md.qmu.numberofpartitions = md.mesh.numberofelements 71 md = partitioner(md, 'package', 'linear', 'type','element')71 md = partitioner(md, 'package', 'linear', 'type', 'element') 72 72 md.qmu.epartition = (md.qmu.epartition - 1) 73 73 … … 75 75 md.qmu.variables.surface_mass_balanceC = normal_uncertain.normal_uncertain('scaled_SmbC', 1, 0.5) 76 76 Tmin = 273. 77 telms = np.atleast_2d(np.min(md.smb.Ta[0: -1, :], 1))77 telms = np.atleast_2d(np.min(md.smb.Ta[0: - 1, :], 1)) 78 78 mint_on_partition = telms.flatten() 79 79 for pa in range(np.size(mint_on_partition)): 80 80 vi = np.where(md.qmu.epartition == pa) 81 mint = telms[0, vi] * 1.0581 mint = telms[0, vi] * 1.05 82 82 pos = np.where(mint < Tmin) 83 83 mint[pos] = Tmin 84 mint_on_partition[pa] = max(mint / telms[0, vi])84 mint_on_partition[pa] = max(mint / telms[0, vi]) 85 85 86 mint_on_partition[np.where(np.isnan(mint_on_partition))] = 10**- 1086 mint_on_partition[np.where(np.isnan(mint_on_partition))] = 10**- 10 87 87 md.qmu.variables.surface_mass_balanceTa = uniform_uncertain.uniform_uncertain('scaled_SmbTa', 1, 0.05) 88 88 md.qmu.variables.surface_mass_balanceTa[0].lower = 0.95 … … 117 117 118 118 119 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses119 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses 120 120 md.transient.requested_outputs = ['IceVolume', 'TotalSmb', 'IceMass'] 121 121 122 122 #solve 123 md.verbose = verbose('000000000') 123 md.verbose = verbose('000000000') # this line is recommended 124 124 md = solve(md, 'Transient', 'overwrite', 'y') 125 125 md.qmu.results = md.results.dakota -
issm/trunk-jpl/test/NightlyRun/test245.py
r23793 r24214 19 19 # initalize pdd fields 20 20 md.smb.initialize(md) 21 md.smb.s0p = md.geometry.surface.reshape(- 1, 1)22 md.smb.s0t = md.geometry.surface.reshape(- 1, 1)21 md.smb.s0p = md.geometry.surface.reshape(- 1, 1) 22 md.smb.s0t = md.geometry.surface.reshape(- 1, 1) 23 23 24 24 25 25 md.smb.monthlytemperatures = np.empty((md.mesh.numberofvertices + 1, 12)) 26 26 md.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, ))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, )) 30 30 for imonth in range(12): 31 31 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 23 23 md.timestepping.final_time = 4 24 24 25 smb = np.ones((md.mesh.numberofvertices, )) * 3.626 smb = np.array([smb, smb * - 1]).T25 smb = np.ones((md.mesh.numberofvertices, )) * 3.6 26 smb = np.array([smb, smb * - 1]).T 27 27 28 28 md.smb.mass_balance = smb … … 79 79 md.qmu.params.evaluation_concurrency = 1 80 80 81 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses81 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses 82 82 md.transient.requested_outputs = ['IceVolume'] 83 83 84 84 #solve 85 md.verbose = verbose('000000000') 85 md.verbose = verbose('000000000') # this line is recommended 86 86 md = solve(md, 'Transient', 'overwrite', 'y') 87 87 md.qmu.results = md.results.dakota -
issm/trunk-jpl/test/NightlyRun/test251.py
r24174 r24214 23 23 md.timestepping.final_time = 4 24 24 25 smb = np.ones((md.mesh.numberofvertices, )) * 3.626 smb = np.array([smb, smb * - 1]).T25 smb = np.ones((md.mesh.numberofvertices, )) * 3.6 26 smb = np.array([smb, smb * - 1]).T 27 27 28 28 md.smb.mass_balance = smb … … 76 76 md.qmu.params.evaluation_concurrency = 1 77 77 78 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses78 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses 79 79 md.transient.requested_outputs = ['IceVolume'] 80 80 81 81 #solve 82 md.verbose = verbose('000000000') 82 md.verbose = verbose('000000000') # this line is recommended 83 83 md = solve(md, 'Transient', 'overwrite', 'y') 84 84 md.qmu.results = md.results.dakota -
issm/trunk-jpl/test/NightlyRun/test252.py
r24210 r24214 42 42 md.smb.C = np.tile(np.conjugate(inputs[b'LP']['C']), (md.mesh.numberofelements, 1)).flatten() 43 43 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]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] 51 51 52 52 md.smb.isclimatology = 1 … … 70 70 71 71 #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 73 field_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'] 77 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, 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] 77 81 78 82 #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),83 field_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), 86 90 md.results.TransientSolution[0].SmbEC[0], 87 91 md.results.TransientSolution[0].SmbMassBalance[0], … … 89 93 md.results.TransientSolution[0].SmbDzAdd[0], 90 94 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), 98 102 md.results.TransientSolution[145].SmbEC[0], 99 103 md.results.TransientSolution[145].SmbMassBalance[0], … … 101 105 md.results.TransientSolution[145].SmbDzAdd[0], 102 106 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), 110 114 md.results.TransientSolution[146].SmbEC[0], 111 115 md.results.TransientSolution[146].SmbMassBalance[0], … … 113 117 md.results.TransientSolution[146].SmbDzAdd[0], 114 118 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), 122 126 md.results.TransientSolution[-1].SmbEC[0], 123 127 md.results.TransientSolution[-1].SmbMassBalance[0], -
issm/trunk-jpl/test/NightlyRun/test260.py
r23793 r24214 13 13 md = setmask(md, 'all', '') 14 14 md.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, )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, ) 18 18 md = parameterize(md, '../Par/SquareShelf.py') 19 19 md = setflowequation(md, 'SSA', 'all') -
issm/trunk-jpl/test/NightlyRun/test261.py
r24149 r24214 17 17 md.cluster = generic('name', gethostname(), 'np', 3) 18 18 md.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, )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, ) 22 22 md.transient.isstressbalance = 1 23 23 md.transient.ismasstransport = 0 -
issm/trunk-jpl/test/NightlyRun/test272.py
r23793 r24214 25 25 md.inversion.iscontrol = 1 26 26 md.inversion.control_parameters = ['DamageDbar'] 27 md.inversion.min_parameters = 10**- 13 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))27 md.inversion.min_parameters = 10**- 13 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters))) 28 28 md.inversion.max_parameters = np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters))) 29 29 md.inversion.nsteps = 2 -
issm/trunk-jpl/test/NightlyRun/test293.py
r23793 r24214 19 19 md.basalforcings = md.basalforcings.initialize(md) 20 20 md.transient.isgroundingline = 1 21 md.geometry.bed = min(md.geometry.base) * np.ones(md.mesh.numberofvertices, )21 md.geometry.bed = min(md.geometry.base) * np.ones(md.mesh.numberofvertices, ) 22 22 md.transient.requested_outputs = ['default', 'BasalforcingsFloatingiceMeltingRate'] 23 23 -
issm/trunk-jpl/test/NightlyRun/test3015.py
r23793 r24214 14 14 15 15 #This test runs test3005 with autodiff on, and checks that 16 #the value of the scalar forward difference match a step -wise differential16 #the value of the scalar forward difference match a step - wise differential 17 17 18 18 #First configure … … 34 34 index = index - 1 35 35 36 #parameters for the step -wise derivative36 #parameters for the step - wise derivative 37 37 delta = 0.001 38 38 h1 = md.geometry.thickness[index] … … 49 49 md.autodiff.isautodiff = False 50 50 md.geometry.thickness[index] = h0 51 md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness51 md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness 52 52 md.geometry.surface = md.geometry.base + md.geometry.thickness 53 53 md = SetIceShelfBC(md) … … 60 60 md.autodiff.isautodiff = False 61 61 md.geometry.thickness[index] = h2 62 md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness62 md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness 63 63 md.geometry.surface = md.geometry.base + md.geometry.thickness 64 64 md = SetIceShelfBC(md) … … 74 74 md.autodiff.isautodiff = True 75 75 md.geometry.thickness[index] = h1 76 md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness76 md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness 77 77 md.geometry.surface = md.geometry.base + md.geometry.thickness 78 78 md = SetIceShelfBC(md) … … 82 82 dVdh_ad = md.results.MasstransportSolution.AutodiffJacobian 83 83 84 print("dV /dh: analytical: %16.16g\n using adolc: %16.16g\n" % (dVdh_an, dVdh_ad))84 print("dV / dh: analytical: %16.16g\n using adolc: %16.16g\n" % (dVdh_an, dVdh_ad)) 85 85 86 86 #Fields and tolerances to track changes -
issm/trunk-jpl/test/NightlyRun/test3020.py
r23793 r24214 14 14 15 15 #This test runs test3020 with autodiff on, and checks that 16 #the value of the scalar forward difference match a step -wise differential16 #the value of the scalar forward difference match a step - wise differential 17 17 18 18 #First configure … … 36 36 index = index - 1 37 37 38 #parameters for the step -wise derivative38 #parameters for the step - wise derivative 39 39 delta = 0.00001 40 40 h1 = md.geometry.thickness[index] … … 51 51 md.autodiff.isautodiff = False 52 52 md.geometry.thickness[index] = h0 53 md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness53 md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness 54 54 md.geometry.surface = md.geometry.base + md.geometry.thickness 55 55 md = SetIceShelfBC(md) … … 63 63 md.autodiff.isautodiff = False 64 64 md.geometry.thickness[index] = h2 65 md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness65 md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness 66 66 md.geometry.surface = md.geometry.base + md.geometry.thickness 67 67 md = SetIceShelfBC(md) … … 79 79 md.autodiff.isautodiff = True 80 80 md.geometry.thickness[index] = h1 81 md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness81 md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness 82 82 md.geometry.surface = md.geometry.base + md.geometry.thickness 83 83 md = SetIceShelfBC(md) … … 88 88 dMaxVdh_ad = md.results.TransientSolution[0].AutodiffJacobian[1] 89 89 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))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)) 92 92 93 93 #Fields and tolerances to track changes 94 field_names = ['dV/dh -dV/dh0', 'dMaxV/dh-dMaxV/dh0']94 field_names = ['dV/dh - dV / dh0', 'dMaxV/dh - dMaxV / dh0'] 95 95 field_tolerances = [1e-13, 1e-13] 96 96 field_values = [dVdh_ad - dVdh_an, dMaxVdh_an - dMaxVdh_ad] -
issm/trunk-jpl/test/NightlyRun/test319.py
r23793 r24214 24 24 md.inversion.cost_functions = [103, 501] 25 25 md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2)) 26 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 726 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 7 27 27 md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters))) 28 28 md.inversion.maxiter_per_step = 2 * np.ones(md.inversion.nsteps) -
issm/trunk-jpl/test/NightlyRun/test320.py
r23793 r24214 24 24 md.inversion.cost_functions = [103, 501] 25 25 md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2)) 26 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 726 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 7 27 27 md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters))) 28 28 md.inversion.maxiter_per_step = 2 * np.ones(md.inversion.nsteps) -
issm/trunk-jpl/test/NightlyRun/test321.py
r23793 r24214 24 24 md.inversion.cost_functions = [102, 501] 25 25 md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2)) 26 md.inversion.cost_functions_coefficients[:, 1] = 2 * 10**- 726 md.inversion.cost_functions_coefficients[:, 1] = 2 * 10**- 7 27 27 md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters))) 28 28 md.inversion.maxiter_per_step = 2 * np.ones(md.inversion.nsteps) -
issm/trunk-jpl/test/NightlyRun/test322.py
r23793 r24214 24 24 md.inversion.cost_functions = [104, 501] 25 25 md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2)) 26 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 726 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 7 27 27 md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters))) 28 28 md.inversion.maxiter_per_step = 2 * np.ones(md.inversion.nsteps) -
issm/trunk-jpl/test/NightlyRun/test328.py
r23793 r24214 14 14 md = setflowequation(md, 'SSA', 'all') 15 15 md.smb = SMBgradients() 16 md.smb.b_pos = - 100. + 0.00005 * md.mesh.x - 0.0001 * md.mesh.y16 md.smb.b_pos = - 100. + 0.00005 * md.mesh.x - 0.0001 * md.mesh.y 17 17 md.smb.b_neg = 250. + 0.000051 * md.mesh.x - 0.00011 * md.mesh.y 18 18 md.transient.requested_outputs = ['default', 'TotalSmb'] -
issm/trunk-jpl/test/NightlyRun/test330.py
r23793 r24214 38 38 md.hydrology.sediment_transmitivity = (1.0e-3 * md.hydrology.sediment_thickness) * np.ones((md.mesh.numberofvertices)) 39 39 #init 40 md.initialization.sediment_head = - 5.0 * np.ones((md.mesh.numberofvertices))40 md.initialization.sediment_head = - 5.0 * np.ones((md.mesh.numberofvertices)) 41 41 #BC 42 42 md.hydrology.spcsediment_head = np.nan * np.ones((md.mesh.numberofvertices)) -
issm/trunk-jpl/test/NightlyRun/test3300.py
r23793 r24214 50 50 md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices + 1, len(times))) 51 51 52 md.basalforcings.groundedice_melting_rate[:, np.where(times <= 6.0)] = - 0.252 md.basalforcings.groundedice_melting_rate[:, np.where(times <= 6.0)] = - 0.2 53 53 md.basalforcings.groundedice_melting_rate[:, np.where(times <= 1.0)] = 1.0 54 54 md.basalforcings.groundedice_melting_rate[-1, :] = times … … 63 63 # totvol = np.zeros(4001) 64 64 # 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 *store65 # 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 67 67 # for i in range(0, 4000): 68 # sedvol[i] =np.mean(md.results.TransientSolution[i].SedimentHead)*sedstore69 # 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.00268 # 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 71 71 72 72 field_names = ['SedimentWaterHead5', 'EplWaterHead5', 'SedimentWaterHead40', 'EplWaterHead40'] -
issm/trunk-jpl/test/NightlyRun/test332.py
r23793 r24214 43 43 #you can also compare with an analitic solution, but it is exact 44 44 #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)) 46 46 field_names = ['SedimentWaterHead', 'SedimentHeadResidual'] 47 47 field_tolerances = [1e-13, 3e-10] -
issm/trunk-jpl/test/NightlyRun/test334.py
r23793 r24214 43 43 #you can also compare with an analitic solution, but it is exact 44 44 #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)) 46 46 field_names = ['SedimentWaterHead', 'SedimentHeadResidual'] 47 47 field_tolerances = [1e-13, 3e-10] -
issm/trunk-jpl/test/NightlyRun/test336.py
r23793 r24214 22 22 #Set up transient 23 23 smb = np.ones((md.mesh.numberofvertices)) * 3.6 24 smb = np.vstack((smb, smb * - 1.)).T24 smb = np.vstack((smb, smb * - 1.)).T 25 25 26 26 md.smb = SMBcomponents() -
issm/trunk-jpl/test/NightlyRun/test337.py
r23793 r24214 23 23 #Set up transient 24 24 smb = np.ones((md.mesh.numberofvertices)) * 3.6 25 smb = np.vstack((smb, smb * - 1.)).T25 smb = np.vstack((smb, smb * - 1.)).T 26 26 27 27 md.smb = SMBcomponents() -
issm/trunk-jpl/test/NightlyRun/test338.py
r23793 r24214 22 22 #Set up transient 23 23 smb = np.ones((md.mesh.numberofvertices)) * 3.6 24 smb = np.vstack((smb, smb * - 1.)).T24 smb = np.vstack((smb, smb * - 1.)).T 25 25 26 26 md.smb = SMBmeltcomponents() -
issm/trunk-jpl/test/NightlyRun/test341.py
r23793 r24214 27 27 md.inversion.cost_functions = [102, 501] 28 28 md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2)) 29 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 729 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 7 30 30 md.inversion.vx_obs = md.initialization.vx 31 31 md.inversion.vy_obs = md.initialization.vy -
issm/trunk-jpl/test/NightlyRun/test342.py
r23793 r24214 15 15 md.basalforcings = plumebasalforcings() 16 16 md.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, ))17 md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, )) 18 md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices, )) 19 19 md.basalforcings.plumex = 500000 20 20 md.basalforcings.plumey = 500000 -
issm/trunk-jpl/test/NightlyRun/test343.py
r23793 r24214 15 15 md = setflowequation(md, 'SSA', 'all') 16 16 md.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,))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, )) 22 22 23 23 #Change geometry -
issm/trunk-jpl/test/NightlyRun/test344.py
r23793 r24214 21 21 md = setflowequation(md, 'HO', 'all') 22 22 md.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,))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, )) 28 28 29 29 -
issm/trunk-jpl/test/NightlyRun/test346.py
r24096 r24214 1 #Test Name: SquareSheetConstrainedTherTranNyeCO2 2 import numpy as np 1 #Test Name: SquareSheetConstrainedTherTranNyeCO2 3 2 from model import * 4 3 from socket import gethostname … … 18 17 #Transient options 19 18 md.cluster = generic('name', gethostname(), 'np', 3) 20 md.materials.rheology_law ='NyeCO2'21 md.transient.isstressbalance =022 md.transient.ismasstransport =023 md.transient.issmb =124 md.transient.isthermal =125 md.transient.isgroundingline =019 md.materials.rheology_law = 'NyeCO2' 20 md.transient.isstressbalance = 0 21 md.transient.ismasstransport = 0 22 md.transient.issmb = 1 23 md.transient.isthermal = 1 24 md.transient.isgroundingline = 0 26 25 md = solve(md, 'Transient') 27 26 28 27 #Fields and tolerances to track changes 29 field_names = ['Temperature1', 'BasalforcingsGroundediceMeltingRate1',30 'Temperature3', 'BasalforcingsGroundediceMeltingRate3']28 field_names = ['Temperature1', 'BasalforcingsGroundediceMeltingRate1', 29 'Temperature3', 'BasalforcingsGroundediceMeltingRate3'] 31 30 field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13] 32 31 field_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 3 2 from model import * 4 3 from socket import gethostname … … 19 18 #Transient options 20 19 md.cluster = generic('name', gethostname(), 'np', 3) 21 md.materials.rheology_law ='NyeH2O'22 md.materials.rheology_B =nye(md.initialization.temperature,2)20 md.materials.rheology_law = 'NyeH2O' 21 md.materials.rheology_B = nye(md.initialization.temperature, 2) 23 22 24 md.transient.isstressbalance =025 md.transient.ismasstransport =026 md.transient.issmb =127 md.transient.isthermal =128 md.transient.isgroundingline =023 md.transient.isstressbalance = 0 24 md.transient.ismasstransport = 0 25 md.transient.issmb = 1 26 md.transient.isthermal = 1 27 md.transient.isgroundingline = 0 29 28 md = solve(md, 'Transient') 30 29 31 30 #Fields and tolerances to track changes 32 field_names = ['Temperature1', 'BasalforcingsGroundediceMeltingRate1',33 'Temperature3', 'BasalforcingsGroundediceMeltingRate3']31 field_names = ['Temperature1', 'BasalforcingsGroundediceMeltingRate1', 32 'Temperature3', 'BasalforcingsGroundediceMeltingRate3'] 34 33 field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13] 35 34 field_values = [md.results.TransientSolution[0].Temperature, -
issm/trunk-jpl/test/NightlyRun/test350.py
r23793 r24214 30 30 31 31 #Change geometry 32 md.geometry.base = - .02 * md.mesh.x + 20.33 md.geometry.thickness = 300. * np.ones((md.mesh.numberofvertices, ))32 md.geometry.base = - .02 * md.mesh.x + 20. 33 md.geometry.thickness = 300. * np.ones((md.mesh.numberofvertices, )) 34 34 md.geometry.bed = md.geometry.base 35 35 md.geometry.surface = md.geometry.bed + md.geometry.thickness … … 37 37 #define the initial water head as being such that the water pressure is 50% of the ice overburden pressure 38 38 md.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, ))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, )) 45 45 pos = np.intersect1d(np.array(np.where(md.mesh.vertexonboundary)), np.array(np.where(md.mesh.x == 1000))) 46 46 md.hydrology.spchead[pos] = md.geometry.base[pos] 47 47 48 48 #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, ))49 md.initialization.vx = 1e-6 * md.constants.yts * np.ones((md.mesh.numberofvertices, )) 50 md.initialization.vy = np.zeros((md.mesh.numberofvertices, )) 51 51 52 52 md.timestepping.time_step = 3. * 3600. / md.constants.yts 53 53 md.timestepping.final_time = .5 / 365. 54 md.materials.rheology_B = (5e-25)**(- 1. / 3.) * np.ones((md.mesh.numberofvertices,))54 md.materials.rheology_B = (5e-25)**(- 1. / 3.) * np.ones((md.mesh.numberofvertices, )) 55 55 56 56 #Add one moulin and Neumann BC, varying in time -
issm/trunk-jpl/test/NightlyRun/test352.py
r23816 r24214 22 22 #Set up transient 23 23 smb = np.ones((md.mesh.numberofvertices)) * 3.6 24 smb = np.vstack((smb, smb * - 1.)).T24 smb = np.vstack((smb, smb * - 1.)).T 25 25 md.smb.mass_balance = np.vstack((smb, [1.5, 3.])) 26 26 md.transient.isthermal = False -
issm/trunk-jpl/test/NightlyRun/test353.py
r23816 r24214 22 22 #Set up transient 23 23 smb = np.ones((md.mesh.numberofvertices)) * 3.6 24 smb = np.vstack((smb, smb * - 1.)).T24 smb = np.vstack((smb, smb * - 1.)).T 25 25 26 26 md.smb = SMBcomponents() -
issm/trunk-jpl/test/NightlyRun/test354.py
r23816 r24214 22 22 #Set up transient 23 23 smb = np.ones((md.mesh.numberofvertices)) * 3.6 24 smb = np.vstack((smb, smb * - 1.)).T24 smb = np.vstack((smb, smb * - 1.)).T 25 25 26 26 md.smb = SMBmeltcomponents() -
issm/trunk-jpl/test/NightlyRun/test404.py
r23869 r24214 19 19 #Fields and tolerances to track changes 20 20 field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure'] 21 field_tolerances = [2e-06, 4e-06,2e-06,1e-06,8e-07]21 field_tolerances = [2e-06, 4e-06, 2e-06, 1e-06, 8e-07] 22 22 field_values = [md.results.StressbalanceSolution.Vx, 23 23 md.results.StressbalanceSolution.Vy, -
issm/trunk-jpl/test/NightlyRun/test412.py
r24174 r24214 53 53 54 54 #imperative! 55 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses55 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses 56 56 57 57 #solve 58 md.verbose = verbose('000000000') 58 md.verbose = verbose('000000000') # this line is recommended 59 59 md = solve(md, 'Stressbalance', 'overwrite', 'y') 60 60 -
issm/trunk-jpl/test/NightlyRun/test413.py
r24174 r24214 51 51 52 52 #imperative! 53 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses53 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses 54 54 md.qmu.isdakota = 1 55 55 56 56 #solve 57 md.verbose = verbose('000000000') 57 md.verbose = verbose('000000000') # this line is recommended 58 58 md = solve(md, 'Stressbalance', 'overwrite', 'y') 59 59 -
issm/trunk-jpl/test/NightlyRun/test414.py
r24174 r24214 20 20 md.geometry.surface = md.geometry.base + md.geometry.thickness 21 21 22 #constrain all velocities to 1 m /yr, in the y-direction23 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 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, )) 26 26 27 27 #Dakota options … … 60 60 md.qmu.params.interval_type = 'forward' 61 61 md.qmu.isdakota = 1 62 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses62 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses 63 63 64 64 if version >= 6: … … 71 71 72 72 #solve 73 md.verbose = verbose('000000000') 73 md.verbose = verbose('000000000') # this line is recommended 74 74 md = solve(md, 'Stressbalance', 'overwrite', 'y') 75 75 md.qmu.results = md.results.dakota 76 76 77 77 #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/yr78 #ok, mass flux of 3 profiles should be-3 Gt / yr - 3 Gt / yr and the sum, which is - 6 Gt / yr 79 79 #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. 81 81 #we put all that data in the moments, which we will use to test for success. 82 82 #also, check that the stddev are 0. -
issm/trunk-jpl/test/NightlyRun/test415.py
r23793 r24214 24 24 md.inversion.cost_functions = [103, 501] 25 25 md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2)) 26 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 726 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 7 27 27 md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters))) 28 28 md.inversion.maxiter_per_step = 2 * np.ones((md.inversion.nsteps)) -
issm/trunk-jpl/test/NightlyRun/test416.py
r23793 r24214 24 24 md.inversion.cost_functions = [102, 501] 25 25 md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2)) 26 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 726 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 7 27 27 md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters))) 28 28 md.inversion.maxiter_per_step = 2 * np.ones((md.inversion.nsteps)) -
issm/trunk-jpl/test/NightlyRun/test417.py
r24183 r24214 20 20 md.geometry.surface = md.geometry.base + md.geometry.thickness 21 21 22 #constrain all velocities to 1 m /yr, in the y-direction22 #constrain all velocities to 1 m / yr, in the y - direction 23 23 md.stressbalance.spcvx[:] = 0 24 24 md.stressbalance.spcvy[:] = 1 … … 76 76 md.qmu.isdakota = 1 77 77 78 md.stressbalance.reltol = 10**- 5#tighten for qmu analyses78 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses 79 79 80 80 #solve 81 md.verbose = verbose('000000000') 81 md.verbose = verbose('000000000') # this line is recommended 82 82 83 83 # There may be a pair of numpy warnings in the function true_divide, 84 84 # this is normal and will not affect the results 85 # See src /m/qmu/dakota_out_parse.py, function "dak_tab_out" for details85 # See src / m / qmu / dakota_out_parse.py, function "dak_tab_out" for details 86 86 md = solve(md, 'Stressbalance', 'overwrite', 'y') 87 87 … … 89 89 md.qmu.results = md.results.dakota 90 90 91 #ok, mass flux of 3 profiles should be -3 Gt/yr -3 Gt/yr and the sum, which is -6 Gt/yr91 #ok, mass flux of 3 profiles should be-3 Gt / yr - 3 Gt / yr and the sum, which is - 6 Gt / yr 92 92 #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. 94 94 #we put all that data in the montecarlo field, which we will use to test for success. 95 95 #also, check that the stddev are 0. -
issm/trunk-jpl/test/NightlyRun/test418.py
r24180 r24214 1 1 #Test Name: SquareSheetShelfDiadSSA3dDakotaAreaAverage 2 3 2 # this test may crash 4 5 3 import numpy as np 6 4 from model import * … … 25 23 #partitioning 26 24 md.qmu.numberofpartitions = 100 27 25 #partitioner seamd to generate the following message: 28 26 #corrupted size vs. prev_size 29 27 #Aborted (core dumped) 30 28 md = partitioner(md, 'package', 'chaco', 'npart', md.qmu.numberofpartitions) 31 32 29 md.qmu.vpartition = md.qmu.vpartition - 1 33 30 34 vector = np.arange(1, 1 + md.mesh.numberofvertices, 1).reshape(- 1, 1)31 vector = np.arange(1, 1 + md.mesh.numberofvertices, 1).reshape(- 1, 1) 35 32 # double check this before committing: 36 #print 'before AreaAverageOntoPartition'37 33 vector_on_partition = AreaAverageOntoPartition(md, vector) 38 34 vector_on_nodes = vector_on_partition[md.qmu.vpartition] -
issm/trunk-jpl/test/NightlyRun/test420.py
r24174 r24214 50 50 51 51 #imperative! 52 md.stressbalance.reltol = 10**- 5 #tighten for qmu analysese52 md.stressbalance.reltol = 10**- 5 #tighten for qmu analysese 53 53 54 54 #solve 55 md.verbose = verbose('000000000') 55 md.verbose = verbose('000000000') # this line is recommended 56 56 md = solve(md, 'Stressbalance', 'overwrite', 'y') 57 57 md.qmu.results = md.results.dakota 58 58 59 59 #test on thickness 60 h = np.zeros((md.qmu.numberofpartitions, ))60 h = np.zeros((md.qmu.numberofpartitions, )) 61 61 for i in range(md.qmu.numberofpartitions): 62 62 h[i] = md.qmu.results.dresp_out[i].mean -
issm/trunk-jpl/test/NightlyRun/test423.py
r23793 r24214 18 18 pos = np.argmin(rad) 19 19 md.mesh.x[pos] = 0. 20 md.mesh.y[pos] = 0. 20 md.mesh.y[pos] = 0. #the closest node to the center is changed to be exactly at the center 21 21 xelem = np.mean(md.mesh.x[md.mesh.elements.astype(int) - 1], axis=1) 22 22 yelem = np.mean(md.mesh.y[md.mesh.elements.astype(int) - 1], axis=1) -
issm/trunk-jpl/test/NightlyRun/test424.py
r23793 r24214 14 14 md.initialization.vx[:] = 0. 15 15 md.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.16 md.geometry.base = - 700. - abs(md.mesh.y - 500000.) / 1000. 17 md.geometry.bed = - 700. - abs(md.mesh.y - 500000.) / 1000. 18 18 md.geometry.thickness[:] = 1000. 19 19 md.geometry.surface = md.geometry.base + md.geometry.thickness -
issm/trunk-jpl/test/NightlyRun/test425.py
r23793 r24214 14 14 md.initialization.vx[:] = 0. 15 15 md.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.16 md.geometry.base = - 700. - abs(md.mesh.y - 500000.) / 1000. 17 md.geometry.bed = - 700. - abs(md.mesh.y - 500000.) / 1000. 18 18 md.geometry.thickness[:] = 1300. 19 19 md.geometry.surface = md.geometry.base + md.geometry.thickness 20 md.smb.mass_balance[:] = - 150.20 md.smb.mass_balance[:] = - 150. 21 21 md.transient.isstressbalance = False 22 22 md.transient.isgroundingline = True -
issm/trunk-jpl/test/NightlyRun/test426.py
r23793 r24214 13 13 md.initialization.vx[:] = 0. 14 14 md.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.15 md.geometry.base = - 700. - abs(md.mesh.y - 500000.) / 1000. 16 md.geometry.bed = - 700. - abs(md.mesh.y - 500000.) / 1000. 17 17 md.geometry.thickness[:] = 1000. 18 18 md.geometry.surface = md.geometry.base + md.geometry.thickness -
issm/trunk-jpl/test/NightlyRun/test427.py
r23793 r24214 13 13 md.initialization.vx[:] = 0. 14 14 md.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.15 md.geometry.base = - 700. - abs(md.mesh.y - 500000.) / 1000. 16 md.geometry.bed = - 700. - abs(md.mesh.y - 500000.) / 1000. 17 17 md.geometry.thickness[:] = 1300 18 18 md.geometry.surface = md.geometry.base + md.geometry.thickness … … 20 20 md.extrude(3, 1.) 21 21 22 md.smb.mass_balance[:] = - 15022 md.smb.mass_balance[:] = - 150 23 23 md.transient.isstressbalance = False 24 24 md.transient.isgroundingline = True -
issm/trunk-jpl/test/NightlyRun/test430.py
r23793 r24214 15 15 md.initialization.vy[:] = 1. 16 16 md.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_water17 md.geometry.bed = - 100. - md.mesh.x / 1000. 18 md.geometry.base = - md.geometry.thickness * md.materials.rho_ice / md.materials.rho_water 19 19 md.mask.groundedice_levelset = md.geometry.thickness + md.materials.rho_water / md.materials.rho_ice * md.geometry.bed 20 20 pos = np.where(md.mask.groundedice_levelset >= 0.) … … 24 24 25 25 #Boundary conditions: 26 md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices,))26 md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices, )) 27 27 md.mask.ice_levelset[np.where(md.mesh.x == max(md.mesh.x))] = 0. 28 28 md.stressbalance.spcvx[:] = float('NaN') … … 30 30 md.stressbalance.spcvz[:] = float('NaN') 31 31 posA = 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)))32 posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)), np.array(np.where(md.mesh.y > - 0.1))) 33 33 pos = np.unique(np.concatenate((posA, posB))) 34 34 md.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)))35 pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > - 0.1))) 36 36 md.stressbalance.spcvx[pos2] = 0. 37 37 md.stressbalance.spcvy[pos2] = 0. 38 38 39 md.materials.rheology_B = 1. / ((10**- 25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices,))39 md.materials.rheology_B = 1. / ((10**- 25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices, )) 40 40 md.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, ))41 md.friction.coefficient[:] = np.sqrt(10**7) * np.ones((md.mesh.numberofvertices, )) 42 md.friction.p = 3. * np.ones((md.mesh.numberofelements, )) 43 43 md.smb.mass_balance[:] = 1. 44 44 md.basalforcings.groundedice_melting_rate[:] = 0. -
issm/trunk-jpl/test/NightlyRun/test433.py
r23793 r24214 18 18 pos = np.argmin(rad) 19 19 md.mesh.x[pos] = 0. 20 md.mesh.y[pos] = 0. 20 md.mesh.y[pos] = 0. #the closest node to the center is changed to be exactly at the center 21 21 xelem = np.mean(md.mesh.x[md.mesh.elements.astype(int) - 1], axis=1) 22 22 yelem = np.mean(md.mesh.y[md.mesh.elements.astype(int) - 1], axis=1) -
issm/trunk-jpl/test/NightlyRun/test435.py
r23793 r24214 15 15 md.initialization.vy[:] = 1. 16 16 md.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_water17 md.geometry.bed = - 100. - md.mesh.x / 1000. 18 md.geometry.base = - md.geometry.thickness * md.materials.rho_ice / md.materials.rho_water 19 19 md.mask.groundedice_levelset = md.geometry.thickness + md.materials.rho_water / md.materials.rho_ice * md.geometry.bed 20 20 pos = np.where(md.mask.groundedice_levelset >= 0) … … 25 25 26 26 #Boundary conditions: 27 md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices,))27 md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices, )) 28 28 md.mask.ice_levelset[np.where(md.mesh.x == max(md.mesh.x))] = 0. 29 29 md.stressbalance.spcvx[:] = float('Nan') … … 31 31 md.stressbalance.spcvz[:] = float('Nan') 32 32 posA = 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)))33 posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)), np.array(np.where(md.mesh.y > - 0.1))) 34 34 pos = np.unique(np.concatenate((posA, posB))) 35 35 md.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)))36 pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > - 0.1))) 37 37 md.stressbalance.spcvx[pos2] = 0. 38 38 md.stressbalance.spcvy[pos2] = 0. 39 39 40 md.materials.rheology_B = 1. / ((10**- 25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices,))40 md.materials.rheology_B = 1. / ((10**- 25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices, )) 41 41 md.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, ))42 md.friction.coefficient[:] = np.sqrt(1e7) * np.ones((md.mesh.numberofvertices, )) 43 md.friction.p = 3. * np.ones((md.mesh.numberofelements, )) 44 44 md.smb.mass_balance[:] = 1. 45 45 md.basalforcings.groundedice_melting_rate[:] = 0. -
issm/trunk-jpl/test/NightlyRun/test436.py
r23793 r24214 17 17 md.timestepping.time_step = 0. 18 18 md.thermal.isenthalpy = 1 19 md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices, ))20 md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices, ))19 md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices, )) 20 md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices, )) 21 21 22 22 #Go solve … … 26 26 for i in ['LliboutryDuval', 'CuffeyTemperate']: 27 27 print(' ') 28 print(' ====== Testing rheology law: ' + i + ' =')28 print(' == == == Testing rheology law: ' + i + ' = ') 29 29 30 30 md.materials.rheology_law = i -
issm/trunk-jpl/test/NightlyRun/test437.py
r23793 r24214 14 14 15 15 h = 100. 16 md.geometry.thickness = h * np.ones((md.mesh.numberofvertices, ))17 md.geometry.base = - h * np.ones((md.mesh.numberofvertices,))16 md.geometry.thickness = h * np.ones((md.mesh.numberofvertices, )) 17 md.geometry.base = - h * np.ones((md.mesh.numberofvertices, )) 18 18 md.geometry.surface = md.geometry.base + md.geometry.thickness 19 19 … … 27 27 Tb = 273.15 - 1. 28 28 Tsw = Tb 29 qgeo = md.materials.thermalconductivity / max(md.geometry.thickness) * (Tb - Ts) #qgeo = kappa *(Tb-Ts)/H29 qgeo = md.materials.thermalconductivity / max(md.geometry.thickness) * (Tb - Ts) #qgeo = kappa * (Tb - Ts) / H 30 30 md.basalforcings.geothermalflux[np.where(md.mesh.vertexonbase)] = qgeo 31 31 md.initialization.temperature = qgeo / md.materials.thermalconductivity * (md.geometry.surface - md.mesh.z) + Ts … … 33 33 #Surface forcing 34 34 pos = 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, ))35 SPC_cold = float('NaN') * np.ones((md.mesh.numberofvertices, )) 36 SPC_warm = float('NaN') * np.ones((md.mesh.numberofvertices, )) 37 37 SPC_cold[pos] = Ts 38 38 SPC_warm[pos] = Tsw -
issm/trunk-jpl/test/NightlyRun/test440.py
r24174 r24214 51 51 52 52 #imperative! 53 md.stressbalance.reltol = 10**- 5 #tighten for qmu analysese53 md.stressbalance.reltol = 10**- 5 #tighten for qmu analysese 54 54 55 55 #solve 56 md.verbose = verbose('000000000') 56 md.verbose = verbose('000000000') # this line is recommended 57 57 md = solve(md, 'Stressbalance', 'overwrite', 'y') 58 58 md.qmu.results = md.results.dakota -
issm/trunk-jpl/test/NightlyRun/test441.py
r23793 r24214 15 15 md.initialization.vy[:] = 1. 16 16 md.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_water17 md.geometry.bed = - 100. - md.mesh.x / 1000. 18 md.geometry.base = - md.geometry.thickness * md.materials.rho_ice / md.materials.rho_water 19 19 md.mask.groundedice_levelset = md.geometry.thickness + md.materials.rho_water / md.materials.rho_ice * md.geometry.bed 20 20 pos = np.array(np.where(md.mask.groundedice_levelset >= 0.)) … … 24 24 25 25 #Boundary conditions: 26 md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices,))26 md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices, )) 27 27 md.mask.ice_levelset[np.where(md.mesh.x == max(md.mesh.x))] = 0. 28 28 md.stressbalance.spcvx[:] = float('Nan') … … 30 30 md.stressbalance.spcvz[:] = float('Nan') 31 31 posA = 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)))32 posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)), np.array(np.where(md.mesh.y > - 0.1))) 33 33 pos = np.unique(np.concatenate((posA, posB))) 34 34 md.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)))35 pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > - 0.1))) 36 36 md.stressbalance.spcvx[pos2] = 0. 37 37 md.stressbalance.spcvy[pos2] = 0. 38 38 39 md.materials.rheology_B = 1. / ((10**- 25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices,))39 md.materials.rheology_B = 1. / ((10**- 25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices, )) 40 40 md.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, ))41 md.friction.coefficient[:] = np.sqrt(1e7) * np.ones((md.mesh.numberofvertices, )) 42 md.friction.p = 3. * np.ones((md.mesh.numberofelements, )) 43 43 md.smb.mass_balance[:] = 1. 44 44 md.basalforcings.groundedice_melting_rate[:] = 0. -
issm/trunk-jpl/test/NightlyRun/test442.py
r23793 r24214 15 15 md.initialization.vy[:] = 1. 16 16 md.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_water17 md.geometry.bed = - 100. - md.mesh.x / 1000. 18 md.geometry.base = - md.geometry.thickness * md.materials.rho_ice / md.materials.rho_water 19 19 md.mask.groundedice_levelset = md.geometry.thickness + md.materials.rho_water / md.materials.rho_ice * md.geometry.bed 20 20 pos = np.where(md.mask.groundedice_levelset >= 0.) … … 25 25 26 26 #Boundary conditions: 27 md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices,))27 md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices, )) 28 28 md.mask.ice_levelset[np.where(md.mesh.x == max(md.mesh.x))] = 0. 29 29 md.stressbalance.spcvx[:] = float('Nan') … … 31 31 md.stressbalance.spcvz[:] = float('Nan') 32 32 posA = 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)))33 posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)), np.array(np.where(md.mesh.y > - 0.1))) 34 34 pos = np.unique(np.concatenate((posA, posB))) 35 35 md.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)))36 pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > - 0.1))) 37 37 md.stressbalance.spcvx[pos2] = 0. 38 38 md.stressbalance.spcvy[pos2] = 0. 39 39 40 md.materials.rheology_B = 1. / ((10**- 25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices,))40 md.materials.rheology_B = 1. / ((10**- 25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices, )) 41 41 md.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, ))42 md.friction.coefficient[:] = np.sqrt(1e7) * np.ones((md.mesh.numberofvertices, )) 43 md.friction.p = 3. * np.ones((md.mesh.numberofelements, )) 44 44 md.smb.mass_balance[:] = 1. 45 45 md.basalforcings.groundedice_melting_rate[:] = 0. -
issm/trunk-jpl/test/NightlyRun/test444.py
r24174 r24214 21 21 pos = np.where(md.mask.groundedice_levelset < 0) 22 22 md.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, ))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, )) 26 26 md.transient.isthermal = 0 27 27 md.transient.isgroundingline = 1 … … 32 32 md.cluster = generic('name', oshostname(), 'np', 3) 33 33 34 regionalmask = np.zeros((md.mesh.numberofvertices, ))34 regionalmask = np.zeros((md.mesh.numberofvertices, )) 35 35 c_in = ContourToMesh(md.mesh.elements, md.mesh.x, md.mesh.y, '../Exp/SquareHalfRight.exp', 'node', 1) 36 36 regionalmask[np.where(c_in)] = 1 … … 104 104 md.qmu.isdakota = 1 105 105 106 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses106 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses 107 107 108 108 #solve 109 md.verbose = verbose('000000000') 109 md.verbose = verbose('000000000') # this line is recommended 110 110 md = solve(md, 'Transient', 'overwrite', 'y') 111 111 -
issm/trunk-jpl/test/NightlyRun/test445.py
r24174 r24214 75 75 md.qmu.isdakota = 1 76 76 77 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses77 md.stressbalance.reltol = 10**- 5 #tighten for qmu analyses 78 78 79 79 80 80 #solve 81 md.verbose = verbose('000000000') 81 md.verbose = verbose('000000000') # this line is recommended 82 82 md = solve(md, 'Steadystate', 'overwrite', 'y') 83 83 -
issm/trunk-jpl/test/NightlyRun/test460.py
r24025 r24214 15 15 md = md.extrude(3, 1.) 16 16 md.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, ))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, )) 20 20 md.cluster = generic('name', gethostname(), 'np', 3) 21 21 … … 24 24 field_tolerances = [] 25 25 field_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) 27 27 for i in ['SSA', 'HO', 'FS']: 28 28 md = setflowequation(md, i, 'all') 29 29 md = solve(md, 'Stressbalance') 30 30 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] 32 32 field_values = field_values + [md.results.StressbalanceSolution.Vx, 33 33 md.results.StressbalanceSolution.Vy, -
issm/trunk-jpl/test/NightlyRun/test461.py
r23793 r24214 15 15 md = md.extrude(3, 1.) 16 16 md.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, ))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, )) 20 20 21 21 md = setflowequation(md, 'FS', 'all') 22 md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices, ))23 md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices, ))22 md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices, )) 23 md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices, )) 24 24 md.transient.isstressbalance = 0 25 25 md.transient.ismasstransport = 0 -
issm/trunk-jpl/test/NightlyRun/test507.py
r23919 r24214 21 21 field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'BasalforcingsGroundediceMeltingRate1', 22 22 '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]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] 24 24 field_values = [md.results.TransientSolution[0].Vx, 25 25 md.results.TransientSolution[0].Vy, -
issm/trunk-jpl/test/NightlyRun/test511.py
r23793 r24214 14 14 15 15 #impose hydrostatic equilibrium (required by Stokes) 16 md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness16 md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness 17 17 md.geometry.surface = md.geometry.base + md.geometry.thickness 18 18 md.extrude(3, 1.) -
issm/trunk-jpl/test/NightlyRun/test512.py
r23793 r24214 25 25 md.inversion.cost_functions = [103, 501] 26 26 md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2)) 27 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 727 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 7 28 28 md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters))) 29 29 md.inversion.maxiter_per_step = 2. * np.ones((md.inversion.nsteps)) -
issm/trunk-jpl/test/NightlyRun/test513.py
r23793 r24214 23 23 md.inversion.cost_functions = [103, 501] 24 24 md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2)) 25 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 725 md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**- 7 26 26 md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters))) 27 27 md.inversion.maxiter_per_step = 2. * np.ones((md.inversion.nsteps)) -
issm/trunk-jpl/test/NightlyRun/test540.py
r23829 r24214 19 19 md.mask.ice_levelset = 1e4 * (md.mask.ice_levelset + 0.5) 20 20 md.calving = calvingvonmises() 21 md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices, ))21 md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices, )) 22 22 md.transient.ismovingfront = 1 23 23 md.transient.isgroundingline = 1 24 md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices, ))24 md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices, )) 25 25 pos = np.where(md.mesh.vertexonboundary) 26 26 md.levelset.spclevelset[pos] = md.mask.ice_levelset[pos] -
issm/trunk-jpl/test/NightlyRun/test541.py
r23793 r24214 20 20 md.mask.ice_levelset = 1e4 * (md.mask.ice_levelset + 0.5) 21 21 md.calving = calvingvonmises() 22 md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices, ))22 md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices, )) 23 23 md.transient.ismovingfront = 1 24 md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices, ))24 md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices, )) 25 25 pos = np.where(md.mesh.vertexonboundary) 26 26 md.levelset.spclevelset[pos] = md.mask.ice_levelset[pos] -
issm/trunk-jpl/test/NightlyRun/test611.py
r23793 r24214 20 20 md.inversion.control_parameters = ['BalancethicknessThickeningRate'] 21 21 md.inversion.thickness_obs = md.geometry.thickness 22 md.inversion.min_parameters = - 50. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))22 md.inversion.min_parameters = - 50. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters))) 23 23 md.inversion.max_parameters = 50. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters))) 24 24 md.inversion.cost_functions = [201] -
issm/trunk-jpl/test/NightlyRun/test613.py
r23793 r24214 30 30 md.balancethickness.stabilization = 1 31 31 md.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)))).T33 md.inversion.max_parameters = np.vstack((+ 2000. * np.ones((md.mesh.numberofvertices)), + 2000. * np.ones((md.mesh.numberofvertices)))).T32 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 34 34 md.inversion.cost_functions = [201] 35 35 md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, len(md.inversion.cost_functions))) -
issm/trunk-jpl/test/NightlyRun/test701.py
r23793 r24214 9 9 x = np.arange(1, 3001, 100).T 10 10 h = np.linspace(1000, 300, np.size(x)).T 11 b = - 917. / 1023. * h11 b = - 917. / 1023. * h 12 12 13 13 md = bamgflowband(model(), x, b + h, b, 'hmax', 80.) 14 14 15 #Geometry #interp1d returns a function to be called on md.mesh.x 15 print(isinstance(md, model)) 16 17 #Geometry #interp1d returns a function to be called on md.mesh.x 16 18 md.geometry.surface = np.interp(md.mesh.x, x, b + h) 17 19 md.geometry.base = np.interp(md.mesh.x, x, b) … … 19 21 20 22 #mask 21 md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices,))23 md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices, )) 22 24 md.mask.ice_levelset[np.where(md.mesh.vertexflags(2))] = 0. 23 md.mask.groundedice_levelset = np.zeros((md.mesh.numberofvertices, )) - 0.525 md.mask.groundedice_levelset = np.zeros((md.mesh.numberofvertices, )) - 0.5 24 26 25 27 #materials 26 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, ))28 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, )) 27 29 md.materials.rheology_B = paterson(md.initialization.temperature) 28 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements, ))30 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements, )) 29 31 30 32 #friction 31 md.friction.coefficient = np.zeros((md.mesh.numberofvertices, ))33 md.friction.coefficient = np.zeros((md.mesh.numberofvertices, )) 32 34 md.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, ))35 md.friction.p = np.ones((md.mesh.numberofelements, )) 36 md.friction.q = np.ones((md.mesh.numberofelements, )) 35 37 36 38 #Boundary conditions 37 39 md.stressbalance.referential = np.nan * np.ones((md.mesh.numberofvertices, 6)) 38 40 md.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, ))41 md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices, )) 42 md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices, )) 43 md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices, )) 42 44 md.stressbalance.spcvx[np.where(md.mesh.vertexflags(4))] = 0. 43 45 md.stressbalance.spcvy[np.where(md.mesh.vertexflags(4))] = 0. 44 md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))46 md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, )) 45 47 46 48 #Misc 49 print(isinstance(md, model)) 50 print(type(md)) 47 51 md = setflowequation(md, 'FS', 'all') 48 52 md.stressbalance.abstol = np.nan 49 #md.stressbalance.reltol = 10**- 1653 #md.stressbalance.reltol = 10**- 16 50 54 md.stressbalance.FSreconditioning = 1. 51 55 md.stressbalance.maxiter = 20 … … 60 64 field_tolerances = [] 61 65 field_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) 63 67 for i in ['MINI', 'MINIcondensed', 'TaylorHood', 'LATaylorHood', 'CrouzeixRaviart', 'LACrouzeixRaviart']: 64 68 print(' ') 65 print(' ======Testing ' + i + ' Full-Stokes Finite element=====')69 print(' == == == Testing ' + i + ' Full - Stokes Finite element == == = ') 66 70 md.flowequation.fe_FS = i 67 71 md = solve(md, 'Stressbalance') -
issm/trunk-jpl/test/NightlyRun/test702.py
r23793 r24214 10 10 11 11 #mesh parameters 12 x = np.arange(- 5, 5.5, .5).T12 x = np.arange(- 5, 5.5, .5).T 13 13 [b, h, sea] = NowickiProfile(x) 14 14 x = x * 10**3 … … 25 25 26 26 #mask 27 md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices,))27 md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices, )) 28 28 md.mask.ice_levelset[np.where(md.mesh.vertexflags(2))] = 0 29 md.mask.groundedice_levelset = - 0.5 * np.ones((md.mesh.numberofvertices))29 md.mask.groundedice_levelset = - 0.5 * np.ones((md.mesh.numberofvertices)) 30 30 md.mask.groundedice_levelset[np.where(md.mesh.x < 0)] = 0.5 31 31 32 32 #materials 33 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, ))33 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, )) 34 34 md.materials.rheology_B = paterson(md.initialization.temperature) 35 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))35 md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, )) 36 36 37 37 #damage 38 md.damage.D = np.zeros((md.mesh.numberofvertices, ))39 md.damage.spcdamage = float('NaN') * np.ones((md.mesh.numberofvertices, ))38 md.damage.D = np.zeros((md.mesh.numberofvertices, )) 39 md.damage.spcdamage = float('NaN') * np.ones((md.mesh.numberofvertices, )) 40 40 41 41 #friciton 42 md.friction.coefficient = np.zeros((md.mesh.numberofvertices, ))42 md.friction.coefficient = np.zeros((md.mesh.numberofvertices, )) 43 43 md.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, ))44 md.friction.p = np.ones((md.mesh.numberofelements, )) 45 md.friction.q = np.ones((md.mesh.numberofelements, )) 46 46 47 47 #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, ))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, )) 51 51 md.stressbalance.referential = float('NaN') * np.ones((md.mesh.numberofvertices, 6)) 52 52 md.stressbalance.loadingforce = np.zeros((md.mesh.numberofvertices, 3)) 53 53 md.stressbalance.spcvx[np.where(md.mesh.vertexflags(4))] = 800. 54 54 md.stressbalance.spcvy[np.where(md.mesh.vertexflags(4))] = 0. 55 md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))55 md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, )) 56 56 57 57 #misc … … 73 73 for i in ['MINI', 'MINIcondensed', 'TaylorHood', 'XTaylorHood', 'LATaylorHood']: 74 74 print(' ') 75 print(' ======Testing ' + i + ' Full-Stokes Finite element=====')75 print(' == == == Testing ' + i + ' Full - Stokes Finite element == == = ') 76 76 md.flowequation.fe_FS = i 77 77 md = solve(md, 'Stressbalance') -
issm/trunk-jpl/test/NightlyRun/test703.py
r23793 r24214 9 9 10 10 #mesh parameters 11 x = np.arange(- 5, 5.5, .5).T11 x = np.arange(- 5, 5.5, .5).T 12 12 [b, h, sea] = NowickiProfile(x) 13 13 x = x * 10**3 … … 38 38 39 39 #mask 40 md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices))40 md.mask.ice_levelset = - np.ones((md.mesh.numberofvertices)) 41 41 md.mask.ice_levelset[np.where(md.mesh.vertexflags(2))] = 0 42 md.mask.groundedice_levelset = - 0.5 * np.ones((md.mesh.numberofvertices))42 md.mask.groundedice_levelset = - 0.5 * np.ones((md.mesh.numberofvertices)) 43 43 md.mask.groundedice_levelset[np.where(md.mesh.x < 0)] = 0.5 44 44 -
issm/trunk-jpl/test/NightlyRun/test806.py
r24043 r24214 24 24 25 25 #Do not kill ice bergs as all is floating 26 md.levelset.kill_icebergs =026 md.levelset.kill_icebergs = 0 27 27 28 28 md.timestepping.time_step = 10 -
issm/trunk-jpl/test/NightlyRun/test807.py
r24043 r24214 24 24 25 25 #Do not kill ice bergs as all is floating 26 md.levelset.kill_icebergs =026 md.levelset.kill_icebergs = 0 27 27 28 28 md.timestepping.time_step = 10 -
issm/trunk-jpl/test/NightlyRun/test808.py
r24043 r24214 17 17 18 18 #Do not kill ice bergs as all is floating 19 md.levelset.kill_icebergs =019 md.levelset.kill_icebergs = 0 20 20 21 21 x = md.mesh.x … … 24 24 Lx = (xmax - xmin) 25 25 alpha = 2. / 3. 26 md.mask.ice_levelset = - 1 + 2 * (md.mesh.y > 9e5)26 md.mask.ice_levelset = - 1 + 2 * (md.mesh.y > 9e5) 27 27 28 28 md.timestepping.time_step = 1 … … 40 40 md.calving = calvingminthickness() 41 41 md.calving.min_thickness = 400 42 md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices, ))43 md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices, ))42 md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices, )) 43 md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices, )) 44 44 md.levelset.reinit_frequency = 1 45 45 -
issm/trunk-jpl/test/Par/79North.py
r22993 r24214 11 11 12 12 #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'));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')) 20 20 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.thickness21 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 26 26 27 27 #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.temperature28 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 32 32 33 33 #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))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)) 38 38 39 39 #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))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)) 44 44 45 45 #Numerical parameters 46 md.masstransport.stabilization =147 md.thermal.stabilization =148 md.verbose =verbose(0)49 md.settings.waitonlock =3050 md.timestepping.time_step =1.51 md.timestepping.final_time =3.52 md.stressbalance.restol =0.0553 md.stressbalance.reltol =0.00554 md.steadystate.reltol =0.00555 md.stressbalance.abstol =float('NaN')56 md.groundingline.migration ='None'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' 57 57 58 58 #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]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] 63 63 64 64 #Change name so that no test have the same name 65 65 if len(inspect.stack()) > 2: 66 66 md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0] -
issm/trunk-jpl/test/Par/GiaIvinsBenchmarksAB.py
r23017 r24214 13 13 nv = md.mesh.numberofvertices 14 14 if (np.isnan(md.geometry.thickness)): 15 md.geometry.thickness = np.zeros((md.mesh.numberofvertices,))15 md.geometry.thickness = np.zeros((md.mesh.numberofvertices, )) 16 16 for i in range(nv): 17 18 19 20 21 md.geometry.thickness[i] = 1.0 # non-zero thickness17 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 22 22 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 matrix23 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 26 26 27 #Ice density used for benchmarking, not 917 kg /m^328 md.materials.rho_ice = 1000 #kg m^327 #Ice density used for benchmarking, not 917 kg / m^3 28 md.materials.rho_ice = 1000 #kg m^3 29 29 30 30 #GIA parameters specific to Experiments A and B 31 md.gia.mantle_viscosity = 1e21 * np.ones((md.mesh.numberofvertices, ))#in Pa.s32 md.gia.lithosphere_thickness = 100 * np.ones((md.mesh.numberofvertices, ))#in km33 md.materials.lithosphere_shear_modulus = 6.7 *1e10#in Pa34 md.materials.lithosphere_density = 3.36 #in g/cm^335 md.materials.mantle_shear_modulus = 1.45 *1e11#in Pa36 md.materials.mantle_density = 3.38 #in g/cm^331 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 37 37 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 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) 44 44 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 48 vy 49 x 50 y 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 51 51 index = None 52 md.initialization.vz = np.zeros((md.mesh.numberofvertices, ))53 md.initialization.pressure = np.zeros((md.mesh.numberofvertices, ))52 md.initialization.vz = np.zeros((md.mesh.numberofvertices, )) 53 md.initialization.pressure = np.zeros((md.mesh.numberofvertices, )) 54 54 55 55 #Materials 56 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, ))56 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, )) 57 57 md.materials.rheology_B = paterson(md.initialization.temperature) 58 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements, ))58 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements, )) 59 59 60 60 #Friction 61 md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices, ))61 md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices, )) 62 62 md.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, ))63 md.friction.p = np.ones((md.mesh.numberofelements, )) 64 md.friction.q = np.ones((md.mesh.numberofelements, )) 65 65 66 66 #Numerical parameters 67 md.groundingline.migration ='None'67 md.groundingline.migration = 'None' 68 68 md.masstransport.stabilization = 1 69 69 md.thermal.stabilization = 1. … … 82 82 #Change name so that no test have the same name 83 83 if len(inspect.stack()) > 2: 84 84 md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0] -
issm/trunk-jpl/test/Par/GiaIvinsBenchmarksCD.py
r23017 r24214 13 13 nv = md.mesh.numberofvertices 14 14 if (np.isnan(md.geometry.thickness)): 15 md.geometry.thickness = np.zeros((md.mesh.numberofvertices,))15 md.geometry.thickness = np.zeros((md.mesh.numberofvertices, )) 16 16 for i in range(nv): 17 18 19 20 21 md.geometry.thickness[i] = 1.0 # non-zero thickness17 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 22 22 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 matrix23 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 26 26 27 #Ice density used for benchmarking, not 917 kg /m^328 md.materials.rho_ice = 1000 #kg m^327 #Ice density used for benchmarking, not 917 kg / m^3 28 md.materials.rho_ice = 1000 #kg m^3 29 29 30 30 #GIA parameters specific to Experiments A and B 31 md.gia.mantle_viscosity = 1e21 * np.ones((md.mesh.numberofvertices, ))#in Pa.s32 md.gia.lithosphere_thickness = 100 * np.ones((md.mesh.numberofvertices, ))#in km33 md.materials.lithosphere_shear_modulus = 6.7 *1e10#in Pa34 md.materials.lithosphere_density = 3.32 #in g/cm^335 md.materials.mantle_shear_modulus = 1.45 *1e11#in Pa36 md.materials.mantle_density = 3.34 #in g/cm^331 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 37 37 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 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) 44 44 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 48 vy 49 x 50 y 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 51 51 index = None 52 md.initialization.vz = np.zeros((md.mesh.numberofvertices, ))53 md.initialization.pressure = np.zeros((md.mesh.numberofvertices, ))52 md.initialization.vz = np.zeros((md.mesh.numberofvertices, )) 53 md.initialization.pressure = np.zeros((md.mesh.numberofvertices, )) 54 54 55 55 #Materials 56 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, ))56 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, )) 57 57 md.materials.rheology_B = paterson(md.initialization.temperature) 58 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements, ))58 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements, )) 59 59 60 60 #Friction 61 md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices, ))61 md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices, )) 62 62 md.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, ))63 md.friction.p = np.ones((md.mesh.numberofelements, )) 64 md.friction.q = np.ones((md.mesh.numberofelements, )) 65 65 66 66 #Numerical parameters 67 md.groundingline.migration ='None'67 md.groundingline.migration = 'None' 68 68 md.masstransport.stabilization = 1. 69 69 md.thermal.stabilization = 1. … … 82 82 #Change name so that no test have the same name 83 83 if len(inspect.stack()) > 2: 84 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 1 import numpy as np 2 2 from SetIceSheetBC import SetIceSheetBC 3 3 … … 5 5 6 6 print(" 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.base7 md.geometry.surface = -md.mesh.x * np.tan(0.5 * np.pi / 180.) 8 md.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)) 9 md.geometry.thickness = md.geometry.surface - md.geometry.base 10 10 11 11 print(" creating drag") 12 md.friction.coefficient =200.*numpy.ones((md.mesh.numberofvertices))13 md.friction.coefficient[n umpy.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))12 md.friction.coefficient = 200. * np.ones((md.mesh.numberofvertices)) 13 md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0. 14 md.friction.p = np.ones((md.mesh.numberofelements)) 15 md.friction.q = np.ones((md.mesh.numberofelements)) 16 16 17 17 print(" 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))18 md.materials.rheology_B = 6.8067 * 10**7 * np.ones((md.mesh.numberofvertices)) 19 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements)) 20 20 21 21 print(" boundary conditions for stressbalance model") 22 22 #Create node on boundary first (because we cannot use mesh) 23 md =SetIceSheetBC(md)23 md = SetIceSheetBC(md) -
issm/trunk-jpl/test/Par/ISMIPB.py
r23707 r24214 1 import numpy 1 import numpy as np 2 2 from SetIceSheetBC import SetIceSheetBC 3 3 … … 5 5 6 6 print(" 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.base7 md.geometry.surface = -md.mesh.x * np.tan(0.5 * np.pi / 180.) 8 md.geometry.base = md.geometry.surface - 1000. + 500. * np.sin(md.mesh.x * 2. * np.pi / np.max(md.mesh.x)) 9 md.geometry.thickness = md.geometry.surface - md.geometry.base 10 10 11 11 print(" creating drag") 12 md.friction.coefficient =200.*numpy.ones((md.mesh.numberofvertices))13 md.friction.coefficient[n umpy.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))12 md.friction.coefficient = 200. * np.ones((md.mesh.numberofvertices)) 13 md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0. 14 md.friction.p = np.ones((md.mesh.numberofelements)) 15 md.friction.q = np.ones((md.mesh.numberofelements)) 16 16 17 17 print(" 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))18 md.materials.rheology_B = 6.8067 * 10**7 * np.ones((md.mesh.numberofvertices)) 19 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements)) 20 20 21 21 print(" boundary conditions for stressbalance model") 22 22 #Create node on boundary first (because we cannot use mesh) 23 md =SetIceSheetBC(md)23 md = SetIceSheetBC(md) -
issm/trunk-jpl/test/Par/ISMIPC.py
r23707 r24214 1 import numpy 1 import numpy as np 2 2 from SetIceSheetBC import SetIceSheetBC 3 3 … … 5 5 6 6 print(" creating thickness") 7 md.geometry.surface =2000.-md.mesh.x*numpy.tan(0.1*numpy.pi/180.) #to have z>08 md.geometry.base =md.geometry.surface-1000.9 md.geometry.thickness =md.geometry.surface-md.geometry.base7 md.geometry.surface = 2000. - md.mesh.x * np.tan(0.1 * np.pi / 180.) #to have z > 0 8 md.geometry.base = md.geometry.surface - 1000. 9 md.geometry.thickness = md.geometry.surface - md.geometry.base 10 10 11 11 print(" 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[n umpy.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))) 13 md.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)))) 14 md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0. 15 md.friction.p = np.ones((md.mesh.numberofelements)) 16 md.friction.q = np.zeros((md.mesh.numberofelements)) 17 17 18 18 print(" 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))19 md.materials.rheology_B = 6.8067 * 10**7 * np.ones((md.mesh.numberofvertices)) 20 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements)) 21 21 22 22 print(" boundary conditions for stressbalance model:") 23 23 #Create node on boundary first (because we can not use mesh) 24 md =SetIceSheetBC(md)24 md = SetIceSheetBC(md) -
issm/trunk-jpl/test/Par/ISMIPD.py
r23707 r24214 1 import numpy 1 import numpy as np 2 2 from SetIceSheetBC import SetIceSheetBC 3 3 … … 5 5 6 6 print(" creating thickness") 7 md.geometry.surface =2000.-md.mesh.x*numpy.tan(0.1*numpy.pi/180.) #to have z>08 md.geometry.base =md.geometry.surface-1000.9 md.geometry.thickness =md.geometry.surface-md.geometry.base7 md.geometry.surface = 2000. - md.mesh.x * np.tan(0.1 * np.pi / 180.) #to have z > 0 8 md.geometry.base = md.geometry.surface - 1000. 9 md.geometry.thickness = md.geometry.surface - md.geometry.base 10 10 11 11 print(" 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[n umpy.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))12 md.friction.coefficient = np.sqrt(md.constants.yts * (1000. + 1000. * np.sin(md.mesh.x * 2. * np.pi / np.max(md.mesh.x)))) 13 md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0. 14 md.friction.p = np.ones((md.mesh.numberofelements)) 15 md.friction.q = np.zeros((md.mesh.numberofelements)) 16 16 17 17 print(" 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))18 md.materials.rheology_B = 6.8067 * 10**7 * np.ones((md.mesh.numberofvertices)) 19 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements)) 20 20 21 21 print(" boundary conditions for stressbalance model:") 22 22 #Create node on boundary first (because we can not use mesh) 23 md =SetIceSheetBC(md)23 md = SetIceSheetBC(md) -
issm/trunk-jpl/test/Par/ISMIPE.py
r23707 r24214 1 import numpy 1 import numpy as np 2 2 from arch import * 3 3 from SetIceSheetBC import SetIceSheetBC … … 6 6 7 7 print(" creating thickness") 8 data = n umpy.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]8 data = np.array(archread('../Data/ISMIPE.arch', 'data')) 9 md.geometry.surface = np.zeros((md.mesh.numberofvertices)) 10 md.geometry.base = np.zeros((md.mesh.numberofvertices)) 11 for 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] 18 18 19 md.geometry.thickness =md.geometry.surface-md.geometry.base20 md.geometry.thickness[n umpy.nonzero(numpy.logical_not(md.geometry.thickness))]=0.0121 md.geometry.base =md.geometry.surface-md.geometry.thickness19 md.geometry.thickness = md.geometry.surface - md.geometry.base 20 md.geometry.thickness[np.nonzero(np.logical_not(md.geometry.thickness))] = 0.01 21 md.geometry.base = md.geometry.surface - md.geometry.thickness 22 22 23 23 print(" 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))24 md.friction.coefficient = np.zeros((md.mesh.numberofvertices)) 25 md.friction.p = np.ones((md.mesh.numberofelements)) 26 md.friction.q = np.ones((md.mesh.numberofelements)) 27 27 28 28 print(" 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))29 md.materials.rheology_B = 6.8067 * 10**7 * np.ones((md.mesh.numberofvertices)) 30 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements)) 31 31 32 32 print(" boundary conditions for stressbalance model:") 33 33 #Create node on boundary first (because we can not use mesh) 34 md =SetIceSheetBC(md)34 md = SetIceSheetBC(md) -
issm/trunk-jpl/test/Par/ISMIPF.py
r23707 r24214 1 import numpy 1 import numpy as np 2 2 from SetIceSheetBC import SetIceSheetBC 3 3 4 4 #Ok, start defining model parameters here 5 md.verbose =25 md.verbose = 2 6 6 7 7 print(" 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.base8 md.geometry.surface = -md.mesh.x * np.tan(3. * np.pi / 180.) 9 #md.geometry.base = md.geometry.surface-1000. 10 md.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)) 11 md.geometry.thickness = md.geometry.surface - md.geometry.base 12 12 13 13 print(" 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))14 md.friction.coefficient = np.sqrt(md.constants.yts / (2.140373 * 10**- 7 * 1000.)) * np.ones((md.mesh.numberofvertices)) 15 md.friction.p = np.ones((md.mesh.numberofelements)) 16 md.friction.q = np.zeros((md.mesh.numberofelements)) 17 17 18 18 print(" 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'19 md.materials.rheology_B = 1.4734 * 10**14 * np.ones((md.mesh.numberofvertices)) 20 md.materials.rheology_n = 1. * np.ones((md.mesh.numberofelements)) 21 md.materials.rheology_law = 'None' 22 22 23 23 print(" boundary conditions for stressbalance model") 24 24 #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))25 md = SetIceSheetBC(md) 26 md.stressbalance.spcvx = 100. * np.ones((md.mesh.numberofvertices)) 27 md.initialization.vx = np.zeros((md.mesh.numberofvertices)) 28 md.initialization.vy = np.zeros((md.mesh.numberofvertices)) 29 md.initialization.vz = np.zeros((md.mesh.numberofvertices)) 30 md.initialization.vel = np.zeros((md.mesh.numberofvertices)) 31 md.initialization.pressure = np.zeros((md.mesh.numberofvertices)) 32 md.initialization.temperature = 255. * np.ones((md.mesh.numberofvertices)) 33 pos = 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)))) 34 md.balancethickness.spcthickness = float('NaN') * np.ones((md.mesh.numberofvertices)) 35 md.balancethickness.spcthickness[pos] = md.geometry.thickness[pos] 36 md.masstransport.spcthickness = float('NaN') * np.ones((md.mesh.numberofvertices)) 37 md.masstransport.spcthickness[pos] = md.geometry.thickness[pos] 38 md.thermal.spctemperature = 255. * np.ones((md.mesh.numberofvertices)) 39 md.basalforcings.geothermalflux = 0.4 * np.ones((md.mesh.numberofvertices)) 40 40 41 41 #Parallel options 42 md.mesh.average_vertex_connectivity =20042 md.mesh.average_vertex_connectivity = 200 43 43 44 44 #Transient options 45 md.timestepping.time_step =1.46 md.timestepping.final_time =10.47 md.masstransport.stabilization =148 md.thermal.stabilization =149 md.thermal.penalty_threshold =10**550 md.transient.isthermal =045 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 -
issm/trunk-jpl/test/Par/IceCube.py
r22993 r24214 3 3 import inspect 4 4 from verbose import verbose 5 from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d6 5 from paterson import paterson 7 6 from SetIceSheetBC import SetIceSheetBC … … 11 10 12 11 #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.thickness12 md.geometry.thickness = 1000.0 * np.ones((md.mesh.numberofvertices)) 13 md.geometry.base = np.zeros((md.mesh.numberofvertices)) 14 md.geometry.surface = md.geometry.base + md.geometry.thickness 16 15 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))16 md.initialization.vx = np.zeros((md.mesh.numberofvertices)) 17 md.initialization.vy = np.zeros((md.mesh.numberofvertices)) 18 md.initialization.vz = np.zeros((md.mesh.numberofvertices)) 19 md.initialization.pressure = np.zeros((md.mesh.numberofvertices)) 21 20 22 21 #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))22 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices)) 23 md.materials.rheology_B = paterson(md.initialization.temperature) 24 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements)) 26 25 27 26 #Calving 28 md.calving.calvingrate =np.zeros((md.mesh.numberofvertices))29 md.levelset.spclevelset =np.nan*np.ones((md.mesh.numberofvertices))27 md.calving.calvingrate = np.zeros((md.mesh.numberofvertices)) 28 md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices)) 30 29 31 30 #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))31 md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices)) 32 md.friction.coefficient[np.where(md.mask.groundedice_levelset < 0.)[0]] = 0. 33 md.friction.p = np.ones((md.mesh.numberofelements)) 34 md.friction.q = np.ones((md.mesh.numberofelements)) 36 35 37 36 #Numerical parameters 38 md.masstransport.stabilization =1.39 md.thermal.stabilization =1.40 md.verbose =verbose(0)41 md.settings.waitonlock =3042 md.stressbalance.restol =0.0543 md.steadystate.reltol =0.0544 md.stressbalance.reltol =0.0545 md.stressbalance.abstol =float('NaN')46 md.timestepping.time_step =1.47 md.timestepping.final_time =3.48 md.groundingline.migration ='None'37 md.masstransport.stabilization = 1. 38 md.thermal.stabilization = 1. 39 md.verbose = verbose(0) 40 md.settings.waitonlock = 30 41 md.stressbalance.restol = 0.05 42 md.steadystate.reltol = 0.05 43 md.stressbalance.reltol = 0.05 44 md.stressbalance.abstol = float('NaN') 45 md.timestepping.time_step = 1. 46 md.timestepping.final_time = 3. 47 md.groundingline.migration = 'None' 49 48 50 49 #Boundary conditions: 51 md =SetIceSheetBC(md)50 md = SetIceSheetBC(md) 52 51 53 52 #Change name so that no test have the same name 54 53 if len(inspect.stack()) > 2: 55 54 md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0] -
issm/trunk-jpl/test/Par/Pig.py
r23838 r24214 2 2 import inspect 3 3 from arch import * 4 import numpy 4 import numpy as np 5 5 from verbose import verbose 6 6 from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d … … 11 11 12 12 #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 = n umpy.array(archread('../Data/Pig.arch','thickness'))20 bed = numpy.array(archread('../Data/Pig.arch','bed'))13 x = np.array(archread('../Data/Pig.arch', 'x')) 14 y = np.array(archread('../Data/Pig.arch', 'y')) 15 vx_obs = np.array(archread('../Data/Pig.arch', 'vx_obs')) 16 vy_obs = np.array(archread('../Data/Pig.arch', 'vy_obs')) 17 index = np.array(archread('../Data/Pig.arch', 'index')).astype(int) 18 surface = np.array(archread('../Data/Pig.arch', 'surface')) 19 thickness = np.array(archread('../Data/Pig.arch', 'thickness')) 20 bed = np.array(archread('../Data/Pig.arch', 'bed')) 21 21 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.thickness27 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_obs31 md.initialization.vy =md.inversion.vy_obs32 md.initialization.vz =numpy.zeros((md.mesh.numberofvertices))33 md.initialization.pressure =numpy.zeros((md.mesh.numberofvertices))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 = np.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 = np.zeros((md.mesh.numberofvertices)) 33 md.initialization.pressure = np.zeros((md.mesh.numberofvertices)) 34 34 35 35 #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.temperature36 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)) 39 md.initialization.temperature = md.initialization.temperature 40 40 41 41 #Friction 42 md.friction.coefficient =50.*numpy.ones((md.mesh.numberofvertices))43 md.friction.coefficient[n umpy.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))42 md.friction.coefficient = 50. * np.ones((md.mesh.numberofvertices)) 43 md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0. 44 md.friction.p = np.ones((md.mesh.numberofelements)) 45 md.friction.q = np.ones((md.mesh.numberofelements)) 46 46 47 47 #Numerical parameters 48 md.masstransport.stabilization =1.49 md.verbose =verbose(0)50 md.settings.waitonlock =3051 md.timestepping.time_step =1.52 md.timestepping.final_time =2.53 md.stressbalance.restol =0.0554 md.stressbalance.reltol =1.55 md.steadystate.reltol =1.56 md.stressbalance.abstol =float('nan')57 md.groundingline.migration ='None'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' 58 58 59 59 #Boundary conditions: 60 md =SetMarineIceSheetBC(md)60 md = SetMarineIceSheetBC(md) 61 61 62 62 #Change name so that no test have the same name 63 63 if len(inspect.stack()) > 2: 64 64 md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0] -
issm/trunk-jpl/test/Par/RoundSheetEISMINT.py
r23707 r24214 4 4 #Ok, start defining model parameters here 5 5 print(" 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.thickness6 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 9 9 10 10 print(" 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))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)) 14 14 15 15 print(" creating temperatures") 16 tmin =238.15#K17 st =1.67*10**-2/1000. #k/m18 radius =numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2)19 md.initialization.temperature =tmin+st*radius20 md.basalforcings.geothermalflux =4.2*10**-2*numpy.ones((md.mesh.numberofvertices))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)) 21 21 22 22 print(" 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 solution24 md.materials.rheology_n =3.*numpy.ones((md.mesh.numberofelements))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)) 25 25 26 26 print(" creating surface mass balance") 27 smb_max =0.5 #m/yr28 sb =10**-2/1000. #m/yr/m29 rel =450.*1000.#m30 md.smb.mass_balance =numpy.minimum(smb_max*numpy.ones_like(radius),sb*(rel-radius))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)) 31 31 32 32 print(" creating velocities") 33 constant =0.334 md.inversion.vx_obs =constant/2.*md.mesh.x*(md.geometry.thickness)**-135 md.inversion.vy_obs =constant/2.*md.mesh.y*(md.geometry.thickness)**-136 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))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)) 41 41 42 42 #Deal with boundary conditions: 43 43 print(" boundary conditions for stressbalance model:") 44 md =SetMarineIceSheetBC(md,'../Exp/RoundFrontEISMINT.exp')44 md = SetMarineIceSheetBC(md, '../Exp/RoundFrontEISMINT.exp') 45 45 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 center46 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 50 50 51 md.stressbalance.spcvx[pos] =0.52 md.stressbalance.spcvy[pos] =0.53 md.stressbalance.spcvz[pos] =0.51 md.stressbalance.spcvx[pos] = 0. 52 md.stressbalance.spcvy[pos] = 0. 53 md.stressbalance.spcvz[pos] = 0. 54 54 55 55 #parallel options 56 md.timestepping.final_time =50000.56 md.timestepping.final_time = 50000. 57 57 58 58 #Constants 59 md.materials.rho_ice =910.60 md.materials.thermalconductivity =2.161 md.materials.latentheat =3.35*10**562 md.materials.beta =8.66*10**-4/(md.materials.rho_ice*md.constants.g) #conversion from K/m to K/Pa63 md.constants.yts =31556926.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. -
issm/trunk-jpl/test/Par/RoundSheetShelf.py
r22575 r24214 1 1 import os.path 2 import numpy 2 import numpy as np 3 3 import copy 4 4 import inspect … … 8 8 #Start defining model parameters here 9 9 10 di =md.materials.rho_ice/md.materials.rho_water11 rad =1.e612 shelfextent =2.e510 di = md.materials.rho_ice / md.materials.rho_water 11 rad = 1.e6 12 shelfextent = 2.e5 13 13 #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.thickness14 hmin = 300. 15 hmax = 1000. 16 radius = np.sqrt(md.mesh.x * md.mesh.x + md.mesh.y * md.mesh.y.reshape(- 1)) 17 ymin = np.min(radius) 18 ymax = np.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 21 21 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.thickness22 pos = np.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 25 25 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]26 pos = np.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] 30 30 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]31 pos = 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.)) 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] 35 35 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]36 pos = 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))) 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] 40 40 41 #plug holes into the ice sheet, to test for grounding line migration. 42 di =md.materials.rho_ice/md.materials.rho_water43 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. 42 di = md.materials.rho_ice / md.materials.rho_water 43 rad = np.sqrt(md.mesh.x**2 + md.mesh.y**2) 44 pos = np.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] 48 48 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]49 pos = 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.)) 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] 53 53 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]54 pos = 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))) 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] 58 58 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 60 md.initialization.vx = np.zeros((md.mesh.numberofvertices)) 61 md.initialization.vy = np.zeros((md.mesh.numberofvertices)) 62 md.initialization.vz = np.zeros((md.mesh.numberofvertices)) 63 md.initialization.pressure = np.zeros((md.mesh.numberofvertices)) 64 64 65 65 #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))66 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices)) 67 md.materials.rheology_B = paterson(md.initialization.temperature) 68 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements)) 69 69 70 70 #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))71 md.smb.mass_balance = -10. * np.ones((md.mesh.numberofvertices)) 72 md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices)) 73 pos = np.nonzero(md.mask.groundedice_levelset > 0.)[0] 74 md.basalforcings.groundedice_melting_rate[pos] = 10. 75 md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices)) 76 md.basalforcings.geothermalflux = np.ones((md.mesh.numberofvertices)) 77 77 78 78 #Friction 79 radius =1.e680 shelfextent =2.e581 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))79 radius = 1.e6 80 shelfextent = 2.e5 81 md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices)) 82 xelem = np.mean(md.mesh.x[md.mesh.elements.astype(int) - 1], axis=1) 83 yelem = np.mean(md.mesh.y[md.mesh.elements.astype(int) - 1], axis=1) 84 rad = np.sqrt(xelem**2 + yelem**2) 85 flags = np.zeros(md.mesh.numberofelements) 86 pos = np.nonzero(rad >= (radius - shelfextent)) 87 md.friction.coefficient[md.mesh.elements[pos, :] - 1] = 0. 88 md.friction.p = np.ones((md.mesh.numberofelements)) 89 md.friction.q = np.ones((md.mesh.numberofelements)) 90 90 91 91 #Numerical parameters 92 md.masstransport.stabilization =193 md.thermal.stabilization =194 md.verbose =verbose(0)95 md.settings.waitonlock =3096 md.stressbalance.restol =0.0597 md.stressbalance.reltol =0.0598 md.steadystate.reltol =0.0599 md.stressbalance.abstol =float('nan')100 md.timestepping.time_step =5.101 md.timestepping.final_time =5.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. 102 102 103 103 #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.104 md.groundingline.migration = 'AggressiveMigration' 105 md.geometry.bed = copy.deepcopy(md.geometry.base) 106 pos = np.nonzero(md.mask.groundedice_levelset < 0.)[0] 107 md.geometry.bed[pos] = md.geometry.base[pos] - 900. 108 108 109 109 #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))110 md.stressbalance.spcvx = float('nan') * np.ones((md.mesh.numberofvertices)) 111 md.stressbalance.spcvy = float('nan') * np.ones((md.mesh.numberofvertices)) 112 md.stressbalance.spcvz = float('nan') * np.ones((md.mesh.numberofvertices)) 113 113 114 pos =numpy.nonzero(numpy.logical_and(md.mesh.x==0,md.mesh.y==0))115 md.stressbalance.spcvx[pos] =0116 md.stressbalance.spcvy[pos] =0114 pos = np.nonzero(np.logical_and(md.mesh.x == 0, md.mesh.y == 0)) 115 md.stressbalance.spcvx[pos] = 0 116 md.stressbalance.spcvy[pos] = 0 117 117 118 pos =numpy.nonzero(md.mesh.vertexonboundary)119 md.mask.ice_levelset[pos] =0120 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))118 pos = np.nonzero(md.mesh.vertexonboundary) 119 md.mask.ice_levelset[pos] = 0 120 md.balancethickness.spcthickness = float('nan') * np.ones((md.mesh.numberofvertices)) 121 md.masstransport.spcthickness = float('nan') * np.ones((md.mesh.numberofvertices)) 122 md.stressbalance.referential = float('nan') * np.ones((md.mesh.numberofvertices, 6)) 123 md.stressbalance.loadingforce = 0 * np.ones((md.mesh.numberofvertices, 3)) 124 md.thermal.spctemperature = 737. * np.ones((md.mesh.numberofvertices)) 125 125 126 126 #Change name so that no test have the same name 127 127 if len(inspect.stack()) > 2: 128 128 md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0] -
issm/trunk-jpl/test/Par/RoundSheetStaticEISMINT.py
r23707 r24214 3 3 4 4 print(" creating thickness") 5 hmin =0.016 hmax =2756.77 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 statement10 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.thickness12 md.geometry.surface =md.geometry.base+md.geometry.thickness5 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 13 13 14 14 print(" 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))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)) 19 19 20 20 print(" creating temperatures") 21 tmin =238.15#K22 st =1.67*10**-2/1000. #k/m23 md.initialization.temperature =tmin+st*radius24 md.basalforcings.geothermalflux =4.2*10**-2*numpy.ones((md.mesh.numberofvertices))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)) 25 25 26 26 print(" 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 solution28 md.materials.rheology_n =3.*numpy.ones((md.mesh.numberofelements))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)) 29 29 30 30 print(" creating surface mass balance") 31 smb_max =0.5 #m/yr32 sb =10**-2/1000. #m/yr/m33 rel =450.*1000.#m34 md.smb.mass_balance =numpy.minimum(smb_max*numpy.ones_like(radius),sb*(rel-radius))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)) 35 35 36 36 print(" creating velocities") 37 constant =0.338 md.inversion.vx_obs =constant/2.*md.mesh.x*(md.geometry.thickness)**-139 md.inversion.vy_obs =constant/2.*md.mesh.y*(md.geometry.thickness)**-140 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))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)) 45 45 46 46 #Deal with boundary conditions: 47 47 print(" boundary conditions for stressbalance model:") 48 md =SetMarineIceSheetBC(md,'../Exp/RoundFrontEISMINT.exp')48 md = SetMarineIceSheetBC(md, '../Exp/RoundFrontEISMINT.exp') 49 49 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 center50 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 54 54 55 md.stressbalance.spcvx[pos] =0.56 md.stressbalance.spcvy[pos] =0.57 md.stressbalance.spcvz[pos] =0.55 md.stressbalance.spcvx[pos] = 0. 56 md.stressbalance.spcvy[pos] = 0. 57 md.stressbalance.spcvz[pos] = 0. -
issm/trunk-jpl/test/Par/SquareEISMINT.py
r23707 r24214 1 import numpy 1 import numpy as np 2 2 from SetMarineIceSheetBC import SetMarineIceSheetBC 3 3 … … 5 5 6 6 print(" 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.thickness11 md.geometry.surface =md.geometry.base+md.geometry.thickness7 ymin = np.min(md.mesh.y) 8 ymax = np.max(md.mesh.y) 9 md.geometry.thickness = 500. * np.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 12 12 13 13 print(" creating drag") 14 md.friction.coefficient =200.*numpy.ones((md.mesh.numberofvertices))15 md.friction.coefficient[n umpy.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))14 md.friction.coefficient = 200. * np.ones((md.mesh.numberofvertices)) 15 md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0. 16 md.friction.p = np.ones((md.mesh.numberofelements)) 17 md.friction.q = np.ones((md.mesh.numberofelements)) 18 18 19 19 print(" 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))20 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices)) 21 md.initialization.vx = np.zeros((md.mesh.numberofvertices)) 22 md.initialization.vy = np.zeros((md.mesh.numberofvertices)) 23 md.initialization.vz = np.zeros((md.mesh.numberofvertices)) 24 md.initialization.vel = np.zeros((md.mesh.numberofvertices)) 25 md.initialization.pressure = np.zeros((md.mesh.numberofvertices)) 26 26 27 27 print(" 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))28 md.materials.rheology_B = 1.7687 * 10**8 * np.ones((md.mesh.numberofvertices)) 29 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements)) 30 30 31 31 print(" creating surface mass balance") 32 md.smb.mass_balance =0.2*numpy.ones((md.mesh.numberofvertices)) #0m/a33 md.basalforcings.floatingice_melting_rate =0.*numpy.ones((md.mesh.numberofvertices)) #0m/a34 md.basalforcings.groundedice_melting_rate =0.*numpy.ones((md.mesh.numberofvertices)) #0m/a32 md.smb.mass_balance = 0.2 * np.ones((md.mesh.numberofvertices)) #0m / a 33 md.basalforcings.floatingice_melting_rate = 0. * np.ones((md.mesh.numberofvertices)) #0m / a 34 md.basalforcings.groundedice_melting_rate = 0. * np.ones((md.mesh.numberofvertices)) #0m / a 35 35 36 36 print(" boundary conditions") 37 md =SetMarineIceSheetBC(md,'../Exp/SquareFrontEISMINT.exp')37 md = SetMarineIceSheetBC(md, '../Exp/SquareFrontEISMINT.exp') 38 38 39 39 #Evolution of the ice shelf 40 pos =numpy.nonzero(md.mesh.y==200000.)#nodes on the upper boundary condition41 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 diffusivity46 md.thermal.stabilization =047 md.timestepping.final_time =500.48 md.timestepping.time_step =140 pos = np.nonzero(md.mesh.y == 200000.) #nodes on the upper boundary condition 41 md.balancethickness.spcthickness = float('NaN') * np.ones((md.mesh.numberofvertices)) 42 md.balancethickness.spcthickness[pos] = 500. 43 md.masstransport.spcthickness = float('NaN') * np.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 -
issm/trunk-jpl/test/Par/SquareSheetConstrained.py
r24096 r24214 11 11 12 12 #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.thickness13 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 22 22 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 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) 29 29 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))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)) 34 34 35 35 #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))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)) 39 39 40 40 #Calving 41 md.calving.calvingrate =np.zeros((md.mesh.numberofvertices))42 md.levelset.spclevelset =np.nan*np.ones((md.mesh.numberofvertices))41 md.calving.calvingrate = np.zeros((md.mesh.numberofvertices)) 42 md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices)) 43 43 44 44 #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))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)) 49 49 50 50 #Numerical parameters 51 md.masstransport.stabilization =1.52 md.thermal.stabilization =1.53 md.verbose =verbose(0)54 md.settings.waitonlock =3055 md.stressbalance.restol =0.0556 md.steadystate.reltol =0.0557 md.stressbalance.reltol =0.0558 md.stressbalance.abstol =np.nan59 md.timestepping.time_step =1.60 md.timestepping.final_time =3.61 md.groundingline.migration ='None'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' 62 62 63 63 #GIA: 64 md.gia.lithosphere_thickness =100.*np.ones((md.mesh.numberofvertices));# in km65 md.gia.mantle_viscosity =1.*10**21*np.ones((md.mesh.numberofvertices));# in Pa.s66 md.materials.lithosphere_shear_modulus =6.7*10**10;# in Pa67 md.materials.lithosphere_density =3.32; # in g/cm^-368 md.materials.mantle_shear_modulus =1.45*10**11;# in Pa69 md.materials.mantle_density =3.34; # in g/cm^-364 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 70 70 71 71 #Boundary conditions: 72 md =SetIceSheetBC(md)72 md = SetIceSheetBC(md) 73 73 74 74 #Change name so that no test have the same name 75 75 if len(inspect.stack()) > 2: 76 76 md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0] -
issm/trunk-jpl/test/Par/SquareSheetConstrainedCO2.py
r24096 r24214 16 16 CO2_heatCapacity = 700. 17 17 CO2_thermalCond = 0.5 18 CO2_dynViscosity = 13.72*10**-618 CO2_dynViscosity = 13.72 * 10**- 6 19 19 CO2_rhoLiquidZeroDeg = 929. 20 20 md.materials.rho_ice = CO2_rhoIce … … 27 27 28 28 #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.thickness29 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 38 38 39 39 #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)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) 45 45 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) 48 md.initialization.vz = np.zeros((md.mesh.numberofvertices)) 49 md.initialization.pressure = np.zeros((md.mesh.numberofvertices)) 50 50 51 51 #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))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)) 55 55 56 56 #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))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)) 60 60 61 61 #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))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)) 66 66 67 67 #Numerical parameters 68 md.masstransport.stabilization =169 md.thermal.stabilization =168 md.masstransport.stabilization = 1 69 md.thermal.stabilization = 1 70 70 md.verbose = verbose(0) 71 md.settings.waitonlock =3072 md.stressbalance.restol =0.0573 md.stressbalance.reltol =0.0574 md.steadystate.reltol =0.0575 md.stressbalance.abstol =float('nan')76 md.timestepping.time_step =1.77 md.timestepping.final_time =3.78 md.groundingline.migration ='None'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' 79 79 80 80 #Deal with boundary conditions: … … 83 83 #Change name so that no tests have the same name 84 84 if len(inspect.stack()) > 2: 85 85 md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0] -
issm/trunk-jpl/test/Par/SquareSheetShelf.py
r22993 r24214 2 2 import inspect 3 3 from arch import * 4 import numpy 4 import numpy as np 5 5 from verbose import verbose 6 6 from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d 7 from paterson import paterson 7 from paterson import paterson 8 8 from SetMarineIceSheetBC import SetMarineIceSheetBC 9 9 … … 11 11 12 12 #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.thickness21 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_sheet24 md.geometry.surface =md.geometry.base+md.geometry.thickness13 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 = np.nonzero(md.mesh.y <= ymax / 2.) 23 md.geometry.base[pos] = bed_sheet 24 md.geometry.surface = md.geometry.base + md.geometry.thickness 25 25 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 27 x = np.array(archread('../Data/SquareSheetShelf.arch', 'x')) 28 y = np.array(archread('../Data/SquareSheetShelf.arch', 'y')) 29 vx = np.array(archread('../Data/SquareSheetShelf.arch', 'vx')) 30 vy = np.array(archread('../Data/SquareSheetShelf.arch', 'vy')) 31 index = np.array(archread('../Data/SquareSheetShelf.arch', 'index')).astype(int) 32 32 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) 35 md.initialization.vz = np.zeros((md.mesh.numberofvertices)) 36 md.initialization.pressure = np.zeros((md.mesh.numberofvertices)) 37 37 38 38 #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))39 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices)) 40 md.materials.rheology_B = paterson(md.initialization.temperature) 41 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements)) 42 42 43 43 #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))44 md.smb.mass_balance = 10. * np.ones((md.mesh.numberofvertices)) 45 md.basalforcings.groundedice_melting_rate = 5. * np.ones((md.mesh.numberofvertices)) 46 md.basalforcings.floatingice_melting_rate = 5. * np.ones((md.mesh.numberofvertices)) 47 47 48 48 #Friction 49 md.friction.coefficient =20.*numpy.ones((md.mesh.numberofvertices))50 md.friction.coefficient[n umpy.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))49 md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices)) 50 md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0. 51 md.friction.p = np.ones((md.mesh.numberofelements)) 52 md.friction.q = np.ones((md.mesh.numberofelements)) 53 53 54 54 #Numerical parameters 55 md.masstransport.stabilization =156 md.thermal.stabilization =157 md.verbose =verbose(0)58 md.settings.waitonlock =3059 md.stressbalance.restol =0.0560 md.steadystate.reltol =0.0561 md.stressbalance.reltol =0.0562 md.stressbalance.abstol =float('NaN')63 md.timestepping.time_step =1.64 md.timestepping.final_time =3.65 md.groundingline.migration ='None'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' 66 66 67 67 #Deal with boundary conditions: 68 md =SetMarineIceSheetBC(md,'../Exp/SquareFront.exp')68 md = SetMarineIceSheetBC(md, '../Exp/SquareFront.exp') 69 69 70 70 #Change name so that no test have the same name 71 71 if len(inspect.stack()) > 2: 72 72 md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0] -
issm/trunk-jpl/test/Par/SquareShelf.py
r23836 r24214 2 2 import inspect 3 3 from arch import * 4 import numpy 4 import numpy as np 5 5 from verbose import verbose 6 6 from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d … … 10 10 #Start defining model parameters here 11 11 #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.thickness20 md.geometry.surface =md.geometry.base+md.geometry.thickness21 md.geometry.bed = md.geometry.base -500.;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. 22 22 23 23 #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);24 x = np.array(archread('../Data/SquareShelf.arch', 'x')) 25 y = np.array(archread('../Data/SquareShelf.arch', 'y')) 26 vx = np.array(archread('../Data/SquareShelf.arch', 'vx')) 27 vy = np.array(archread('../Data/SquareShelf.arch', 'vy')) 28 index = archread('../Data/SquareShelf.arch', 'index').astype(int) 29 29 30 30 #dbg - begin 31 # #print 'vars in SquareShelf.nc:'32 # #for v in iVelF.variables:33 # #print v34 #dbg - end 31 # #print 'vars in SquareShelf.nc:' 32 # #for v in iVelF.variables: 33 # # print v 34 #dbg - end 35 35 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) 38 md.initialization.vz = np.zeros((md.mesh.numberofvertices)) 39 md.initialization.pressure = np.zeros((md.mesh.numberofvertices)) 40 40 41 41 #dbg - begin … … 44 44 #print '...vy:' 45 45 #print md.initialization.vy 46 # #print '...vz:'47 # #print md.initialization.vz48 # #print '...pressure:'49 # #print md.initialization.pressure50 #dbg - end 46 # #print '...vz:' 47 # #print md.initialization.vz 48 # #print '...pressure:' 49 # #print md.initialization.pressure 50 #dbg - end 51 51 52 52 53 53 #Materials 54 md.initialization.temperature = (273. -20.)*numpy.ones((md.mesh.numberofvertices))54 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices)) 55 55 md.materials.rheology_B = paterson(md.initialization.temperature) 56 md.materials.rheology_n = 3. *numpy.ones((md.mesh.numberofelements))56 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements)) 57 57 58 58 #Friction 59 md.friction.coefficient = 20. *numpy.ones((md.mesh.numberofvertices))60 md.friction.coefficient[n umpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.61 md.friction.p = n umpy.ones((md.mesh.numberofelements))62 md.friction.q = n umpy.ones((md.mesh.numberofelements))59 md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices)) 60 md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0. 61 md.friction.p = np.ones((md.mesh.numberofelements)) 62 md.friction.q = np.ones((md.mesh.numberofelements)) 63 63 64 64 #Numerical parameters … … 66 66 md.thermal.stabilization = 1. 67 67 md.settings.waitonlock = 30 68 md.verbose =verbose()68 md.verbose = verbose() 69 69 md.stressbalance.restol = 0.10 70 70 md.steadystate.reltol = 0.02 … … 76 76 77 77 #Boundary conditions: 78 # #md=SetIceShelfBC(md)79 md =SetIceShelfBC(md,'../Exp/SquareFront.exp')78 # #md = SetIceShelfBC(md) 79 md = SetIceShelfBC(md, '../Exp/SquareFront.exp') 80 80 81 81 #Change name so that no test have the same name 82 82 if 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 2 2 import inspect 3 3 from arch import * 4 import numpy 4 import numpy as np 5 5 from verbose import verbose 6 6 from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d … … 10 10 #Start defining model parameters here 11 11 #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.thickness20 md.geometry.surface =md.geometry.base+md.geometry.thickness12 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 21 22 22 #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);23 x = np.array(archread('../Data/SquareShelf.arch', 'x')) 24 y = np.array(archread('../Data/SquareShelf.arch', 'y')) 25 vx = np.array(archread('../Data/SquareShelf.arch', 'vx')) 26 vy = np.array(archread('../Data/SquareShelf.arch', 'vy')) 27 index = archread('../Data/SquareShelf.arch', 'index').astype(int) 28 28 #dbg - begin 29 # #print 'vars in SquareShelf.nc:'30 # #for v in iVelF.variables:31 # #print v32 #dbg - end 29 # #print 'vars in SquareShelf.nc:' 30 # #for v in iVelF.variables: 31 # # print v 32 #dbg - end 33 33 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) 36 md.initialization.vz = np.zeros((md.mesh.numberofvertices)) 37 md.initialization.pressure = np.zeros((md.mesh.numberofvertices)) 38 38 39 39 #dbg - begin … … 42 42 #print '...vy:' 43 43 #print md.initialization.vy 44 # #print '...vz:'45 # #print md.initialization.vz46 # #print '...pressure:'47 # #print md.initialization.pressure48 #dbg - end 44 # #print '...vz:' 45 # #print md.initialization.vz 46 # #print '...pressure:' 47 # #print md.initialization.pressure 48 #dbg - end 49 49 50 50 51 51 #Materials 52 md.initialization.temperature = (273. -20.)*numpy.ones((md.mesh.numberofvertices))52 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices)) 53 53 md.materials.rheology_B = paterson(md.initialization.temperature) 54 md.materials.rheology_n = 3. *numpy.ones((md.mesh.numberofelements))54 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements)) 55 55 56 56 #Friction 57 md.friction.coefficient = 20. *numpy.ones((md.mesh.numberofvertices))58 md.friction.coefficient[n umpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.59 md.friction.p = n umpy.ones((md.mesh.numberofelements))60 md.friction.q = n umpy.ones((md.mesh.numberofelements))57 md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices)) 58 md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0. 59 md.friction.p = np.ones((md.mesh.numberofelements)) 60 md.friction.q = np.ones((md.mesh.numberofelements)) 61 61 62 62 #Numerical parameters … … 64 64 md.thermal.stabilization = 1. 65 65 md.settings.waitonlock = 30 66 md.verbose =verbose()66 md.verbose = verbose() 67 67 md.stressbalance.restol = 0.10 68 68 md.steadystate.reltol = 0.02 … … 71 71 md.timestepping.time_step = 1. 72 72 md.timestepping.final_time = 3. 73 md.groundingline.migration = 'None'73 md.groundingline.migration = 'None' 74 74 75 75 #Boundary conditions: 76 # #md=SetIceShelfBC(md)77 md =SetIceShelfBC(md,'../Exp/SquareFront2.exp')76 # #md = SetIceShelfBC(md) 77 md = SetIceShelfBC(md, '../Exp/SquareFront2.exp') 78 78 79 79 #Change name so that no test have the same name 80 80 if 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 10 10 #Start defining model parameters here 11 11 #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.thickness20 md.geometry.surface =md.geometry.base+md.geometry.thickness21 md.geometry.bed =md.geometry.base-10;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 22 22 23 23 #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))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)) 29 29 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) 32 md.initialization.vz = np.zeros((md.mesh.numberofvertices)) 33 md.initialization.pressure = np.zeros((md.mesh.numberofvertices)) 34 34 35 35 #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))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)) 39 39 40 40 #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))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)) 44 44 45 45 #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))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)) 50 50 51 51 #Numerical parameters 52 md.masstransport.stabilization =153 md.thermal.stabilization =152 md.masstransport.stabilization = 1 53 md.thermal.stabilization = 1 54 54 md.verbose = verbose(0) 55 md.settings.waitonlock =3056 md.stressbalance.restol =0.0557 md.stressbalance.reltol =0.0558 md.steadystate.reltol =0.0559 md.stressbalance.abstol =float('nan')60 md.timestepping.time_step =1.61 md.timestepping.final_time =3.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. 62 62 63 63 #Deal with boundary conditions: … … 66 66 #Change name so that no tests have the same name 67 67 if len(inspect.stack()) > 2: 68 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 1 import numpy as np 2 2 from paterson import paterson 3 3 from SetMarineIceSheetBC import SetMarineIceSheetBC … … 5 5 #Ok, start defining model parameters here 6 6 7 md.timestepping.time_step =08 md.groundingline.migration ='None'7 md.timestepping.time_step = 0 8 md.groundingline.migration = 'None' 9 9 10 10 print(" 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;11 h = 1000. 12 md.geometry.thickness = h * np.ones((md.mesh.numberofvertices)) 13 md.geometry.base = - 1000. * np.ones((md.mesh.numberofvertices)) 14 md.geometry.surface = md.geometry.base + md.geometry.thickness 15 15 16 16 print(" 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))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 20 21 21 print(" creating drag") 22 md.friction.coefficient =200.*numpy.ones((md.mesh.numberofvertices))23 md.friction.coefficient[n umpy.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))22 md.friction.coefficient = 200. * np.ones((md.mesh.numberofvertices)) 23 md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0. 24 md.friction.p = np.ones((md.mesh.numberofelements)) 25 md.friction.q = np.ones((md.mesh.numberofelements)) 26 26 27 27 print(" 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,))28 md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices)) 29 md.initialization.pressure = np.zeros((md.mesh.numberofvertices, )) 30 md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices, )) 31 md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices, )) 32 32 33 33 print(" creating flow law parameter") 34 md.materials.rheology_B =paterson(md.initialization.temperature)35 md.materials.rheology_n =3.*numpy.ones((md.mesh.numberofelements))34 md.materials.rheology_B = paterson(md.initialization.temperature) 35 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements)) 36 36 37 37 print(" creating surface mass balance") 38 md.smb.mass_balance =numpy.ones((md.mesh.numberofvertices))/md.constants.yts #1m/a39 #md.basalforcings.melting_rate =0.*numpy.ones((md.mesh.numberofvertices))/md.constants.yts #1m/a40 md.basalforcings.groundedice_melting_rate =0.*numpy.ones((md.mesh.numberofvertices))/md.constants.yts #1m/a41 md.basalforcings.floatingice_melting_rate =0.*numpy.ones((md.mesh.numberofvertices))/md.constants.yts #1m/a38 md.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 40 md.basalforcings.groundedice_melting_rate = 0. * np.ones((md.mesh.numberofvertices)) / md.constants.yts #1m / a 41 md.basalforcings.floatingice_melting_rate = 0. * np.ones((md.mesh.numberofvertices)) / md.constants.yts #1m / a 42 42 43 43 #Deal with boundary conditions: 44 44 45 45 print(" boundary conditions for stressbalance model") 46 md =SetMarineIceSheetBC(md,'../Exp/SquareFront.exp')46 md = SetMarineIceSheetBC(md, '../Exp/SquareFront.exp') 47 47 48 48 print(" boundary conditions for thermal model") 49 md.thermal.spctemperature[:] =md.initialization.temperature50 md.basalforcings.geothermalflux =numpy.zeros((md.mesh.numberofvertices))51 md.basalforcings.geothermalflux[n umpy.nonzero(md.mask.groundedice_levelset>0.)[0]]=1.*10**-3 #1 mW/m^249 md.thermal.spctemperature[:] = md.initialization.temperature 50 md.basalforcings.geothermalflux = np.zeros((md.mesh.numberofvertices)) 51 md.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 1 1 import os.path 2 2 from arch import * 3 import numpy 3 import numpy as np 4 4 import inspect 5 import math6 5 from verbose import verbose 7 from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d8 6 from paterson import paterson 9 7 from SetIceShelfBC import SetIceShelfBC 10 8 11 9 #Start defining model parameters here 12 x =md.mesh.x13 y =md.mesh.y10 x = md.mesh.x 11 y = md.mesh.y 14 12 xmin, xmax = min(x), max(x) 15 13 ymin, ymax = min(y), max(y) 16 Lx =(xmax-xmin)17 Ly =(ymax-ymin)18 xm, ym = (xmin+xmax)/2., (ymin+ymax)/2.14 Lx = (xmax - xmin) 15 Ly = (ymax - ymin) 16 xm, ym = (xmin + xmax) / 2., (ymin + ymax) / 2. 19 17 20 #Geometry: U -shaped valley in y direction18 #Geometry: U - shaped valley in y direction 21 19 thk_center = 1000. 22 thk_margin = 0.5 *thk_center23 bmax =0.24 bmin =-thk_center*md.materials.rho_ice/md.materials.rho_water20 thk_margin = 0.5 * thk_center 21 bmax = 0. 22 bmin = -thk_center * md.materials.rho_ice / md.materials.rho_water 25 23 26 alpha =2./3.27 slope = 0.9 *(bmin-bmax)*(x-xmin)/(Lx*alpha) + 0.1*(bmin-bmax)*(y-ymin)/(Ly) + bmax28 md.geometry.surface = (thk_center+bmax) + slope29 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.base24 alpha = 2. / 3. 25 slope = 0.9 * (bmin - bmax) * (x - xmin) / (Lx * alpha) + 0.1 * (bmin - bmax) * (y - ymin) / (Ly) + bmax 26 md.geometry.surface = (thk_center + bmax) + slope 27 md.geometry.base = bmax + slope + 4. / Ly**2 * (thk_center - thk_margin) * (np.power(y - ym, 2)) 28 md.geometry.thickness = md.geometry.surface - md.geometry.base 31 29 md.geometry.bed = md.geometry.base 32 30 33 31 #Mask 34 md.mask.ice_levelset =x - alpha*Lx35 md.mask.groundedice_levelset = numpy.ones((md.mesh.numberofvertices))32 md.mask.ice_levelset = x - alpha * Lx 33 md.mask.groundedice_levelset = np.ones((md.mesh.numberofvertices)) 36 34 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 36 md.initialization.vx = np.zeros((md.mesh.numberofvertices)) 37 md.initialization.vy = np.zeros((md.mesh.numberofvertices)) 38 md.initialization.vz = np.zeros((md.mesh.numberofvertices)) 39 md.initialization.pressure = np.zeros((md.mesh.numberofvertices)) 42 40 43 41 #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))42 md.initialization.temperature = (273.15 - 5.) * np.ones((md.mesh.numberofvertices)) 43 md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices)) 44 md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices)) 45 md.materials.rheology_B = paterson(md.initialization.temperature) 46 md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements)) 49 47 50 48 #Thermal 51 md.thermal.isenthalpy =False52 md.thermal.spctemperature =float('nan')*numpy.ones((md.mesh.numberofvertices))49 md.thermal.isenthalpy = False 50 md.thermal.spctemperature = float('nan') * np.ones((md.mesh.numberofvertices)) 53 51 54 52 #Groundingline 55 md.groundingline.migration ='SubelementMigration'53 md.groundingline.migration = 'SubelementMigration' 56 54 57 55 #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_balance60 md.basalforcings.floatingice_melting_rate =md.smb.mass_balance56 md.smb.mass_balance = 0.3 * np.ones((md.mesh.numberofvertices)) 57 md.basalforcings.groundedice_melting_rate = md.smb.mass_balance 58 md.basalforcings.floatingice_melting_rate = md.smb.mass_balance 61 59 62 60 #Friction 63 md.friction.coefficient =20.*numpy.ones((md.mesh.numberofvertices))64 md.friction.coefficient[n umpy.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))61 md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices)) 62 md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0. 63 md.friction.p = np.ones((md.mesh.numberofelements)) 64 md.friction.q = np.ones((md.mesh.numberofelements)) 67 65 68 66 #Transient 69 md.transient.isstressbalance =True70 md.transient.ismovingfront =True71 md.transient.ismasstransport =False72 md.transient.isthermal =False73 md.transient.isgroundingline =True74 md.transient.isgia =False67 md.transient.isstressbalance = True 68 md.transient.ismovingfront = True 69 md.transient.ismasstransport = False 70 md.transient.isthermal = False 71 md.transient.isgroundingline = True 72 md.transient.isgia = False 75 73 76 74 #Stressbalance 77 md.stressbalance.maxiter =10078 md.stressbalance.restol =0.0579 md.stressbalance.reltol =0.0580 md.stressbalance.abstol =float('nan')75 md.stressbalance.maxiter = 100 76 md.stressbalance.restol = 0.05 77 md.stressbalance.reltol = 0.05 78 md.stressbalance.abstol = float('nan') 81 79 82 80 #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.81 md.calving.calvingrate = 0. * np.ones((md.mesh.numberofvertices)) 82 md.frontalforcings.meltingrate = 0. * np.ones((md.mesh.numberofvertices)) 83 md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices)) 84 md.masstransport.stabilization = 1. 87 85 88 86 #Numerical parameters 89 md.thermal.stabilization =1.90 md.settings.waitonlock =3091 md.steadystate.reltol =0.0592 md.timestepping.time_step =1.93 md.timestepping.final_time =3.87 md.thermal.stabilization = 1. 88 md.settings.waitonlock = 30 89 md.steadystate.reltol = 0.05 90 md.timestepping.time_step = 1. 91 md.timestepping.final_time = 3. 94 92 95 93 #Verbose … … 101 99 #Change name so that no tests have the same name 102 100 if len(inspect.stack()) > 2: 103 101 md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
Note:
See TracChangeset
for help on using the changeset viewer.