Index: /issm/trunk/startup.m
===================================================================
--- /issm/trunk/startup.m	(revision 6376)
+++ /issm/trunk/startup.m	(revision 6377)
@@ -12,19 +12,18 @@
 lastwarn(''); % clear the last warning to focus on the warnings of the ISSM path
 
-%Recover ISSM_TIER 
+%Recover ISSM_TIER, ISSM_DIR and USERNAME
 if ispc,
 	[status1,ISSM_TIER]=system('echo [%ISSM_TIER_WIN%]');
-	[status2,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
+	[status2,ISSM_DIR] =system('echo [%ISSM_DIR_WIN%]');
+	[status3,USERNAME] =system('echo [%USER%]');
 else
 	[status1,ISSM_TIER]=system('echo $ISSM_TIER');
-	[status2,ISSM_DIR]=system('echo $ISSM_DIR');
+	[status2,ISSM_DIR] =system('echo $ISSM_DIR');
+	[status3,USERNAME] =system('echo $USER');
 end
-if status1~=0,
-	error('startup error message: problem when running ''echo $ISSM_TIER'' shell command');
-end
-if status2~=0,
-	error('startup error message: problem when running ''echo $ISSM_DIR'' shell command');
-end
-
+if status1~=0, error('startup error message: problem when running ''echo $ISSM_TIER'' shell command'); end
+if status2~=0, error('startup error message: problem when running ''echo $ISSM_DIR'' shell command'); end
+if status3~=0, error('startup error message: problem when running ''echo $USER'' shell command'); end
+clear status1 status2 status3;
 if (length(ISSM_TIER)<=1),
 	error('issmdir error message: ''ISSM_TIER'' environment variable is empty! You should define ISSM_TIER in your .cshrc or .bashrc!');
@@ -36,6 +35,6 @@
 %get rid of useless symbols in the name
 ISSM_TIER=strtrim(ISSM_TIER); 
-ISSM_DIR=strtrim(ISSM_DIR); 
-clear status1 status2;
+ISSM_DIR =strtrim(ISSM_DIR); 
+USERNAME =strtrim(USERNAME); 
 
 %Now add all issm code paths necessary to run issm smoothly. 
@@ -52,4 +51,5 @@
 addpath(genpath_ice([ISSM_TIER '/externalpackages/subplotSpacing']));
 addpath(genpath_ice([ISSM_TIER '/externalpackages/scotch']));
+rmpath(genpath_ice([ISSM_TIER '/src/m/contrib']));
 
 %Check on any warning messages that might indicate that the paths were not correct. 
@@ -75,17 +75,7 @@
 clear ans
 
-
 %Now, load personal startup preferences, using the local user name: 
-%Recover user name 
-if ispc,
-	[status,USERNAME]=system('echo [%USER%]');
-else
-	[status,USERNAME]=system('echo $USER');
-end
-if status~=0,
-	error('startup error message: problem when running ''echo $USER'' shell command');
-end
 if exist([ISSM_TIER '/src/m/contrib/' USERNAME],'dir'),
 	addpath([ISSM_TIER '/src/m/contrib/' USERNAME]);
 end
-clear status USERNAME;
+clear USERNAME;
