Changeset 6377


Ignore:
Timestamp:
10/21/10 14:35:39 (14 years ago)
Author:
Mathieu Morlighem
Message:

Load only src/m/contrib/username

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/startup.m

    r6327 r6377  
    1212lastwarn(''); % clear the last warning to focus on the warnings of the ISSM path
    1313
    14 %Recover ISSM_TIER 
     14%Recover ISSM_TIER, ISSM_DIR and USERNAME
    1515if ispc,
    1616        [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%]');
    1819else
    1920        [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');
    2123end
    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 
     24if status1~=0, error('startup error message: problem when running ''echo $ISSM_TIER'' shell command'); end
     25if status2~=0, error('startup error message: problem when running ''echo $ISSM_DIR'' shell command'); end
     26if status3~=0, error('startup error message: problem when running ''echo $USER'' shell command'); end
     27clear status1 status2 status3;
    2928if (length(ISSM_TIER)<=1),
    3029        error('issmdir error message: ''ISSM_TIER'' environment variable is empty! You should define ISSM_TIER in your .cshrc or .bashrc!');
     
    3635%get rid of useless symbols in the name
    3736ISSM_TIER=strtrim(ISSM_TIER);
    38 ISSM_DIR=strtrim(ISSM_DIR);
    39 clear status1 status2;
     37ISSM_DIR =strtrim(ISSM_DIR);
     38USERNAME =strtrim(USERNAME);
    4039
    4140%Now add all issm code paths necessary to run issm smoothly.
     
    5251addpath(genpath_ice([ISSM_TIER '/externalpackages/subplotSpacing']));
    5352addpath(genpath_ice([ISSM_TIER '/externalpackages/scotch']));
     53rmpath(genpath_ice([ISSM_TIER '/src/m/contrib']));
    5454
    5555%Check on any warning messages that might indicate that the paths were not correct.
     
    7575clear ans
    7676
    77 
    7877%Now, load personal startup preferences, using the local user name:
    79 %Recover user name
    80 if ispc,
    81         [status,USERNAME]=system('echo [%USER%]');
    82 else
    83         [status,USERNAME]=system('echo $USER');
    84 end
    85 if status~=0,
    86         error('startup error message: problem when running ''echo $USER'' shell command');
    87 end
    8878if exist([ISSM_TIER '/src/m/contrib/' USERNAME],'dir'),
    8979        addpath([ISSM_TIER '/src/m/contrib/' USERNAME]);
    9080end
    91 clear status USERNAME;
     81clear USERNAME;
Note: See TracChangeset for help on using the changeset viewer.