Index: /issm/trunk/src/m/model/process_solve_options.m
===================================================================
--- /issm/trunk/src/m/model/process_solve_options.m	(revision 9892)
+++ /issm/trunk/src/m/model/process_solve_options.m	(revision 9893)
@@ -34,5 +34,4 @@
 %  process flaim arguments
 outoptions.fmdir=getfieldvalue(options,'fmdir',['fm' num2str(feature('GetPid'))]);
-outoptions.fmfile=getfieldvalue(options,'fmfile','fm_targets');
 outoptions.overwrite=getfieldvalue(options,'overwrite','n');
 outoptions.keep=getfieldvalue(options,'keep','y');
Index: /issm/trunk/src/m/model/solve.m
===================================================================
--- /issm/trunk/src/m/model/solve.m	(revision 9892)
+++ /issm/trunk/src/m/model/solve.m	(revision 9893)
@@ -38,6 +38,6 @@
 if (solutionenum == FlaimSolutionEnum)
 	modelconsistency(true);
-	md.mesh.checkconsistency(md);
-	md.flaim.checkconsistency(md);
+	md.mesh.checkconsistency(md,solutionenum);
+	md.flaim.checkconsistency(md,solutionenum);
 	if ~modelconsistency()
 		error(' ');
Index: /issm/trunk/src/m/solutions/flaim_sol.m
===================================================================
--- /issm/trunk/src/m/solutions/flaim_sol.m	(revision 9892)
+++ /issm/trunk/src/m/solutions/flaim_sol.m	(revision 9893)
@@ -1,13 +1,15 @@
 function md=flaim_sol(md,options)
-%QMU - apply Quantification of Margins and Uncertainties techniques 
-%      to a solution sequence (like diagnostic.m, progonstic.m, etc ...), 
-%      using the Dakota software from Sandia.
+%
+%   run flaim solution.
 %
 %   options come from the solve.m routine. They can include flaim options:
 %
-%       fmdir:  any directory where to run the flaim analysis
+%       fmdir:  any directory to run the flaim analysis
 %       fmfile: input file for flaim
 %       overwrite: overwrite qmudir before analysis
 %       keep: keep qmudir after analysis
+%       latsgn: latitude sign (+1, north; -1, south)
+%       cmap: matlab colormap
+%
 
 disp('preprocessing flaim inputs');
@@ -34,11 +36,17 @@
 [pathstr,name,ext,versn] = fileparts(md.flaim.tracks);
 fm_tracks=fullfile('',[name ext versn]);
-[pathstr,name,ext,versn] = fileparts(options.fmfile);
-if isempty(ext)
-    ext='.kml';
+if ~isempty(md.flaim.targets)
+    [pathstr,name,ext,versn] = fileparts(md.flaim.targets);
+    if isempty(ext)
+        ext='.kml';
+    end
+    fm_targets=fullfile(pathstr,[name ext versn]);
+    ext='.log';
+    filelog=fullfile(pathstr,[name ext versn]);
+else
+    fm_targets='fm_targets.kml';
+    filelog='fm_targets.log';
 end
-filekml=fullfile(pathstr,[name ext versn]);
-ext='.log';
-filelog=fullfile(pathstr,[name ext versn]);
+md.flaim.targets=fm_targets;
 if ~isempty(md.flaim.solution)
 	[pathstr,name,ext,versn] = fileparts(md.flaim.solution);
@@ -80,7 +88,7 @@
 
 display('Calling KMLMeshWrite.');
-KMLMeshWrite(md.miscellaneous.name,md.miscellaneous.notes,md.mesh.elements,md.mesh.vertexconnectivity,md.mesh.lat,md.mesh.long,md.qmu.partition,md.flaim.criterion,options.cmap,filekml);
+KMLMeshWrite(md.miscellaneous.name,md.miscellaneous.notes,md.mesh.elements,md.mesh.vertexconnectivity,md.mesh.lat,md.mesh.long,md.qmu.partition,md.flaim.criterion,options.cmap,fm_targets);
 %  for testing
-%filekml='issm-split-geikie1-targets.kml';
+%fm_targets='issm-split-geikie1-targets.kml';
 
 %  call flaim
@@ -88,6 +96,6 @@
 display('Calling flaim.');
 FLAIM_DIR=flaimdir();
-%system([FLAIM_DIR '/clasp/swathModule/models/issm/issm.exe -kml ' fm_tracks ' -kml ' filekml ' -gridsatequator 200000 -opt 1 -hst 2017-276T02:57:00 -hdur 4d -sparsepoints -usevalueordering -split-antimeridian >& ' filelog]);
-flaim_cmd=[FLAIM_DIR '/clasp/swathModule/models/issm/issm.exe -kml ' fm_tracks ' -kml ' filekml ' -gridsatequator ' int2str(md.flaim.gridsatequator) ' -opt 1 -hst 2017-276T02:57:00 -hdur 4d -sparsepoints'];
+%system([FLAIM_DIR '/clasp/swathModule/models/issm/issm.exe -kml ' fm_tracks ' -kml ' fm_targets ' -gridsatequator 200000 -opt 1 -hst 2017-276T02:57:00 -hdur 4d -sparsepoints -usevalueordering -split-antimeridian >& ' filelog]);
+flaim_cmd=[FLAIM_DIR '/clasp/swathModule/models/issm/issm.exe -kml ' fm_tracks ' -kml ' fm_targets ' -gridsatequator ' int2str(md.flaim.gridsatequator) ' -opt 1 -hst 2017-276T02:57:00 -hdur 4d -sparsepoints'];
 if (md.flaim.usevalueordering)
 	flaim_cmd=[flaim_cmd ' -usevalueordering'];
