source: issm/trunk-jpl/test/Par/ISMIPE.py@ 14134

Last change on this file since 14134 was 14134, checked in by jschierm, 12 years ago

NEW: Working python tests 1101-1108 (plus other cosmetic changes).

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1import numpy
2import netCDF4
3from SetIceSheetBC import *
4
5#Ok, start defining model parameters here
6
7print " creating thickness"
8f = netCDF4.Dataset('../Data/ISMIPE.nc','r')
9data = f.variables['data'][:]
10f.close()
11md.geometry.surface=numpy.zeros((md.mesh.numberofvertices,1))
12md.geometry.bed=numpy.zeros((md.mesh.numberofvertices,1))
13for i in xrange(0,md.mesh.numberofvertices):
14 y=md.mesh.y[i]
15 point1=numpy.floor(y/100.)
16 point2=numpy.minimum(point1+1,50)
17 coeff=(y-(point1-1.)*100.)/100.
18 md.geometry.bed[i]=(1.-coeff)*data[point1,1]+coeff*data[point2,1]
19 md.geometry.surface[i]=(1.-coeff)*data[point1,2]+coeff*data[point2,2]
20md.geometry.thickness=md.geometry.surface-md.geometry.bed
21md.geometry.thickness[numpy.nonzero(numpy.logical_not(md.geometry.thickness))]=0.01
22md.geometry.bed=md.geometry.surface-md.geometry.thickness
23
24print " creating drag"
25md.friction.coefficient=numpy.zeros((md.mesh.numberofvertices,1))
26md.friction.p=numpy.ones((md.mesh.numberofelements,1))
27md.friction.q=numpy.ones((md.mesh.numberofelements,1))
28
29print " creating flow law parameter"
30md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices,1))
31md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
32
33print " boundary conditions for diagnostic model:"
34#Create node on boundary first (because we can not use mesh)
35md=SetIceSheetBC(md)
Note: See TracBrowser for help on using the repository browser.