[cig-commits] r12558 - seismo/3D/SPECFEM3D_GLOBE/trunk/version41_beta/src

dkomati1 at geodynamics.org dkomati1 at geodynamics.org
Wed Aug 6 14:23:19 PDT 2008


Author: dkomati1
Date: 2008-08-06 14:23:19 -0700 (Wed, 06 Aug 2008)
New Revision: 12558

Modified:
   seismo/3D/SPECFEM3D_GLOBE/trunk/version41_beta/src/write_seismograms.f90
Log:
converted write_seismograms.f90 from heap to stack


Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/version41_beta/src/write_seismograms.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/version41_beta/src/write_seismograms.f90	2008-08-06 21:19:04 UTC (rev 12557)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/version41_beta/src/write_seismograms.f90	2008-08-06 21:23:19 UTC (rev 12558)
@@ -69,7 +69,8 @@
  integer :: total_seismos,total_seismos_local
  double precision :: write_time_begin,write_time
 
- real(kind=CUSTOM_REAL), dimension(:,:), allocatable :: one_seismogram
+! allocate this automatic array in the memory stack to avoid memory fragmentation with "allocate()"
+ real(kind=CUSTOM_REAL), dimension(NDIM,NTSTEP_BETWEEN_OUTPUT_SEISMOS) :: one_seismogram
 
  integer msg_status(MPI_STATUS_SIZE)
 
@@ -91,9 +92,6 @@
   logical SAVE_ALL_SEISMOS_IN_ONE_FILE
   logical USE_BINARY_FOR_LARGE_FILE
 
-  allocate(one_seismogram(NDIM,NTSTEP_BETWEEN_OUTPUT_SEISMOS),stat=ier)
-  if(ier /= 0) stop 'error while allocating one temporary seismogram'
-
 ! check that the sum of the number of receivers in each slice is nrec
   call MPI_REDUCE(nrec_local,nrec_tot_found,1,MPI_INTEGER,MPI_SUM,0,MPI_COMM_WORLD,ier)
   if(myrank == 0 .and. nrec_tot_found /= nrec) &
@@ -266,8 +264,6 @@
 
  endif ! WRITE_SEISMOGRAMS_BY_MASTER
 
-  deallocate(one_seismogram)
-
   end subroutine write_seismograms
 
 !



More information about the cig-commits mailing list