[cig-commits] r21172 - in seismo/2D/SPECFEM2D/trunk: setup src/specfem2D

dkomati1 at geodynamics.org dkomati1 at geodynamics.org
Sat Dec 15 08:09:51 PST 2012


Author: dkomati1
Date: 2012-12-15 08:09:50 -0800 (Sat, 15 Dec 2012)
New Revision: 21172

Modified:
   seismo/2D/SPECFEM2D/trunk/setup/constants.h.in
   seismo/2D/SPECFEM2D/trunk/src/specfem2D/prepare_color_image.F90
   seismo/2D/SPECFEM2D/trunk/src/specfem2D/read_databases.f90
   seismo/2D/SPECFEM2D/trunk/src/specfem2D/specfem2D.F90
Log:
added NX_NZ_IMAGE_MAX for the max size of a JPEG image, and converted factor_subsample_image from integer to double precision


Modified: seismo/2D/SPECFEM2D/trunk/setup/constants.h.in
===================================================================
--- seismo/2D/SPECFEM2D/trunk/setup/constants.h.in	2012-12-15 16:01:26 UTC (rev 21171)
+++ seismo/2D/SPECFEM2D/trunk/setup/constants.h.in	2012-12-15 16:09:50 UTC (rev 21172)
@@ -30,6 +30,9 @@
 ! due to non matching polynomial degrees along common edges
   integer, parameter :: NGLLZ = NGLLX
 
+! maximum size of the X and Z directions of a JPEG image generated by the display routine
+  integer, parameter :: NX_NZ_IMAGE_MAX = 2500
+
 ! further reduce cache misses inner/outer in two passes in the case of an MPI simulation
 ! this flag is ignored in the case of a serial simulation
   logical, parameter :: FURTHER_REDUCE_CACHE_MISSES = .true.

Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/prepare_color_image.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/prepare_color_image.F90	2012-12-15 16:01:26 UTC (rev 21171)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/prepare_color_image.F90	2012-12-15 16:09:50 UTC (rev 21172)
@@ -58,7 +58,7 @@
   integer :: NX_IMAGE_color,NZ_IMAGE_color
 
 ! factor to subsample color images output by the code (useful for very large models)
-  integer :: factor_subsample_image
+  double precision :: factor_subsample_image
 
   integer :: nglob,npgeo
   double precision, dimension(NDIM,nglob) :: coord
@@ -109,20 +109,26 @@
 
   ! convert pixel sizes to even numbers because easier to reduce size,
   ! create MPEG movies in postprocessing
-  NX_IMAGE_color = 2 * (NX_IMAGE_color / 2 + 1) / factor_subsample_image
-  NZ_IMAGE_color = 2 * (NZ_IMAGE_color / 2 + 1) / factor_subsample_image
+  NX_IMAGE_color = 2 * nint((NX_IMAGE_color / 2 + 1) / factor_subsample_image)
+  NZ_IMAGE_color = 2 * nint((NZ_IMAGE_color / 2 + 1) / factor_subsample_image)
 
   ! check that image size is not too big
 ! because from http://www.jpegcameras.com/libjpeg/libjpeg-2.html
 ! we know that the size limit of the image in each dimension is 65535:
 ! "JPEG supports image dimensions of 1 to 64K pixels in either direction".
-  if (NX_IMAGE_color < 4) call exit_MPI('output image too big : NX_IMAGE_color < 4.')
-  if (NZ_IMAGE_color < 4) call exit_MPI('output image too big : NZ_IMAGE_color < 4.')
+  if (NX_IMAGE_color < 4) call exit_MPI('output image too small: NX_IMAGE_color < 4.')
+  if (NZ_IMAGE_color < 4) call exit_MPI('output image too small: NZ_IMAGE_color < 4.')
+
   if (NX_IMAGE_color > 65534) &
-    call exit_MPI('output image too big : NX_IMAGE_color > 65534; increase factor_subsample_image in DATA/Par_file.')
+    call exit_MPI('output image too big: NX_IMAGE_color > 65534; increase factor_subsample_image in DATA/Par_file.')
   if (NZ_IMAGE_color > 65534) &
-    call exit_MPI('output image too big : NZ_IMAGE_color > 65534; increase factor_subsample_image in DATA/Par_file.')
+    call exit_MPI('output image too big: NZ_IMAGE_color > 65534; increase factor_subsample_image in DATA/Par_file.')
 
+  if (NX_IMAGE_color > NX_NZ_IMAGE_MAX) call exit_MPI( &
+      'output image too big: NX_IMAGE_color > NX_NZ_IMAGE_MAX; increase factor_subsample_image or change NX_NZ_IMAGE_MAX.')
+  if (NZ_IMAGE_color > NX_NZ_IMAGE_MAX) call exit_MPI( &
+      'output image too big: NZ_IMAGE_color > NX_NZ_IMAGE_MAX; increase factor_subsample_image or change NX_NZ_IMAGE_MAX.')
+
   end subroutine prepare_color_image_init
 
 

Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/read_databases.f90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/read_databases.f90	2012-12-15 16:01:26 UTC (rev 21171)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/read_databases.f90	2012-12-15 16:09:50 UTC (rev 21172)
@@ -87,7 +87,7 @@
              subsamp_seismos,imagetype_JPEG,imagetype_wavefield_dumps,NELEM_PML_THICKNESS
 
 ! factor to subsample color images output by the code (useful for very large models)
-  integer :: factor_subsample_image
+  double precision :: factor_subsample_image
 
 ! use snapshot number in the file name of JPG color snapshots instead of the time step
   logical :: USE_SNAPSHOT_NUMBER_IN_FILENAME

Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/specfem2D.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/specfem2D.F90	2012-12-15 16:01:26 UTC (rev 21171)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/specfem2D.F90	2012-12-15 16:09:50 UTC (rev 21172)
@@ -379,7 +379,7 @@
   logical :: p_sv
 
 ! factor to subsample color images output by the code (useful for very large models)
-  integer :: factor_subsample_image
+  double precision :: factor_subsample_image
 
 ! use snapshot number in the file name of JPG color snapshots instead of the time step
   logical :: USE_SNAPSHOT_NUMBER_IN_FILENAME



More information about the CIG-COMMITS mailing list