<p><b>dwj07@fsu.edu</b> 2012-12-14 13:44:31 -0700 (Fri, 14 Dec 2012)</p><p><br>
        -- TRUNK COMMIT --<br>
<br>
        Adding the ability for latest restart option.<br>
        Cores need to be modified still, this commit only makes this possible in the ocean core.<br>
</p><hr noshade><pre><font color="gray">Modified: trunk/mpas/src/core_ocean/mpas_ocn_mpas_core.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_mpas_core.F        2012-12-13 19:07:12 UTC (rev 2350)
+++ trunk/mpas/src/core_ocean/mpas_ocn_mpas_core.F        2012-12-14 20:44:31 UTC (rev 2351)
@@ -184,11 +184,19 @@
 
       type (MPAS_Time_Type) :: startTime, stopTime, alarmStartTime
       type (MPAS_TimeInterval_type) :: runDuration, timeStep, alarmTimeStep
+      character(len=StrKIND) :: restartTimeStamp
       integer :: ierr
 
-      call mpas_set_time(curr_time=startTime, dateTimeString=config_start_time, ierr=ierr)
+      if(config_start_time == 'file') then
+        open(22,file='restart_timestamp',form='formatted',status='old')
+        read(22,*) restartTimeStamp
+        close(22)
+        call mpas_set_time(curr_time=startTime, dateTimeString=restartTimeStamp, ierr=ierr)
+      else
+        call mpas_set_time(curr_time=startTime, dateTimeString=config_start_time, ierr=ierr)
+      end if
+
       call mpas_set_timeInterval(timeStep, dt=dt, ierr=ierr)
-
       if (trim(config_run_duration) /= &quot;none&quot;) then
          call mpas_set_timeInterval(runDuration, timeString=config_run_duration, ierr=ierr)
          call mpas_create_clock(clock, startTime=startTime, timeStep=timeStep, runDuration=runDuration, ierr=ierr)

Modified: trunk/mpas/src/framework/mpas_io_input.F
===================================================================
--- trunk/mpas/src/framework/mpas_io_input.F        2012-12-13 19:07:12 UTC (rev 2350)
+++ trunk/mpas/src/framework/mpas_io_input.F        2012-12-14 20:44:31 UTC (rev 2351)
@@ -94,7 +94,7 @@
       type (graph) :: partial_global_graph_info
 
       type (MPAS_Time_type) :: startTime
-      character(len=StrKIND) :: timeStamp
+      character(len=StrKIND) :: timeStamp, restartTimeStamp
       character(len=StrKIND) :: filename
 
       integer :: nHalos
@@ -103,9 +103,18 @@
 
       if (config_do_restart) then
         ! this get followed by set is to ensure that the time is in standard format
-        call mpas_set_time(curr_time=startTime, dateTimeString=config_start_time)
+        if(trim(config_start_time) == 'file') then
+          open(22,file='restart_timestamp',form='formatted',status='old')
+          read(22,*) restartTimeStamp
+          close(22)
+
+        else
+          restartTimeStamp = config_start_time
+        end if
+
+        write(0,*) 'RestartTimeStamp ', trim(restartTimeStamp)
+        call mpas_set_time(curr_time=startTime, dateTimeString=restartTimeStamp)
         call mpas_get_time(curr_time=startTime, dateTimeString=timeStamp)
-
         call mpas_insert_string_suffix(trim(config_restart_name), timeStamp, filename)
 
         input_obj % filename = trim(filename)
@@ -256,11 +265,17 @@
         ! If doing a restart, we need to decide which time slice to read from the 
         !   restart file
         !
-        input_obj % time = MPAS_seekStream(input_obj % io_stream, config_start_time, MPAS_STREAM_EXACT_TIME, timeStamp, ierr)
+        input_obj % time = MPAS_seekStream(input_obj % io_stream, restartTimeStamp, MPAS_STREAM_EXACT_TIME, timeStamp, ierr)
         if (ierr == MPAS_IO_ERR) then
-          write(0,*) 'Error: restart file '//trim(filename)//' did not contain time '//trim(config_start_time)
+          write(0,*) 'Error: restart file '//trim(filename)//' did not contain time '//trim(restartTimeStamp)
           call mpas_dmpar_abort(domain % dminfo)
         end if
+
+!       input_obj % time = MPAS_seekStream(input_obj % io_stream, config_start_time, MPAS_STREAM_EXACT_TIME, timeStamp, ierr)
+!       if (ierr == MPAS_IO_ERR) then
+!         write(0,*) 'Error: restart file '//trim(filename)//' did not contain time '//trim(config_start_time)
+!         call mpas_dmpar_abort(domain % dminfo)
+!       end if
 !write(0,*) 'MGD DEBUGGING time = ', input_obj % time
         write(0,*) 'Restarting model from time ', trim(timeStamp)
       end if

Modified: trunk/mpas/src/framework/mpas_io_output.F
===================================================================
--- trunk/mpas/src/framework/mpas_io_output.F        2012-12-13 19:07:12 UTC (rev 2350)
+++ trunk/mpas/src/framework/mpas_io_output.F        2012-12-14 20:44:31 UTC (rev 2351)
@@ -48,6 +48,9 @@
       else if (trim(stream) == 'RESTART') then
          if(present(outputSuffix)) then
             call mpas_insert_string_suffix(config_restart_name, outputSuffix, tempfilename)
+            open(22,file='restart_timestamp',form='formatted',status='replace')
+            write(22,*) outputSuffix
+            close(22)
          else
             tempfilename = config_restart_name
          end if

</font>
</pre>