Index: /issm/trunk/src/m/model/modeldefault/modeldefault_process.m
===================================================================
--- /issm/trunk/src/m/model/modeldefault/modeldefault_process.m	(revision 6859)
+++ /issm/trunk/src/m/model/modeldefault/modeldefault_process.m	(revision 6860)
@@ -6,6 +6,5 @@
 
 %retrieve some paths
-global ISSM_DIR
-modeldatapath=[ISSM_DIR '/projects/ModelData'];
+modeldatapath=[issmdir() '/projects/ModelData'];
 
 %initialize output
Index: /issm/trunk/src/m/model/modis.m
===================================================================
--- /issm/trunk/src/m/model/modis.m	(revision 6859)
+++ /issm/trunk/src/m/model/modis.m	(revision 6860)
@@ -5,6 +5,4 @@
 %      [xm,ym,modis]=modis(modisgeotif,xlim,ylim)
 %
-
-global ISSM_TIER
 
 %find gdal coordinates
@@ -16,9 +14,9 @@
 
 %Get path  to gdal binaries
-path_gdal=[ISSM_TIER '/externalpackages/gdal/install/bin/'];
+path_gdal=[issmtier() '/externalpackages/gdal/install/bin/'];
 
 %Was gdal compiled? 
 if ~exist([path_gdal 'gdal_translate']),
-	error(['modis error message: GDAL library needs to be compiled to use this routine. Compile GDAL in ' ISSM_TIER '/externalpackages/gdal to use this routine.']);
+	error(['modis error message: GDAL library needs to be compiled to use this routine. Compile GDAL in ' issmtier() '/externalpackages/gdal to use this routine.']);
 end
 
Index: /issm/trunk/src/m/model/multiplequeue/BuildMultipleQueueingScriptGeneric.m
===================================================================
--- /issm/trunk/src/m/model/multiplequeue/BuildMultipleQueueingScriptGeneric.m	(revision 6859)
+++ /issm/trunk/src/m/model/multiplequeue/BuildMultipleQueueingScriptGeneric.m	(revision 6860)
@@ -5,7 +5,4 @@
 %      BuildMultipleQueueingScriptGeneric(executionpath,codepath)
 
-global ISSM_TIER
-
-
 %not done yet
 error('BuildMultipleQueueingScriptGenericerror message: not supported yet!');
Index: /issm/trunk/src/m/model/petscversion.m
===================================================================
--- /issm/trunk/src/m/model/petscversion.m	(revision 6859)
+++ /issm/trunk/src/m/model/petscversion.m	(revision 6860)
@@ -1,9 +1,16 @@
-function version=petscversion(issm_tier)
-%PETSCVERSION: recover petsc version number, inside config.h file
+function PETSC_VERSION=petscversion()
+%PETSCVERSION - recover petsc version number, inside config.h file
+%
+%   Usage:
+%       PETSC_VERSION=petscversion();
 
 
-fid=fopen([issm_tier '/config.h'],'r');
+configfile=[issmtier() '/config.h'];
+if ~exist(configfile,'file'),
+	error(['File ' configfile ' not found. ISSM has not been configured yet!']);
+end
 
 %go through the file, and recover the line we want
+fid=fopen(configfile,'r');
 while(1),
 	tline=fgets(fid);
@@ -11,5 +18,5 @@
 	if length(tline)>=25,
 		if  strcmpi(tline(1:23),'#define _PETSC_VERSION_'),
-			version=str2num(tline(25));
+			PETSC_VERSION=str2num(tline(25));
 		end
 	end
Index: /issm/trunk/src/m/model/plot/applyoptions.m
===================================================================
--- /issm/trunk/src/m/model/plot/applyoptions.m	(revision 6859)
+++ /issm/trunk/src/m/model/plot/applyoptions.m	(revision 6860)
@@ -6,6 +6,4 @@
 %
 %   See also: PLOTMODEL, PARSE_OPTIONS
-
-global ISSM_DIR
 
 %fontsize
@@ -340,7 +338,7 @@
 	%box off
 	if strcmpi(md.hemisphere,'n') | strcmpi(md.hemisphere,'north'),
-		A=expread([ ISSM_DIR '/projects/Exp/Greenland.exp']);
+		A=expread([ issmdir() '/projects/Exp/Greenland.exp']);
 	elseif strcmpi(md.hemisphere,'s') | strcmpi(md.hemisphere,'south'),
-		A=expread([ ISSM_DIR '/projects/Exp/Antarctica.exp']);
+		A=expread([ issmdir() '/projects/Exp/Antarctica.exp']);
 	else
 		error('applyoptions error message: hemisphere not defined');
Index: /issm/trunk/src/m/model/plot/plotmodel.m
===================================================================
--- /issm/trunk/src/m/model/plot/plotmodel.m	(revision 6859)
+++ /issm/trunk/src/m/model/plot/plotmodel.m	(revision 6860)
@@ -1,9 +1,4 @@
 function plotmodel(md,varargin)
 %At command prompt, type plotdoc for help on documentation.
