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

Last change on this file since 28022 was 28022, checked in by jdquinn, 16 months ago

CHG: Cleanup

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