source: issm/trunk/test/NightlyRun/test2111.py@ 25836

Last change on this file since 25836 was 25836, checked in by Mathieu Morlighem, 4 years ago

merged trunk-jpl and trunk for revision 25834

File size: 2.6 KB
Line 
1#Test Name: Esa2Dsurface
2#AIS - - southern hemisphere example for north - south, east - west components of horiz motion
3from socket import gethostname
4
5import numpy as np
6
7from lovenumbers import *
8from model import *
9from paterson import *
10from roundmesh import *
11from solve import *
12
13
14#mesh ais: {{{
15md = model()
16md = triangle(md, '../Exp/Ais.exp', 200000) # max element size
17# }}}
18#define load: {{{
19md.esa.deltathickness = np.zeros((md.mesh.numberofelements, 1))
20disc_radius = 500 # km
21index = md.mesh.elements
22x_element = md.mesh.x[index - 1].mean(axis=1) - 1.0e6
23y_element = md.mesh.y[index - 1].mean(axis=1) - 1.0e6
24rad_dist = np.sqrt(x_element**2 + y_element**2) / 1000 # radial distance in km
25pos = np.where(rad_dist <= disc_radius)[0]
26md.esa.deltathickness[pos] = -1 # 1 m water withdrawl
27# }}}
28#love numbers: {{{
29md.solidearth.lovenumbers = lovenumbers('maxdeg', 10000, 'referenceframe', 'CF')
30# }}}
31#mask: {{{
32#make sure wherever there is an ice load, that the mask is set to ice:
33md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, 1))
34pos = np.where(md.esa.deltathickness)[0]
35md.mask.ice_levelset[md.mesh.elements[pos, :]] = -1
36
37#is ice grounded?
38md.mask.ocean_levelset = -np.ones((md.mesh.numberofvertices, 1))
39pos = np.where(md.mask.ice_levelset <= 0)[0]
40md.mask.ocean_levelset[pos] = 1
41# }}}
42#geometry: {{{
43di = md.materials.rho_ice / md.materials.rho_water
44md.geometry.thickness = np.ones((md.mesh.numberofvertices, 1))
45md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, 1))
46md.geometry.base = md.geometry.surface - md.geometry.thickness
47md.geometry.bed = md.geometry.base
48# }}}
49#materials: {{{
50md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, 1))
51md.materials.rheology_B = paterson(md.initialization.temperature)
52md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, 1))
53# }}}
54#additional parameters, miscellaneous: {{{
55md.miscellaneous.name = 'test2111'
56md.esa.degacc = 0.01
57md.esa.hemisphere = -1
58# }}}
59
60#solve esa: {{{
61md.esa.requested_outputs = ['EsaUmotion', 'EsaNmotion', 'EsaEmotion', 'EsaXmotion', 'EsaYmotion']
62md.cluster = generic('name', gethostname(), 'np', 3)
63md.verbose = verbose('111111111')
64md = solve(md, 'Esa')
65# }}}
66#Fields and tolerances to track changes: {{{
67field_names = ['EsaUmotion', 'EsaNmotion', 'EsaEmotion', 'EsaXmotion', 'EsaYmotion']
68field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
69field_values = [md.results.EsaSolution.EsaUmotion,
70 md.results.EsaSolution.EsaNmotion,
71 md.results.EsaSolution.EsaEmotion,
72 md.results.EsaSolution.EsaXmotion,
73 md.results.EsaSolution.EsaYmotion]
74# }}}
Note: See TracBrowser for help on using the repository browser.