Index: /issm/trunk-jpl/src/m/io/loadmodel.py
===================================================================
--- /issm/trunk-jpl/src/m/io/loadmodel.py	(revision 25091)
+++ /issm/trunk-jpl/src/m/io/loadmodel.py	(revision 25092)
@@ -10,5 +10,5 @@
 
 
-def loadmodel(path):
+def loadmodel(path, onlylast=False):
     """
     LOADMODEL - load a model using built - in load module
@@ -33,5 +33,5 @@
     #       try:
     #recover model on file and name it md
-    struc = loadvars(path)
+    struc = loadvars(path, OL=onlylast)
     name = [key for key in list(struc.keys())]
     if len(name) > 1:
Index: /issm/trunk-jpl/src/m/io/loadvars.py
===================================================================
--- /issm/trunk-jpl/src/m/io/loadvars.py	(revision 25091)
+++ /issm/trunk-jpl/src/m/io/loadvars.py	(revision 25092)
@@ -14,5 +14,5 @@
 
 
-def loadvars(*args):
+def loadvars(*args, OL):
     """
     LOADVARS - function to load variables to a file.
@@ -116,6 +116,10 @@
                             nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = [OrderedDict() for i in range(max(1, len(curclass.groups)))]
                         else:
-                            nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = [getattr(__import__(listtype), listtype)() for i in range(max(1, len(curclass.groups)))]
-                            Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]][:]
+                            if OL:   #we load only the last result to save on time and memory
+                                nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = [getattr(__import__(listtype), listtype)()]
+                                Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]]
+                            else:
+                                nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = [getattr(__import__(listtype), listtype)() for i in range(max(1, len(curclass.groups)))]
+                                Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]][:]
                     else:
                         #that is the current treatment
@@ -125,10 +129,18 @@
                         indexlist = np.arange(0, len(NCFile.dimensions['Time']))
                         AllHaveTime = np.all(['Time' in dimtuple for dimtuple in dimlist])
+                        listtype = curclass.classtype
                         if AllHaveTime:
                             #Time dimension is in all the variables so we take that as stepnumber for the results
-                            listtype = curclass.classtype
-                            nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = [getattr(__import__(listtype), listtype)() for i in range(max(1, len(NCFile.dimensions['Time'])))]
-                            Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]][:]
+                            if OL:   #we load only the last result to save on time and memory
+                                nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = [getattr(__import__(listtype), listtype)()]
+                                Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]]
+                            else:
+                                nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = [getattr(__import__(listtype), listtype)() for i in range(max(1, len(NCFile.dimensions['Time'])))]
+                                Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]][:]
+                        elif len(NCFile.dimensions['Time']) == 1:
+                            nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = getattr(__import__(listtype), listtype)()
+                            Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]]
                         else:
+
                             print("ERROR: Time dimension is not in all results. That has been overlooked for now but your resulat are not saved.")
 
@@ -160,13 +172,25 @@
                         NewFormat = 'Time' in NCFile.dimensions
                         if type(Tree) == list and NewFormat:
-                            for t in indexlist:
+                            if OL:
                                 if vardim == 1:
-                                    Tree[t].__dict__[str(var)] = varval[t].data
+                                    Tree[0].__dict__[str(var)] = varval[-1].data
                                 elif vardim == 2:
-                                    Tree[t].__dict__[str(var)] = varval[t, :].data
+                                    Tree[0].__dict__[str(var)] = varval[-1, :].data
                                 elif vardim == 3:
-                                    Tree[t].__dict__[str(var)] = varval[t, :, :].data
+                                    Tree[0].__dict__[str(var)] = varval[-1, :, :].data
                                 else:
                                     print('table dimension greater than 3 not implemented yet')
+                            else:
+                                for t in indexlist:
+                                    if vardim == 0:
+                                        Tree[t].__dict__[str(var)] = varval[:].data
+                                    if vardim == 1:
+                                        Tree[t].__dict__[str(var)] = varval[t].data
+                                    elif vardim == 2:
+                                        Tree[t].__dict__[str(var)] = varval[t, :].data
+                                    elif vardim == 3:
+                                        Tree[t].__dict__[str(var)] = varval[t, :, :].data
+                                    else:
+                                        print('table dimension greater than 3 not implemented yet')
                         else:
                             if vardim == 0:  #that is a scalar
