Changeset 6377
- Timestamp:
- 10/21/10 14:35:39 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/startup.m
r6327 r6377 12 12 lastwarn(''); % clear the last warning to focus on the warnings of the ISSM path 13 13 14 %Recover ISSM_TIER 14 %Recover ISSM_TIER, ISSM_DIR and USERNAME 15 15 if ispc, 16 16 [status1,ISSM_TIER]=system('echo [%ISSM_TIER_WIN%]'); 17 [status2,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]'); 17 [status2,ISSM_DIR] =system('echo [%ISSM_DIR_WIN%]'); 18 [status3,USERNAME] =system('echo [%USER%]'); 18 19 else 19 20 [status1,ISSM_TIER]=system('echo $ISSM_TIER'); 20 [status2,ISSM_DIR]=system('echo $ISSM_DIR'); 21 [status2,ISSM_DIR] =system('echo $ISSM_DIR'); 22 [status3,USERNAME] =system('echo $USER'); 21 23 end 22 if status1~=0, 23 error('startup error message: problem when running ''echo $ISSM_TIER'' shell command'); 24 end 25 if status2~=0, 26 error('startup error message: problem when running ''echo $ISSM_DIR'' shell command'); 27 end 28 24 if status1~=0, error('startup error message: problem when running ''echo $ISSM_TIER'' shell command'); end 25 if status2~=0, error('startup error message: problem when running ''echo $ISSM_DIR'' shell command'); end 26 if status3~=0, error('startup error message: problem when running ''echo $USER'' shell command'); end 27 clear status1 status2 status3; 29 28 if (length(ISSM_TIER)<=1), 30 29 error('issmdir error message: ''ISSM_TIER'' environment variable is empty! You should define ISSM_TIER in your .cshrc or .bashrc!'); … … 36 35 %get rid of useless symbols in the name 37 36 ISSM_TIER=strtrim(ISSM_TIER); 38 ISSM_DIR =strtrim(ISSM_DIR);39 clear status1 status2; 37 ISSM_DIR =strtrim(ISSM_DIR); 38 USERNAME =strtrim(USERNAME); 40 39 41 40 %Now add all issm code paths necessary to run issm smoothly. … … 52 51 addpath(genpath_ice([ISSM_TIER '/externalpackages/subplotSpacing'])); 53 52 addpath(genpath_ice([ISSM_TIER '/externalpackages/scotch'])); 53 rmpath(genpath_ice([ISSM_TIER '/src/m/contrib'])); 54 54 55 55 %Check on any warning messages that might indicate that the paths were not correct. … … 75 75 clear ans 76 76 77 78 77 %Now, load personal startup preferences, using the local user name: 79 %Recover user name80 if ispc,81 [status,USERNAME]=system('echo [%USER%]');82 else83 [status,USERNAME]=system('echo $USER');84 end85 if status~=0,86 error('startup error message: problem when running ''echo $USER'' shell command');87 end88 78 if exist([ISSM_TIER '/src/m/contrib/' USERNAME],'dir'), 89 79 addpath([ISSM_TIER '/src/m/contrib/' USERNAME]); 90 80 end 91 clear statusUSERNAME;81 clear USERNAME;
Note:
See TracChangeset
for help on using the changeset viewer.