Changeset 12124


Ignore:
Timestamp:
04/25/12 09:17:55 (13 years ago)
Author:
Eric.Larour
Message:

Almost finished translated to python

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/test/Par/SquareShelfConstrained.py

    r12122 r12124  
    11from numpy import *
     2from verbose import *
    23import scipy.io as matio
    34import InterpFromMeshToMesh2d as im
     5from   paterson import  *
    46
    57#Start defining model parameters here
     
    1416md.geometry.surface = md.geometry.bed+md.geometry.thickness
    1517
    16 #%Initial velocity
     18#Initial velocity
    1719mat=matio.loadmat('../Data/SquareShelfConstrained.data')
    1820#deal with 'F' oriented matlab matrices!
     
    2426md.initialization.vz = zeros(md.mesh.numberofvertices)
    2527md.initialization.pressure = zeros(md.mesh.numberofvertices)
    26 #%Materials
     28#Materials
    2729md.initialization.temperature = (273.-20)*ones(md.mesh.numberofvertices)
    2830md.materials.rheology_B = paterson(md.initialization.temperature)
    2931md.materials.rheology_n = 3.*ones(md.mesh.numberofelements)
    30 #%Surface mass balance and basal melting
     32#Surface mass balance and basal melting
    3133md.surfaceforcings.mass_balance = 10.*ones(md.mesh.numberofvertices)
    3234md.basalforcings.melting_rate = 5.*ones(md.mesh.numberofvertices)
    33 #%Friction
     35#Friction
    3436pos = nonzero(md.mask.elementonfloatingice)
    3537md.friction.coefficient = 20.*ones(md.mesh.numberofvertices)
    36 md.friction.coefficient[(md.mesh.elements[int(pos)-1,:])] = 0.
     38md.friction.coefficient[md.mesh.elements[pos,:].astype(int)-1] =0.
    3739md.friction.p = ones(md.mesh.numberofelements)
    3840md.friction.q = ones(md.mesh.numberofelements)
    39 #%Numerical parameters
     41#Numerical parameters
    4042md.diagnostic.viscosity_overshoot = 0.0
    4143md.prognostic.stabilization = 1.
    4244md.thermal.stabilization = 1.
    43 md.verbose = verbose[-1]
     45md.verbose = verbose()
    4446md.settings.waitonlock = 30.
    4547md.diagnostic.restol = 0.05
     
    4951md.timestepping.time_step = 1.
    5052md.timestepping.final_time = 3.
    51 #%Deal with boundary conditions:
     53#Deal with boundary conditions:
    5254md = SetIceShelfBC(md)
    53 #%Change name so that no test have the same name
     55#Change name so that no test have the same name
    5456A = dbstack
    5557if length(A) > 2.:
Note: See TracChangeset for help on using the changeset viewer.