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