source: issm/branches/trunk-larour-NatGeoScience2016/test/Par/RoundSheetStaticEISMINT.py@ 21243

Last change on this file since 21243 was 19527, checked in by Eric.Larour, 10 years ago

CHG: moved md.surfaceforcings to md.smb.
By doing so, had to rename the SMB class to SMBforcing class (it's just that, a mass_balance forcing inside
a SMB class, hence the name).
We also now have an smb_core solution, taken out of the mass transport core. Makes more sense long term.
Synced all enums according to the new changes, and operated the adjustments in all the test decks.

In addition, progressing in terms of GEMB integration into ISSM, specifically at the SMBgemb level (which
is spurring all the changes described above). Brought the class up to the level of the GEMB.m call in Alex's
code. Starting the C integration now.

  • Property svn:executable set to *
File size: 2.5 KB
Line 
1import numpy
2from SetMarineIceSheetBC import SetMarineIceSheetBC
3
4print " creating thickness"
5hmin=0.01
6hmax=2756.7
7radius=numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2).reshape(-1,1)
8radiusmax=numpy.max(radius)
9radius[numpy.nonzero(radius>(1.-10**-9)*radiusmax)]=radiusmax #eliminate roundoff issues in next statement
10md.geometry.thickness=hmin*numpy.ones((numpy.size(md.mesh.x),1))+hmax*(4.*((1./2.)**(4./3.)*numpy.ones((numpy.size(md.mesh.x),1))-((radius)/(2.*radiusmax))**(4./3.)))**(3./8.)
11md.geometry.base=0.*md.geometry.thickness
12md.geometry.surface=md.geometry.base+md.geometry.thickness
13
14print " creating drag"
15md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices,1))
16md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
17md.friction.p=numpy.ones((md.mesh.numberofelements,1))
18md.friction.q=numpy.ones((md.mesh.numberofelements,1))
19
20print " creating temperatures"
21tmin=238.15 #K
22st=1.67*10**-2/1000. #k/m
23md.initialization.temperature=tmin+st*radius
24md.basalforcings.geothermalflux=4.2*10**-2*numpy.ones((md.mesh.numberofvertices,1))
25
26print " creating flow law parameter"
27md.materials.rheology_B=6.81*10**7*numpy.ones((md.mesh.numberofvertices,1)) #to have the same B as the analytical solution
28md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
29
30print " creating surface mass balance"
31smb_max=0.5 #m/yr
32sb=10**-2/1000. #m/yr/m
33rel=450.*1000. #m
34md.smb.mass_balance=numpy.minimum(smb_max*numpy.ones_like(radius),sb*(rel-radius))
35
36print " creating velocities"
37constant=0.3
38md.inversion.vx_obs=constant/2.*md.mesh.x.reshape(-1,1)*(md.geometry.thickness)**-1
39md.inversion.vy_obs=constant/2.*md.mesh.y.reshape(-1,1)*(md.geometry.thickness)**-1
40md.inversion.vel_obs=numpy.sqrt((md.inversion.vx_obs)**2+(md.inversion.vy_obs)**2)
41md.initialization.vx=numpy.zeros((md.mesh.numberofvertices,1))
42md.initialization.vy=numpy.zeros((md.mesh.numberofvertices,1))
43md.initialization.vz=numpy.zeros((md.mesh.numberofvertices,1))
44md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1))
45
46#Deal with boundary conditions:
47print " boundary conditions for stressbalance model:"
48md=SetMarineIceSheetBC(md,'../Exp/RoundFrontEISMINT.exp')
49
50radius=numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2)
51pos=numpy.nonzero(radius==numpy.min(radius))[0]
52md.mesh.x[pos]=0.
53md.mesh.y[pos]=0. #the closest node to the center is changed to be exactly at the center
54
55md.stressbalance.spcvx[pos]=0.
56md.stressbalance.spcvy[pos]=0.
57md.stressbalance.spcvz[pos]=0.
Note: See TracBrowser for help on using the repository browser.