Index: /issm/trunk-jpl/src/m/contrib/larour/ismip6.m
===================================================================
--- /issm/trunk-jpl/src/m/contrib/larour/ismip6.m	(revision 25060)
+++ /issm/trunk-jpl/src/m/contrib/larour/ismip6.m	(revision 25061)
@@ -11,11 +11,13 @@
 		root = ''; %where are the files for CMIP5
 		n   = 0;   %number of files
-		directories   = {};   %directories where the files are
-		experiments   = {};   %names of experiments
-		thickness     = {};   %placeholder for thicknesses
-		deltathickness     = {};   %placeholder for delta thicknesses
-		icemask     = {};   %placeholder for ice masks
-		oceanmask     = {};   %placeholder for ocean masks
-		time     = {};   %placeholder for times
+		directories    = {};   %directories where the files are
+		experiments    = {};   %names of experiments
+		thickness      = {};   %placeholder for thicknesses
+		deltathickness = {};   %placeholder for delta thicknesses
+		icemask        = {};   %placeholder for ice masks
+		oceanmask      = {};   %placeholder for ocean masks
+		time           = {};   %placeholder for times
+		timestart      = {};   %placeholder for times
+		calendar      = {};   %placeholder for times
 	end
 	methods
@@ -67,5 +69,13 @@
 			fielddisplay(self,'n','number of files');
 			fielddisplay(self,'root','where are the files for ISMIP6');
-			fielddisplay(self,'directories','IMSIP6 directories');
+			fielddisplay(self,'directories','directories');
+			fielddisplay(self,'experiments','experiments');
+			fielddisplay(self,'thickness','thickness');
+			fielddisplay(self,'deltathickness','deltathickness');
+			fielddisplay(self,'icemask','icemask');
+			fielddisplay(self,'oceanmask','oceanmask');
+			fielddisplay(self,'time','time');
+			fielddisplay(self,'timestart','timestart');
+			fielddisplay(self,'calendar','calendar');
 		end % }}}
 		function listexp(self) % {{{
@@ -76,5 +86,5 @@
 
 		end % }}}
-		function [output,time]=read(self,experiment,field) % {{{
+		function [output,time,timestart,calendar]=read(self,experiment,field) % {{{
 
 			%go through list of experiments and find the right one: 
@@ -118,4 +128,63 @@
 			output=ncread([self.root '/' dir '/' file ],field);
 
+			%figure out start time: 
+			info=ncinfo([self.root '/' dir '/' file]);
+			attributes=[];
+			for i=1:length(info.Variables),
+				if strcmpi(info.Variables(i).Name,'time'),
+					attributes=info.Variables(i).Attributes;
+					break;
+				end
+			end
+			for j=1:length(attributes),
+				if strcmpi(attributes(j).Name,'units') | strcmpi(attributes(j).Name,'unit'),
+					timestart=attributes(j).Value;
+				end
+				if strcmpi(attributes(j).Name,'calendar')
+					calendar=attributes(j).Value;
+				end
+			end
+
+		end % }}}
+		function info=readinfo(self,experiment,field) % {{{
+
+			%go through list of experiments and find the right one: 
+			if strcmpi(class(experiment),'double'),
+				ind=experiment;
+			elseif strcmpi(class(experiment),'char'),
+				for i=1:self.n,
+					if strcmpi(experiment,self.experiments{i}),
+						ind=i;
+						break;
+					end
+				end
+			else 
+				error(['ismip6 read error message: experiment should be a string or index']);
+			end
+
+			if ind==0 
+				error(['ismip6 read error message: experiment ' experiment ' could not be found!']);
+			end;
+
+			%figure out the files in this directory: 
+			dir=self.directories{ind};
+			currentdir=pwd;
+			cd([self.root '/' dir]); 
+			list=listfiles;
+			cd(currentdir);
+
+			%go through list of files and figure out which one starts with the field: 
+			for i=1:length(list),
+				file=list{i};
+				ind=findstr(file,'_');
+				file_field=file(1:ind-1);
+				if strcmpi(file_field,field),
+					break;
+				end
+			end
+
+			%read attributes
+			info=ncinfo([self.root '/' dir '/' file]);
+
 		end % }}}
 		function interpolate(self,field,ismip2mesh,ismip2mesh_correction) % {{{
@@ -125,5 +194,5 @@
 
 				%read field from disk: 
-				[h,t]=self.read(i,field); nt=length(t);
+				[h,t,t0,cal]=self.read(i,field); nt=length(t);
 
 				%map onto 1 dimension field: 
@@ -140,6 +209,10 @@
 				if strcmpi(field,'lithk'),
 					self.thickness{i}=hg; 
+					self.deltathickness{i}=diff(hg,1,2);
 				end
 				self.time{i}=t;
+				self.timestart{i}=t0;
+				self.calendar{i}=cal;
+
 			end
 		end  % }}}
