Changeset 13636
- Timestamp:
- 10/12/12 10:50:01 (12 years ago)
- Location:
- issm/trunk-jpl/test/Par
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/test/Par/SquareSheetConstrained.par ¶
r13234 r13636 6 6 ymin=min(md.mesh.y); 7 7 ymax=max(md.mesh.y); 8 8 9 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin); 9 md.geometry.bed=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness+20 ;10 md.geometry.bed=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness+20.; 10 11 md.geometry.surface=md.geometry.bed+md.geometry.thickness; 11 12 … … 16 17 vy = transpose(ncread('../Data/SquareSheetConstrained.nc','vy')); 17 18 index = transpose(ncread('../Data/SquareSheetConstrained.nc','index')); 19 18 20 md.initialization.vx=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y); 19 21 md.initialization.vy=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y); … … 23 25 24 26 %Materials 25 md.initialization.temperature=(273 -20)*ones(md.mesh.numberofvertices,1);27 md.initialization.temperature=(273.-20.)*ones(md.mesh.numberofvertices,1); 26 28 md.materials.rheology_B=paterson(md.initialization.temperature); 27 md.materials.rheology_n=3 *ones(md.mesh.numberofelements,1);29 md.materials.rheology_n=3.*ones(md.mesh.numberofelements,1); 28 30 29 31 %Friction 30 32 pos=find(md.mask.elementonfloatingice); 31 md.friction.coefficient=20 *ones(md.mesh.numberofvertices,1);33 md.friction.coefficient=20.*ones(md.mesh.numberofvertices,1); 32 34 md.friction.coefficient(md.mesh.elements(pos,:))=0; 33 35 md.friction.p=ones(md.mesh.numberofelements,1); … … 36 38 %Numerical parameters 37 39 md.diagnostic.viscosity_overshoot=0.0; 38 md.prognostic.stabilization=1 ;39 md.thermal.stabilization=1 ;40 md.prognostic.stabilization=1.; 41 md.thermal.stabilization=1.; 40 42 md.verbose=verbose(0); 41 43 md.settings.waitonlock=30; … … 44 46 md.diagnostic.reltol=0.05; 45 47 md.diagnostic.abstol=NaN; 46 md.timestepping.time_step=1 ;47 md.timestepping.final_time=3 ;48 md.timestepping.time_step=1.; 49 md.timestepping.final_time=3.; 48 50 49 51 %Boundary conditions: -
TabularUnified issm/trunk-jpl/test/Par/SquareShelfConstrained.py ¶
r13463 r13636 1 1 import os.path 2 import netCDF4 3 import numpy 2 4 import inspect 3 import netCDF44 from numpy import *5 5 from verbose import * 6 6 from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d … … 10 10 #Start defining model parameters here 11 11 #Geometry 12 hmin =300.13 hmax =1000.14 ymin =min(md.mesh.y)15 ymax =max(md.mesh.y)12 hmin=300. 13 hmax=1000. 14 ymin=numpy.min(md.mesh.y) 15 ymax=numpy.max(md.mesh.y) 16 16 17 md.geometry.thickness =hmax+(hmin-hmax)*(md.mesh.y.reshape(-1,1)-ymin)/(ymax-ymin)17 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y.reshape(-1,1)-ymin)/(ymax-ymin) 18 18 md.geometry.bed=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness 19 md.geometry.surface =md.geometry.bed+md.geometry.thickness19 md.geometry.surface=md.geometry.bed+md.geometry.thickness 20 20 21 21 #Initial velocity … … 29 29 f.close() 30 30 31 [md.initialization.vx] = InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y) 32 [md.initialization.vy] = InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y) 33 md.initialization.vz = zeros((md.mesh.numberofvertices,1)) 34 md.initialization.pressure = zeros((md.mesh.numberofvertices,1)) 31 [md.initialization.vx]=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y) 32 [md.initialization.vy]=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y) 33 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices,1)) 34 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1)) 35 35 36 #Materials 36 md.initialization.temperature = (273.-20.)*ones((md.mesh.numberofvertices,1)) 37 md.materials.rheology_B = paterson(md.initialization.temperature) 38 md.materials.rheology_n = 3.*ones((md.mesh.numberofelements,1)) 37 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices,1)) 38 md.materials.rheology_B=paterson(md.initialization.temperature) 39 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1)) 40 39 41 #Surface mass balance and basal melting 40 md.surfaceforcings.mass_balance = 10.*ones((md.mesh.numberofvertices,1)) 41 md.basalforcings.melting_rate = 5.*ones((md.mesh.numberofvertices,1)) 42 md.surfaceforcings.mass_balance=10.*numpy.ones((md.mesh.numberofvertices,1)) 43 md.basalforcings.melting_rate=5.*numpy.ones((md.mesh.numberofvertices,1)) 44 42 45 #Friction 43 pos = nonzero(md.mask.elementonfloatingice) 44 md.friction.coefficient = 20.*ones((md.mesh.numberofvertices,1)) 45 md.friction.coefficient[md.mesh.elements[pos,:].astype(int)-1] =0. 46 md.friction.p = ones((md.mesh.numberofelements,1)) 47 md.friction.q = ones((md.mesh.numberofelements,1)) 46 pos=numpy.nonzero(md.mask.elementonfloatingice) 47 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices,1)) 48 md.friction.coefficient[md.mesh.elements[pos,:].astype(int)-1]=0. 49 md.friction.p=numpy.ones((md.mesh.numberofelements,1)) 50 md.friction.q=numpy.ones((md.mesh.numberofelements,1)) 51 48 52 #Numerical parameters 49 md.diagnostic.viscosity_overshoot = 0.0 50 md.prognostic.stabilization = 1. 51 md.thermal.stabilization = 1. 52 md.verbose = verbose() 53 md.settings.waitonlock = 30. 54 md.diagnostic.restol = 0.05 55 md.diagnostic.reltol = 0.05 56 md.steadystate.reltol = 0.05 57 md.diagnostic.abstol = float('nan') 58 md.timestepping.time_step = 1. 59 md.timestepping.final_time = 3. 53 md.diagnostic.viscosity_overshoot=0.0 54 md.prognostic.stabilization=1. 55 md.thermal.stabilization=1. 56 md.verbose = verbose(0) 57 md.settings.waitonlock=30. 58 md.diagnostic.restol=0.05 59 md.diagnostic.reltol=0.05 60 md.steadystate.reltol=0.05 61 md.diagnostic.abstol=float('nan') 62 md.timestepping.time_step=1. 63 md.timestepping.final_time=3. 64 60 65 #Deal with boundary conditions: 61 66 md = SetIceShelfBC(md) 67 62 68 #Change name so that no tests have the same name 63 69 if len(inspect.stack()) > 2:
Note:
See TracChangeset
for help on using the changeset viewer.