source: issm/trunk/test/Par/Pig.py@ 16560

Last change on this file since 16560 was 16560, checked in by Mathieu Morlighem, 11 years ago

merged trunk-jpl and trunk for revision 16554

  • Property svn:executable set to *
File size: 2.3 KB
RevLine 
[13463]1import os.path
2import inspect
3import netCDF4
[16560]4import numpy
5from verbose import verbose
[13463]6from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
[16560]7from paterson import paterson
8from SetMarineIceSheetBC import SetMarineIceSheetBC
[13463]9
10#Start defining model parameters here
11
12#Geometry and observation
13f = netCDF4.Dataset('../Data/Pig.nc','r')
[16560]14x = numpy.reshape(f.variables['x'][:],(-1))
15y = numpy.reshape(f.variables['y'][:],(-1))
[13463]16vx_obs = f.variables['vx_obs'][:]
17vy_obs = f.variables['vy_obs'][:]
18index = f.variables['index'][:]
19surface = f.variables['surface'][:]
20thickness = f.variables['thickness'][:]
21f.close()
22
23[md.inversion.vx_obs] =InterpFromMeshToMesh2d(index,x,y,vx_obs,md.mesh.x,md.mesh.y)
24[md.inversion.vy_obs] =InterpFromMeshToMesh2d(index,x,y,vy_obs,md.mesh.x,md.mesh.y)
25[md.geometry.surface] =InterpFromMeshToMesh2d(index,x,y,surface,md.mesh.x,md.mesh.y)
26[md.geometry.thickness]=InterpFromMeshToMesh2d(index,x,y,thickness,md.mesh.x,md.mesh.y)
27md.geometry.bed=md.geometry.surface-md.geometry.thickness
28md.initialization.vx=md.inversion.vx_obs
29md.initialization.vy=md.inversion.vy_obs
[16560]30md.initialization.vz=numpy.zeros((md.mesh.numberofvertices,1))
31md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1))
[13463]32
33#Materials
[16560]34md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices,1))
[13463]35md.materials.rheology_B=paterson(md.initialization.temperature)
[16560]36md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
[13463]37md.initialization.temperature=md.initialization.temperature
38
[16560]39#Damage
40md.damage.D=numpy.zeros((md.mesh.numberofvertices,1))
41
[13463]42#Friction
[16560]43md.friction.coefficient=50.*numpy.ones((md.mesh.numberofvertices,1))
[16137]44md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
[16560]45md.friction.p=numpy.ones((md.mesh.numberofelements,1))
46md.friction.q=numpy.ones((md.mesh.numberofelements,1))
[13463]47
48#Numerical parameters
[16137]49md.stressbalance.viscosity_overshoot=0.3
50md.masstransport.stabilization=1.
[13463]51md.verbose=verbose(0)
[14310]52md.settings.waitonlock=30
[13463]53md.timestepping.time_step=1.
54md.timestepping.final_time=2.
[16137]55md.stressbalance.restol=0.05
56md.stressbalance.reltol=1.
[13463]57md.steadystate.reltol=1.
[16137]58md.stressbalance.abstol=float('nan')
[13463]59
60#Boundary conditions:
[13471]61md=SetMarineIceSheetBC(md)
[13463]62
63#Change name so that no test have the same name
64if len(inspect.stack()) > 2:
65 md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
Note: See TracBrowser for help on using the repository browser.