source: issm/branches/trunk-larour-NatGeoScience2016/test/Par/79North.py@ 21759

Last change on this file since 21759 was 21759, checked in by Eric.Larour, 8 years ago

CHG: merged branch back to trunk-jpl 21754.

File size: 2.8 KB
Line 
1import os.path
2import inspect
3from arch import *
4import numpy
5from verbose import verbose
6from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
7from paterson import paterson
8from SetMarineIceSheetBC import SetMarineIceSheetBC
9
10#Start defining model parameters here
11
12#Geometry and observation
13x = numpy.array(archread('../Data/79North.arch','x'))
14y = numpy.array(archread('../Data/79North.arch','y'))
15vx = numpy.array(archread('../Data/79North.arch','vx'));
16vy = numpy.array(archread('../Data/79North.arch','vy'));
17index = numpy.array(archread('../Data/79North.arch','index')).astype(int);
18surface = numpy.array(archread('../Data/79North.arch','surface'));
19thickness = numpy.array(archread('../Data/79North.arch','thickness'));
20
21[md.initialization.vx] = InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
22[md.initialization.vy] = InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
23[md.geometry.surface] = InterpFromMeshToMesh2d(index,x,y,surface,md.mesh.x,md.mesh.y)
24[md.geometry.thickness] = InterpFromMeshToMesh2d(index,x,y,thickness,md.mesh.x,md.mesh.y)
25md.geometry.base = md.geometry.surface-md.geometry.thickness
26
27#Materials
28md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
29md.materials.rheology_B=paterson(md.initialization.temperature)
30md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
31md.initialization.temperature=md.initialization.temperature
32
33#Friction
34md.friction.coefficient=50.*numpy.ones((md.mesh.numberofvertices))
35md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
36md.friction.p=numpy.ones((md.mesh.numberofelements))
37md.friction.q=numpy.ones((md.mesh.numberofelements))
38
39#Ice shelf melting and surface mass balance
40md.basalforcings.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices))
41md.basalforcings.floatingice_melting_rate[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
42md.basalforcings.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices))
43md.smb.mass_balance=15*numpy.ones((md.mesh.numberofvertices))
44
45#Numerical parameters
46md.stressbalance.viscosity_overshoot=0.3
47md.masstransport.stabilization=1
48md.thermal.stabilization=1
49md.verbose=verbose(0)
50md.settings.waitonlock=30
51md.timestepping.time_step=1.
52md.timestepping.final_time=3.
53md.stressbalance.restol=0.05
54md.stressbalance.reltol=0.005
55md.steadystate.reltol=0.005
56md.stressbalance.abstol=float('NaN')
57
58#Boundary conditions:
59md=SetMarineIceSheetBC(md)
60pos=numpy.nonzero(md.mesh.vertexonboundary)
61md.balancethickness.spcthickness[pos]=md.geometry.thickness[pos]
62md.masstransport.spcthickness[pos]=md.geometry.thickness[pos]
63
64#Change name so that no test have the same name
65if len(inspect.stack()) > 2:
66 md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
Note: See TracBrowser for help on using the repository browser.