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