Changeset 13636


Ignore:
Timestamp:
10/12/12 10:50:01 (12 years ago)
Author:
jschierm
Message:

NEW: Python version of SquareSheetConstrained.

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  
    66ymin=min(md.mesh.y);
    77ymax=max(md.mesh.y);
     8
    89md.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;
     10md.geometry.bed=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness+20.;
    1011md.geometry.surface=md.geometry.bed+md.geometry.thickness;
    1112
     
    1617vy    = transpose(ncread('../Data/SquareSheetConstrained.nc','vy'));
    1718index = transpose(ncread('../Data/SquareSheetConstrained.nc','index'));
     19
    1820md.initialization.vx=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y);
    1921md.initialization.vy=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y);
     
    2325
    2426%Materials
    25 md.initialization.temperature=(273-20)*ones(md.mesh.numberofvertices,1);
     27md.initialization.temperature=(273.-20.)*ones(md.mesh.numberofvertices,1);
    2628md.materials.rheology_B=paterson(md.initialization.temperature);
    27 md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
     29md.materials.rheology_n=3.*ones(md.mesh.numberofelements,1);
    2830
    2931%Friction
    3032pos=find(md.mask.elementonfloatingice);
    31 md.friction.coefficient=20*ones(md.mesh.numberofvertices,1);
     33md.friction.coefficient=20.*ones(md.mesh.numberofvertices,1);
    3234md.friction.coefficient(md.mesh.elements(pos,:))=0;
    3335md.friction.p=ones(md.mesh.numberofelements,1);
     
    3638%Numerical parameters
    3739md.diagnostic.viscosity_overshoot=0.0;
    38 md.prognostic.stabilization=1;
    39 md.thermal.stabilization=1;
     40md.prognostic.stabilization=1.;
     41md.thermal.stabilization=1.;
    4042md.verbose=verbose(0);
    4143md.settings.waitonlock=30;
     
    4446md.diagnostic.reltol=0.05;
    4547md.diagnostic.abstol=NaN;
    46 md.timestepping.time_step=1;
    47 md.timestepping.final_time=3;
     48md.timestepping.time_step=1.;
     49md.timestepping.final_time=3.;
    4850
    4951%Boundary conditions:
  • TabularUnified issm/trunk-jpl/test/Par/SquareShelfConstrained.py

    r13463 r13636  
    11import os.path
     2import netCDF4
     3import numpy
    24import inspect
    3 import netCDF4
    4 from numpy import *
    55from verbose import *
    66from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
     
    1010#Start defining model parameters here
    1111#Geometry
    12 hmin = 300.
    13 hmax = 1000.
    14 ymin = min(md.mesh.y)
    15 ymax = max(md.mesh.y)
     12hmin=300.
     13hmax=1000.
     14ymin=numpy.min(md.mesh.y)
     15ymax=numpy.max(md.mesh.y)
    1616
    17 md.geometry.thickness = hmax+(hmin-hmax)*(md.mesh.y.reshape(-1,1)-ymin)/(ymax-ymin)
     17md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y.reshape(-1,1)-ymin)/(ymax-ymin)
    1818md.geometry.bed=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
    19 md.geometry.surface = md.geometry.bed+md.geometry.thickness
     19md.geometry.surface=md.geometry.bed+md.geometry.thickness
    2020
    2121#Initial velocity
     
    2929f.close()
    3030
    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)
     33md.initialization.vz=numpy.zeros((md.mesh.numberofvertices,1))
     34md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1))
     35
    3536#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))
     37md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices,1))
     38md.materials.rheology_B=paterson(md.initialization.temperature)
     39md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
     40
    3941#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))
     42md.surfaceforcings.mass_balance=10.*numpy.ones((md.mesh.numberofvertices,1))
     43md.basalforcings.melting_rate=5.*numpy.ones((md.mesh.numberofvertices,1))
     44
    4245#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))
     46pos=numpy.nonzero(md.mask.elementonfloatingice)
     47md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices,1))
     48md.friction.coefficient[md.mesh.elements[pos,:].astype(int)-1]=0.
     49md.friction.p=numpy.ones((md.mesh.numberofelements,1))
     50md.friction.q=numpy.ones((md.mesh.numberofelements,1))
     51
    4852#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.
     53md.diagnostic.viscosity_overshoot=0.0
     54md.prognostic.stabilization=1.
     55md.thermal.stabilization=1.
     56md.verbose = verbose(0)
     57md.settings.waitonlock=30.
     58md.diagnostic.restol=0.05
     59md.diagnostic.reltol=0.05
     60md.steadystate.reltol=0.05
     61md.diagnostic.abstol=float('nan')
     62md.timestepping.time_step=1.
     63md.timestepping.final_time=3.
     64
    6065#Deal with boundary conditions:
    6166md = SetIceShelfBC(md)
     67
    6268#Change name so that no tests have the same name
    6369if len(inspect.stack()) > 2:
Note: See TracChangeset for help on using the changeset viewer.