[issm-svn] r12329 - issm/trunk/src/m

morlighe at issm.ess.uci.edu morlighe at issm.ess.uci.edu
Fri Jun 1 17:25:46 PDT 2012


Author: morlighe
Date: 2012-06-01 17:25:46 -0700 (Fri, 01 Jun 2012)
New Revision: 12329

Added:
   issm/trunk/src/m/classes/autodiff.py
   issm/trunk/src/m/classes/balancethickness.py
   issm/trunk/src/m/classes/basalforcings.py
   issm/trunk/src/m/classes/clusters/generic.py
   issm/trunk/src/m/classes/clusters/none.py
   issm/trunk/src/m/classes/constants.py
   issm/trunk/src/m/classes/debug.py
   issm/trunk/src/m/classes/diagnostic.py
   issm/trunk/src/m/classes/flaim.py
   issm/trunk/src/m/classes/flowequation.py
   issm/trunk/src/m/classes/friction.py
   issm/trunk/src/m/classes/geometry.py
   issm/trunk/src/m/classes/groundingline.py
   issm/trunk/src/m/classes/hydrology.py
   issm/trunk/src/m/classes/initialization.py
   issm/trunk/src/m/classes/inversion.py
   issm/trunk/src/m/classes/mask.py
   issm/trunk/src/m/classes/materials.py
   issm/trunk/src/m/classes/mesh.py
   issm/trunk/src/m/classes/miscellaneous.py
   issm/trunk/src/m/classes/model.py
   issm/trunk/src/m/classes/pairoptions.py
   issm/trunk/src/m/classes/private.py
   issm/trunk/src/m/classes/prognostic.py
   issm/trunk/src/m/classes/qmu.py
   issm/trunk/src/m/classes/radaroverlay.py
   issm/trunk/src/m/classes/rifts.py
   issm/trunk/src/m/classes/settings.py
   issm/trunk/src/m/classes/solver.py
   issm/trunk/src/m/classes/steadystate.py
   issm/trunk/src/m/classes/surfaceforcings.py
   issm/trunk/src/m/classes/thermal.py
   issm/trunk/src/m/classes/timestepping.py
   issm/trunk/src/m/classes/transient.py
   issm/trunk/src/m/classes/verbose.py
   issm/trunk/src/m/enum/MaxIterationConvergenceFlagEnum.m
   issm/trunk/src/m/enum/MaximumNumberOfEnums.m
   issm/trunk/src/m/kml/kmlnodeconnectivity.m
   issm/trunk/src/m/model/AnalysisConfiguration.m
   issm/trunk/src/m/model/MatlabProcessPatch.m
   issm/trunk/src/m/model/addnote.py
   issm/trunk/src/m/model/mesh/triangle.py
   issm/trunk/src/m/model/parameterization/parameterize.py
   issm/trunk/src/m/model/plot/subplotmodel.m
   issm/trunk/src/m/model/setmask.py
   issm/trunk/src/m/utils/BC/SetIceShelfBC.py
   issm/trunk/src/m/utils/DataProcessing/gamv.m
   issm/trunk/src/m/utils/DataProcessing/gslib.m
   issm/trunk/src/m/utils/DataProcessing/varmap.m
   issm/trunk/src/m/utils/Geometry/FlagElements.py
   issm/trunk/src/m/utils/Meca/paterson.py
   issm/trunk/src/m/utils/Shell/jplsvn.m
   issm/trunk/src/m/utils/Shell/ucisvn.m
Removed:
   issm/trunk/src/m/kml/nodeconnectivity.m
   issm/trunk/src/m/model/mesh/meshnodensity.m
   issm/trunk/src/m/model/mesh/meshrefine.m
   issm/trunk/src/m/shared/
   issm/trunk/src/m/solutions/
   issm/trunk/src/m/solvers/
   issm/trunk/src/m/utils/Analysis/
   issm/trunk/src/m/utils/ImageProcessing/gradient_perso.m
   issm/trunk/src/m/utils/ImageProcessing/transp.m
   issm/trunk/src/m/utils/Shell/issmtier.m
Modified:
   issm/trunk/src/m/Makefile.am
   issm/trunk/src/m/classes/
   issm/trunk/src/m/classes/clusters/
   issm/trunk/src/m/classes/clusters/generic.m
   issm/trunk/src/m/classes/clusters/none.m
   issm/trunk/src/m/classes/groundingline.m
   issm/trunk/src/m/classes/model/model.m
   issm/trunk/src/m/classes/modellist.m
   issm/trunk/src/m/classes/solver.m
   issm/trunk/src/m/kml/README.txt
   issm/trunk/src/m/kml/kml_part_edges.m
   issm/trunk/src/m/kml/kml_partitions.m
   issm/trunk/src/m/kml/kml_unsh_edges.m
   issm/trunk/src/m/model/collapse.m
   issm/trunk/src/m/model/marshall.m
   issm/trunk/src/m/model/mesh/
   issm/trunk/src/m/model/mesh/triangle.m
   issm/trunk/src/m/model/modis.m
   issm/trunk/src/m/model/partition/AreaAverageOntoPartition.m
   issm/trunk/src/m/model/petscversion.m
   issm/trunk/src/m/model/plot/applyoptions.m
   issm/trunk/src/m/model/plot/northarrow.m
   issm/trunk/src/m/model/plot/plot_gridded.m
   issm/trunk/src/m/model/plot/plot_overlay.m
   issm/trunk/src/m/model/plot/plotdoc.m
   issm/trunk/src/m/model/radarpower.m
   issm/trunk/src/m/utils/DataProcessing/TracksToMatrix.m
   issm/trunk/src/m/utils/Exp/exptool.m
   issm/trunk/src/m/utils/Miscellaneous/issmdoc.m
   issm/trunk/src/m/utils/OS/ismumps.m
   issm/trunk/src/m/utils/OS/ispetsc.m
   issm/trunk/src/m/utils/OS/issmscpin.m
   issm/trunk/src/m/utils/OS/issmscpout.m
   issm/trunk/src/m/utils/OS/issmssh.m
   issm/trunk/src/m/utils/Shell/flaimdir.m
   issm/trunk/src/m/utils/Shell/issmdir.m
