Index: /issm/trunk/src/m/classes/public/plot/plot_transient_movie.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_transient_movie.m	(revision 1484)
+++ /issm/trunk/src/m/classes/public/plot/plot_transient_movie.m	(revision 1485)
@@ -9,16 +9,9 @@
 	subplot(width,width,i); 
 
-	if strcmpi(md.type,'2d') 
-		choice=input('Which field do you want to plot? (vel/vx/vy/thickness/surface/bed)','s');
-		if ~strcmp(choice,'vel') & ~strcmp(choice,'vx') & ~strcmp(choice,'vy') & ~strcmp(choice,'thickness') & ~strcmp(choice,'bed') & ~strcmp(choice,'surface')
-			disp('plot_transient_movie error message: input not supported yet, exiting...')
-			return
-		end
+	%xlim
+	if ~isnan(options_structure.transient_movie_field),
+		field=options_structure.transient_movie_field;
 	else
-		choice=input('Which field do you want to plot? (vel/vx/vy/vz/thickness/surface/bed/temperature/melting)','s');
-		if ~strcmp(choice,'vel') & ~strcmp(choice,'vx') & ~strcmp(choice,'vy') & ~strcmp(choice,'vz') & ~strcmp(choice,'temperature') & ~strcmp(choice,'thickness') & ~strcmp(choice,'bed') & ~strcmp(choice,'surface')
-			disp('plot_transient_movie error message: input not supported yet, exiting...')
-			return
-		end
+		error('specify transient_movie_field in options list');
 	end
 
@@ -28,13 +21,38 @@
 	%loop over the time steps
 	for i=1:length(md.results.transient)
-		eval(['data=md.results.transient(' num2str(i) ').' num2str(choice) ';']);
+		eval(['data=md.results.transient(' num2str(i) ').' num2str(field) ';']);
 
 		%process data
 		[data isongrid]=processdata(md,data,options_structure);
-		titlestring=[choice ' at time ' num2str(md.results.transient(i).time/md.yts) ' year'];
+		titlestring=[field ' at time ' num2str(md.results.transient(i).time/md.yts) ' year'];
 		plot_unit(x,y,z,elements,data,isongrid,is2d,options_structure)
 		apply_options_movie(md,options_structure,titlestring);
-		pause(0.5)
+		
+		if ~isnan(options_structure.transient_movie_output),
+			frames(i)=getframe(gcf);
+		else
+			pause(0.5)
+		end
 	end
+
+	%output movie if requested.
+	if ~isnan(options_structure.transient_movie_output),
+		filename=options_structure.transient_movie_output;
+		
+		%fps 
+		if ~isnan(options_structure.transient_movie_fps),
+			fps=options_structure.transient_movie_fps;
+		else
+			fps=5;
+		end
+		%quality
+		if ~isnan(options_structure.transient_movie_quality),
+			quality=options_structure.transient_movie_quality;
+		else
+			quality=75;
+		end
+		movie2avi(frames,filename,'fps',fps,'quality',quality);
+	end
+
 end %function
 
