[cig-commits] r21315 - seismo/2D/SPECFEM2D/trunk/src/specfem2D

dkomati1 at geodynamics.org dkomati1 at geodynamics.org
Fri Feb 1 05:29:56 PST 2013


Author: dkomati1
Date: 2013-02-01 05:29:55 -0800 (Fri, 01 Feb 2013)
New Revision: 21315

Modified:
   seismo/2D/SPECFEM2D/trunk/src/specfem2D/write_seismograms.F90
Log:
added hidden flag PAUL_SAVE_ASCII_IN_BINARY to save the ASCII *.sem* seismograms in binary instead, to save disk space and/or writing time.
we could/should move this flag to DATA/Par_file one day.


Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/write_seismograms.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/write_seismograms.F90	2013-02-01 13:24:56 UTC (rev 21314)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/write_seismograms.F90	2013-02-01 13:29:55 UTC (rev 21315)
@@ -52,6 +52,11 @@
 
   implicit none
 
+! uncomment this to save the ASCII *.sem* seismograms in binary instead, to save disk space and/or writing time
+! we could/should move this flag to DATA/Par_file one day.
+!
+! #define PAUL_SAVE_ASCII_IN_BINARY
+
   include "constants.h"
 #ifdef USE_MPI
   include "mpif.h"
@@ -288,14 +293,22 @@
                open(unit=11,file=sisname(1:len_trim(sisname)),status='unknown')
                close(11,status='delete')
              endif
+#ifndef PAUL_SAVE_ASCII_IN_BINARY
              open(unit=11,file=sisname(1:len_trim(sisname)),status='unknown',position='append')
+#else
+             open(unit=11,file=sisname(1:len_trim(sisname)),status='unknown',form='unformatted',position='append')
+#endif
 
              ! make sure we never write more than the maximum number of time steps
              ! subtract offset of the source to make sure travel time is correct
+#ifndef PAUL_SAVE_ASCII_IN_BINARY
              do isample = 1,seismo_current
                  write(11,*) sngl(dble(seismo_offset+isample-1)*deltat - t0),' ', &
                               sngl(buffer_binary(isample,iorientation))
              enddo
+#else
+                 write(11) sngl(buffer_binary(:,iorientation))
+#endif
 
              close(11)
           enddo



More information about the CIG-COMMITS mailing list