source: issm/trunk-jpl/test/NightlyRun/test2113.py@ 27811

Last change on this file since 27811 was 27811, checked in by jdquinn, 21 months ago

CHG: Eased tolerances

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