-
-global ISSM_TIER
-if isempty(ISSM_TIER),
-	error('ISSM_TIER variable got erased! This variable is needed to run Ice code correctly. Please rerun your startup file.');
-end
 
 %First process options
Index: /issm/trunk/src/m/model/plot/showregion.m
===================================================================
--- /issm/trunk/src/m/model/plot/showregion.m	(revision 6859)
+++ /issm/trunk/src/m/model/plot/showregion.m	(revision 6860)
@@ -1,4 +1,7 @@
 function showregion(md,insetpos)
-global ISSM_DIR
+%SHOWREGION - show region on plot
+%
+%   Usage:
+%      showregion(md,insetpos);
 
 %get inset relative position (x,y,width,height)
@@ -13,7 +16,7 @@
 %box off
 if strcmpi(md.hemisphere,'n') | strcmpi(md.hemisphere,'north'),
-	A=expread([ ISSM_DIR 'projects/Exp/Greenland.exp']);
+	A=expread([issmdir() 'projects/Exp/Greenland.exp']);
 elseif strcmpi(md.hemisphere,'s') | strcmpi(md.hemisphere,'south'),
-	A=expread([ ISSM_DIR '/projects/Exp/Antarctica.exp']);
+	A=expread([issmdir() '/projects/Exp/Antarctica.exp']);
 else
 	error('applyoptions error message: hemisphere not defined');
Index: /issm/trunk/src/m/model/radarpower.m
===================================================================
--- /issm/trunk/src/m/model/radarpower.m	(revision 6859)
+++ /issm/trunk/src/m/model/radarpower.m	(revision 6860)
@@ -9,10 +9,4 @@
 %      md=radarpower(md,options);
 %      md=radarpower(md)
-
-global ISSM_TIER
-global MODELDATA
-
-%if MODELDATA has not been initialized (ie: empty), use default path.
-if isempty(MODELDATA), MODELDATA='/u/astrid-r1b/larour/ModelData'; end
 
 %Parse inputs
@@ -32,9 +26,9 @@
 if ~exist(options,'overlay_image'),
 	if strcmpi(md.hemisphere,'n'),
-		if ~exist([MODELDATA '/MOG/mog150_greenland_map.jpg']),
-			error(['radarpower error message: file ' MODELDATA '/MOG/mog150_greenland_map.jpg not found. Check MODELDATA variable..']);
+		if ~exist([issmdir() '/projects/ModelData/MOG/mog150_greenland_map.jpg']),
+			error(['radarpower error message: file ' issmdir() '/projects/ModelData/MOG/mog150_greenland_map.jpg not found.']);
 		end
-		jpgim=[MODELDATA '/MOG/mog150_greenland_map.jpg'];
-		geom=load([MODELDATA '/MOG/mog150_greenland_map.jpgw'],'ascii');
+		jpgim=[issmdir() '/projects/ModelData/MOG/mog150_greenland_map.jpg'];
+		geom=load([issmdir() '/projects/ModelData/MOG/mog150_greenland_map.jpgw'],'ascii');
 		sizex=floor((x1-x0)/geom(1)); % x posting
 		sizey=floor((y1-y0)/geom(4)); % y posting
@@ -52,13 +46,13 @@
 	elseif strcmpi(md.hemisphere,'s'),
 		if highres,
