Changeset 6860


Ignore:
Timestamp:
12/30/10 07:40:15 (14 years ago)
Author:
Mathieu Morlighem
Message:

deleted all global variables. If ISSM_DIR is needed, call issmdir() routine. This makes everything easier: no more clearall

Location:
issm/trunk/src/m
Files:
1 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/model/modeldefault/modeldefault_process.m

    r6088 r6860  
    66
    77%retrieve some paths
    8 global ISSM_DIR
    9 modeldatapath=[ISSM_DIR '/projects/ModelData'];
     8modeldatapath=[issmdir() '/projects/ModelData'];
    109
    1110%initialize output
  • issm/trunk/src/m/model/modis.m

    r6088 r6860  
    55%      [xm,ym,modis]=modis(modisgeotif,xlim,ylim)
    66%
    7 
    8 global ISSM_TIER
    97
    108%find gdal coordinates
     
    1614
    1715%Get path  to gdal binaries
    18 path_gdal=[ISSM_TIER '/externalpackages/gdal/install/bin/'];
     16path_gdal=[issmtier() '/externalpackages/gdal/install/bin/'];
    1917
    2018%Was gdal compiled?
    2119if ~exist([path_gdal 'gdal_translate']),
    22         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.']);
     20        error(['modis error message: GDAL library needs to be compiled to use this routine. Compile GDAL in ' issmtier() '/externalpackages/gdal to use this routine.']);
    2321end
    2422
  • issm/trunk/src/m/model/multiplequeue/BuildMultipleQueueingScriptGeneric.m

    r6088 r6860  
    55%      BuildMultipleQueueingScriptGeneric(executionpath,codepath)
    66
    7 global ISSM_TIER
    8 
    9 
    107%not done yet
    118error('BuildMultipleQueueingScriptGenericerror message: not supported yet!');
  • issm/trunk/src/m/model/petscversion.m

    r6854 r6860  
    1 function version=petscversion(issm_tier)
    2 %PETSCVERSION: recover petsc version number, inside config.h file
     1function PETSC_VERSION=petscversion()
     2%PETSCVERSION - recover petsc version number, inside config.h file
     3%
     4%   Usage:
     5%       PETSC_VERSION=petscversion();
    36
    47
    5 fid=fopen([issm_tier '/config.h'],'r');
     8configfile=[issmtier() '/config.h'];
     9if ~exist(configfile,'file'),
     10        error(['File ' configfile ' not found. ISSM has not been configured yet!']);
     11end
    612
    713%go through the file, and recover the line we want
     14fid=fopen(configfile,'r');
    815while(1),
    916        tline=fgets(fid);
     
    1118        if length(tline)>=25,
    1219                if  strcmpi(tline(1:23),'#define _PETSC_VERSION_'),
    13                         version=str2num(tline(25));
     20                        PETSC_VERSION=str2num(tline(25));
    1421                end
    1522        end
  • issm/trunk/src/m/model/plot/applyoptions.m

    r6759 r6860  
    66%
    77%   See also: PLOTMODEL, PARSE_OPTIONS
    8 
    9 global ISSM_DIR
    108
    119%fontsize
     
    340338        %box off
    341339        if strcmpi(md.hemisphere,'n') | strcmpi(md.hemisphere,'north'),
    342                 A=expread([ ISSM_DIR '/projects/Exp/Greenland.exp']);
     340                A=expread([ issmdir() '/projects/Exp/Greenland.exp']);
    343341        elseif strcmpi(md.hemisphere,'s') | strcmpi(md.hemisphere,'south'),
    344                 A=expread([ ISSM_DIR '/projects/Exp/Antarctica.exp']);
     342                A=expread([ issmdir() '/projects/Exp/Antarctica.exp']);
    345343        else
    346344                error('applyoptions error message: hemisphere not defined');
  • issm/trunk/src/m/model/plot/plotmodel.m

    r6497 r6860  
    11function plotmodel(md,varargin)
    22%At command prompt, type plotdoc for help on documentation.
    3 
    4 global ISSM_TIER
    5 if isempty(ISSM_TIER),
    6         error('ISSM_TIER variable got erased! This variable is needed to run Ice code correctly. Please rerun your startup file.');
    7 end
    83
    94%First process options
  • issm/trunk/src/m/model/plot/showregion.m

    r6367 r6860  
    11function showregion(md,insetpos)
    2 global ISSM_DIR
     2%SHOWREGION - show region on plot
     3%
     4%   Usage:
     5%      showregion(md,insetpos);
    36
    47%get inset relative position (x,y,width,height)
     
    1316%box off
    1417if strcmpi(md.hemisphere,'n') | strcmpi(md.hemisphere,'north'),
    15         A=expread([ ISSM_DIR 'projects/Exp/Greenland.exp']);
     18        A=expread([issmdir() 'projects/Exp/Greenland.exp']);
    1619elseif strcmpi(md.hemisphere,'s') | strcmpi(md.hemisphere,'south'),
    17         A=expread([ ISSM_DIR '/projects/Exp/Antarctica.exp']);
     20        A=expread([issmdir() '/projects/Exp/Antarctica.exp']);
    1821else
    1922        error('applyoptions error message: hemisphere not defined');
  • issm/trunk/src/m/model/radarpower.m

    r6670 r6860  
    99%      md=radarpower(md,options);
    1010%      md=radarpower(md)
    11 
    12 global ISSM_TIER
    13 global MODELDATA
    14 
    15 %if MODELDATA has not been initialized (ie: empty), use default path.
    16 if isempty(MODELDATA), MODELDATA='/u/astrid-r1b/larour/ModelData'; end
    1711
    1812%Parse inputs
     
    3226if ~exist(options,'overlay_image'),
    3327        if strcmpi(md.hemisphere,'n'),
    34                 if ~exist([MODELDATA '/MOG/mog150_greenland_map.jpg']),
    35                         error(['radarpower error message: file ' MODELDATA '/MOG/mog150_greenland_map.jpg not found. Check MODELDATA variable..']);
     28                if ~exist([issmdir() '/projects/ModelData/MOG/mog150_greenland_map.jpg']),
     29                        error(['radarpower error message: file ' issmdir() '/projects/ModelData/MOG/mog150_greenland_map.jpg not found.']);
    3630                end
    37                 jpgim=[MODELDATA '/MOG/mog150_greenland_map.jpg'];
    38                 geom=load([MODELDATA '/MOG/mog150_greenland_map.jpgw'],'ascii');
     31                jpgim=[issmdir() '/projects/ModelData/MOG/mog150_greenland_map.jpg'];
     32                geom=load([issmdir() '/projects/ModelData/MOG/mog150_greenland_map.jpgw'],'ascii');
    3933                sizex=floor((x1-x0)/geom(1)); % x posting
    4034                sizey=floor((y1-y0)/geom(4)); % y posting
     
    5246        elseif strcmpi(md.hemisphere,'s'),
    5347                if highres,
    54                         if ~exist([MODELDATA '/MosaicTiffRsat/amm125m_v2_200m.tif']),
    55                                 error(['radarpower error message: file ' MODELDATA '/MosaicTiffRsat/amm125m_v2_200m.tif not found. Check MODELDATA variable..']);
     48                        if ~exist([issmdir() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif']),
     49                                error(['radarpower error message: file ' issmdir() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif not found.']);
    5650                        end
    57                         geotiff_name=[MODELDATA '/MosaicTiffRsat/amm125m_v2_200m.tif'];
     51                        geotiff_name=[issmdir() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif'];
    5852                else
    59                         if ~exist([MODELDATA '/MosaicTiffRsat/amm125m_v2_1km.tif']),
    60                                 error(['radarpower error message: file ' MODELDATA '/MosaicTiffRsat/amm125m_v2_1km.tif not found. Check MODELDATA variable..']);
     53                        if ~exist([issmdir() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif']),
     54                                error(['radarpower error message: file ' issmdir() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif not found.']);
    6155                        end
    62                         geotiff_name=[MODELDATA '/MosaicTiffRsat/amm125m_v2_1km.tif'];
     56                        geotiff_name=[issmdir() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif'];
    6357                end
    6458
  • issm/trunk/src/m/model/solve.m

    r6569 r6860  
    1313%      md=solve(md,'analysis_type',ThermalSolutionEnum,'sub_analysis_type',SteadyAnalysisEnum);
    1414%      md=solve(md,'analysis_type','ThermalAnalysis');
    15 
    16 %some checks on list of arguments
    17 global ISSM_TIER
    1815
    1916%recover options
  • issm/trunk/src/m/model/solvers/mumpsoptions.m

    r6858 r6860  
    55%      options=mumpsoptions;
    66
    7 global PETSC_VERSION
    8 
    97%retrieve options provided in varargin
    108arguments=pairoptions(varargin{:});
    119
    1210%default mumps options
     11PETSC_VERSION=petscversion();
    1312if PETSC_VERSION==2,
    1413        options={{'mat_type','aijmumps'},{'ksp_type','preonly'},{'pc_type','lu'},{'mat_mumps_icntl_14',120},{'pc_factor_shift_positive_definite','true'}};
  • issm/trunk/src/m/qmu/postqmu.m

    r6088 r6860  
    11function md=postqmu(md)
    2 
    32%INPUT function md=postqmu(md,qmufile,qmudir)
    43%Deal with dakota output results in files.
    5 
    6 global ISSM_TIER;
    74
    85%  check to see if dakota returned errors in the err file
  • issm/trunk/src/m/qmu/preqmu.m

    r6615 r6860  
    1818%       rundakota: (John?)
    1919%       runmpi: (John?)
    20 
    21 global ISSM_TIER;
    2220
    2321disp('preprocessing dakota inputs');
  • issm/trunk/src/m/utils/DataProcessing/TracksToMatrix.m

    r6088 r6860  
    2020%   See also: CREATEDATABOUNDARIES, CREATEDATAMATRIX
    2121
    22 global ISSM_TIER
    23 
    2422%some checks
    2523if nargin~=8 & nargin~=11,
     
    2826
    2927%Add path to dace
    30 addpath([ISSM_TIER '/externalpackages/dace/install'])
     28addpath([issmtier() '/externalpackages/dace/install'])
    3129
    3230%First create the x_m and y_m fot the matrix
     
    8482
    8583%remove DACE path
    86 rmpath([ISSM_TIER '/externalpackages/dace/install']);
     84rmpath([issmtier() '/externalpackages/dace/install']);
  • issm/trunk/src/m/utils/Mesh/BamgCall.m

    r6088 r6860  
    1414%   Example:
    1515%      md=BamgCall(md,md.vel_obs,1500,10^8,1.3,0.9);
    16 
    17 global ISSM_TIER
    1816
    1917%2d geometric parameter (do not change)
  • issm/trunk/src/m/utils/Mesh/BamgCallFromMetric.m

    r6088 r6860  
    1010%   Example:
    1111%      md=BamgCall(md,metric,1500,10^8,1.3,0.9);
    12 
    13 global ISSM_TIER
    1412
    1513%2d geometric parameter (do not change)
  • issm/trunk/src/m/utils/Mesh/YamsCall.m

    r6088 r6860  
    1414%   Example:
    1515%      md=YamsCall(md,md.vel_obs,1500,10^8,1.3,0.9);
    16 
    17 global ISSM_TIER
    1816
    1917%2d geometric parameter (do not change)
Note: See TracChangeset for help on using the changeset viewer.