[issm-svn] r22781 - issm/trunk/src/m/coordsystems

morlighe at issm.ess.uci.edu morlighe at issm.ess.uci.edu
Tue May 15 13:55:45 PDT 2018


Author: morlighe
Date: 2018-05-15 13:55:45 -0700 (Tue, 15 May 2018)
New Revision: 22781

Modified:
   issm/trunk/src/m/coordsystems/gmtmask.m
   issm/trunk/src/m/coordsystems/gmtmaskparallel.m
Log:
CHG: gmt might not be installed in externalpackages

Modified: issm/trunk/src/m/coordsystems/gmtmask.m
===================================================================
--- issm/trunk/src/m/coordsystems/gmtmask.m	2018-05-15 20:46:12 UTC (rev 22780)
+++ issm/trunk/src/m/coordsystems/gmtmask.m	2018-05-15 20:55:45 UTC (rev 22781)
@@ -40,8 +40,20 @@
 		setenv('DYLD_LIBRARY_PATH',[ issmdir '/externalpackages/curl/install/lib:' issmdir '/externalpackages/hdf5/install/lib:' issmdir '/externalpackages/netcdf/install/lib' ]);
 	end
 
+   %Find path to gmt
+   paths = {[issmdir() '/bin/gmt'],[issmdir() '/externalpackages/gmt/install/bin/gmt'],'/Applications/GMT-5.4.3.app/Contents/Resources/bin/gmt'};
+   gmtpath = '';
+   for i=paths
+      if exist(i{1},'file'),
+         gmtpath = i{1};
+      end
+   end
+   if isempty(gmtpath),
+      error('gmt not found, make sure it is properly installed');
+   end
+   
 	%figure out which vertices are on the ocean, which one on the continent:
-	[status,result] = system(['gmt gmtselect ./' filename_all ' -h0 -Df -R0/360/-90/90  -A0 -JQ180/200 -Nk/s/s/k/s > ./' filename_oce]);
+	[status,result] = system([gmtpath ' gmtselect ./' filename_all ' -h0 -Df -R0/360/-90/90  -A0 -JQ180/200 -Nk/s/s/k/s > ./' filename_oce]);
 	if status~=0,
 		error(result);
 	end

Modified: issm/trunk/src/m/coordsystems/gmtmaskparallel.m
===================================================================
--- issm/trunk/src/m/coordsystems/gmtmaskparallel.m	2018-05-15 20:46:12 UTC (rev 22780)
+++ issm/trunk/src/m/coordsystems/gmtmaskparallel.m	2018-05-15 20:55:45 UTC (rev 22781)
@@ -22,10 +22,22 @@
 		setenv('DYLD_LIBRARY_PATH',[ issmdir '/externalpackages/curl/install/lib:' issmdir '/externalpackages/hdf5/install/lib:' issmdir '/externalpackages/netcdf/install/lib' ]);
 	end
 
+   %Find path to gmt
+   paths = {[issmdir() '/bin/gmt'],[issmdir() '/externalpackages/gmt/install/bin/gmt'],'/Applications/GMT-5.4.3.app/Contents/Resources/bin/gmt'};
+   gmtpath = '';
+   for i=paths
+      if exist(i{1},'file'),
+         gmtpath = i{1};
+      end
+   end
+   if isempty(gmtpath),
+      error('gmt not found, make sure it is properly installed');
+   end
+
 	%Build xjobs script:
 	fid=fopen('xjobs.script','w');
 	for i=1:length(nnv)-1,
-		fprintf(fid,'gmt gmtselect ./all_vertices%i.txt -h0 -Df -R0/360/-90/90  -A0 -JQ180/200 -Nk/s/s/k/s > ./oce_vertices%i.txt\n',i,i);
+		fprintf(fid,'%s gmtselect ./all_vertices%i.txt -h0 -Df -R0/360/-90/90  -A0 -JQ180/200 -Nk/s/s/k/s > ./oce_vertices%i.txt\n',gmtpath,i,i);
 	end
 	fclose(fid);
 



More information about the issm-svn mailing list