<p><b>duda</b> 2012-04-17 00:46:11 -0600 (Tue, 17 Apr 2012)</p><p>BRANCH COMMIT<br>
<br>
Add code to sync to disk at the end of each call to MPAS_writeStream().<br>
<br>
<br>
M src/framework/mpas_io_streams.F<br>
M src/framework/mpas_io.F<br>
</p><hr noshade><pre><font color="gray">Modified: branches/omp_blocks/io/src/framework/mpas_io.F
===================================================================
--- branches/omp_blocks/io/src/framework/mpas_io.F        2012-04-17 05:43:36 UTC (rev 1783)
+++ branches/omp_blocks/io/src/framework/mpas_io.F        2012-04-17 06:46:11 UTC (rev 1784)
@@ -3306,6 +3306,27 @@
end subroutine MPAS_io_advance_frame
+ subroutine MPAS_io_sync(handle, ierr)
+
+ implicit none
+
+ type (MPAS_IO_Handle_type), intent(inout) :: handle
+ integer, intent(out), optional :: ierr
+
+ write(0,*) 'Called MPAS_io_sync()'
+ if (present(ierr)) ierr = MPAS_IO_NOERR
+
+ ! Sanity checks
+ if (.not. handle % initialized) then
+ if (present(ierr)) ierr = MPAS_IO_ERR_UNINIT_HANDLE
+ return
+ end if
+
+ call PIO_syncfile(handle % pio_file)
+
+ end subroutine MPAS_io_sync
+
+
subroutine MPAS_io_close(handle, ierr)
implicit none
Modified: branches/omp_blocks/io/src/framework/mpas_io_streams.F
===================================================================
--- branches/omp_blocks/io/src/framework/mpas_io_streams.F        2012-04-17 05:43:36 UTC (rev 1783)
+++ branches/omp_blocks/io/src/framework/mpas_io_streams.F        2012-04-17 06:46:11 UTC (rev 1784)
@@ -2349,6 +2349,12 @@
field_cursor => field_cursor % next
end do
+
+ !
+ ! Sync all fields with disk
+ !
+ call MPAS_io_sync(stream % fileHandle)
+
end subroutine MPAS_writeStream
</font>
</pre>