source: issm/trunk-jpl/test/NightlyRun/test1106.py

Last change on this file was 24261, checked in by bdef, 5 years ago

BUG: still some space fix

File size: 2.3 KB
Line 
1#Test Name: ISMIPCFS
2import numpy as np
3from model import *
4from socket import gethostname
5from triangle import *
6from setmask import *
7from parameterize import *
8from setflowequation import *
9from solve import *
10
11"""
12This test is a test from the ISMP - HOM Intercomparison project.
13Pattyn and Payne 2006
14"""
15
16L_list = [80000]
17results = []
18
19for L in L_list:
20 md = triangle(model(), "../Exp/Square_{}.exp".format(L), L / 10.) #size 3 * L
21 md = setmask(md, '', '') #ice sheet test
22 md = parameterize(md, '../Par/ISMIPC.py')
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 md.extrude(10, 1.)
25
26#Add spc on the borders
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 md.stressbalance.spcvx[pos] = 0.
29 md.stressbalance.spcvy[pos] = 0.
30 if (L == 5000.):
31 md.stressbalance.spcvx[pos] = 15.66
32 md.stressbalance.spcvy[pos] = -0.1967
33 elif (L == 10000.):
34 md.stressbalance.spcvx[pos] = 16.04
35 md.stressbalance.spcvy[pos] = -0.1977
36 elif (L == 20000.):
37 md.stressbalance.spcvx[pos] = 16.53
38 md.stressbalance.spcvy[pos] = -1.27
39 elif (L == 40000.):
40 md.stressbalance.spcvx[pos] = 17.23
41 md.stressbalance.spcvy[pos] = -3.17
42 elif (L == 80000.):
43 md.stressbalance.spcvx[pos] = 16.68
44 md.stressbalance.spcvy[pos] = -2.69
45 elif (L == 160000.):
46 md.stressbalance.spcvx[pos] = 16.03
47 md.stressbalance.spcvy[pos] = -1.27
48
49 md = setflowequation(md, 'FS', 'all')
50
51#Compute the stressbalance
52 md.cluster = generic('name', gethostname(), 'np', 8)
53 md = solve(md, 'Stressbalance')
54
55#Plot the results and save them
56 vx = md.results.StressbalanceSolution.Vx
57 vy = md.results.StressbalanceSolution.Vy
58 vz = md.results.StressbalanceSolution.Vz
59 results.append(md.results.StressbalanceSolution)
60
61# plotmodel(md, 'data', vx, 'data', vy, 'data', vz, 'layer #all', md.mesh.numberoflayers)
62
63#Fields and tolerances to track changes
64field_names = ['Vx80km', 'Vy80km', 'Vz80km']
65field_tolerances = [1e-12, 1e-12, 1e-12]
66field_values = []
67for result in results:
68 field_values = field_values + [result.Vx, result.Vy, result.Vz]
Note: See TracBrowser for help on using the repository browser.