Changeset 12158
- Timestamp:
- 05/01/12 07:35:08 (13 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/startup.m
r11879 r12158 11 11 lastwarn(''); 12 12 13 %Recover ISSM_ TIER , or if on a Windows machine, ISSM_TIER_WIN13 %Recover ISSM_DIR , or if on a Windows machine, ISSM_DIR_WIN 14 14 if ~ispc, 15 ISSM_ TIER=getenv('ISSM_TIER');15 ISSM_DIR=getenv('ISSM_DIR'); 16 16 else 17 ISSM_ TIER=getenv('ISSM_TIER_WIN');18 %ISSM_ TIER='';17 ISSM_DIR=getenv('ISSM_DIR_WIN'); 18 %ISSM_DIR=''; 19 19 end 20 if (isempty(ISSM_ TIER)),21 error('''ISSM_ TIER'' environment variable is empty! You should define ISSM_TIER in your .cshrc or .bashrc!');20 if (isempty(ISSM_DIR)), 21 error('''ISSM_DIR'' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!'); 22 22 end 23 23 24 24 %Now add all issm code paths necessary to run issm smoothly. 25 25 %We capture the error output, so that we can warn the user to update 26 %the variable ISSM_ TIER in this file, in case it is not correctly setup.26 %the variable ISSM_DIR in this file, in case it is not correctly setup. 27 27 28 28 %ISSM path 29 addpath([ISSM_ TIER '/src/m/utils/']); %loads recursivepath30 addpath([ISSM_ TIER '/bin']);31 addpath(recursivepath([ISSM_ TIER '/src/m']));32 addpath(recursivepath([ISSM_ TIER '/externalpackages/scotch']));33 addpath(recursivepath([ISSM_ TIER '/externalpackages/canos']));34 addpath(recursivepath([ISSM_ TIER '/externalpackages/kml']));35 addpath(recursivepath([ISSM_ TIER '/externalpackages/export_fig']));36 addpath(recursivepath([ISSM_ TIER '/externalpackages/googleearthtoolbox']));37 addpath(recursivepath([ISSM_ TIER '/externalpackages/cm_and_cb_utilities']));29 addpath([ISSM_DIR '/src/m/utils/']); %loads recursivepath 30 addpath([ISSM_DIR '/bin']); 31 addpath(recursivepath([ISSM_DIR '/src/m'])); 32 addpath(recursivepath([ISSM_DIR '/externalpackages/scotch'])); 33 addpath(recursivepath([ISSM_DIR '/externalpackages/canos'])); 34 addpath(recursivepath([ISSM_DIR '/externalpackages/kml'])); 35 addpath(recursivepath([ISSM_DIR '/externalpackages/export_fig'])); 36 addpath(recursivepath([ISSM_DIR '/externalpackages/googleearthtoolbox'])); 37 addpath(recursivepath([ISSM_DIR '/externalpackages/cm_and_cb_utilities'])); 38 38 39 clear ISSM_ TIER;39 clear ISSM_DIR; 40 40 41 41 %Check on any warning messages that might indicate that the paths were not correct. 42 42 if ~isempty(lastwarn), 43 fprintf('\n Error trying to setup ''ISSM'' code paths. Try and update the ISSM_ TIER variable in your .cshrc or .bashrc!\n');43 fprintf('\n Error trying to setup ''ISSM'' code paths. Try and update the ISSM_DIR variable in your .cshrc or .bashrc!\n'); 44 44 fprintf(' ''ISSM'' will not work at all until this is resolved\n\n'); 45 45 else -
issm/trunk-jpl/startup.py
r12112 r12158 5 5 # before handing over the prompt to the user if the environment variable 6 6 # PYTHONSTARTUP is defined: 7 # export PYTHONSTARTUP=$ISSM_ TIER/startup.py7 # export PYTHONSTARTUP=$ISSM_DIR/startup.py 8 8 # This startup script should be run by users before trying to use ISSM. 9 9 10 10 import os,sys 11 11 12 #Recover ISSM_ TIER, ISSM_DIRand USERNAME13 ISSM_ TIER=os.getenv('ISSM_TIER')12 #Recover ISSM_DIR and USERNAME 13 ISSM_DIR=os.getenv('ISSM_DIR') 14 14 USERNAME =os.getenv('USER') 15 if(ISSM_ TIER==None):16 raise NameError('"ISSM_ TIER" environment variable is empty! You should define ISSM_TIER in your .cshrc or .bashrc!')15 if(ISSM_DIR==None): 16 raise NameError('"ISSM_DIR" environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!') 17 17 18 18 #Now add all issm code paths necessary to run issm smoothly. 19 19 #We capture the error output, so that we can warn the user to update 20 #the variable ISSM_ TIER in this file, in case it is not correctly setup.20 #the variable ISSM_DIR in this file, in case it is not correctly setup. 21 21 22 22 #ISSM path. Go through src/py and load everything we find that looks like a python file 23 for root,dirs,files in os.walk(ISSM_ TIER+ '/src/py'):23 for root,dirs,files in os.walk(ISSM_DIR+ '/src/py'): 24 24 for file in files: 25 25 if file.find(".py") != -1: … … 30 30 #__import__(file) 31 31 32 for root,dirs,files in os.walk(ISSM_ TIER+ '/src/m'):32 for root,dirs,files in os.walk(ISSM_DIR+ '/src/m'): 33 33 for file in files: 34 34 if file.find(".py") != -1: … … 39 39 #__import__(file) 40 40 41 sys.path.append(ISSM_ TIER + '/src/modules/python')41 sys.path.append(ISSM_DIR + '/src/modules/python') 42 42 43 43 #Deal with scipy import:
Note:
See TracChangeset
for help on using the changeset viewer.