source: issm/trunk/src/m/materials/DepthAvgTempCond.py@ 17989

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

merged trunk-jpl and trunk for revision 17986

File size: 931 bytes
RevLine 
[17963]1import numpy as npy
2from TMeltingPoint import TMeltingPoint
3
4def DepthAvgTempCond(md):
[17961]5 ''' compute conduction dependent temperature profile for an ice sheet.
6 Usage:
7 Tbar=DepthAvgTempCond(md)
8 '''
9
[17963]10 Tpmp=TMeltingPoint(md.materials.meltingpoint,0) #pressure melting point at 0 pressure.
[17961]11
[17963]12 k=md.materials.thermalconductivity
13 G=md.basalforcings.geothermalflux
14 H=md.geometry.thickness[:,0]
15 Ts=md.initialization.temperature
16 alpha=G*H/k
[17961]17
[17963]18 Tbar=npy.zeros(md.mesh.numberofvertices,)
[17961]19
[17963]20 #find temperature average when we are below melting point:
21 pos=npy.nonzero( Ts+alpha < Tpmp)
22 if pos:
23 Tbar[pos]=Ts[pos]+alpha[pos]/2
[17961]24
[17963]25 pos=npy.nonzero( Ts+alpha>= Tpmp)
26 if pos:
27 Tbar[pos]=Tpmp+(Tpmp**2-Ts[pos]**2)/2/alpha[pos]+ Tpmp*(Ts[pos]-Tpmp)/alpha[pos]
28
29 #on ice shelf, easier:
30 pos=npy.nonzero(md.mask.groundedice_levelset[0]<=0)
31 if pos:
32 Tbar[pos]=(Ts[pos]+Tpmp)/2
[17961]33
[17963]34 return Tbar
Note: See TracBrowser for help on using the repository browser.