[13636] | 1 | import os.path
|
---|
[21657] | 2 | import numpy as np
|
---|
[13636] | 3 | import inspect
|
---|
[16170] | 4 | from verbose import verbose
|
---|
[13636] | 5 | from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
|
---|
[16170] | 6 | from paterson import paterson
|
---|
| 7 | from SetIceSheetBC import SetIceSheetBC
|
---|
[21170] | 8 | from arch import *
|
---|
[13636] | 9 |
|
---|
| 10 | #Start defining model parameters here
|
---|
| 11 |
|
---|
| 12 | #Geometry
|
---|
[24214] | 13 | hmin = 300.
|
---|
| 14 | hmax = 1000.
|
---|
| 15 | ymin = np.min(md.mesh.y)
|
---|
| 16 | ymax = np.max(md.mesh.y)
|
---|
| 17 | xmin = np.min(md.mesh.x)
|
---|
| 18 | xmax = np.max(md.mesh.x)
|
---|
| 19 | md.geometry.thickness = hmax + (hmin - hmax) * (md.mesh.y - ymin) / (ymax - ymin) + 0.1 * (hmin - hmax) * (md.mesh.x - xmin) / (xmax - xmin)
|
---|
| 20 | md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness + 20.
|
---|
| 21 | md.geometry.surface = md.geometry.base + md.geometry.thickness
|
---|
[13636] | 22 |
|
---|
[24214] | 23 | #Initial velocity
|
---|
| 24 | x = np.array(archread('../Data/SquareSheetConstrained.arch', 'x'))
|
---|
| 25 | y = np.array(archread('../Data/SquareSheetConstrained.arch', 'y'))
|
---|
| 26 | vx = np.array(archread('../Data/SquareSheetConstrained.arch', 'vx'))
|
---|
| 27 | vy = np.array(archread('../Data/SquareSheetConstrained.arch', 'vy'))
|
---|
| 28 | index = archread('../Data/SquareSheetConstrained.arch', 'index').astype(int)
|
---|
[13636] | 29 |
|
---|
[24214] | 30 | md.initialization.vx = InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)[0]
|
---|
| 31 | md.initialization.vy = InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)[0]
|
---|
| 32 | md.initialization.vz = np.zeros((md.mesh.numberofvertices))
|
---|
| 33 | md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
|
---|
[13636] | 34 |
|
---|
| 35 | #Materials
|
---|
[24214] | 36 | md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
|
---|
| 37 | md.materials.rheology_B = paterson(md.initialization.temperature)
|
---|
| 38 | md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
|
---|
[13636] | 39 |
|
---|
[18761] | 40 | #Calving
|
---|
[24214] | 41 | md.calving.calvingrate = np.zeros((md.mesh.numberofvertices))
|
---|
| 42 | md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices))
|
---|
[17438] | 43 |
|
---|
[13636] | 44 | #Friction
|
---|
[24214] | 45 | md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
|
---|
[24862] | 46 | md.friction.coefficient[np.where(md.mask.ocean_levelset < 0.)[0]] = 0.
|
---|
[24214] | 47 | md.friction.p = np.ones((md.mesh.numberofelements))
|
---|
| 48 | md.friction.q = np.ones((md.mesh.numberofelements))
|
---|
[13636] | 49 |
|
---|
| 50 | #Numerical parameters
|
---|
[24214] | 51 | md.masstransport.stabilization = 1.
|
---|
| 52 | md.thermal.stabilization = 1.
|
---|
| 53 | md.verbose = verbose(0)
|
---|
| 54 | md.settings.waitonlock = 30
|
---|
| 55 | md.stressbalance.restol = 0.05
|
---|
| 56 | md.steadystate.reltol = 0.05
|
---|
| 57 | md.stressbalance.reltol = 0.05
|
---|
| 58 | md.stressbalance.abstol = np.nan
|
---|
| 59 | md.timestepping.time_step = 1.
|
---|
| 60 | md.timestepping.final_time = 3.
|
---|
| 61 | md.groundingline.migration = 'None'
|
---|
[13636] | 62 |
|
---|
[14826] | 63 | #GIA:
|
---|
[24214] | 64 | md.gia.lithosphere_thickness = 100. * np.ones((md.mesh.numberofvertices)) # in km
|
---|
[25129] | 65 | md.gia.mantle_viscosity = 1.e21 * np.ones((md.mesh.numberofvertices)) # in Pa.s
|
---|
| 66 | md.materials.lithosphere_shear_modulus = 6.7e10 # in Pa
|
---|
[24214] | 67 | md.materials.lithosphere_density = 3.32 # in g / cm^ - 3
|
---|
[25129] | 68 | md.materials.mantle_shear_modulus = 1.45e11 # in Pa
|
---|
[24214] | 69 | md.materials.mantle_density = 3.34 # in g / cm^ - 3
|
---|
[14826] | 70 |
|
---|
[13636] | 71 | #Boundary conditions:
|
---|
[24214] | 72 | md = SetIceSheetBC(md)
|
---|
[13636] | 73 |
|
---|
| 74 | #Change name so that no test have the same name
|
---|
| 75 | if len(inspect.stack()) > 2:
|
---|
[24214] | 76 | md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
|
---|