Changeset 21409
- Timestamp:
- 11/22/16 02:33:00 (8 years ago)
- Location:
- issm/trunk-jpl/test/Par
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/test/Par/79North.py
r21176 r21409 26 26 27 27 #Materials 28 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices ,1))28 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices)) 29 29 md.materials.rheology_B=paterson(md.initialization.temperature) 30 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements ,1))30 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 31 31 md.initialization.temperature=md.initialization.temperature 32 32 33 33 #Friction 34 md.friction.coefficient=50.*numpy.ones((md.mesh.numberofvertices ,1))34 md.friction.coefficient=50.*numpy.ones((md.mesh.numberofvertices)) 35 35 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. 36 md.friction.p=numpy.ones((md.mesh.numberofelements ,1))37 md.friction.q=numpy.ones((md.mesh.numberofelements ,1))36 md.friction.p=numpy.ones((md.mesh.numberofelements)) 37 md.friction.q=numpy.ones((md.mesh.numberofelements)) 38 38 39 39 #Ice shelf melting and surface mass balance 40 md.basalforcings.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices ,1))40 md.basalforcings.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices)) 41 41 md.basalforcings.floatingice_melting_rate[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. 42 md.basalforcings.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices ,1))43 md.smb.mass_balance=15*numpy.ones((md.mesh.numberofvertices ,1))42 md.basalforcings.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices)) 43 md.smb.mass_balance=15*numpy.ones((md.mesh.numberofvertices)) 44 44 45 45 #Numerical parameters -
issm/trunk-jpl/test/Par/ISMIPA.py
r17769 r21409 5 5 6 6 print " creating thickness" 7 md.geometry.surface=-md.mesh.x .reshape(-1,1)*numpy.tan(0.5*numpy.pi/180.)8 md.geometry.base=md.geometry.surface-1000.+500.*numpy.sin(md.mesh.x .reshape(-1,1)*2.*numpy.pi/numpy.max(md.mesh.x))*numpy.sin(md.mesh.y.reshape(-1,1)*2.*numpy.pi/numpy.max(md.mesh.x))7 md.geometry.surface=-md.mesh.x*numpy.tan(0.5*numpy.pi/180.) 8 md.geometry.base=md.geometry.surface-1000.+500.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x))*numpy.sin(md.mesh.y*2.*numpy.pi/numpy.max(md.mesh.x)) 9 9 md.geometry.thickness=md.geometry.surface-md.geometry.base 10 10 11 11 print " creating drag" 12 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices ,1))12 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices)) 13 13 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. 14 md.friction.p=numpy.ones((md.mesh.numberofelements ,1))15 md.friction.q=numpy.ones((md.mesh.numberofelements ,1))14 md.friction.p=numpy.ones((md.mesh.numberofelements)) 15 md.friction.q=numpy.ones((md.mesh.numberofelements)) 16 16 17 17 print " creating flow law parameter" 18 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices ,1))19 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements ,1))18 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices)) 19 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 20 20 21 21 print " boundary conditions for stressbalance model" -
issm/trunk-jpl/test/Par/ISMIPB.py
r17769 r21409 5 5 6 6 print " creating thickness" 7 md.geometry.surface=-md.mesh.x .reshape(-1,1)*numpy.tan(0.5*numpy.pi/180.)8 md.geometry.base=md.geometry.surface-1000.+500.*numpy.sin(md.mesh.x .reshape(-1,1)*2.*numpy.pi/numpy.max(md.mesh.x))7 md.geometry.surface=-md.mesh.x*numpy.tan(0.5*numpy.pi/180.) 8 md.geometry.base=md.geometry.surface-1000.+500.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x)) 9 9 md.geometry.thickness=md.geometry.surface-md.geometry.base 10 10 11 11 print " creating drag" 12 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices ,1))12 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices)) 13 13 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. 14 md.friction.p=numpy.ones((md.mesh.numberofelements ,1))15 md.friction.q=numpy.ones((md.mesh.numberofelements ,1))14 md.friction.p=numpy.ones((md.mesh.numberofelements)) 15 md.friction.q=numpy.ones((md.mesh.numberofelements)) 16 16 17 17 print " creating flow law parameter" 18 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices ,1))19 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements ,1))18 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices)) 19 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 20 20 21 21 print " boundary conditions for stressbalance model" -
issm/trunk-jpl/test/Par/ISMIPC.py
r17769 r21409 5 5 6 6 print " creating thickness" 7 md.geometry.surface=2000.-md.mesh.x .reshape(-1,1)*numpy.tan(0.1*numpy.pi/180.) #to have z>07 md.geometry.surface=2000.-md.mesh.x*numpy.tan(0.1*numpy.pi/180.) #to have z>0 8 8 md.geometry.base=md.geometry.surface-1000. 9 9 md.geometry.thickness=md.geometry.surface-md.geometry.base … … 11 11 print " creating drag" 12 12 #md.friction.coefficient=sqrt(md.constants.yts.*(1000.+1000.*sin(md.mesh.x*2.*pi/max(md.mesh.x/2.)).*sin(md.mesh.y*2.*pi/max(md.mesh.x/2.)))./(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.base))); 13 md.friction.coefficient=numpy.sqrt(md.constants.yts*(1000.+1000.*numpy.sin(md.mesh.x .reshape(-1,1)*2.*numpy.pi/numpy.max(md.mesh.x))*numpy.sin(md.mesh.y.reshape(-1,1)*2.*numpy.pi/numpy.max(md.mesh.x))))13 md.friction.coefficient=numpy.sqrt(md.constants.yts*(1000.+1000.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x))*numpy.sin(md.mesh.y*2.*numpy.pi/numpy.max(md.mesh.x)))) 14 14 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. 15 md.friction.p=numpy.ones((md.mesh.numberofelements ,1))16 md.friction.q=numpy.zeros((md.mesh.numberofelements ,1))15 md.friction.p=numpy.ones((md.mesh.numberofelements)) 16 md.friction.q=numpy.zeros((md.mesh.numberofelements)) 17 17 18 18 print " creating flow law parameter" 19 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices ,1))20 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements ,1))19 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices)) 20 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 21 21 22 22 print " boundary conditions for stressbalance model:" -
issm/trunk-jpl/test/Par/ISMIPD.py
r17769 r21409 5 5 6 6 print " creating thickness" 7 md.geometry.surface=2000.-md.mesh.x .reshape(-1,1)*numpy.tan(0.1*numpy.pi/180.) #to have z>07 md.geometry.surface=2000.-md.mesh.x*numpy.tan(0.1*numpy.pi/180.) #to have z>0 8 8 md.geometry.base=md.geometry.surface-1000. 9 9 md.geometry.thickness=md.geometry.surface-md.geometry.base 10 10 11 11 print " creating drag" 12 md.friction.coefficient=numpy.sqrt(md.constants.yts*(1000.+1000.*numpy.sin(md.mesh.x .reshape(-1,1)*2.*numpy.pi/numpy.max(md.mesh.x))))12 md.friction.coefficient=numpy.sqrt(md.constants.yts*(1000.+1000.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x)))) 13 13 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. 14 md.friction.p=numpy.ones((md.mesh.numberofelements ,1))15 md.friction.q=numpy.zeros((md.mesh.numberofelements ,1))14 md.friction.p=numpy.ones((md.mesh.numberofelements)) 15 md.friction.q=numpy.zeros((md.mesh.numberofelements)) 16 16 17 17 print " creating flow law parameter" 18 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices ,1))19 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements ,1))18 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices)) 19 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 20 20 21 21 print " boundary conditions for stressbalance model:" -
issm/trunk-jpl/test/Par/ISMIPE.py
r21170 r21409 7 7 print " creating thickness" 8 8 data = numpy.array(archread('../Data/ISMIPE.arch','data')); 9 md.geometry.surface=numpy.zeros((md.mesh.numberofvertices ,1))10 md.geometry.base=numpy.zeros((md.mesh.numberofvertices ,1))9 md.geometry.surface=numpy.zeros((md.mesh.numberofvertices)) 10 md.geometry.base=numpy.zeros((md.mesh.numberofvertices)) 11 11 for i in xrange(0,md.mesh.numberofvertices): 12 12 y=md.mesh.y[i] … … 21 21 22 22 print " creating drag" 23 md.friction.coefficient=numpy.zeros((md.mesh.numberofvertices ,1))24 md.friction.p=numpy.ones((md.mesh.numberofelements ,1))25 md.friction.q=numpy.ones((md.mesh.numberofelements ,1))23 md.friction.coefficient=numpy.zeros((md.mesh.numberofvertices)) 24 md.friction.p=numpy.ones((md.mesh.numberofelements)) 25 md.friction.q=numpy.ones((md.mesh.numberofelements)) 26 26 27 27 print " creating flow law parameter" 28 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices ,1))29 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements ,1))28 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices)) 29 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 30 30 31 31 print " boundary conditions for stressbalance model:" -
issm/trunk-jpl/test/Par/ISMIPF.py
r17769 r21409 6 6 7 7 print " creating thickness" 8 md.geometry.surface=-md.mesh.x .reshape(-1,1)*numpy.tan(3.*numpy.pi/180.)8 md.geometry.surface=-md.mesh.x*numpy.tan(3.*numpy.pi/180.) 9 9 #md.geometry.base=md.geometry.surface-1000. 10 md.geometry.base=md.geometry.surface-1000.+100.*numpy.exp(-((md.mesh.x .reshape(-1,1)-numpy.max(md.mesh.x)/2.)**2+(md.mesh.y.reshape(-1,1)-numpy.max(md.mesh.y)/2.)**2)/(10000.**2))10 md.geometry.base=md.geometry.surface-1000.+100.*numpy.exp(-((md.mesh.x-numpy.max(md.mesh.x)/2.)**2+(md.mesh.y-numpy.max(md.mesh.y)/2.)**2)/(10000.**2)) 11 11 md.geometry.thickness=md.geometry.surface-md.geometry.base 12 12 13 13 print " creating drag" 14 md.friction.coefficient=numpy.sqrt(md.constants.yts/(2.140373*10**-7*1000.))*numpy.ones((md.mesh.numberofvertices ,1))15 md.friction.p=numpy.ones((md.mesh.numberofelements ,1))16 md.friction.q=numpy.zeros((md.mesh.numberofelements ,1))14 md.friction.coefficient=numpy.sqrt(md.constants.yts/(2.140373*10**-7*1000.))*numpy.ones((md.mesh.numberofvertices)) 15 md.friction.p=numpy.ones((md.mesh.numberofelements)) 16 md.friction.q=numpy.zeros((md.mesh.numberofelements)) 17 17 18 18 print " creating flow law parameter" 19 md.materials.rheology_B=1.4734*10**14*numpy.ones((md.mesh.numberofvertices ,1))20 md.materials.rheology_n=1.*numpy.ones((md.mesh.numberofelements ,1))19 md.materials.rheology_B=1.4734*10**14*numpy.ones((md.mesh.numberofvertices)) 20 md.materials.rheology_n=1.*numpy.ones((md.mesh.numberofelements)) 21 21 md.materials.rheology_law='None' 22 22 … … 24 24 #Create node on boundary first (because we cannot use mesh) 25 25 md=SetIceSheetBC(md) 26 md.stressbalance.spcvx=100.*numpy.ones((md.mesh.numberofvertices ,1))27 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices ,1))28 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices ,1))29 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices ,1))30 md.initialization.vel=numpy.zeros((md.mesh.numberofvertices ,1))31 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices ,1))32 md.initialization.temperature=255.*numpy.ones((md.mesh.numberofvertices ,1))26 md.stressbalance.spcvx=100.*numpy.ones((md.mesh.numberofvertices)) 27 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices)) 28 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices)) 29 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices)) 30 md.initialization.vel=numpy.zeros((md.mesh.numberofvertices)) 31 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices)) 32 md.initialization.temperature=255.*numpy.ones((md.mesh.numberofvertices)) 33 33 pos=numpy.nonzero(numpy.logical_or(numpy.logical_or(md.mesh.x==numpy.min(md.mesh.x),md.mesh.x==numpy.max(md.mesh.x)),numpy.logical_or(md.mesh.y==numpy.min(md.mesh.y),md.mesh.y==numpy.max(md.mesh.y)))) 34 md.balancethickness.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices ,1))34 md.balancethickness.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices)) 35 35 md.balancethickness.spcthickness[pos]=md.geometry.thickness[pos] 36 md.masstransport.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices ,1))36 md.masstransport.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices)) 37 37 md.masstransport.spcthickness[pos]=md.geometry.thickness[pos] 38 md.thermal.spctemperature=255.*numpy.ones((md.mesh.numberofvertices ,1))39 md.basalforcings.geothermalflux=0.4*numpy.ones((md.mesh.numberofvertices ,1))38 md.thermal.spctemperature=255.*numpy.ones((md.mesh.numberofvertices)) 39 md.basalforcings.geothermalflux=0.4*numpy.ones((md.mesh.numberofvertices)) 40 40 41 41 #Parallel options -
issm/trunk-jpl/test/Par/Pig.py
r21176 r21409 26 26 md.initialization.vx=md.inversion.vx_obs 27 27 md.initialization.vy=md.inversion.vy_obs 28 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices ,1))29 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices ,1))28 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices)) 29 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices)) 30 30 31 31 #Materials 32 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices ,1))32 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices)) 33 33 md.materials.rheology_B=paterson(md.initialization.temperature) 34 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements ,1))34 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 35 35 md.initialization.temperature=md.initialization.temperature 36 36 37 37 #Friction 38 md.friction.coefficient=50.*numpy.ones((md.mesh.numberofvertices ,1))38 md.friction.coefficient=50.*numpy.ones((md.mesh.numberofvertices)) 39 39 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. 40 md.friction.p=numpy.ones((md.mesh.numberofelements ,1))41 md.friction.q=numpy.ones((md.mesh.numberofelements ,1))40 md.friction.p=numpy.ones((md.mesh.numberofelements)) 41 md.friction.q=numpy.ones((md.mesh.numberofelements)) 42 42 43 43 #Numerical parameters -
issm/trunk-jpl/test/Par/RoundSheetEISMINT.py
r19527 r21409 4 4 #Ok, start defining model parameters here 5 5 print " creating thickness" 6 md.geometry.thickness=10.*numpy.ones((md.mesh.numberofvertices ,1))7 md.geometry.base=numpy.zeros((md.mesh.numberofvertices ,1))6 md.geometry.thickness=10.*numpy.ones((md.mesh.numberofvertices)) 7 md.geometry.base=numpy.zeros((md.mesh.numberofvertices)) 8 8 md.geometry.surface=md.geometry.base+md.geometry.thickness 9 9 10 10 print " creating drag" 11 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices ,1))12 md.friction.p=numpy.ones((md.mesh.numberofelements ,1))13 md.friction.q=numpy.ones((md.mesh.numberofelements ,1))11 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices)) 12 md.friction.p=numpy.ones((md.mesh.numberofelements)) 13 md.friction.q=numpy.ones((md.mesh.numberofelements)) 14 14 15 15 print " creating temperatures" 16 16 tmin=238.15 #K 17 17 st=1.67*10**-2/1000. #k/m 18 radius=numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2) .reshape(-1,1)18 radius=numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2) 19 19 md.initialization.temperature=tmin+st*radius 20 md.basalforcings.geothermalflux=4.2*10**-2*numpy.ones((md.mesh.numberofvertices ,1))20 md.basalforcings.geothermalflux=4.2*10**-2*numpy.ones((md.mesh.numberofvertices)) 21 21 22 22 print " creating flow law parameter" 23 md.materials.rheology_B=6.81*10**7*numpy.ones((md.mesh.numberofvertices ,1)) #to have the same B as the analytical solution24 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements ,1))23 md.materials.rheology_B=6.81*10**7*numpy.ones((md.mesh.numberofvertices)) #to have the same B as the analytical solution 24 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 25 25 26 26 print " creating surface mass balance" … … 32 32 print " creating velocities" 33 33 constant=0.3 34 md.inversion.vx_obs=constant/2.*md.mesh.x .reshape(-1,1)*(md.geometry.thickness)**-135 md.inversion.vy_obs=constant/2.*md.mesh.y .reshape(-1,1)*(md.geometry.thickness)**-134 md.inversion.vx_obs=constant/2.*md.mesh.x*(md.geometry.thickness)**-1 35 md.inversion.vy_obs=constant/2.*md.mesh.y*(md.geometry.thickness)**-1 36 36 md.inversion.vel_obs=numpy.sqrt((md.inversion.vx_obs)**2+(md.inversion.vy_obs)**2) 37 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices ,1))38 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices ,1))39 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices ,1))40 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices ,1))37 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices)) 38 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices)) 39 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices)) 40 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices)) 41 41 42 42 #Deal with boundary conditions: -
issm/trunk-jpl/test/Par/RoundSheetShelf.py
r20992 r21409 14 14 hmin=300. 15 15 hmax=1000. 16 radius=numpy.sqrt(md.mesh.x .reshape(-1,1)*md.mesh.x.reshape(-1,1)+md.mesh.y.reshape(-1,1)*md.mesh.y.reshape(-1,1))16 radius=numpy.sqrt(md.mesh.x*md.mesh.x+md.mesh.y*md.mesh.y.reshape(-1)) 17 17 ymin=numpy.min(radius) 18 18 ymax=numpy.max(radius) … … 58 58 59 59 #Initial velocity 60 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices ,1))61 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices ,1))62 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices ,1))63 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices ,1))60 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices)) 61 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices)) 62 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices)) 63 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices)) 64 64 65 65 #Materials 66 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices ,1))66 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices)) 67 67 md.materials.rheology_B=paterson(md.initialization.temperature) 68 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements ,1))68 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 69 69 70 70 #Surface mass balance and basal melting 71 md.smb.mass_balance=-10.*numpy.ones((md.mesh.numberofvertices ,1))72 md.basalforcings.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices ,1))71 md.smb.mass_balance=-10.*numpy.ones((md.mesh.numberofvertices)) 72 md.basalforcings.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices)) 73 73 pos=numpy.nonzero(md.mask.groundedice_levelset>0.)[0] 74 74 md.basalforcings.groundedice_melting_rate[pos]=10. 75 md.basalforcings.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices ,1))76 md.basalforcings.geothermalflux=numpy.ones((md.mesh.numberofvertices ,1))75 md.basalforcings.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices)) 76 md.basalforcings.geothermalflux=numpy.ones((md.mesh.numberofvertices)) 77 77 78 78 #Friction 79 79 radius=1.e6 80 80 shelfextent=2.e5 81 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices ,1))81 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices)) 82 82 xelem=numpy.mean(md.mesh.x[md.mesh.elements.astype(int)-1],axis=1) 83 83 yelem=numpy.mean(md.mesh.y[md.mesh.elements.astype(int)-1],axis=1) … … 86 86 pos=numpy.nonzero(rad>=(radius-shelfextent)) 87 87 md.friction.coefficient[md.mesh.elements[pos,:]-1]=0. 88 md.friction.p=numpy.ones((md.mesh.numberofelements ,1))89 md.friction.q=numpy.ones((md.mesh.numberofelements ,1))88 md.friction.p=numpy.ones((md.mesh.numberofelements)) 89 md.friction.q=numpy.ones((md.mesh.numberofelements)) 90 90 91 91 #Numerical parameters … … 109 109 110 110 #Deal with boundary conditions: 111 md.stressbalance.spcvx=float('nan')*numpy.ones((md.mesh.numberofvertices ,1))112 md.stressbalance.spcvy=float('nan')*numpy.ones((md.mesh.numberofvertices ,1))113 md.stressbalance.spcvz=float('nan')*numpy.ones((md.mesh.numberofvertices ,1))111 md.stressbalance.spcvx=float('nan')*numpy.ones((md.mesh.numberofvertices)) 112 md.stressbalance.spcvy=float('nan')*numpy.ones((md.mesh.numberofvertices)) 113 md.stressbalance.spcvz=float('nan')*numpy.ones((md.mesh.numberofvertices)) 114 114 115 115 pos=numpy.nonzero(numpy.logical_and(md.mesh.x==0,md.mesh.y==0)) … … 119 119 pos=numpy.nonzero(md.mesh.vertexonboundary) 120 120 md.mask.ice_levelset[pos]=0 121 md.balancethickness.spcthickness=float('nan')*numpy.ones((md.mesh.numberofvertices ,1))122 md.masstransport.spcthickness=float('nan')*numpy.ones((md.mesh.numberofvertices ,1))121 md.balancethickness.spcthickness=float('nan')*numpy.ones((md.mesh.numberofvertices)) 122 md.masstransport.spcthickness=float('nan')*numpy.ones((md.mesh.numberofvertices)) 123 123 md.stressbalance.referential=float('nan')*numpy.ones((md.mesh.numberofvertices,6)) 124 124 md.stressbalance.loadingforce=0*numpy.ones((md.mesh.numberofvertices,3)) 125 md.thermal.spctemperature=737.*numpy.ones((md.mesh.numberofvertices ,1))125 md.thermal.spctemperature=737.*numpy.ones((md.mesh.numberofvertices)) 126 126 127 127 #Change name so that no test have the same name -
issm/trunk-jpl/test/Par/RoundSheetStaticEISMINT.py
r19527 r21409 5 5 hmin=0.01 6 6 hmax=2756.7 7 radius=numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2) .reshape(-1,1)7 radius=numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2) 8 8 radiusmax=numpy.max(radius) 9 9 radius[numpy.nonzero(radius>(1.-10**-9)*radiusmax)]=radiusmax #eliminate roundoff issues in next statement 10 md.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.)10 md.geometry.thickness=hmin*numpy.ones((numpy.size(md.mesh.x)))+hmax*(4.*((1./2.)**(4./3.)*numpy.ones((numpy.size(md.mesh.x)))-((radius)/(2.*radiusmax))**(4./3.)))**(3./8.) 11 11 md.geometry.base=0.*md.geometry.thickness 12 12 md.geometry.surface=md.geometry.base+md.geometry.thickness 13 13 14 14 print " creating drag" 15 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices ,1))15 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices)) 16 16 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. 17 md.friction.p=numpy.ones((md.mesh.numberofelements ,1))18 md.friction.q=numpy.ones((md.mesh.numberofelements ,1))17 md.friction.p=numpy.ones((md.mesh.numberofelements)) 18 md.friction.q=numpy.ones((md.mesh.numberofelements)) 19 19 20 20 print " creating temperatures" … … 22 22 st=1.67*10**-2/1000. #k/m 23 23 md.initialization.temperature=tmin+st*radius 24 md.basalforcings.geothermalflux=4.2*10**-2*numpy.ones((md.mesh.numberofvertices ,1))24 md.basalforcings.geothermalflux=4.2*10**-2*numpy.ones((md.mesh.numberofvertices)) 25 25 26 26 print " creating flow law parameter" 27 md.materials.rheology_B=6.81*10**7*numpy.ones((md.mesh.numberofvertices ,1)) #to have the same B as the analytical solution28 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements ,1))27 md.materials.rheology_B=6.81*10**7*numpy.ones((md.mesh.numberofvertices)) #to have the same B as the analytical solution 28 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 29 29 30 30 print " creating surface mass balance" … … 36 36 print " creating velocities" 37 37 constant=0.3 38 md.inversion.vx_obs=constant/2.*md.mesh.x .reshape(-1,1)*(md.geometry.thickness)**-139 md.inversion.vy_obs=constant/2.*md.mesh.y .reshape(-1,1)*(md.geometry.thickness)**-138 md.inversion.vx_obs=constant/2.*md.mesh.x*(md.geometry.thickness)**-1 39 md.inversion.vy_obs=constant/2.*md.mesh.y*(md.geometry.thickness)**-1 40 40 md.inversion.vel_obs=numpy.sqrt((md.inversion.vx_obs)**2+(md.inversion.vy_obs)**2) 41 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices ,1))42 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices ,1))43 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices ,1))44 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices ,1))41 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices)) 42 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices)) 43 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices)) 44 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices)) 45 45 46 46 #Deal with boundary conditions: -
issm/trunk-jpl/test/Par/SquareEISMINT.py
r19527 r21409 7 7 ymin=numpy.min(md.mesh.y) 8 8 ymax=numpy.max(md.mesh.y) 9 md.geometry.thickness=500.*numpy.ones((md.mesh.numberofvertices ,1))9 md.geometry.thickness=500.*numpy.ones((md.mesh.numberofvertices)) 10 10 md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness 11 11 md.geometry.surface=md.geometry.base+md.geometry.thickness 12 12 13 13 print " creating drag" 14 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices ,1))14 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices)) 15 15 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. 16 md.friction.p=numpy.ones((md.mesh.numberofelements ,1))17 md.friction.q=numpy.ones((md.mesh.numberofelements ,1))16 md.friction.p=numpy.ones((md.mesh.numberofelements)) 17 md.friction.q=numpy.ones((md.mesh.numberofelements)) 18 18 19 19 print " creating initial values" 20 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices ,1))21 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices ,1))22 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices ,1))23 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices ,1))24 md.initialization.vel=numpy.zeros((md.mesh.numberofvertices ,1))25 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices ,1))20 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices)) 21 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices)) 22 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices)) 23 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices)) 24 md.initialization.vel=numpy.zeros((md.mesh.numberofvertices)) 25 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices)) 26 26 27 27 print " creating flow law parameter" 28 md.materials.rheology_B=1.7687*10**8*numpy.ones((md.mesh.numberofvertices ,1))29 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements ,1))28 md.materials.rheology_B=1.7687*10**8*numpy.ones((md.mesh.numberofvertices)) 29 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 30 30 31 31 print " creating surface mass balance" 32 md.smb.mass_balance=0.2*numpy.ones((md.mesh.numberofvertices ,1)) #0m/a33 md.basalforcings.floatingice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices ,1)) #0m/a34 md.basalforcings.groundedice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices ,1)) #0m/a32 md.smb.mass_balance=0.2*numpy.ones((md.mesh.numberofvertices)) #0m/a 33 md.basalforcings.floatingice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices)) #0m/a 34 md.basalforcings.groundedice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices)) #0m/a 35 35 36 36 print " boundary conditions" … … 39 39 #Evolution of the ice shelf 40 40 pos=numpy.nonzero(md.mesh.y==200000.) #nodes on the upper boundary condition 41 md.balancethickness.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices ,1))41 md.balancethickness.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices)) 42 42 md.balancethickness.spcthickness[pos]=500. 43 md.masstransport.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices ,1))43 md.masstransport.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices)) 44 44 md.masstransport.spcthickness[pos]=500. 45 45 md.masstransport.stabilization=0 #Better result with no artificial diffusivity -
issm/trunk-jpl/test/Par/SquareSheetConstrained.py
r21170 r21409 17 17 xmin=min(md.mesh.x) 18 18 xmax=max(md.mesh.x) 19 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y .reshape(-1,1)-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x.reshape(-1,1)-xmin)/(xmax-xmin)19 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin) 20 20 md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness+20. 21 21 md.geometry.surface=md.geometry.base+md.geometry.thickness … … 30 30 [md.initialization.vx]=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y) 31 31 [md.initialization.vy]=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y) 32 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices ,1))33 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices ,1))32 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices)) 33 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices)) 34 34 35 35 #Materials 36 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices ,1))36 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices)) 37 37 md.materials.rheology_B=paterson(md.initialization.temperature) 38 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements ,1))38 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 39 39 40 40 #Calving 41 md.calving.calvingrate=0.*numpy.ones((md.mesh.numberofvertices ,1))42 md.levelset.spclevelset=float('NaN')*numpy.ones((md.mesh.numberofvertices ,1))41 md.calving.calvingrate=0.*numpy.ones((md.mesh.numberofvertices)) 42 md.levelset.spclevelset=float('NaN')*numpy.ones((md.mesh.numberofvertices)) 43 43 44 44 #Friction 45 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices ,1))45 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices)) 46 46 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. 47 md.friction.p=numpy.ones((md.mesh.numberofelements ,1))48 md.friction.q=numpy.ones((md.mesh.numberofelements ,1))47 md.friction.p=numpy.ones((md.mesh.numberofelements)) 48 md.friction.q=numpy.ones((md.mesh.numberofelements)) 49 49 50 50 #Numerical parameters … … 62 62 63 63 #GIA: 64 md.gia.lithosphere_thickness=100.*numpy.ones((md.mesh.numberofvertices ,1)); # in km65 md.gia.mantle_viscosity=1.*10**21*numpy.ones((md.mesh.numberofvertices ,1)); # in Pa.s64 md.gia.lithosphere_thickness=100.*numpy.ones((md.mesh.numberofvertices)); # in km 65 md.gia.mantle_viscosity=1.*10**21*numpy.ones((md.mesh.numberofvertices)); # in Pa.s 66 66 md.materials.lithosphere_shear_modulus=6.7*10**10; # in Pa 67 67 md.materials.lithosphere_density=3.32; # in g/cm^-3 -
issm/trunk-jpl/test/Par/SquareSheetShelf.py
r21176 r21409 17 17 xmin=min(md.mesh.x) 18 18 xmax=max(md.mesh.x) 19 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y .reshape(-1,1)-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x.reshape(-1,1)-xmin)/(xmax-xmin)19 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin) 20 20 md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness 21 21 bed_sheet=-md.materials.rho_ice/md.materials.rho_water*(hmax+(hmin-hmax)*(ymax/2-ymin)/(ymax-ymin)) … … 33 33 [md.initialization.vx] = InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y) 34 34 [md.initialization.vy] = InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y) 35 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices ,1))36 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices ,1))35 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices)) 36 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices)) 37 37 38 38 #Materials 39 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices ,1))39 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices)) 40 40 md.materials.rheology_B=paterson(md.initialization.temperature) 41 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements ,1))41 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 42 42 43 43 #Accumulation and melting 44 md.smb.mass_balance=10.*numpy.ones((md.mesh.numberofvertices ,1))45 md.basalforcings.groundedice_melting_rate=5.*numpy.ones((md.mesh.numberofvertices ,1))46 md.basalforcings.floatingice_melting_rate=5.*numpy.ones((md.mesh.numberofvertices ,1))44 md.smb.mass_balance=10.*numpy.ones((md.mesh.numberofvertices)) 45 md.basalforcings.groundedice_melting_rate=5.*numpy.ones((md.mesh.numberofvertices)) 46 md.basalforcings.floatingice_melting_rate=5.*numpy.ones((md.mesh.numberofvertices)) 47 47 48 48 #Friction 49 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices ,1))49 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices)) 50 50 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. 51 md.friction.p=numpy.ones((md.mesh.numberofelements ,1))52 md.friction.q=numpy.ones((md.mesh.numberofelements ,1))51 md.friction.p=numpy.ones((md.mesh.numberofelements)) 52 md.friction.q=numpy.ones((md.mesh.numberofelements)) 53 53 54 54 #Numerical parameters -
issm/trunk-jpl/test/Par/SquareShelf.py
r21170 r21409 16 16 xmin=min(md.mesh.x) 17 17 xmax=max(md.mesh.x) 18 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y .reshape(-1,1)-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x.reshape(-1,1)-xmin)/(xmax-xmin)18 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin) 19 19 md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness 20 20 md.geometry.surface=md.geometry.base+md.geometry.thickness … … 35 35 [md.initialization.vx]=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y) 36 36 [md.initialization.vy]=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y) 37 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices ,1))38 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices ,1))37 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices)) 38 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices)) 39 39 40 40 #dbg - begin … … 51 51 52 52 #Materials 53 md.initialization.temperature = (273.-20.)*numpy.ones((md.mesh.numberofvertices ,1))53 md.initialization.temperature = (273.-20.)*numpy.ones((md.mesh.numberofvertices)) 54 54 md.materials.rheology_B = paterson(md.initialization.temperature) 55 md.materials.rheology_n = 3.*numpy.ones((md.mesh.numberofelements ,1))55 md.materials.rheology_n = 3.*numpy.ones((md.mesh.numberofelements)) 56 56 57 57 #Friction 58 md.friction.coefficient = 20.*numpy.ones((md.mesh.numberofvertices ,1))58 md.friction.coefficient = 20.*numpy.ones((md.mesh.numberofvertices)) 59 59 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. 60 md.friction.p = numpy.ones((md.mesh.numberofelements ,1))61 md.friction.q = numpy.ones((md.mesh.numberofelements ,1))60 md.friction.p = numpy.ones((md.mesh.numberofelements)) 61 md.friction.q = numpy.ones((md.mesh.numberofelements)) 62 62 63 63 #Numerical parameters -
issm/trunk-jpl/test/Par/SquareShelf2.py
r21170 r21409 16 16 xmin=min(md.mesh.x) 17 17 xmax=max(md.mesh.x) 18 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y .reshape(-1,1)-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x.reshape(-1,1)-xmin)/(xmax-xmin)18 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin) 19 19 md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness 20 20 md.geometry.surface=md.geometry.base+md.geometry.thickness … … 34 34 [md.initialization.vx]=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y) 35 35 [md.initialization.vy]=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y) 36 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices ,1))37 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices ,1))36 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices)) 37 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices)) 38 38 39 39 #dbg - begin … … 50 50 51 51 #Materials 52 md.initialization.temperature = (273.-20.)*numpy.ones((md.mesh.numberofvertices ,1))52 md.initialization.temperature = (273.-20.)*numpy.ones((md.mesh.numberofvertices)) 53 53 md.materials.rheology_B = paterson(md.initialization.temperature) 54 md.materials.rheology_n = 3.*numpy.ones((md.mesh.numberofelements ,1))54 md.materials.rheology_n = 3.*numpy.ones((md.mesh.numberofelements)) 55 55 56 56 #Friction 57 md.friction.coefficient = 20.*numpy.ones((md.mesh.numberofvertices ,1))57 md.friction.coefficient = 20.*numpy.ones((md.mesh.numberofvertices)) 58 58 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. 59 md.friction.p = numpy.ones((md.mesh.numberofelements ,1))60 md.friction.q = numpy.ones((md.mesh.numberofelements ,1))59 md.friction.p = numpy.ones((md.mesh.numberofelements)) 60 md.friction.q = numpy.ones((md.mesh.numberofelements)) 61 61 62 62 #Numerical parameters -
issm/trunk-jpl/test/Par/SquareShelfConstrained.py
r21170 r21409 1 1 import os.path 2 2 from arch import * 3 import numpy 3 import numpy as np 4 4 import inspect 5 5 from verbose import verbose … … 12 12 hmin=300. 13 13 hmax=1000. 14 ymin=n umpy.min(md.mesh.y)15 ymax=n umpy.max(md.mesh.y)14 ymin=np.min(md.mesh.y) 15 ymax=np.max(md.mesh.y) 16 16 xmin=min(md.mesh.x) 17 17 xmax=max(md.mesh.x) 18 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y .reshape(-1,1)-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x.reshape(-1,1)-xmin)/(xmax-xmin)18 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin) 19 19 md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness 20 20 md.geometry.surface=md.geometry.base+md.geometry.thickness … … 22 22 23 23 #Initial velocity 24 #x = n umpy.reshape(numpy.array(archread('../Data/SquareShelfConstrained.arch','x')),(-1))25 #y = n umpy.reshape(numpy.array(archread('../Data/SquareShelfConstrained.arch','y')),(-1))26 x = n umpy.array(archread('../Data/SquareShelfConstrained.arch','x'))27 y = n umpy.array(archread('../Data/SquareShelfConstrained.arch','y'))28 vx = n umpy.array(archread('../Data/SquareShelfConstrained.arch','vx'))29 vy = n umpy.array(archread('../Data/SquareShelfConstrained.arch','vy'))30 index = n umpy.array(archread('../Data/SquareShelfConstrained.arch','index').astype(int))24 #x = np.reshape(np.array(archread('../Data/SquareShelfConstrained.arch','x')),(-1)) 25 #y = np.reshape(np.array(archread('../Data/SquareShelfConstrained.arch','y')),(-1)) 26 x = np.array(archread('../Data/SquareShelfConstrained.arch','x')) 27 y = np.array(archread('../Data/SquareShelfConstrained.arch','y')) 28 vx = np.array(archread('../Data/SquareShelfConstrained.arch','vx')) 29 vy = np.array(archread('../Data/SquareShelfConstrained.arch','vy')) 30 index = np.array(archread('../Data/SquareShelfConstrained.arch','index').astype(int)) 31 31 32 32 [md.initialization.vx]=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y) 33 33 [md.initialization.vy]=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y) 34 md.initialization.vz=n umpy.zeros((md.mesh.numberofvertices,1))35 md.initialization.pressure=n umpy.zeros((md.mesh.numberofvertices,1))34 md.initialization.vz=np.zeros((md.mesh.numberofvertices)) 35 md.initialization.pressure=np.zeros((md.mesh.numberofvertices)) 36 36 37 37 #Materials 38 md.initialization.temperature=(273.-20.)*n umpy.ones((md.mesh.numberofvertices,1))38 md.initialization.temperature=(273.-20.)*np.ones((md.mesh.numberofvertices)) 39 39 md.materials.rheology_B=paterson(md.initialization.temperature) 40 md.materials.rheology_n=3.*n umpy.ones((md.mesh.numberofelements,1))40 md.materials.rheology_n=3.*np.ones((md.mesh.numberofelements)) 41 41 42 42 #Surface mass balance and basal melting 43 md.smb.mass_balance=10.*n umpy.ones((md.mesh.numberofvertices,1))44 md.basalforcings.groundedice_melting_rate=5.*n umpy.ones((md.mesh.numberofvertices,1))45 md.basalforcings.floatingice_melting_rate=5.*n umpy.ones((md.mesh.numberofvertices,1))43 md.smb.mass_balance=10.*np.ones((md.mesh.numberofvertices)) 44 md.basalforcings.groundedice_melting_rate=5.*np.ones((md.mesh.numberofvertices)) 45 md.basalforcings.floatingice_melting_rate=5.*np.ones((md.mesh.numberofvertices)) 46 46 47 47 #Friction 48 md.friction.coefficient=20.*n umpy.ones((md.mesh.numberofvertices,1))49 md.friction.coefficient[n umpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.50 md.friction.p=n umpy.ones((md.mesh.numberofelements,1))51 md.friction.q=n umpy.ones((md.mesh.numberofelements,1))48 md.friction.coefficient=20.*np.ones((md.mesh.numberofvertices)) 49 md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. 50 md.friction.p=np.ones((md.mesh.numberofelements)) 51 md.friction.q=np.ones((md.mesh.numberofelements)) 52 52 53 53 #Numerical parameters -
issm/trunk-jpl/test/Par/SquareThermal.py
r19527 r21409 9 9 print " creating thickness" 10 10 h=1000. 11 md.geometry.thickness=h*numpy.ones((md.mesh.numberofvertices ,1))12 md.geometry.base=-1000.*numpy.ones((md.mesh.numberofvertices ,1))11 md.geometry.thickness=h*numpy.ones((md.mesh.numberofvertices)) 12 md.geometry.base=-1000.*numpy.ones((md.mesh.numberofvertices)) 13 13 md.geometry.surface=md.geometry.base+md.geometry.thickness; 14 14 15 15 print " creating velocities" 16 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices ,1))17 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices ,1))18 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices ,1))16 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices)) 17 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices)) 18 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices)) 19 19 20 20 print " creating drag" 21 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices ,1))21 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices)) 22 22 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. 23 md.friction.p=numpy.ones((md.mesh.numberofelements ,1))24 md.friction.q=numpy.ones((md.mesh.numberofelements ,1))23 md.friction.p=numpy.ones((md.mesh.numberofelements)) 24 md.friction.q=numpy.ones((md.mesh.numberofelements)) 25 25 26 26 print " creating temperatures" 27 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices ,1))27 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices)) 28 28 29 29 print " creating flow law parameter" 30 30 md.materials.rheology_B=paterson(md.initialization.temperature) 31 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements ,1))31 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 32 32 33 33 print " creating surface mass balance" 34 md.smb.mass_balance=numpy.ones((md.mesh.numberofvertices ,1))/md.constants.yts #1m/a35 md.basalforcings.melting_rate=0.*numpy.ones((md.mesh.numberofvertices ,1))/md.constants.yts #1m/a34 md.smb.mass_balance=numpy.ones((md.mesh.numberofvertices))/md.constants.yts #1m/a 35 md.basalforcings.melting_rate=0.*numpy.ones((md.mesh.numberofvertices))/md.constants.yts #1m/a 36 36 37 37 #Deal with boundary conditions: … … 41 41 42 42 print " boundary conditions for thermal model" 43 md.thermal.spctemperature [:]=md.initialization.temperature44 md.basalforcings.geothermalflux=numpy.zeros((md.mesh.numberofvertices ,1))43 md.thermal.spctemperature=md.initialization.temperature 44 md.basalforcings.geothermalflux=numpy.zeros((md.mesh.numberofvertices)) 45 45 md.basalforcings.geothermalflux[numpy.nonzero(md.mask.groundedice_levelset>0.)[0]]=1.*10**-3 #1 mW/m^2 -
issm/trunk-jpl/test/Par/ValleyGlacierShelf.py
r21170 r21409 10 10 11 11 #Start defining model parameters here 12 x=md.mesh.x .reshape(-1,1)13 y=md.mesh.y .reshape(-1,1)12 x=md.mesh.x 13 y=md.mesh.y 14 14 xmin, xmax = min(x), max(x) 15 15 ymin, ymax = min(y), max(y) … … 33 33 #Mask 34 34 md.mask.ice_levelset=x - alpha*Lx 35 md.mask.groundedice_levelset= numpy.ones((md.mesh.numberofvertices ,1))35 md.mask.groundedice_levelset= numpy.ones((md.mesh.numberofvertices)) 36 36 37 37 #Initial velocity 38 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices ,1))39 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices ,1))40 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices ,1))41 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices ,1))38 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices)) 39 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices)) 40 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices)) 41 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices)) 42 42 43 43 #Materials 44 md.initialization.temperature=(273.15-5.)*numpy.ones((md.mesh.numberofvertices ,1))45 md.initialization.waterfraction=numpy.zeros((md.mesh.numberofvertices ,1))46 md.initialization.watercolumn=numpy.zeros((md.mesh.numberofvertices ,1))44 md.initialization.temperature=(273.15-5.)*numpy.ones((md.mesh.numberofvertices)) 45 md.initialization.waterfraction=numpy.zeros((md.mesh.numberofvertices)) 46 md.initialization.watercolumn=numpy.zeros((md.mesh.numberofvertices)) 47 47 md.materials.rheology_B=paterson(md.initialization.temperature) 48 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements ,1))48 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 49 49 50 50 #Thermal 51 51 md.thermal.isenthalpy=False 52 md.thermal.spctemperature=float('nan')*numpy.ones((md.mesh.numberofvertices ,1))52 md.thermal.spctemperature=float('nan')*numpy.ones((md.mesh.numberofvertices)) 53 53 54 54 #Groundingline … … 56 56 57 57 #Surface mass balance and basal melting 58 md.smb.mass_balance=0.3*numpy.ones((md.mesh.numberofvertices ,1))58 md.smb.mass_balance=0.3*numpy.ones((md.mesh.numberofvertices)) 59 59 md.basalforcings.groundedice_melting_rate=md.smb.mass_balance 60 60 md.basalforcings.floatingice_melting_rate=md.smb.mass_balance 61 61 62 62 #Friction 63 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices ,1))63 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices)) 64 64 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. 65 md.friction.p=numpy.ones((md.mesh.numberofelements ,1))66 md.friction.q=numpy.ones((md.mesh.numberofelements ,1))65 md.friction.p=numpy.ones((md.mesh.numberofelements)) 66 md.friction.q=numpy.ones((md.mesh.numberofelements)) 67 67 68 68 #Transient … … 82 82 83 83 #Masstransport 84 md.calving.calvingrate=0.*numpy.ones((md.mesh.numberofvertices ,1))85 md.calving.meltingrate=0.*numpy.ones((md.mesh.numberofvertices ,1))86 md.levelset.spclevelset=float('NaN')*numpy.ones((md.mesh.numberofvertices ,1))84 md.calving.calvingrate=0.*numpy.ones((md.mesh.numberofvertices)) 85 md.calving.meltingrate=0.*numpy.ones((md.mesh.numberofvertices)) 86 md.levelset.spclevelset=float('NaN')*numpy.ones((md.mesh.numberofvertices)) 87 87 md.masstransport.stabilization=1. 88 88
Note:
See TracChangeset
for help on using the changeset viewer.