Ignore:
Timestamp:
03/24/12 10:27:17 (13 years ago)
Author:
Eric.Larour
Message:

Create python model and subclasses

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/startup.py

    r10939 r11787  
    1010import os,sys
    1111
     12 
     13#First check we are running python 3 at least
     14if sys.version_info[0] < 3:
     15        print("ISSM can only work in Python 3. Exiting python")
     16        sys.exit(1)
     17
    1218#Recover ISSM_TIER, ISSM_DIR  and USERNAME
    1319ISSM_TIER=os.getenv('ISSM_TIER')
     
    2026#the variable ISSM_TIER in this file, in case it is not correctly setup.
    2127
    22 #ISSM path
    23 sys.path.append(ISSM_TIER+'/src/py')
    24 sys.path.append(ISSM_TIER+'/src/py/classes')
    25 sys.path.append(ISSM_TIER+'/src/py/modules/TriMesh')
    26 sys.path.append(ISSM_TIER+'/src/py/modules/hello')
     28#ISSM path. Go through src/py and load everything we find  that looks like a python file
     29for root,dirs,files in os.walk(ISSM_TIER+ '/src/py'):
     30        for file in files:
     31                if file.find(".py") != -1:
     32                        if file.find(".pyc") == -1:
     33                                #add to path
     34                                sys.path.append(root)
     35                                file=os.path.splitext(file)[0]
     36                                #__import__(file)
     37
     38#Deal with scipy import:
     39import scipy
     40import numpy
     41import nose
     42
     43#Import modules that are absolutely needed in ISSM {{{
    2744from model import *
     45from mesh import *
     46from mask import *
     47from geometry import *
     48from constants import *
     49from surfaceforcings import *
     50from basalforcings import *
     51from materials import *
     52from friction import *
     53from flowequation import *
     54from fielddisplay import *
     55from timestepping import *
     56from initialization import *
     57from rifts import *
     58from debug import *
     59from settings import *
     60from solver import *
     61#}}}
    2862
    29 print "\n  To get started with ISSM, type issmdoc at the command prompt.\n\n"
     63print("\n  To get started with ISSM, type issmdoc at the command prompt.\n\n")
Note: See TracChangeset for help on using the changeset viewer.