Log:
merged trunk-jpl and trunk for revision 12326M

Modified: issm/trunk/src/m/Makefile.am
===================================================================
--- issm/trunk/src/m/Makefile.am	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/Makefile.am	2012-06-02 00:25:46 UTC (rev 12329)
@@ -12,11 +12,7 @@
 				./model/solvers/*.m \
 				./planet/*.m \
 				./qmu/*.m \
-				./shared/*.m \
-				./solutions/*.m \
-				./solvers/*.m \
 				./utils/*.m \
-				./utils/Analysis/*.m \
 				./utils/Array/*.m \
 				./utils/BC/*.m \
 				./utils/Basins/*.m \


Property changes on: issm/trunk/src/m/classes
___________________________________________________________________
Modified: svn:ignore
   - Makefile.in
Makefile

   + __pycache__
Makefile.in
Makefile



Property changes on: issm/trunk/src/m/classes/clusters
___________________________________________________________________
Modified: svn:ignore
   - Makefile.in
Makefile

   + __pycache__
Makefile.in
Makefile


Modified: issm/trunk/src/m/classes/clusters/generic.m
===================================================================
--- issm/trunk/src/m/classes/clusters/generic.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/classes/clusters/generic.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -1,7 +1,6 @@
 %GENERIC cluster class definition
 %
 %   Usage:
-%      cluster=generic('name','astrid',);
 %      cluster=generic('name','astrid','np',3);
 %      cluster=generic('name',oshostname(),'np',3,'login','username');
 
@@ -13,11 +12,11 @@
 		 np=1;
 		 port=0;
 		 interactive=1;
-		 codepath=[issmtier() '/bin'];
-		 executionpath=[issmtier() '/execution'];
-		 valgrind=[issmtier() '/externalpackages/valgrind/install/bin/valgrind'];
-		 valgrindlib=[issmtier() '/externalpackages/valgrind/install/lib/libmpidebug.so'];
-		 valgrindsup=[issmtier() '/externalpackages/valgrind/issm.supp'];
+		 codepath=[issmdir() '/bin'];
+		 executionpath=[issmdir() '/execution'];
+		 valgrind=[issmdir() '/externalpackages/valgrind/install/bin/valgrind'];
+		 valgrindlib=[issmdir() '/externalpackages/valgrind/install/lib/libmpidebug.so'];
+		 valgrindsup=[issmdir() '/externalpackages/valgrind/issm.supp'];
 		 %}}}
 	 end
 	 methods
@@ -27,8 +26,7 @@
 			 options=pairoptions(varargin{:});
 
 			 %get name
-			 if ~exist(options,'name'), error('option ''name'' has not been provided'); end
-			 cluster.name=getfieldvalue(options,'name');
+			 cluster.name=getfieldvalue(options,'name',oshostname());
 
 			 %initialize cluster using user settings if provided
 			 if (exist([cluster.name '_settings'])==2), eval([cluster.name '_settings']); end

Modified: issm/trunk/src/m/classes/clusters/none.m
===================================================================
--- issm/trunk/src/m/classes/clusters/none.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/classes/clusters/none.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -11,21 +11,8 @@
     end
     methods
 		 function cluster=none(varargin) % {{{1
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+			 error('Cannot assign md.cluster to ''none'': ISSM is not available in serial model anymore');
 		 end
 		 %}}}
-		 function disp(cluster) % {{{1
-			 %  display the object
-			 disp(sprintf('cluster class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			 disp(sprintf('    name: %s',cluster.name));
-		 end
-		 %}}}
-		 function checkconsistency(cluster,md,solution,analyses) % {{{1
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,md) % {{{1
-			 error('none.BuildQueueScript error message: serial cluster cannot build queue script');
-		 end
-		 %}}}
 	end
 end

Modified: issm/trunk/src/m/classes/groundingline.m
===================================================================
--- issm/trunk/src/m/classes/groundingline.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/classes/groundingline.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -36,7 +36,7 @@
 					checkmessage(['requesting grounding line migration, but bathymetry is absent!']);
 				end
 				pos=find(md.mask.vertexongroundedice); 
-				if any(md.geometry.bed(pos)-md.geometry.bathymetry(pos)),
+				if any(abs(md.geometry.bed(pos)-md.geometry.bathymetry(pos))>10^-10),
 					checkmessage(['bathymetry not equal to bed on grounded ice !']);
 				end
 				pos=find(md.mask.vertexonfloatingice); 

Modified: issm/trunk/src/m/classes/model/model.m
===================================================================
--- issm/trunk/src/m/classes/model/model.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/classes/model/model.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -378,7 +378,7 @@
 			 else
 				 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum,iluasmoptions);
 			 end
-			 md.cluster          = none();
+			 md.cluster          = generic();
 			 md.balancethickness = balancethickness();
 			 md.diagnostic       = diagnostic();
 			 md.hydrology        = hydrology();

Modified: issm/trunk/src/m/classes/modellist.m
===================================================================
--- issm/trunk/src/m/classes/modellist.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/classes/modellist.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -6,7 +6,7 @@
 classdef modellist
 	properties (SetAccess=public) 
 		models  = cell(0,1);
-		cluster = none();
+		cluster = generic();
 	end
 	methods
 		function obj = modellist(varargin) % {{{

Modified: issm/trunk/src/m/classes/solver.m
===================================================================
--- issm/trunk/src/m/classes/solver.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/classes/solver.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -17,7 +17,10 @@
 					 error('constructor not supported');
 				 end
 			 end % }}}
-		 function obj = addoptions(obj,analysis,solveroptions) % {{{1
+		 function obj = addoptions(obj,analysis,varargin) % {{{1
+		 % Usage example:
+		 %    md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum,stokesoptions());
+		 %    md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum);
 
 			 %Convert analysis from enum to string
 			 analysis=EnumToString(analysis);
@@ -28,7 +31,7 @@
 			 end
 
 			 %Add solver options to analysis
-			 obj.(analysis) = solveroptions;
+			 if nargin==3, obj.(analysis) = varargin{1}; end
 		 end
 		 %}}}
 		 function obj = setdefaultparameters(obj) % {{{

Modified: issm/trunk/src/m/kml/README.txt
===================================================================
--- issm/trunk/src/m/kml/README.txt	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/kml/README.txt	2012-06-02 00:25:46 UTC (rev 12329)
@@ -60,7 +60,7 @@
 
 There are some other utilities that are used in the construction of topological tables for the kml writing.
 
-nodeconnectivity.m   - create a node connectivity table (nnodes x mxepg+1)
+kmlnodeconnectivity.m   - create a node connectivity table (nnodes x mxepg+1)
 edgeadjacency.m      - create an edge adjacency array (elems x edges)
 edgeperimeter.m      - create an edge perimeter (edgeper x 2) and element perimeter (edgeper x 1) list
 

Modified: issm/trunk/src/m/kml/kml_part_edges.m
===================================================================
--- issm/trunk/src/m/kml/kml_part_edges.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/kml/kml_part_edges.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -149,7 +149,7 @@
         irow=unique(irow);
         elemp=md.mesh.elements(irow,:);
         epartp=epart(irow,:);
-        nodeconp=nodeconnectivity(elemp,md.mesh.numberofvertices);
+        nodeconp=kmlnodeconnectivity(elemp,md.mesh.numberofvertices);
         [edgeadjp]=edgeadjacency(elemp,nodeconp);
         [edgeper,elemper,iloop]=edgeperimeter(elemp,nodeconp,edgeadjp);
         iloop(end+1)=size(edgeper,1)+1;

Modified: issm/trunk/src/m/kml/kml_partitions.m
===================================================================
--- issm/trunk/src/m/kml/kml_partitions.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/kml/kml_partitions.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -150,7 +150,7 @@
         irow=unique(irow);
         elemp=md.mesh.elements(irow,:);
         epartp=epart(irow,:);
-        nodeconp=nodeconnectivity(elemp,md.mesh.numberofvertices);
+        nodeconp=kmlnodeconnectivity(elemp,md.mesh.numberofvertices);
         [edgeadjp]=edgeadjacency(elemp,nodeconp);
         [edgeper,elemper,iloop]=edgeperimeter(elemp,nodeconp,edgeadjp);
         iloop(end+1)=size(edgeper,1)+1;

Modified: issm/trunk/src/m/kml/kml_unsh_edges.m
===================================================================
--- issm/trunk/src/m/kml/kml_unsh_edges.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/kml/kml_unsh_edges.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -73,7 +73,7 @@
 
 if (~exist('prtplt','var') || strncmpi(prtplt,'on' ,2) || strncmpi(prtplt,'y',1)) && ...
     md.qmu.numberofpartitions
-    [edgeadj]=edgeadjacency(md.mesh.elements,md.nodeconnectivity);
+    [edgeadj]=edgeadjacency(md.mesh.elements,md.kmlnodeconnectivity);
     [icol,irow]=find(edgeadj'==0);
     edgeuns=zeros(length(irow),2);
     for i=1:length(irow)

Modified: issm/trunk/src/m/model/collapse.m
===================================================================
--- issm/trunk/src/m/model/collapse.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/model/collapse.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -29,8 +29,8 @@
 if ~isnan(md.inversion.vy_obs), md.inversion.vy_obs=project2d(md,md.inversion.vy_obs,md.mesh.numberoflayers); end;
 if ~isnan(md.inversion.vel_obs), md.inversion.vel_obs=project2d(md,md.inversion.vel_obs,md.mesh.numberoflayers); end;
 if ~isnan(md.inversion.cost_functions_coefficients), md.inversion.cost_functions_coefficients=project2d(md,md.inversion.cost_functions_coefficients,md.mesh.numberoflayers); end;
-if ~isnan(md.inversion.min_parameters), md.inversion.min_parameters=project2d(md,md.inversion.min_parameters,md.mesh.numberoflayers); end;
-if ~isnan(md.inversion.max_parameters), md.inversion.max_parameters=project2d(md,md.inversion.max_parameters,md.mesh.numberoflayers); end;
+if numel(md.inversion.min_parameters)>1, md.inversion.min_parameters=project2d(md,md.inversion.min_parameters,md.mesh.numberoflayers); end;
+if numel(md.inversion.max_parameters)>1, md.inversion.max_parameters=project2d(md,md.inversion.max_parameters,md.mesh.numberoflayers); end;
 if ~isnan(md.surfaceforcings.mass_balance),
 	md.surfaceforcings.mass_balance=project2d(md,md.surfaceforcings.mass_balance,md.mesh.numberoflayers); 
 end;
@@ -100,8 +100,8 @@
 md.mask.vertexonwater=project2d(md,md.mask.vertexonwater,1);
 
 %lat long
-md.mesh.lat=project2d(md,md.mesh.lat,1);
-md.mesh.long=project2d(md,md.mesh.long,1);
+if numel(md.mesh.lat) ==md.mesh.numberofvertices,  md.mesh.lat=project2d(md,md.mesh.lat,1); end
+if numel(md.mesh.long)==md.mesh.numberofvertices, md.mesh.long=project2d(md,md.mesh.long,1); end
 
 %Initialize with the 2d mesh
 md.mesh.x=md.mesh.x2d;

Modified: issm/trunk/src/m/model/marshall.m
===================================================================
--- issm/trunk/src/m/model/marshall.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/model/marshall.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -15,6 +15,9 @@
 	error(['marshall error message: could not open ' [md.miscellaneous.name '.bin'],' file for binary writing']);
 end
 
+%First, write MaximumNumberOfEnum to make sure that the Enums are synchronized
+WriteData(fid,'enum',MaximumNumberOfEnums(),'data',true,'format','Boolean');
+
 %Go through all model fields: check that it is a class and call checkconsistency
 fields=properties('model');
 for i=1:length(fields),


Property changes on: issm/trunk/src/m/model/mesh
___________________________________________________________________
Modified: svn:ignore
   - Makefile.in
Makefile

   + __pycache__
Makefile.in
Makefile


Modified: issm/trunk/src/m/model/mesh/triangle.m
===================================================================
--- issm/trunk/src/m/model/mesh/triangle.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/model/mesh/triangle.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -37,36 +37,33 @@
 area=resolution^2;
 
 %Mesh using TriMesh
-if strcmp(riftname,''),
-	[md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.segments,md.mesh.segmentmarkers]=TriMesh(domainname,area,true);
-else
-	[elements,x,y,segments,segmentmarkers]=TriMeshRifts(domainname,riftname,area,'yes');
+[elements,x,y,segments,segmentmarkers]=TriMesh(domainname,riftname,area);
 
-	%check that all the created nodes belong to at least one element
-	orphan=find(~ismember([1:length(x)],sort(unique(elements(:)))));
-	for i=1:length(orphan),
-		%get rid of the orphan node i
-		%update x and y
-		x=[x(1:orphan(i)-(i-1)-1); x(orphan(i)-(i-1)+1:end)];
-		y=[y(1:orphan(i)-(i-1)-1); y(orphan(i)-(i-1)+1:end)];
-		%update elements
-		pos=find(elements>orphan(i)-(i-1));
-		elements(pos)=elements(pos)-1;
-		%update segments
-		pos1=find(segments(:,1)>orphan(i)-(i-1));
-		pos2=find(segments(:,2)>orphan(i)-(i-1));
-		segments(pos1,1)=segments(pos1,1)-1;
-		segments(pos2,2)=segments(pos2,2)-1;
-	end
-
-	%plug into md
-	md.mesh.x=x;
-	md.mesh.y=y;
-	md.mesh.elements=elements;
-	md.mesh.segments=segments;
-	md.mesh.segmentmarkers=segmentmarkers;
+%check that all the created nodes belong to at least one element
+orphan=find(~ismember([1:length(x)],sort(unique(elements(:)))));
+for i=1:length(orphan),
+	disp('WARNING: removing orphans');
+	%get rid of the orphan node i
+	%update x and y
+	x=[x(1:orphan(i)-(i-1)-1); x(orphan(i)-(i-1)+1:end)];
+	y=[y(1:orphan(i)-(i-1)-1); y(orphan(i)-(i-1)+1:end)];
+	%update elements
+	pos=find(elements>orphan(i)-(i-1));
+	elements(pos)=elements(pos)-1;
+	%update segments
+	pos1=find(segments(:,1)>orphan(i)-(i-1));
+	pos2=find(segments(:,2)>orphan(i)-(i-1));
+	segments(pos1,1)=segments(pos1,1)-1;
+	segments(pos2,2)=segments(pos2,2)-1;
 end
 
+%plug into md
+md.mesh.x=x;
+md.mesh.y=y;
+md.mesh.elements=elements;
+md.mesh.segments=segments;
+md.mesh.segmentmarkers=segmentmarkers;
+
 %Fill in rest of fields:
 md.mesh.numberofelements=length(md.mesh.elements);
 md.mesh.numberofvertices=length(md.mesh.x);

Modified: issm/trunk/src/m/model/modis.m
===================================================================
--- issm/trunk/src/m/model/modis.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/model/modis.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -13,11 +13,11 @@
 y1=max(ylim);
 
 %Get path  to gdal binaries
-path_gdal=[issmtier() '/externalpackages/gdal/install/bin/'];
+path_gdal=[issmdir() '/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 ' issmtier() '/externalpackages/gdal to use this routine.']);
+	error(['modis error message: GDAL library needs to be compiled to use this routine. Compile GDAL in ' issmdir() '/externalpackages/gdal to use this routine.']);
 end
 
 inputname='./temp.tif';

Modified: issm/trunk/src/m/model/partition/AreaAverageOntoPartition.m
===================================================================
--- issm/trunk/src/m/model/partition/AreaAverageOntoPartition.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/model/partition/AreaAverageOntoPartition.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -28,7 +28,7 @@
 
 	%finally, project vector: 
 	vector=project2d(md3d,vector,layer);
-	md.qmu.partition=project2d(md3d,md3d.part,layer);
+	md.qmu.partition=project2d(md3d,md3d.qmu.partition,layer);
 end
 
 %ok, first check that part is Matlab indexed

Modified: issm/trunk/src/m/model/petscversion.m
===================================================================
--- issm/trunk/src/m/model/petscversion.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/model/petscversion.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -7,7 +7,7 @@
 %default
 PETSC_VERSION=3;
 
-configfile=[issmtier() '/config.h'];
+configfile=[issmdir() '/config.h'];
 if ~exist(configfile,'file'),
 	error(['File ' configfile ' not found. ISSM has not been configured yet!']);
 end

Modified: issm/trunk/src/m/model/plot/applyoptions.m
===================================================================
--- issm/trunk/src/m/model/plot/applyoptions.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/model/plot/applyoptions.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -218,6 +218,9 @@
 		end
 		warning on MATLAB:log:logOfZero;
 		set(c,'YTickLabel',labels);
+	end 
+ 	if exist(options,'cbYLim'); 
+		set(c,'YLim',getfieldvalue(options,'cbYLim'));
 	end
 	if exist(options,'colorbartitle'),
 		set(get(c,'title'),'FontSize',getfieldvalue(options,'colorbarfontsize',fontsize),'String',getfieldvalue(options,'colorbartitle'),...
@@ -288,7 +291,7 @@
 		textcolori=textcolor{i};
 		textpositioni=textposition{i};
 		textrotationi=textrotation{i};
-		h=text(textpositioni(1),textpositioni(2),textstringi,'FontSize',textsizei,'FontWeight',textweighti,'Color',textcolori,'Rotation',textrotationi);
+		h=text(textpositioni(1),textpositioni(2),10,textstringi,'FontSize',textsizei,'FontWeight',textweighti,'Color',textcolori,'Rotation',textrotationi);
 		set(h,'Clipping','on'); %prevent text from appearing outside of the box
 	end
 end
@@ -345,6 +348,7 @@
 end
 if exist(options,'axispos'),
 	Axis=getfieldvalue(options,'axispos');
+	hold on
 	set(gca,'pos',Axis);
 end
 
@@ -410,26 +414,28 @@
 	axis equal off
 	%box off
 	if strcmpi(md.mesh.hemisphere,'n') | strcmpi(md.mesh.hemisphere,'north'),
-		A=expread([ issmdir() '/projects/Exp/GreenlandBoxFront.exp']);
+		A=expread([ jplsvn() '/projects/Exp/GreenlandBoxFront.exp']);
 		[A.x A.y]=ll2xy(A.x,A.y,+1,45,70);
+		A.x = A.x(1:30:end);
+		A.y = A.y(1:30:end);
 	elseif strcmpi(md.mesh.hemisphere,'s') | strcmpi(md.mesh.hemisphere,'south'),
-		A=expread([ issmdir() '/projects/Exp/Antarctica.exp']);
+		A=expread([ jplsvn() '/projects/Exp/Antarctica.exp']);
 	else
 		error('applyoptions error message: hemisphere not defined');
 	end
-	Ax=[min(A.x) max(A.x)];
-	Ay=[min(A.y) max(A.y)];
+	offset=3*10^4;
+	Ax=[min(A.x)-offset max(A.x)+offset];
+	Ay=[min(A.y)-offset max(A.y)+offset];
 	%if we are zooming on a basin, don't take the mesh for the boundaries!
 	if exist(options,'basin'),
 		[mdx mdy]=basinzoom(options);
 	else
-		offset=3*10^4;
 		mdx=[min(md.mesh.x)-offset max(md.mesh.x)+offset];
 		mdy=[min(md.mesh.y)-offset max(md.mesh.y)+offset];
 	end
 	line(A.x,A.y,ones(size(A.x)),'color','b');
 	patch([Ax(1)  Ax(2)  Ax(2)  Ax(1) Ax(1)],[Ay(1)  Ay(1)  Ay(2)  Ay(2) Ay(1)],[1 1 1],'EdgeColor',[0 0 0],'LineWidth',1,'FaceLighting','none')
-	patch( [mdx(1) mdx(2) mdx(2) mdx(1)],[mdy(1) mdy(1) mdy(2) mdy(2)],ones(4,1),'EdgeColor',[0 0 0],'FaceColor','r','FaceAlpha',0.5)
+	patch([mdx(1) mdx(2) mdx(2) mdx(1)],[mdy(1) mdy(1) mdy(2) mdy(2)],ones(4,1),'EdgeColor',[0 0 0],'FaceColor','r','FaceAlpha',0.5)
 	colorbar('off');
 	%back to main gca
 	set(gcf,'CurrentAxes',maingca)
@@ -437,15 +443,22 @@
 
 %flag edges of a partition
 if exist(options,'partitionedges')
-[xsegments ysegments]=flagedges(md.mesh.elements,md.mesh.x,md.mesh.y,md.qmu.partition);
-xsegments=xsegments*getfieldvalue(options,'unit',1);
-ysegments=ysegments*getfieldvalue(options,'unit',1);
-color=getfieldvalue(options,'partitionedgescolor','r-');
-linewidth=getfieldvalue(options,'linewidth',1);
-hold on;
-for i=1:length(xsegments),
-	plot(xsegments(i,:),ysegments(i,:),color,'LineWidth',linewidth);
+	[xsegments ysegments]=flagedges(md.mesh.elements,md.mesh.x,md.mesh.y,md.qmu.partition);
+	xsegments=xsegments*getfieldvalue(options,'unit',1);
+	ysegments=ysegments*getfieldvalue(options,'unit',1);
+	color=getfieldvalue(options,'partitionedgescolor','r-');
+	linewidth=getfieldvalue(options,'linewidth',1);
+	hold on;
+	for i=1:length(xsegments),
+		plot(xsegments(i,:),ysegments(i,:),color,'LineWidth',linewidth);
+	end
 end
+
+%Scatter
+if exist(options,'scatter')
+	data=getfieldvalue(options,'scatter');
+	hold on
+	plot_scatter(data(:,1),data(:,2),getfieldvalue(options,'scattersize',3),data(:,3),options);
 end
 
 %backgroundcolor

Modified: issm/trunk/src/m/model/plot/northarrow.m
===================================================================
--- issm/trunk/src/m/model/plot/northarrow.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/model/plot/northarrow.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -15,7 +15,7 @@
 elseif length(structure)==5
 	structure(6)=16; %default fontsize
 elseif length(structure)>6
-	error('plotmodel error message: to many input arguments for northarrow: [x0 y0 length [ratio [width]]]');
+	error('plotmodel error message: to many input arguments for northarrow: [x0 y0 length [ratio width fontsize]]');
 end
 
 %retrieve north arrow parameters
@@ -71,6 +71,6 @@
 p2=patch([E(1) F(1) G(1) H(1)],[E(2) F(2) G(2) H(2)],'Black');
 
 %Text North
-xN=max([A(1) D(1) E(1) F(1) G(1)])+ratio/3*lengtharrow;
+xN=max([A(1) D(1) E(1) F(1) G(1)])+ratio/3*abs(lengtharrow);
 yN=mean([A(2) F(2) H(2)]);
 text(xN,yN,'North','FontSize',fontsize,'FontWeight','b');

Modified: issm/trunk/src/m/model/plot/plot_gridded.m
===================================================================
--- issm/trunk/src/m/model/plot/plot_gridded.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/model/plot/plot_gridded.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -39,6 +39,7 @@
 	data_min=min(data_grid(:));
 	data_max=max(data_grid(:));
 end
+options=changefieldvalue(options,'cbYLim',[data_min data_max]);
 if whitepos==1,
 	white  =data_max + (data_max-data_min)/55;
 	options=changefieldvalue(options,'caxis',[data_min white]);

Modified: issm/trunk/src/m/model/plot/plot_overlay.m
===================================================================
--- issm/trunk/src/m/model/plot/plot_overlay.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/model/plot/plot_overlay.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -95,7 +95,7 @@
 	%h_data=0.7*ones(size(data_grid));
 	%h_data(find(data_grid>data_mean))=1;
 	h_data=1*ones(size(data_grid));
-	h_data(find(data_grid>data_mean))=0.7;
+	h_data(find(data_grid<data_mean))=0.7;
 	%saturation (S)
 	s_data=max(min(abs(data_grid-data_mean)/(data_max-data_mean) ,1),0);
 else
@@ -119,7 +119,7 @@
 image_rgb=hsv2rgb(image_hsv);
 
 %Select plot area 
-subplot(plotlines,plotcols,i);
+subplotmodel(plotlines,plotcols,i,options);
 
 %Plot: 
 imagesc(md.radaroverlay.x*getfieldvalue(options,'unit',1),md.radaroverlay.y*getfieldvalue(options,'unit',1),image_rgb);set(gca,'YDir','normal');
@@ -139,3 +139,4 @@
 end
 options=addfielddefault(options,'axis','equal off');           %default axis
 applyoptions(md,data,options);
+drawnow

Modified: issm/trunk/src/m/model/plot/plotdoc.m
===================================================================
--- issm/trunk/src/m/model/plot/plotdoc.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/model/plot/plotdoc.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -129,7 +129,7 @@
 disp('       ''latlonnumbering'': ''on'' or {latgap longap colornumber latangle lonangle} where latgap and longap are pixel gaps for the numbers,'); 
 disp('       ''latlonclick'': ''on'' to click on latlon ticks positions');
 disp('                   colornumber is a [r g b] array and latangle and lonangle are angles to flip the numbers');
-disp('       ''northarrow'': add an arrow pointing north, ''on'' for default value or [x0 y0 length [ratio [width]]] where (x0,y0) are the coordinates of the base, and ratio=headlength/length');
+disp('       ''northarrow'': add an arrow pointing north, ''on'' for default value or [x0 y0 length [ratio width fontsize]] where (x0,y0) are the coordinates of the base, ratio=headlength/length');
 disp('       ''offset'': mesh offset used by ''rifts'', default is 500');
 disp('       ''scaleruler'': add a scale ruler, ''on'' for default value or [x0 y0 length width numberofticks] where (x0,y0) are the coordinates of the lower left corner');
 disp('       ''showregion'': show domain in Antarctica on an inset, use ''insetpos'' properties');

Modified: issm/trunk/src/m/model/radarpower.m
===================================================================
--- issm/trunk/src/m/model/radarpower.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/model/radarpower.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -33,11 +33,11 @@
 %figure out if we should go look for Greenland or Antarctica geotiff, or if user provided one.
 if ~exist(options,'overlay_image'),
 	if strcmpi(md.mesh.hemisphere,'n'),
-		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.']);
+		if ~exist([jplsvn() '/projects/ModelData/MOG/mog150_greenland_map.jpg']),
+			error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MOG/mog150_greenland_map.jpg not found.']);
 		end
-		jpgim=[issmdir() '/projects/ModelData/MOG/mog150_greenland_map.jpg'];
-		geom=load([issmdir() '/projects/ModelData/MOG/mog150_greenland_map.jpgw'],'ascii');
+		jpgim=[jplsvn() '/projects/ModelData/MOG/mog150_greenland_map.jpg'];
+		geom=load([jplsvn() '/projects/ModelData/MOG/mog150_greenland_map.jpgw'],'ascii');
 
 		%geom:   xposting nbcols nbrows yposting xmin ymax
 		xmin=max(geom(5),x0);
@@ -61,15 +61,15 @@
 
 	elseif strcmpi(md.mesh.hemisphere,'s'),
 		if highres,
-			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.']);
+			if ~exist([jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif']),
+				error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif not found.']);
 			end
-			geotiff_name=[issmdir() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif'];
+			geotiff_name=[jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif'];
 		else
-			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.']);
+			if ~exist([jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif']),
+				error(['radarpower error message: file ' jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif not found.']);
 			end
-			geotiff_name=[issmdir() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif'];
+			geotiff_name=[jplsvn() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif'];
 		end
 
 		%Name of image

Modified: issm/trunk/src/m/utils/DataProcessing/TracksToMatrix.m
===================================================================
--- issm/trunk/src/m/utils/DataProcessing/TracksToMatrix.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/utils/DataProcessing/TracksToMatrix.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -25,7 +25,7 @@
 end
 
 %Add path to dace
-addpath([issmtier() '/externalpackages/dace/install'])
+addpath([issmdir() '/externalpackages/dace/install'])
 
 %First create the x_m and y_m fot the matrix
 x_f=[xmin:posting:xmin+posting*nx]';
@@ -81,4 +81,4 @@
 MatData=reshape(VecData,ny,nx);
 
 %remove DACE path
-rmpath([issmtier() '/externalpackages/dace/install']);
+rmpath([issmdir() '/externalpackages/dace/install']);

Modified: issm/trunk/src/m/utils/Exp/exptool.m
===================================================================
--- issm/trunk/src/m/utils/Exp/exptool.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/utils/Exp/exptool.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -70,7 +70,7 @@
 			error(['exptool error message:, ' filename ' does not exist. Exiting...']);
 		else
 			%read file
-			B=expread(filename,1);
+			B=expread(filename);
 			%go through all profiles of B
 			for i=1:size(B,2)
 				%plug profile in A

Modified: issm/trunk/src/m/utils/Miscellaneous/issmdoc.m
===================================================================
--- issm/trunk/src/m/utils/Miscellaneous/issmdoc.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/utils/Miscellaneous/issmdoc.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -1,11 +1,11 @@
 %Quick documentation for ISSM
 
 %First get ISSM tier: 
-ISSM_TIER=issmtier;
+ISSM_DIR=issmdir;
 
 disp(sprintf('\n%s','  A comprehensive documentation is available on http://issm.jpl.nasa.gov'));
 disp(sprintf('\n%s','  Example: how to create a square ice shelf'));
-disp(sprintf('%s','	   go to ',ISSM_TIER,'/examples/SquareIceshelf'));
+disp(sprintf('%s','	   go to ',ISSM_DIR,'/examples/SquareIceshelf'));
 disp(sprintf('%s','	   md=model;                                %creates a new empty model structure'));
 disp(sprintf('%s','	   md=triangle(md,''DomainOutline.exp'',50000);   %creates a mesh of the domain outline with a resolution of 50000m'));
 disp(sprintf('%s','	   md=geography(md,''all'','''');               %defines the glacier system as an ice shelf (no island)'));

Modified: issm/trunk/src/m/utils/OS/ismumps.m
===================================================================
--- issm/trunk/src/m/utils/OS/ismumps.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/utils/OS/ismumps.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -5,7 +5,7 @@
 %       flag=ismumps();
 
 
-configfile=[issmtier() '/bin/config.h']; %should find it in the install target
+configfile=[issmdir() '/bin/config.h']; %should find it in the install target
 if ~exist(configfile,'file'),
 	error(['File ' configfile ' not found. ISSM has not been configured yet!']);
 end

Modified: issm/trunk/src/m/utils/OS/ispetsc.m
===================================================================
--- issm/trunk/src/m/utils/OS/ispetsc.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/utils/OS/ispetsc.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -5,7 +5,7 @@
 %       flag=ispetsc();
 
 
-configfile=[issmtier() '/bin/config.h']; %should find it in the install target
+configfile=[issmdir() '/bin/config.h']; %should find it in the install target
 if ~exist(configfile,'file'),
 	error(['File ' configfile ' not found. ISSM has not been configured yet!']);
 end

Modified: issm/trunk/src/m/utils/OS/issmscpin.m
===================================================================
--- issm/trunk/src/m/utils/OS/issmscpin.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/utils/OS/issmscpin.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -31,18 +31,18 @@
 	if ispc,
 		%use the putty project pscp.exe: it should be in the path.
 		
-		%get ISSM_TIER variable
-		[status,ISSM_TIER]=system('echo [%ISSM_TIER_WIN%]');
+		%get ISSM_DIR variable
+		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
 		if status, 
-			error('scpin error message: could not find ISSM_TIER_WIN envirnoment variable');
+			error('scpin error message: could not find ISSM_DIR_WIN envirnoment variable');
 		end
-		ISSM_TIER=ISSM_TIER(2:end-2);
+		ISSM_DIR=ISSM_DIR(2:end-2);
 
 		username=input('Username: (quoted string) ');
 		key=input('Key: (quoted string) ');
 
 		for i=1:numel(packages),
-			[status,result]=system([ISSM_TIER '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' host ':' path '/' packages{i} ' ./']);
+			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' host ':' path '/' packages{i} ' ./']);
 			if status, 
 				error('scpin error message: could not call putty pscp');
 			end

Modified: issm/trunk/src/m/utils/OS/issmscpout.m
===================================================================
--- issm/trunk/src/m/utils/OS/issmscpout.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/utils/OS/issmscpout.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -22,18 +22,18 @@
 	if ispc,
 		%use the putty project pscp.exe: it should be in the path.
 		
-		%get ISSM_TIER variable
-		[status,ISSM_TIER]=system('echo [%ISSM_TIER_WIN%]');
+		%get ISSM_DIR variable
+		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
 		if status, 
-			error('scpout error message: could not find ISSM_TIER_WIN envirnoment variable');
+			error('scpout error message: could not find ISSM_DIR_WIN envirnoment variable');
 		end
-		ISSM_TIER=ISSM_TIER(2:end-2);
+		ISSM_DIR=ISSM_DIR(2:end-2);
 
 		username=input('Username: (quoted string) ');
 		key=input('Key: (quoted string) ');
 
 		for i=1:numel(packages),
-			[status,result]=system([ISSM_TIER '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' packages{i} ' ' host ':' path]);
+			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' packages{i} ' ' host ':' path]);
 			if status, 
 				error('scpout error message: could not call putty pscp');
 			end

Modified: issm/trunk/src/m/utils/OS/issmssh.m
===================================================================
--- issm/trunk/src/m/utils/OS/issmssh.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/utils/OS/issmssh.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -14,17 +14,17 @@
 	if ispc,
 		%use the putty project plink.exe: it should be in the path.
 		
-		%get ISSM_TIER variable
-		[status,ISSM_TIER]=system('echo [%ISSM_TIER_WIN%]');
+		%get ISSM_DIR variable
+		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
 		if status, 
-			error('issmssh error message: could not find ISSM_TIER_WIN envirnoment variable');
+			error('issmssh error message: could not find ISSM_DIR_WIN envirnoment variable');
 		end
-		ISSM_TIER=ISSM_TIER(2:end-2);
+		ISSM_DIR=ISSM_DIR(2:end-2);
 
 		username=input('Username: (quoted string) ');
 		key=input('Key: (quoted string) ');
 
-		system([ISSM_TIER '/externalpackages/ssh/plink.exe -ssh -l "' username '" -pw "' key '" ' host ' "' command '"']);
+		system([ISSM_DIR '/externalpackages/ssh/plink.exe -ssh -l "' username '" -pw "' key '" ' host ' "' command '"']);
 
 	else
 		%just use standard unix ssh

Modified: issm/trunk/src/m/utils/Shell/flaimdir.m
===================================================================
--- issm/trunk/src/m/utils/Shell/flaimdir.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/utils/Shell/flaimdir.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -4,4 +4,4 @@
 %   Usage:
 %      FLAIM_DIR=flaimdir()
 
-FLAIM_DIR=[issmtier '/externalpackages/flaim/install'];
+FLAIM_DIR=[issmdir '/externalpackages/flaim/install'];

Modified: issm/trunk/src/m/utils/Shell/issmdir.m
===================================================================
--- issm/trunk/src/m/utils/Shell/issmdir.m	2012-06-02 00:23:55 UTC (rev 12328)
+++ issm/trunk/src/m/utils/Shell/issmdir.m	2012-06-02 00:25:46 UTC (rev 12329)
@@ -1,5 +1,5 @@
 function ISSM_DIR=issmdir()
-%ISSMDIR - Get ISSM_DIR environment variable contents.
+%ISSMDIR - Get ISSM_DIR environment variable
 %
 %   Usage:
 %      ISSM_DIR=issmdir()
@@ -8,6 +8,9 @@
 	ISSM_DIR =getenv('ISSM_DIR');
 else
 	ISSM_DIR =getenv('ISSM_DIR_WIN');
+	if strcmpi(ISSM_DIR(end),'/') | strcmpi(ISSM_DIR(end),'\'),
+		ISSM_DIR = ISSM_DIR(1:end-1); %shave off the last '/'
+	end
 end
 
 if (isempty(ISSM_DIR)),



More information about the issm-svn mailing list