-			if ~exist([MODELDATA '/MosaicTiffRsat/amm125m_v2_200m.tif']),
-				error(['radarpower error message: file ' MODELDATA '/MosaicTiffRsat/amm125m_v2_200m.tif not found. Check MODELDATA variable..']);
+			if ~exist([issmdir() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif']),
+				error(['radarpower error message: file ' issmdir() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif not found.']);
 			end
-			geotiff_name=[MODELDATA '/MosaicTiffRsat/amm125m_v2_200m.tif'];
+			geotiff_name=[issmdir() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif'];
 		else
-			if ~exist([MODELDATA '/MosaicTiffRsat/amm125m_v2_1km.tif']),
-				error(['radarpower error message: file ' MODELDATA '/MosaicTiffRsat/amm125m_v2_1km.tif not found. Check MODELDATA variable..']);
+			if ~exist([issmdir() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif']),
+				error(['radarpower error message: file ' issmdir() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif not found.']);
 			end
-			geotiff_name=[MODELDATA '/MosaicTiffRsat/amm125m_v2_1km.tif'];
+			geotiff_name=[issmdir() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif'];
 		end
 
Index: /issm/trunk/src/m/model/solve.m
===================================================================
--- /issm/trunk/src/m/model/solve.m	(revision 6859)
+++ /issm/trunk/src/m/model/solve.m	(revision 6860)
@@ -13,7 +13,4 @@
 %      md=solve(md,'analysis_type',ThermalSolutionEnum,'sub_analysis_type',SteadyAnalysisEnum);
 %      md=solve(md,'analysis_type','ThermalAnalysis');
-
-%some checks on list of arguments
-global ISSM_TIER
 
 %recover options
Index: /issm/trunk/src/m/model/solvers/mumpsoptions.m
===================================================================
--- /issm/trunk/src/m/model/solvers/mumpsoptions.m	(revision 6859)
+++ /issm/trunk/src/m/model/solvers/mumpsoptions.m	(revision 6860)
@@ -5,10 +5,9 @@
 %      options=mumpsoptions;
 
-global PETSC_VERSION
-
 %retrieve options provided in varargin
 arguments=pairoptions(varargin{:});
 
 %default mumps options
+PETSC_VERSION=petscversion();
 if PETSC_VERSION==2,
 	options={{'mat_type','aijmumps'},{'ksp_type','preonly'},{'pc_type','lu'},{'mat_mumps_icntl_14',120},{'pc_factor_shift_positive_definite','true'}};
Index: /issm/trunk/src/m/qmu/postqmu.m
===================================================================
--- /issm/trunk/src/m/qmu/postqmu.m	(revision 6859)
+++ /issm/trunk/src/m/qmu/postqmu.m	(revision 6860)
@@ -1,8 +1,5 @@
 function md=postqmu(md)
-
 %INPUT function md=postqmu(md,qmufile,qmudir)
 %Deal with dakota output results in files.
-
-global ISSM_TIER;
 
 %  check to see if dakota returned errors in the err file
Index: /issm/trunk/src/m/qmu/preqmu.m
===================================================================
--- /issm/trunk/src/m/qmu/preqmu.m	(revision 6859)
+++ /issm/trunk/src/m/qmu/preqmu.m	(revision 6860)
@@ -18,6 +18,4 @@
 %       rundakota: (John?)
 %       runmpi: (John?)
-
-global ISSM_TIER;
 
 disp('preprocessing dakota inputs');
Index: /issm/trunk/src/m/utils/DataProcessing/TracksToMatrix.m
===================================================================
--- /issm/trunk/src/m/utils/DataProcessing/TracksToMatrix.m	(revision 6859)
+++ /issm/trunk/src/m/utils/DataProcessing/TracksToMatrix.m	(revision 6860)
@@ -20,6 +20,4 @@
 %   See also: CREATEDATABOUNDARIES, CREATEDATAMATRIX
 
-global ISSM_TIER
-
 %some checks
 if nargin~=8 & nargin~=11,
@@ -28,5 +26,5 @@
 
 %Add path to dace
-addpath([ISSM_TIER '/externalpackages/dace/install'])
+addpath([issmtier() '/externalpackages/dace/install'])
 
 %First create the x_m and y_m fot the matrix
@@ -84,3 +82,3 @@
 
 %remove DACE path
-rmpath([ISSM_TIER '/externalpackages/dace/install']);
+rmpath([issmtier() '/externalpackages/dace/install']);
Index: /issm/trunk/src/m/utils/Mesh/BamgCall.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/BamgCall.m	(revision 6859)
+++ /issm/trunk/src/m/utils/Mesh/BamgCall.m	(revision 6860)
@@ -14,6 +14,4 @@
 %   Example:
 %      md=BamgCall(md,md.vel_obs,1500,10^8,1.3,0.9);
-
-global ISSM_TIER
 
 %2d geometric parameter (do not change)
Index: /issm/trunk/src/m/utils/Mesh/BamgCallFromMetric.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/BamgCallFromMetric.m	(revision 6859)
+++ /issm/trunk/src/m/utils/Mesh/BamgCallFromMetric.m	(revision 6860)
@@ -10,6 +10,4 @@
 %   Example:
 %      md=BamgCall(md,metric,1500,10^8,1.3,0.9);
-
-global ISSM_TIER
 
 %2d geometric parameter (do not change)
Index: /issm/trunk/src/m/utils/Mesh/YamsCall.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/YamsCall.m	(revision 6859)
+++ /issm/trunk/src/m/utils/Mesh/YamsCall.m	(revision 6860)
@@ -14,6 +14,4 @@
 %   Example:
 %      md=YamsCall(md,md.vel_obs,1500,10^8,1.3,0.9);
-
-global ISSM_TIER
 
 %2d geometric parameter (do not change)
Index: sm/trunk/src/m/utils/OS/clearall.m
===================================================================
--- /issm/trunk/src/m/utils/OS/clearall.m	(revision 6859)
+++ 	(revision )
@@ -1,12 +1,0 @@
-%script that erases all variables except ISSM_TIER
-
-%get all localvariables
-Lvariables=evalin('base','who');
-
-%remove ISSM_TIER and ISSM_DIR from this list
-Lvariables=Lvariables(find(~strcmp(Lvariables,'ISSM_TIER')));
-Lvariables=Lvariables(find(~strcmp(Lvariables,'ISSM_DIR')));
-Lvariables=Lvariables(find(~strcmp(Lvariables,'PETSC_VERSION')));
-
-%clear all
-clear(Lvariables{:},'Lvariables')
