Changeset 16318
- Timestamp:
- 10/07/13 16:03:10 (11 years ago)
- Location:
- issm/trunk-jpl/src/m/boundaryconditions
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.m ¶
r16187 r16318 53 53 if (length(md.initialization.temperature)==md.mesh.numberofvertices), 54 54 md.thermal.spctemperature=NaN*ones(md.mesh.numberofvertices,1); 55 pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface 55 if isprop(md.mesh,'vertexonsurface') 56 pos=find(md.mesh.vertexonsurface); 57 md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface 58 end 56 59 if (length(md.basalforcings.geothermalflux)~=md.mesh.numberofvertices), 57 60 md.basalforcings.geothermalflux=50.*10^-3*ones(md.mesh.numberofvertices,1); %50 mW/m^2 -
TabularUnified issm/trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.py ¶
r16187 r16318 54 54 if isinstance(md.initialization.temperature,numpy.ndarray) and numpy.size(md.initialization.temperature,axis=0)==md.mesh.numberofvertices: 55 55 md.thermal.spctemperature=float('nan')*numpy.ones((md.mesh.numberofvertices,1)) 56 # pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface 57 pos=numpy.nonzero(md.mesh.vertexonsurface)[0]58 md.thermal.spctemperature[pos]=md.initialization.temperature[pos] #impose observed temperature on surface56 if hasattr(md.mesh,'vertexonsurface'): 57 pos=numpy.nonzero(md.mesh.vertexonsurface)[0] 58 md.thermal.spctemperature[pos]=md.initialization.temperature[pos] #impose observed temperature on surface 59 59 if not isinstance(md.basalforcings.geothermalflux,numpy.ndarray) or not numpy.size(md.basalforcings.geothermalflux)==md.mesh.numberofvertices: 60 60 md.basalforcings.geothermalflux=50.*10**-3*numpy.ones((md.mesh.numberofvertices,1)) #50 mW/m^2 -
TabularUnified issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.m ¶
r16187 r16318 38 38 39 39 %First find segments that are not completely on the front 40 if(md.mesh.dimension==2), 40 if strcmp(meshtype(md.mesh),'3D'), 41 numbernodesfront=4; 42 elseif strcmp(meshtype(md.mesh),'2Dhorizontal'), 41 43 numbernodesfront=2; 42 else 43 numbernodesfront=4;44 else 45 error('mesh type not supported yet'); 44 46 end 45 47 segmentsfront=md.mask.ice_levelset(md.mesh.segments(:,1:numbernodesfront))==0; … … 84 86 if (length(md.initialization.temperature)==md.mesh.numberofvertices), 85 87 md.thermal.spctemperature=NaN*ones(md.mesh.numberofvertices,1); 86 pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface 88 if isprop(md.mesh,'vertexonsurface'), 89 pos=find(md.mesh.vertexonsurface); 90 md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface 91 end 87 92 if (length(md.basalforcings.geothermalflux)~=md.mesh.numberofvertices), 88 93 md.basalforcings.geothermalflux=zeros(md.mesh.numberofvertices,1); -
TabularUnified issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py ¶
r16187 r16318 2 2 import numpy 3 3 from ContourToMesh import * 4 from MatlabFuncs import * 4 5 5 6 def SetIceShelfBC(md,icefrontfile=''): … … 43 44 44 45 #First find segments that are not completely on the front 45 if md.mesh.dimension==2: 46 numbernodesfront=2 46 if strcmp(md.mesh.meshtype(),'3D'): 47 numbernodesfront=4; 48 elif strcmp(md.mesh.meshtype(),'2Dhorizontal'): 49 numbernodesfront=2; 47 50 else: 48 numbernodesfront=451 raise error('mesh type not supported yet') 49 52 if any(md.mask.ice_levelset<=0): 50 53 values=md.mask.ice_levelset[md.mesh.segments[:,0:-1]-1] … … 93 96 if isinstance(md.initialization.temperature,numpy.ndarray) and numpy.size(md.initialization.temperature,axis=0)==md.mesh.numberofvertices: 94 97 md.thermal.spctemperature=float('nan')*numpy.ones((md.mesh.numberofvertices,1)) 95 # pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface 96 pos=numpy.nonzero(md.mesh.vertexonsurface)[0]97 md.thermal.spctemperature[pos]=md.initialization.temperature[pos] #impose observed temperature on surface98 if hasattr(md.mesh,'vertexonsurface'): 99 pos=numpy.nonzero(md.mesh.vertexonsurface)[0] 100 md.thermal.spctemperature[pos]=md.initialization.temperature[pos] #impose observed temperature on surface 98 101 if not isinstance(md.basalforcings.geothermalflux,numpy.ndarray) or not numpy.size(md.basalforcings.geothermalflux,axis=0)==md.mesh.numberofvertices: 99 102 md.basalforcings.geothermalflux=numpy.zeros((md.mesh.numberofvertices,1)) -
TabularUnified issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m ¶
r16269 r16318 102 102 if (length(md.initialization.temperature)==md.mesh.numberofvertices), 103 103 md.thermal.spctemperature=NaN*ones(md.mesh.numberofvertices,1); 104 pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface 104 if isprop(md.mesh,'vertexonsurface'), 105 pos=find(md.mesh.vertexonsurface); 106 md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface 107 end 105 108 if (length(md.basalforcings.geothermalflux)~=md.mesh.numberofvertices), 106 109 md.basalforcings.geothermalflux=zeros(md.mesh.numberofvertices,1); -
TabularUnified issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py ¶
r16187 r16318 101 101 if isinstance(md.initialization.temperature,numpy.ndarray) and numpy.size(md.initialization.temperature,axis=0)==md.mesh.numberofvertices: 102 102 md.thermal.spctemperature=float('nan')*numpy.ones((md.mesh.numberofvertices,1)) 103 # pos=find(md.mesh.vertexonsurface); md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface 104 pos=numpy.nonzero(md.mesh.vertexonsurface)[0]105 md.thermal.spctemperature[pos]=md.initialization.temperature[pos] #impose observed temperature on surface103 if hasattr(md.mesh,'vertexonsurface'): 104 pos=numpy.nonzero(md.mesh.vertexonsurface)[0] 105 md.thermal.spctemperature[pos]=md.initialization.temperature[pos] #impose observed temperature on surface 106 106 if not isinstance(md.basalforcings.geothermalflux,numpy.ndarray) or not numpy.size(md.basalforcings.geothermalflux,axis=0)==md.mesh.numberofvertices: 107 107 md.basalforcings.geothermalflux=numpy.zeros((md.mesh.numberofvertices,1))
Note:
See TracChangeset
for help on using the changeset viewer.