[cig-commits] r20307 - in seismo/2D/SPECFEM2D/trunk: DATA src/meshfem2D src/specfem2D

dkomati1 at geodynamics.org dkomati1 at geodynamics.org
Mon Jun 4 16:45:24 PDT 2012


Author: dkomati1
Date: 2012-06-04 16:45:24 -0700 (Mon, 04 Jun 2012)
New Revision: 20307

Modified:
   seismo/2D/SPECFEM2D/trunk/DATA/Par_file
   seismo/2D/SPECFEM2D/trunk/src/meshfem2D/meshfem2D.F90
   seismo/2D/SPECFEM2D/trunk/src/meshfem2D/read_parameter_file.F90
   seismo/2D/SPECFEM2D/trunk/src/meshfem2D/save_databases.f90
   seismo/2D/SPECFEM2D/trunk/src/specfem2D/gmat01.f90
   seismo/2D/SPECFEM2D/trunk/src/specfem2D/invert_mass_matrix.F90
   seismo/2D/SPECFEM2D/trunk/src/specfem2D/plotpost.F90
   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
   seismo/2D/SPECFEM2D/trunk/src/specfem2D/write_seismograms.F90
Log:
created all the new parameters requested by Paul Cristini in DATA/Par_file.
Not all of them are fully implemented yet, but the data structure is ready and I will implement them soon.


Modified: seismo/2D/SPECFEM2D/trunk/DATA/Par_file
===================================================================
--- seismo/2D/SPECFEM2D/trunk/DATA/Par_file	2012-06-04 22:14:05 UTC (rev 20306)
+++ seismo/2D/SPECFEM2D/trunk/DATA/Par_file	2012-06-04 23:45:24 UTC (rev 20307)
@@ -1,5 +1,5 @@
 # title of job
-title                           = Test for M2 UPPA
+title                           = Test of SPECFEM2D with curved interfaces
 
 # forward or adjoint simulation
 SIMULATION_TYPE                 = 1   # 1 = forward, 2 = adjoint + kernels
@@ -26,7 +26,7 @@
 nt                              = 1600           # total number of time steps
 deltat                          = 1.d-3          # duration of a time step
 USER_T0                         = 0.0d0          # use this t0 as earliest starting time rather than the automatically calculated one
-time_stepping_scheme            = 1   # 1 = Newmark (2nd order),     2 = LDDRK4-6 (4th-order 6-stage low storage Runge-Kutta),     3 = classical 4th-order 4-stage Runge-Kutta
+time_stepping_scheme            = 1              # 1 = Newmark (2nd order),     2 = LDDRK4-6 (4th-order 6-stage low storage Runge-Kutta),     3 = classical 4th-order 4-stage Runge-Kutta
 
 # source parameters
 NSOURCES                        = 1              # number of sources [source info read in CMTSOLUTION file]
@@ -34,17 +34,21 @@
 
 # constants for attenuation
 N_SLS                           = 2                      # number of standard linear solids for attenuation
-f0_attenuation                  = 5.196152422706633      # (Hz) relevant only if source is a Dirac or a Heaviside, else it is f0
+f0_attenuation                  = 5.196152422706633      # (Hz) relevant only if source is a Dirac or a Heaviside, otherwise it is f0 the dominant frequency of the source in the CMTSOLUTION file
 
 # receiver set parameters for seismograms
 seismotype                      = 1              # record 1=displ 2=veloc 3=accel 4=pressure 6=potential
+NSTEP_BETWEEN_OUTPUT_SEISMOS    = 5000000        # every how many time steps we save the seismograms (costly, do not use a very small value; if you use a very large value that is larger than the total number of time steps of the run, the seismograms will automatically be saved once at the end of the run anyway)
+save_ASCII_seismograms          = .true.         # save seismograms in ASCII format or not (they are saved once and only once, at the end of the run)
+save_binary_seismograms         = .true.         # save seismograms in binary format or not (can be used jointly with ASCII above to save both)
+subsamp_seismos                 = 1              # subsampling of the seismograms to create small files (but less accurately sampled in time)
 generate_STATIONS               = .true.         # creates a STATION file in ./DATA
 nreceiversets                   = 1              # number of receiver sets
 anglerec                        = 0.d0           # angle to rotate components at receivers
 rec_normal_to_surface           = .false.        # base anglerec normal to surface (external mesh and curve file needed)
 SU_FORMAT                       = .false.        # output seismograms in Seismic Unix format (adjoint traces will be read in the same format)
 
-# first receiver set (repeat these 6 lines and adjust nreceiversets  accordingly)
+# first receiver set (repeat these 6 lines and adjust nreceiversets accordingly)
 nrec                            = 11             # number of receivers
 xdeb                            = 300.           # first receiver x in meters
 zdeb                            = 2200.          # first receiver z in meters
@@ -53,27 +57,37 @@
 enreg_surf_same_vertical        = .true.         # receivers inside the medium or at the surface
 
 # display parameters
-NTSTEP_BETWEEN_OUTPUT_INFO      = 100            # display frequency in time steps
-output_postscript_snapshot      = .true.         # output Postscript snapshot of the results
-output_color_image              = .true.         # output JPEG color image of the results
-imagetype                       = 1              # display 1=displ 2=veloc 3=accel 4=pressure
-cutsnaps                        = 1.             # minimum amplitude in % for snapshots
-meshvect                        = .true.         # display mesh on vector plots or not
-modelvect                       = .false.        # display velocity model on vector plots
-boundvect                       = .true.         # display boundary conditions on plots
-interpol                        = .true.         # interpolation of the display or not
-pointsdisp                      = 6              # points for interpolation of display (set to 1 for lower-left corner only)
+NSTEP_BETWEEN_OUTPUT_INFO       = 100            # every how many time steps we display information about the simulation (costly, do not use a very small value)
+####
+NSTEP_BETWEEN_OUTPUT_IMAGES     = 100            # every how many time steps we draw JPEG or PostScript pictures of the simulation (costly, do not use a very small value)
+#### for PostScript snapshots ####
+output_postscript_snapshot      = .true.         # output Postscript snapshot of the results every NSTEP_BETWEEN_OUTPUT_IMAGES time steps
+imagetype_postscript            = 1              # display 1=displ vector 2=veloc vector 3=accel vector 4=pressure
+cutsnaps                        = 1.             # minimum amplitude in % for JPEG and PostScript snapshots
+meshvect                        = .true.         # display mesh on PostScript plots or not
+modelvect                       = .false.        # display velocity model on PostScript plots
+boundvect                       = .true.         # display boundary conditions on PostScript plots
+interpol                        = .true.         # interpolation of the PostScript display or not
+pointsdisp                      = 6              # points for interpolation of PostScript snapshots (set to 1 for lower-left corner only)
 subsamp_postscript              = 1              # subsampling of background velocity model in PostScript snapshots
-factor_subsample_image          = 1              # factor to subsample color images output by the code (useful for very large models)
-POWER_DISPLAY_COLOR             = 0.30d0         # non linear display to enhance small amplitudes in color images
-DRAW_WATER_CONSTANT_BLUE_IN_JPG = .true.         # display acoustic layers as constant blue in JPEG images, because they likely correspond to water
-sizemax_arrows                  = 1.d0           # maximum size of arrows on vector plots in cm
-US_LETTER                       = .false.        # US letter paper or European A4
+sizemax_arrows                  = 1.d0           # maximum size of arrows on PostScript plots in centimeters
+US_LETTER                       = .false.        # US letter or European A4 paper for PostScript plots
+#### for JPEG color images ####
+output_color_image              = .true.         # output JPEG color image of the results every NSTEP_BETWEEN_OUTPUT_IMAGES time steps
+imagetype_JPEG                  = 2              # display 1=displ_Ux 2=displ_Uz 3=displ_norm 4=veloc_Vx 5=veloc_Vz 6=veloc_norm 7=accel_Ax 8=accel_Az 9=accel_norm 10=pressure
+factor_subsample_image          = 1              # factor to spatially subsample color JPEG images output by the code (useful for very large models)
+POWER_DISPLAY_COLOR             = 0.30d0         # non linear display to enhance small amplitudes in JPEG color images
+DRAW_SOURCES_AND_RECEIVERS      = .true.         # display sources as orange crosses and receivers are green squares in JPEG images or not
+DRAW_WATER_IN_BLUE              = .true.         # display acoustic layers as constant blue in JPEG images, because they likely correspond to water in the case of ocean acoustics or in the case of offshore oil industry experiments (if off, display them as greyscale, as for elastic or poroelastic elements, for instance for acoustic-only oil industry models of solid media)
 USE_SNAPSHOT_NUMBER_IN_FILENAME = .false.        # use snapshot number in the file name of JPEG color snapshots instead of the time step
-gnuplot                         = .false.        # generate a GNUPLOT file for the grid
-output_grid                     = .false.        # save the grid in a text file or not
-output_energy                   = .false.        # compute and output acoustic and elastic energy (slows down the code significantly)
-output_wavefield_snapshot       = .false.        # output Ux,Uy,Uz text file for each output time (big files)
+####
+NSTEP_BETWEEN_OUTPUT_TEXT_DUMPS = 100            # every how many time steps we dump results of the simulation as ASCII text files (costly, do not use a very small value)
+output_TEXT_wavefield_dumps     = .false.        # output wave field to text file every NSTEP_BETWEEN_OUTPUT_TEXT_DUMPS time steps (creates very big files)
+imagetype_TEXT_wavefield_dumps  = 1              # display 1=displ vector 2=veloc vector 3=accel vector 4=pressure
+####
+output_grid_gnuplot             = .false.        # generate a GNUPLOT file containing the grid, and a script to plot it
+output_grid_ASCII               = .false.        # dump the grid in an ASCII text file consisting of a set of X,Y,Z points or not
+output_energy                   = .false.        # compute and output total acoustic and elastic energy curves (slows down the code significantly)
 
 # velocity and density models
 nbmodels                        = 4              # nb of different models

Modified: seismo/2D/SPECFEM2D/trunk/src/meshfem2D/meshfem2D.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/meshfem2D/meshfem2D.F90	2012-06-04 22:14:05 UTC (rev 20306)
+++ seismo/2D/SPECFEM2D/trunk/src/meshfem2D/meshfem2D.F90	2012-06-04 23:45:24 UTC (rev 20307)
@@ -764,9 +764,7 @@
   ! ***
   ! *** create a Gnuplot file that displays the grid
   ! ***
-  if ( .not. read_external_mesh ) then
-    call save_gnuplot_file(ngnod,nx,nz,x,z)
-  endif
+  if (output_grid_gnuplot .and. .not. read_external_mesh) call save_gnuplot_file(ngnod,nx,nz,x,z)
 
 
   !*****************************

Modified: seismo/2D/SPECFEM2D/trunk/src/meshfem2D/read_parameter_file.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/meshfem2D/read_parameter_file.F90	2012-06-04 22:14:05 UTC (rev 20306)
+++ seismo/2D/SPECFEM2D/trunk/src/meshfem2D/read_parameter_file.F90	2012-06-04 23:45:24 UTC (rev 20307)
@@ -68,7 +68,8 @@
   integer :: nx,ngnod
 
   logical :: initialfield,add_Bielak_conditions,assign_external_model, &
-            READ_EXTERNAL_SEP_FILE,ATTENUATION_VISCOELASTIC_SOLID,ATTENUATION_PORO_FLUID_PART
+            READ_EXTERNAL_SEP_FILE,ATTENUATION_VISCOELASTIC_SOLID,ATTENUATION_PORO_FLUID_PART, &
+            save_ASCII_seismograms,save_binary_seismograms,DRAW_SOURCES_AND_RECEIVERS
 
   double precision :: Q0,freq0
 
@@ -97,14 +98,15 @@
   double precision, dimension(:), pointer :: xdeb,zdeb,xfin,zfin
   logical, dimension(:), pointer :: enreg_surf_same_vertical
 
-  integer :: NTSTEP_BETWEEN_OUTPUT_INFO
+  integer :: NSTEP_BETWEEN_OUTPUT_INFO,NSTEP_BETWEEN_OUTPUT_SEISMOS,NSTEP_BETWEEN_OUTPUT_IMAGES,NSTEP_BETWEEN_OUTPUT_TEXT_DUMPS, &
+             subsamp_seismos,imagetype_JPEG,imagetype_TEXT_wavefield_dumps
   logical :: output_postscript_snapshot,output_color_image
-  integer :: imagetype
+  integer :: imagetype_postscript
   double precision :: cutsnaps
   logical :: meshvect,modelvect,boundvect,interpol
   integer :: pointsdisp,subsamp_postscript
   double precision :: sizemax_arrows
-  logical :: gnuplot,output_grid,output_energy,output_wavefield_snapshot
+  logical :: output_grid_gnuplot,output_grid_ASCII,output_energy,output_TEXT_wavefield_dumps
   logical :: plot_lowerleft_corner_only
 
   ! to store density and velocity model
@@ -124,7 +126,7 @@
 ! display acoustic layers as constant blue, because they likely correspond to water in the case of ocean acoustics
 ! or in the case of offshore oil industry experiments.
 ! (if off, display them as greyscale, as for elastic or poroelastic elements)
-  logical :: DRAW_WATER_CONSTANT_BLUE_IN_JPG
+  logical :: DRAW_WATER_IN_BLUE
 
 ! US letter paper or European A4
   logical :: US_LETTER
@@ -218,7 +220,7 @@
 
   ! read viscous attenuation parameters (poroelastic media)
   call read_value_logical_p(ATTENUATION_PORO_FLUID_PART, 'solver.ATTENUATION_PORO_FLUID_PART')
-  if(err_occurred() /= 0) stop 'error reading parameter 12 in Par_file'
+  if(err_occurred() /= 0) stop 'error reading parameter 12a in Par_file'
 
   call read_value_double_precision_p(Q0, 'solver.Q0')
   if(err_occurred() /= 0) stop 'error reading parameter 13 in Par_file'
@@ -241,7 +243,7 @@
   if(err_occurred() /= 0) stop 'error reading parameter 17b in Par_file'
 
   call read_value_integer_p(time_stepping_scheme, 'solver.time_stepping_scheme')
-  if(err_occurred() /= 0) stop 'error reading parameter 17c in Par_file'        
+  if(err_occurred() /= 0) stop 'error reading parameter 17c in Par_file'
 
   ! read source infos
   call read_value_integer_p(NSOURCES, 'solver.NSOURCES')
@@ -261,6 +263,18 @@
   call read_value_integer_p(seismotype, 'solver.seismotype')
   if(err_occurred() /= 0) stop 'error reading parameter 22 in Par_file'
 
+  call read_value_integer_p(NSTEP_BETWEEN_OUTPUT_SEISMOS, 'solver.NSTEP_BETWEEN_OUTPUT_SEISMOS')
+  if(err_occurred() /= 0) stop 'error reading parameter 33b in Par_file'
+
+  call read_value_logical_p(save_ASCII_seismograms, 'solver.save_ASCII_seismograms')
+  if(err_occurred() /= 0) stop 'error reading parameter 12b in Par_file'
+
+  call read_value_logical_p(save_binary_seismograms, 'solver.save_binary_seismograms')
+  if(err_occurred() /= 0) stop 'error reading parameter 12c in Par_file'
+
+  call read_value_integer_p(subsamp_seismos, 'solver.subsamp_seismos')
+  if(err_occurred() /= 0) stop 'error reading parameter 33e in Par_file'
+
   call read_value_logical_p(generate_STATIONS, 'solver.generate_STATIONS')
   if(err_occurred() /= 0) stop 'error reading parameter 23 in Par_file'
 
@@ -313,16 +327,16 @@
   enddo
 
   ! read display parameters
-  call read_value_integer_p(NTSTEP_BETWEEN_OUTPUT_INFO, 'solver.NTSTEP_BETWEEN_OUTPUT_INFO')
-  if(err_occurred() /= 0) stop 'error reading parameter 33 in Par_file'
+  call read_value_integer_p(NSTEP_BETWEEN_OUTPUT_INFO, 'solver.NSTEP_BETWEEN_OUTPUT_INFO')
+  if(err_occurred() /= 0) stop 'error reading parameter 33a in Par_file'
 
+  call read_value_integer_p(NSTEP_BETWEEN_OUTPUT_IMAGES, 'solver.NSTEP_BETWEEN_OUTPUT_IMAGES')
+  if(err_occurred() /= 0) stop 'error reading parameter 33c in Par_file'
+
   call read_value_logical_p(output_postscript_snapshot, 'solver.output_postscript_snapshot')
   if(err_occurred() /= 0) stop 'error reading parameter 34 in Par_file'
 
-  call read_value_logical_p(output_color_image, 'solver.output_color_image')
-  if(err_occurred() /= 0) stop 'error reading parameter 35 in Par_file'
-
-  call read_value_integer_p(imagetype, 'solver.imagetype')
+  call read_value_integer_p(imagetype_postscript, 'solver.imagetype_postscript')
   if(err_occurred() /= 0) stop 'error reading parameter 36 in Par_file'
 
   call read_value_double_precision_p(cutsnaps, 'solver.cutsnaps')
@@ -346,36 +360,51 @@
   call read_value_integer_p(subsamp_postscript, 'solver.subsamp_postscript')
   if(err_occurred() /= 0) stop 'error reading parameter 43a in Par_file'
 
+  call read_value_double_precision_p(sizemax_arrows, 'solver.sizemax_arrows')
+  if(err_occurred() /= 0) stop 'error reading parameter 44a in Par_file'
+
+  call read_value_logical_p(US_LETTER, 'solver.US_LETTER')
+  if(err_occurred() /= 0) stop 'error reading parameter 44b in Par_file'
+
+  call read_value_logical_p(output_color_image, 'solver.output_color_image')
+  if(err_occurred() /= 0) stop 'error reading parameter 35 in Par_file'
+
+  call read_value_integer_p(imagetype_JPEG, 'solver.imagetype_JPEG')
+  if(err_occurred() /= 0) stop 'error reading parameter 33f in Par_file'
+
   call read_value_integer_p(factor_subsample_image, 'solver.factor_subsample_image')
   if(err_occurred() /= 0) stop 'error reading parameter 43b in Par_file'
 
   call read_value_double_precision_p(POWER_DISPLAY_COLOR, 'solver.POWER_DISPLAY_COLOR')
   if(err_occurred() /= 0) stop 'error reading parameter 43c in Par_file'
 
-  call read_value_logical_p(DRAW_WATER_CONSTANT_BLUE_IN_JPG, 'solver.DRAW_WATER_CONSTANT_BLUE_IN_JPG')
+  call read_value_logical_p(DRAW_SOURCES_AND_RECEIVERS, 'solver.DRAW_SOURCES_AND_RECEIVERS')
+  if(err_occurred() /= 0) stop 'error reading parameter 12d in Par_file'
+
+  call read_value_logical_p(DRAW_WATER_IN_BLUE, 'solver.DRAW_WATER_IN_BLUE')
   if(err_occurred() /= 0) stop 'error reading parameter 43d in Par_file'
 
-  call read_value_double_precision_p(sizemax_arrows, 'solver.sizemax_arrows')
-  if(err_occurred() /= 0) stop 'error reading parameter 44a in Par_file'
-
-  call read_value_logical_p(US_LETTER, 'solver.US_LETTER')
-  if(err_occurred() /= 0) stop 'error reading parameter 44b in Par_file'
-
   call read_value_logical_p(USE_SNAPSHOT_NUMBER_IN_FILENAME, 'solver.USE_SNAPSHOT_NUMBER_IN_FILENAME')
   if(err_occurred() /= 0) stop 'error reading parameter 44c in Par_file'
 
-  call read_value_logical_p(gnuplot, 'solver.gnuplot')
+  call read_value_integer_p(NSTEP_BETWEEN_OUTPUT_TEXT_DUMPS, 'solver.NSTEP_BETWEEN_OUTPUT_TEXT_DUMPS')
+  if(err_occurred() /= 0) stop 'error reading parameter 33d in Par_file'
+
+  call read_value_logical_p(output_TEXT_wavefield_dumps, 'solver.output_TEXT_wavefield_dumps')
+  if(err_occurred() /= 0) stop 'error reading parameter 48 in Par_file'
+
+  call read_value_integer_p(imagetype_TEXT_wavefield_dumps, 'solver.imagetype_TEXT_wavefield_dumps')
+  if(err_occurred() /= 0) stop 'error reading parameter 33g in Par_file'
+
+  call read_value_logical_p(output_grid_gnuplot, 'solver.output_grid_gnuplot')
   if(err_occurred() /= 0) stop 'error reading parameter 45 in Par_file'
 
-  call read_value_logical_p(output_grid, 'solver.output_grid')
+  call read_value_logical_p(output_grid_ASCII, 'solver.output_grid_ASCII')
   if(err_occurred() /= 0) stop 'error reading parameter 46 in Par_file'
 
   call read_value_logical_p(output_energy, 'solver.output_energy')
   if(err_occurred() /= 0) stop 'error reading parameter 47 in Par_file'
 
-  call read_value_logical_p(output_wavefield_snapshot, 'solver.output_wavefield_snapshot')
-  if(err_occurred() /= 0) stop 'error reading parameter 48 in Par_file'
-
   ! read the different material materials
   call read_value_integer_p(nb_materials, 'mesher.nbmodels')
   if(err_occurred() /= 0) stop 'error reading parameter 49 in Par_file'

Modified: seismo/2D/SPECFEM2D/trunk/src/meshfem2D/save_databases.f90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/meshfem2D/save_databases.f90	2012-06-04 22:14:05 UTC (rev 20306)
+++ seismo/2D/SPECFEM2D/trunk/src/meshfem2D/save_databases.f90	2012-06-04 23:45:24 UTC (rev 20307)
@@ -103,12 +103,24 @@
     write(15,*) 'npgeo nproc'
     write(15,*) npgeo,nproc
 
-    write(15,*) 'gnuplot interpol'
-    write(15,*) gnuplot,interpol
+    write(15,*) 'output_grid_gnuplot interpol'
+    write(15,*) output_grid_gnuplot,interpol
 
-    write(15,*) 'NTSTEP_BETWEEN_OUTPUT_INFO'
-    write(15,*) NTSTEP_BETWEEN_OUTPUT_INFO
+    write(15,*) 'NSTEP_BETWEEN_OUTPUT_INFO'
+    write(15,*) NSTEP_BETWEEN_OUTPUT_INFO
 
+    write(15,*) 'NSTEP_BETWEEN_OUTPUT_SEISMOS'
+    write(15,*) NSTEP_BETWEEN_OUTPUT_SEISMOS
+
+    write(15,*) 'NSTEP_BETWEEN_OUTPUT_IMAGES'
+    write(15,*) NSTEP_BETWEEN_OUTPUT_IMAGES
+
+    write(15,*) 'NSTEP_BETWEEN_OUTPUT_TEXT_DUMPS'
+    write(15,*) NSTEP_BETWEEN_OUTPUT_TEXT_DUMPS
+
+    write(15,*) 'subsamp_seismos imagetype_JPEG imagetype_TEXT_wavefield_dumps'
+    write(15,*) subsamp_seismos,imagetype_JPEG,imagetype_TEXT_wavefield_dumps
+
     write(15,*) 'output_postscript_snapshot output_color_image colors numbers'
     write(15,*) output_postscript_snapshot,output_color_image,' 1 0'
 
@@ -121,18 +133,21 @@
     write(15,*) 'initialfield add_Bielak_conditions'
     write(15,*) initialfield,add_Bielak_conditions
 
-    write(15,*) 'seismotype imagetype'
-    write(15,*) seismotype,imagetype
+    write(15,*) 'seismotype imagetype_postscript'
+    write(15,*) seismotype,imagetype_postscript
 
     write(15,*) 'assign_external_model READ_EXTERNAL_SEP_FILE'
     write(15,*) assign_external_model,READ_EXTERNAL_SEP_FILE
 
-    write(15,*) 'output_grid output_energy output_wavefield_snapshot'
-    write(15,*) output_grid,output_energy,output_wavefield_snapshot
+    write(15,*) 'output_grid_ASCII output_energy output_TEXT_wavefield_dumps'
+    write(15,*) output_grid_ASCII,output_energy,output_TEXT_wavefield_dumps
 
     write(15,*) 'ATTENUATION_VISCOELASTIC_SOLID ATTENUATION_PORO_FLUID_PART'
     write(15,*) ATTENUATION_VISCOELASTIC_SOLID,ATTENUATION_PORO_FLUID_PART
 
+    write(15,*) 'save_ASCII_seismograms save_binary_seismograms DRAW_SOURCES_AND_RECEIVERS'
+    write(15,*) save_ASCII_seismograms,save_binary_seismograms,DRAW_SOURCES_AND_RECEIVERS
+
     write(15,*) 'Q0 freq0'
     write(15,*) Q0,freq0
 
@@ -145,8 +160,8 @@
     write(15,*) 'USE_SNAPSHOT_NUMBER_IN_FILENAME'
     write(15,*) USE_SNAPSHOT_NUMBER_IN_FILENAME
 
-    write(15,*) 'DRAW_WATER_CONSTANT_BLUE_IN_JPG'
-    write(15,*) DRAW_WATER_CONSTANT_BLUE_IN_JPG
+    write(15,*) 'DRAW_WATER_IN_BLUE'
+    write(15,*) DRAW_WATER_IN_BLUE
 
     write(15,*) 'US_LETTER'
     write(15,*) US_LETTER

Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/gmat01.f90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/gmat01.f90	2012-06-04 22:14:05 UTC (rev 20306)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/gmat01.f90	2012-06-04 23:45:24 UTC (rev 20307)
@@ -304,7 +304,7 @@
              write(IOUT,*) 'see e.g. R. Lakes, "Science" vol. 235, p. 1038-1040 (1987),'
              write(IOUT,*) 'but are extremely rare.'
              write(IOUT,*) 'Hope you know what you are doing...'
-             write(IOUT,*) 
+             write(IOUT,*)
            endif
            write(iout,700) density(2),kappa_f,eta_f
            write(iout,800) lambda_fr,mu_fr,kappa_fr,porosity_array(n),tortuosity_array(n),&

Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/invert_mass_matrix.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/invert_mass_matrix.F90	2012-06-04 22:14:05 UTC (rev 20306)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/invert_mass_matrix.F90	2012-06-04 23:45:24 UTC (rev 20307)
@@ -186,7 +186,7 @@
   endif
 #endif
           rmass_inverse_elastic_three(iglob) = rmass_inverse_elastic_one(iglob)
- 
+
         else
 
           ! for acoustic medium

Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/plotpost.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/plotpost.F90	2012-06-04 22:14:05 UTC (rev 20306)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/plotpost.F90	2012-06-04 23:45:24 UTC (rev 20307)
@@ -47,7 +47,7 @@
           poroelastcoef,knods,kmato,ibool, &
           numabs,codeabs,anyabs,nelem_acoustic_surface, acoustic_edges, &
           simulation_title,nglob,npgeo,vpmin,vpmax,nrec,NSOURCES, &
-          colors,numbers,subsamp_postscript,imagetype,interpol,meshvect,modelvect, &
+          colors,numbers,subsamp_postscript,imagetype_postscript,interpol,meshvect,modelvect, &
           boundvect,assign_external_model,cutsnaps,sizemax_arrows,nelemabs,numat,pointsdisp, &
           nspec,ngnod,coupled_acoustic_elastic,coupled_acoustic_poro,coupled_elastic_poro, &
           any_acoustic,any_poroelastic,plot_lowerleft_corner_only, &
@@ -149,7 +149,7 @@
   integer k,j,ispec,material,is,ir,imat,icol,l,line_length
   integer index_char,ii,ipoin,in,nnum,inum,ideb,ifin,iedge
 
-  integer colors,numbers,subsamp_postscript,imagetype
+  integer colors,numbers,subsamp_postscript,imagetype_postscript
   logical interpol,meshvect,modelvect,boundvect,assign_external_model
   double precision cutsnaps,sizemax_arrows
 
@@ -1600,11 +1600,11 @@
   write(24,*) '24.35 CM 18.9 CM MV'
   write(24,*) usoffset,' CM 2 div neg 0 MR'
   write(24,*) 'currentpoint gsave translate -90 rotate 0 0 moveto'
-  if(imagetype == 1) then
+  if(imagetype_postscript == 1) then
     write(24,*) '(Displacement vector field) show'
-  else if(imagetype == 2) then
+  else if(imagetype_postscript == 2) then
     write(24,*) '(Velocity vector field) show'
-  else if(imagetype == 3) then
+  else if(imagetype_postscript == 3) then
     write(24,*) '(Acceleration vector field) show'
   else
     call exit_MPI('Bad field code in PostScript display')

Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/prepare_color_image.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/prepare_color_image.F90	2012-06-04 22:14:05 UTC (rev 20306)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/prepare_color_image.F90	2012-06-04 23:45:24 UTC (rev 20307)
@@ -244,7 +244,7 @@
                             NX_IMAGE_color,NZ_IMAGE_color,nb_pixel_loc, &
                             num_pixel_loc,nspec,elastic,poroelastic,ibool,kmato, &
                             numat,density,poroelastcoef,porosity,tortuosity, &
-                            nproc,myrank,assign_external_model,vpext,DRAW_WATER_CONSTANT_BLUE_IN_JPG)
+                            nproc,myrank,assign_external_model,vpext,DRAW_WATER_IN_BLUE)
 
 ! stores P-velocity model in image_color_vp_display
 
@@ -278,7 +278,7 @@
 ! display acoustic layers as constant blue, because they likely correspond to water in the case of ocean acoustics
 ! or in the case of offshore oil industry experiments.
 ! (if off, display them as greyscale, as for elastic or poroelastic elements)
-  logical :: DRAW_WATER_CONSTANT_BLUE_IN_JPG
+  logical :: DRAW_WATER_IN_BLUE
 
   ! local parameters
   double precision, dimension(:), allocatable :: vp_display
@@ -371,11 +371,11 @@
 
 ! now display acoustic layers as constant blue, because they likely correspond to water in the case of ocean acoustics
 ! or in the case of offshore oil industry experiments.
-! (simply turn DRAW_WATER_CONSTANT_BLUE_IN_JPG off in setup/constants.h if you want to suppress this (for instance when running
+! (simply turn DRAW_WATER_IN_BLUE off in DATA/Par_file if you want to suppress this (for instance when running
 !  a purely acoustic simulation with different acoustic media for the oil industry, one then wants to see the different
 !  acoustic wave speeds displayed as a grey scale).
 ! For now, in this routine, use -1 as a flag to label such acoustic points
-    if(DRAW_WATER_CONSTANT_BLUE_IN_JPG .and. .not. elastic(ispec) .and. .not. poroelastic(ispec)) then
+    if(DRAW_WATER_IN_BLUE .and. .not. elastic(ispec) .and. .not. poroelastic(ispec)) then
       do j = 1,NGLLZ
         do i = 1,NGLLX
           vp_display(ibool(i,j,ispec)) = -1

Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/read_databases.f90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/read_databases.f90	2012-06-04 22:14:05 UTC (rev 20306)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/read_databases.f90	2012-06-04 23:45:24 UTC (rev 20307)
@@ -43,18 +43,18 @@
 !
 !========================================================================
 
-
   subroutine read_databases_init(myrank,ipass, &
                   simulation_title,SIMULATION_TYPE,NOISE_TOMOGRAPHY,SAVE_FORWARD,npgeo,nproc, &
-                  gnuplot,interpol,NTSTEP_BETWEEN_OUTPUT_INFO, &
+                  output_grid_gnuplot,interpol,NSTEP_BETWEEN_OUTPUT_INFO,NSTEP_BETWEEN_OUTPUT_SEISMOS,NSTEP_BETWEEN_OUTPUT_IMAGES, &
+                  NSTEP_BETWEEN_OUTPUT_TEXT_DUMPS,subsamp_seismos,imagetype_JPEG,imagetype_TEXT_wavefield_dumps, &
                   output_postscript_snapshot,output_color_image,colors,numbers, &
                   meshvect,modelvect,boundvect,cutsnaps,subsamp_postscript,sizemax_arrows, &
                   anglerec,initialfield,add_Bielak_conditions, &
-                  seismotype,imagetype,assign_external_model,READ_EXTERNAL_SEP_FILE, &
-                  output_grid,output_energy,output_wavefield_snapshot,ATTENUATION_VISCOELASTIC_SOLID, &
-                  ATTENUATION_PORO_FLUID_PART,Q0,freq0,p_sv, &
-                  NSTEP,deltat,NTSTEP_BETWEEN_OUTPUT_SEISMO,NSOURCES, &
-                  factor_subsample_image,USE_SNAPSHOT_NUMBER_IN_FILENAME,DRAW_WATER_CONSTANT_BLUE_IN_JPG,US_LETTER, &
+                  seismotype,imagetype_postscript,assign_external_model,READ_EXTERNAL_SEP_FILE, &
+                  output_grid_ASCII,output_energy,output_TEXT_wavefield_dumps,ATTENUATION_VISCOELASTIC_SOLID, &
+                  ATTENUATION_PORO_FLUID_PART,save_ASCII_seismograms,save_binary_seismograms, &
+                  DRAW_SOURCES_AND_RECEIVERS,Q0,freq0,p_sv,NSTEP,deltat,NSOURCES, &
+                  factor_subsample_image,USE_SNAPSHOT_NUMBER_IN_FILENAME,DRAW_WATER_IN_BLUE,US_LETTER, &
                   POWER_DISPLAY_COLOR,PERFORM_CUTHILL_MCKEE,SU_FORMAT,USER_T0,time_stepping_scheme,&
                   ADD_SPRING_TO_STACEY,ADD_PERIODIC_CONDITIONS,PERIODIC_horiz_dist,PERIODIC_DETECT_TOL)
 
@@ -66,20 +66,22 @@
   integer :: myrank,ipass
   character(len=60) simulation_title
   integer :: SIMULATION_TYPE,NOISE_TOMOGRAPHY,npgeo,nproc
-  integer :: colors,numbers,subsamp_postscript,seismotype,imagetype
-  logical :: SAVE_FORWARD,gnuplot,interpol,output_postscript_snapshot, &
+  integer :: colors,numbers,subsamp_postscript,seismotype,imagetype_postscript
+  logical :: SAVE_FORWARD,output_grid_gnuplot,interpol,output_postscript_snapshot, &
     output_color_image
   logical :: meshvect,modelvect,boundvect,initialfield,add_Bielak_conditions, &
     assign_external_model,READ_EXTERNAL_SEP_FILE, &
-    output_grid,output_energy,output_wavefield_snapshot,p_sv
-  logical :: ATTENUATION_VISCOELASTIC_SOLID,ATTENUATION_PORO_FLUID_PART
+    output_grid_ASCII,output_energy,output_TEXT_wavefield_dumps,p_sv
+  logical :: ATTENUATION_VISCOELASTIC_SOLID,ATTENUATION_PORO_FLUID_PART, &
+             save_ASCII_seismograms,save_binary_seismograms,DRAW_SOURCES_AND_RECEIVERS
 
   double precision :: cutsnaps,sizemax_arrows,anglerec
   double precision :: Q0,freq0
   double precision :: deltat
 
   integer :: NSTEP,NSOURCES
-  integer :: NTSTEP_BETWEEN_OUTPUT_INFO,NTSTEP_BETWEEN_OUTPUT_SEISMO
+  integer :: NSTEP_BETWEEN_OUTPUT_INFO,NSTEP_BETWEEN_OUTPUT_SEISMOS,NSTEP_BETWEEN_OUTPUT_IMAGES,NSTEP_BETWEEN_OUTPUT_TEXT_DUMPS, &
+             subsamp_seismos,imagetype_JPEG,imagetype_TEXT_wavefield_dumps
 
 ! factor to subsample color images output by the code (useful for very large models)
   integer :: factor_subsample_image
@@ -90,7 +92,7 @@
 ! display acoustic layers as constant blue, because they likely correspond to water in the case of ocean acoustics
 ! or in the case of offshore oil industry experiments.
 ! (if off, display them as greyscale, as for elastic or poroelastic elements)
-  logical :: DRAW_WATER_CONSTANT_BLUE_IN_JPG
+  logical :: DRAW_WATER_IN_BLUE
 
 ! US letter paper or European A4
   logical :: US_LETTER
@@ -165,12 +167,24 @@
   read(IIN,*) npgeo,nproc
 
   read(IIN,"(a80)") datlin
-  read(IIN,*) gnuplot,interpol
+  read(IIN,*) output_grid_gnuplot,interpol
 
   read(IIN,"(a80)") datlin
-  read(IIN,*) NTSTEP_BETWEEN_OUTPUT_INFO
+  read(IIN,*) NSTEP_BETWEEN_OUTPUT_INFO
 
   read(IIN,"(a80)") datlin
+  read(IIN,*) NSTEP_BETWEEN_OUTPUT_SEISMOS
+
+  read(IIN,"(a80)") datlin
+  read(IIN,*) NSTEP_BETWEEN_OUTPUT_IMAGES
+
+  read(IIN,"(a80)") datlin
+  read(IIN,*) NSTEP_BETWEEN_OUTPUT_TEXT_DUMPS
+
+  read(IIN,"(a80)") datlin
+  read(IIN,*) subsamp_seismos,imagetype_JPEG,imagetype_TEXT_wavefield_dumps
+
+  read(IIN,"(a80)") datlin
   read(IIN,*) output_postscript_snapshot,output_color_image,colors,numbers
 
   read(IIN,"(a80)") datlin
@@ -186,9 +200,9 @@
     stop 'need to have an initial field to add Bielak plane wave conditions'
 
   read(IIN,"(a80)") datlin
-  read(IIN,*) seismotype,imagetype
+  read(IIN,*) seismotype,imagetype_postscript
   if(seismotype < 1 .or. seismotype > 6) call exit_MPI('Wrong type for seismogram output')
-  if(imagetype < 1 .or. imagetype > 4) call exit_MPI('Wrong type for snapshots')
+  if(imagetype_postscript < 1 .or. imagetype_postscript > 4) call exit_MPI('Wrong type for PostScript snapshots')
 
   if(SAVE_FORWARD .and. (seismotype /= 1 .and. seismotype /= 6)) then
     print*, '***** WARNING *****'
@@ -202,12 +216,15 @@
   read(IIN,*) assign_external_model,READ_EXTERNAL_SEP_FILE
 
   read(IIN,"(a80)") datlin
-  read(IIN,*) output_grid,output_energy,output_wavefield_snapshot
+  read(IIN,*) output_grid_ASCII,output_energy,output_TEXT_wavefield_dumps
 
   read(IIN,"(a80)") datlin
   read(IIN,*) ATTENUATION_VISCOELASTIC_SOLID,ATTENUATION_PORO_FLUID_PART
 
   read(IIN,"(a80)") datlin
+  read(IIN,*) save_ASCII_seismograms,save_binary_seismograms,DRAW_SOURCES_AND_RECEIVERS
+
+  read(IIN,"(a80)") datlin
   read(IIN,*) Q0,freq0
 
   read(IIN,"(a80)") datlin
@@ -220,7 +237,7 @@
   read(IIN,*) USE_SNAPSHOT_NUMBER_IN_FILENAME
 
   read(IIN,"(a80)") datlin
-  read(IIN,*) DRAW_WATER_CONSTANT_BLUE_IN_JPG
+  read(IIN,*) DRAW_WATER_IN_BLUE
 
   read(IIN,"(a80)") datlin
   read(IIN,*) US_LETTER
@@ -255,12 +272,12 @@
   !---- check parameters read
   if (myrank == 0 .and. ipass == 1) then
     write(IOUT,200) npgeo,NDIM
-    write(IOUT,600) NTSTEP_BETWEEN_OUTPUT_INFO,colors,numbers
+    write(IOUT,600) NSTEP_BETWEEN_OUTPUT_INFO,colors,numbers
     write(IOUT,700) seismotype,anglerec
     write(IOUT,750) initialfield,add_Bielak_conditions,assign_external_model,&
                     READ_EXTERNAL_SEP_FILE,ATTENUATION_VISCOELASTIC_SOLID, &
-                    output_grid,output_energy
-    write(IOUT,800) imagetype,100.d0*cutsnaps,subsamp_postscript
+                    output_grid_ASCII,output_energy
+    write(IOUT,800) imagetype_postscript,100.d0*cutsnaps,subsamp_postscript
   endif
 
   !---- read time step
@@ -275,7 +292,8 @@
     stop
   endif
 
-  NTSTEP_BETWEEN_OUTPUT_SEISMO = min(NSTEP,NTSTEP_BETWEEN_OUTPUT_INFO)
+! output seismograms at least once at the end of the simulation
+  NSTEP_BETWEEN_OUTPUT_SEISMOS = min(NSTEP,NSTEP_BETWEEN_OUTPUT_SEISMOS)
 
   !----  read source information
   read(IIN,"(a80)") datlin
@@ -289,7 +307,7 @@
   'Number of space dimensions. . . . . . . . . . (NDIM) =',i8)
 
 600 format(//1x,'C o n t r o l',/1x,13('='),//5x, &
-  'Display frequency . . . (NTSTEP_BETWEEN_OUTPUT_INFO) = ',i6/ 5x, &
+  'Display frequency . . . .(NSTEP_BETWEEN_OUTPUT_INFO) = ',i6/ 5x, &
   'Color display . . . . . . . . . . . . . . . (colors) = ',i6/ 5x, &
   '        ==  0     black and white display              ',  / 5x, &
   '        ==  1     color display                        ',  /5x, &
@@ -307,11 +325,11 @@
   'Assign external model . . . .(assign_external_model) = ',l6/5x, &
   'Read external SEP file . . .(READ_EXTERNAL_SEP_FILE) = ',l6/5x, &
   'Attenuation on/off .(ATTENUATION_VISCOELASTIC_SOLID) = ',l6/5x, &
-  'Save grid in external file or not. . . (output_grid) = ',l6/5x, &
+  'Save grid in ASCII file or not . (output_grid_ASCII) = ',l6/5x, &
   'Save a file with total energy or not.(output_energy) = ',l6)
 
 800 format(//1x,'C o n t r o l',/1x,13('='),//5x, &
-  'Vector display type . . . . . . . . . . . . . . (imagetype) = ',i6/5x, &
+  'Vector display type . . . . . . . . .(imagetype_postscript) = ',i6/5x, &
   'Percentage of cut for vector plots. . . . . . . .(cutsnaps) = ',f6.2/5x, &
   'Subsampling of velocity model display. (subsamp_postscript) = ',i6)
 

Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/specfem2D.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/specfem2D.F90	2012-06-04 22:14:05 UTC (rev 20306)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/specfem2D.F90	2012-06-04 23:45:24 UTC (rev 20307)
@@ -355,8 +355,9 @@
 
 ! display acoustic layers as constant blue, because they likely correspond to water in the case of ocean acoustics
 ! or in the case of offshore oil industry experiments.
-! (if off, display them as greyscale, as for elastic or poroelastic elements)
-  logical :: DRAW_WATER_CONSTANT_BLUE_IN_JPG
+! (if off, display them as greyscale, as for elastic or poroelastic elements,
+!  for instance for acoustic-only oil industry models of solid media)
+  logical :: DRAW_WATER_IN_BLUE
 
 ! US letter paper or European A4
   logical :: US_LETTER
@@ -406,8 +407,8 @@
   logical :: anyabs
   double precision :: dxd,dyd,dzd,dcurld,valux,valuy,valuz,valcurl,hlagrange,rhol,xi,gamma,x,z
 
-!! DK DK Dec 2011: add a crack manually
-  logical, parameter :: ADD_A_CRACK = .false.
+!! DK DK Dec 2011: add a small crack (discontinuity) in the medium manually
+  logical, parameter :: ADD_A_SMALL_CRACK_IN_THE_MEDIUM = .false.
 !! must be set equal to the number of spectral elements on one vertical side of the crack
   integer :: NB_POINTS_TO_ADD_TO_NPGEO = 3
   integer :: check_nb_points_to_add_to_npgeo,current_last_point,npgeo_ori,original_value,ignod
@@ -519,15 +520,16 @@
 
   double precision :: vpImin,vpImax,vpIImin,vpIImax
 
-  integer :: colors,numbers,subsamp_postscript,imagetype, &
-    NTSTEP_BETWEEN_OUTPUT_INFO,NTSTEP_BETWEEN_OUTPUT_SEISMO,seismotype
+  integer :: colors,numbers,subsamp_postscript,imagetype_postscript, &
+    NSTEP_BETWEEN_OUTPUT_INFO,seismotype,NSTEP_BETWEEN_OUTPUT_SEISMOS,NSTEP_BETWEEN_OUTPUT_IMAGES, &
+    NSTEP_BETWEEN_OUTPUT_TEXT_DUMPS,subsamp_seismos,imagetype_JPEG,imagetype_TEXT_wavefield_dumps
   integer :: numat,ngnod,nspec,pointsdisp, &
     nelemabs,nelem_acoustic_surface,ispecabs,UPPER_LIMIT_DISPLAY
 
   logical interpol,meshvect,modelvect,boundvect,assign_external_model,initialfield, &
-    output_grid,gnuplot,ATTENUATION_VISCOELASTIC_SOLID,output_postscript_snapshot,output_color_image, &
+    output_grid_ASCII,output_grid_gnuplot,ATTENUATION_VISCOELASTIC_SOLID,output_postscript_snapshot,output_color_image, &
     plot_lowerleft_corner_only,add_Bielak_conditions,output_energy,READ_EXTERNAL_SEP_FILE, &
-    output_wavefield_snapshot
+    output_TEXT_wavefield_dumps
 
   double precision :: cutsnaps,sizemax_arrows,anglerec,xirec,gammarec
 
@@ -573,7 +575,7 @@
   double precision :: theta_e,theta_s
   double precision :: Q0,freq0
   double precision :: alphaval,betaval,gammaval,thetainv
-  logical :: ATTENUATION_PORO_FLUID_PART
+  logical :: ATTENUATION_PORO_FLUID_PART,save_ASCII_seismograms,save_binary_seismograms,DRAW_SOURCES_AND_RECEIVERS
   double precision, dimension(NGLLX,NGLLZ) :: viscox_loc,viscoz_loc
   double precision :: Sn,Snp1,etal_f
   double precision, dimension(3):: bl_unrelaxed_elastic
@@ -963,24 +965,26 @@
   ipass = 1
   call read_databases_init(myrank,ipass, &
                   simulation_title,SIMULATION_TYPE,NOISE_TOMOGRAPHY,SAVE_FORWARD,npgeo,nproc_read_from_database, &
-                  gnuplot,interpol,NTSTEP_BETWEEN_OUTPUT_INFO, &
+                  output_grid_gnuplot,interpol,NSTEP_BETWEEN_OUTPUT_INFO,NSTEP_BETWEEN_OUTPUT_SEISMOS, &
+                  NSTEP_BETWEEN_OUTPUT_IMAGES,NSTEP_BETWEEN_OUTPUT_TEXT_DUMPS,subsamp_seismos, &
+                  imagetype_JPEG,imagetype_TEXT_wavefield_dumps, &
                   output_postscript_snapshot,output_color_image,colors,numbers, &
                   meshvect,modelvect,boundvect,cutsnaps,subsamp_postscript,sizemax_arrows, &
                   anglerec,initialfield,add_Bielak_conditions, &
-                  seismotype,imagetype,assign_external_model,READ_EXTERNAL_SEP_FILE, &
-                  output_grid,output_energy,output_wavefield_snapshot,ATTENUATION_VISCOELASTIC_SOLID, &
-                  ATTENUATION_PORO_FLUID_PART,Q0,freq0,p_sv, &
-                  NSTEP,deltat,NTSTEP_BETWEEN_OUTPUT_SEISMO,NSOURCES, &
-                  factor_subsample_image,USE_SNAPSHOT_NUMBER_IN_FILENAME,DRAW_WATER_CONSTANT_BLUE_IN_JPG,US_LETTER, &
+                  seismotype,imagetype_postscript,assign_external_model,READ_EXTERNAL_SEP_FILE, &
+                  output_grid_ASCII,output_energy,output_TEXT_wavefield_dumps,ATTENUATION_VISCOELASTIC_SOLID, &
+                  ATTENUATION_PORO_FLUID_PART,save_ASCII_seismograms,save_binary_seismograms,DRAW_SOURCES_AND_RECEIVERS, &
+                  Q0,freq0,p_sv,NSTEP,deltat,NSOURCES, &
+                  factor_subsample_image,USE_SNAPSHOT_NUMBER_IN_FILENAME,DRAW_WATER_IN_BLUE,US_LETTER, &
                   POWER_DISPLAY_COLOR,PERFORM_CUTHILL_MCKEE,SU_FORMAT,USER_T0, time_stepping_scheme, &
                   ADD_SPRING_TO_STACEY,ADD_PERIODIC_CONDITIONS,PERIODIC_horiz_dist,PERIODIC_DETECT_TOL)
   if(nproc_read_from_database < 1) stop 'should have nproc_read_from_database >= 1'
   if(SIMULATION_TYPE == 2 .and.(time_stepping_scheme == 2 .or. time_stepping_scheme == 3)) &
                                   stop 'RK and LDDRK time scheme not supported for adjoint inversion'
   if(nproc /= nproc_read_from_database) stop 'must always have nproc == nproc_read_from_database'
-!! DK DK Dec 2011: add a crack manually
+!! DK DK Dec 2011: add a small crack (discontinuity) in the medium manually
   npgeo_ori = npgeo
-  if(ADD_A_CRACK) npgeo = npgeo + NB_POINTS_TO_ADD_TO_NPGEO
+  if(ADD_A_SMALL_CRACK_IN_THE_MEDIUM) npgeo = npgeo + NB_POINTS_TO_ADD_TO_NPGEO
 
 #ifndef USE_MPI
   if(PERFORM_CUTHILL_MCKEE) then
@@ -997,15 +1001,17 @@
     if(ipass > 1) &
        call read_databases_init(myrank,ipass, &
                       simulation_title,SIMULATION_TYPE,NOISE_TOMOGRAPHY,SAVE_FORWARD,npgeo,nproc_read_from_database, &
-                      gnuplot,interpol,NTSTEP_BETWEEN_OUTPUT_INFO, &
+                      output_grid_gnuplot,interpol,NSTEP_BETWEEN_OUTPUT_INFO,NSTEP_BETWEEN_OUTPUT_SEISMOS, &
+                      NSTEP_BETWEEN_OUTPUT_IMAGES,NSTEP_BETWEEN_OUTPUT_TEXT_DUMPS,subsamp_seismos, &
+                      imagetype_JPEG,imagetype_TEXT_wavefield_dumps, &
                       output_postscript_snapshot,output_color_image,colors,numbers, &
                       meshvect,modelvect,boundvect,cutsnaps,subsamp_postscript,sizemax_arrows, &
                       anglerec,initialfield,add_Bielak_conditions, &
-                      seismotype,imagetype,assign_external_model,READ_EXTERNAL_SEP_FILE, &
-                      output_grid,output_energy,output_wavefield_snapshot,ATTENUATION_VISCOELASTIC_SOLID, &
-                      ATTENUATION_PORO_FLUID_PART,Q0,freq0,p_sv, &
-                      NSTEP,deltat,NTSTEP_BETWEEN_OUTPUT_SEISMO,NSOURCES, &
-                      factor_subsample_image,USE_SNAPSHOT_NUMBER_IN_FILENAME,DRAW_WATER_CONSTANT_BLUE_IN_JPG,US_LETTER, &
+                      seismotype,imagetype_postscript,assign_external_model,READ_EXTERNAL_SEP_FILE, &
+                      output_grid_ASCII,output_energy,output_TEXT_wavefield_dumps,ATTENUATION_VISCOELASTIC_SOLID, &
+                      ATTENUATION_PORO_FLUID_PART,save_ASCII_seismograms,save_binary_seismograms,DRAW_SOURCES_AND_RECEIVERS, &
+                      Q0,freq0,p_sv,NSTEP,deltat,NSOURCES, &
+                      factor_subsample_image,USE_SNAPSHOT_NUMBER_IN_FILENAME,DRAW_WATER_IN_BLUE,US_LETTER, &
                       POWER_DISPLAY_COLOR,PERFORM_CUTHILL_MCKEE,SU_FORMAT,USER_T0, time_stepping_scheme, &
                       ADD_SPRING_TO_STACEY,ADD_PERIODIC_CONDITIONS,PERIODIC_horiz_dist,PERIODIC_DETECT_TOL)
 
@@ -1141,8 +1147,8 @@
   call read_databases_mato(ipass,nspec,ngnod,kmato,knods, &
                                 perm,antecedent_list)
 
-!! DK DK Dec 2011: handle a crack added manually
-  if(ADD_A_CRACK) then
+!! DK DK Dec 2011: add a small crack (discontinuity) in the medium manually
+  if(ADD_A_SMALL_CRACK_IN_THE_MEDIUM) then
 
 #ifdef USE_MPI
   stop 'currently only serial runs are handled when adding a crack manually'
@@ -1223,7 +1229,7 @@
     stop 'did not find the right total number of points, should have current_last_point == npgeo_new'
   endif
 
-  endif ! of if(ADD_A_CRACK) then
+  endif ! of if(ADD_A_SMALL_CRACK_IN_THE_MEDIUM) then
 
 !-------------------------------------------------------------------------------
 !----  determine if each spectral element is elastic, poroelastic, or acoustic
@@ -1962,11 +1968,11 @@
 !
 !--- save the grid of points in a file
 !
-  if(output_grid .and. myrank == 0 .and. ipass == 1) then
+  if(output_grid_ASCII .and. myrank == 0 .and. ipass == 1) then
      write(IOUT,*)
-     write(IOUT,*) 'Saving the grid in a text file...'
+     write(IOUT,*) 'Saving the grid in an ASCII text file...'
      write(IOUT,*)
-     open(unit=55,file='OUTPUT_FILES/grid_points_and_model.txt',status='unknown')
+     open(unit=55,file='OUTPUT_FILES/ASCII_dump_of_grid_points.txt',status='unknown')
      write(55,*) nglob
      do n = 1,nglob
         write(55,*) (coord(i,n), i=1,NDIM)
@@ -1977,7 +1983,7 @@
 !
 !-----   plot the GLL mesh in a Gnuplot file
 !
-  if(gnuplot .and. myrank == 0 .and. ipass == 1)  &
+  if(output_grid_gnuplot .and. myrank == 0 .and. ipass == 1)  &
     call plotgll(knods,ibool,coorg,coord,nglob,npgeo,ngnod,nspec)
 
   if(myrank == 0 .and. ipass == 1)  &
@@ -2346,9 +2352,9 @@
 
 ! allocate seismogram arrays
   if(ipass == 1) then
-    allocate(sisux(NTSTEP_BETWEEN_OUTPUT_SEISMO,nrecloc))
-    allocate(sisuz(NTSTEP_BETWEEN_OUTPUT_SEISMO,nrecloc))
-    allocate(siscurl(NTSTEP_BETWEEN_OUTPUT_SEISMO,nrecloc))
+    allocate(sisux(NSTEP_BETWEEN_OUTPUT_SEISMOS,nrecloc))
+    allocate(sisuz(NSTEP_BETWEEN_OUTPUT_SEISMOS,nrecloc))
+    allocate(siscurl(NSTEP_BETWEEN_OUTPUT_SEISMOS,nrecloc))
   endif
 
 ! check if acoustic receiver is exactly on the free surface because pressure is zero there
@@ -3965,7 +3971,7 @@
   if(output_energy) stop 'energy calculation currently serial only, should add an MPI_REDUCE in parallel'
 #endif
 
-!----  create a gnuplot script to display the energy curve in log scale
+!----  create a Gnuplot script to display the energy curve in log scale
   if(output_energy .and. myrank == 0) then
     close(IOUT_ENERGY)
     open(unit=IOUT_ENERGY,file='plot_energy.gnu',status='unknown')
@@ -4095,7 +4101,7 @@
                             NX_IMAGE_color,NZ_IMAGE_color,nb_pixel_loc, &
                             num_pixel_loc,nspec,elastic,poroelastic,ibool,kmato, &
                             numat,density,poroelastcoef,porosity,tortuosity, &
-                            nproc,myrank,assign_external_model,vpext,DRAW_WATER_CONSTANT_BLUE_IN_JPG)
+                            nproc,myrank,assign_external_model,vpext,DRAW_WATER_IN_BLUE)
   endif
 
 ! dummy allocation of plane wave arrays if they are unused (but still need to exist because
@@ -7057,7 +7063,7 @@
                         ATTENUATION_VISCOELASTIC_SOLID,Mu_nu1,Mu_nu2,N_SLS,p_sv)
 
 !----  display time step and max of norm of displacement
-    if(mod(it,NTSTEP_BETWEEN_OUTPUT_INFO) == 0 .or. it == 5 .or. it == NSTEP) then
+    if(mod(it,NSTEP_BETWEEN_OUTPUT_INFO) == 0 .or. it == 5 .or. it == NSTEP) then
       call check_stability(myrank,time,it,NSTEP,NOISE_TOMOGRAPHY, &
                         nglob_acoustic,nglob_elastic,nglob_poroelastic, &
                         any_elastic_glob,any_elastic,displ_elastic, &
@@ -7542,7 +7548,7 @@
 !
 !----  display results at given time steps
 !
-    if(mod(it,NTSTEP_BETWEEN_OUTPUT_INFO) == 0 .or. it == 5 .or. it == NSTEP) then
+    if(mod(it,NSTEP_BETWEEN_OUTPUT_INFO) == 0 .or. it == 5 .or. it == NSTEP) then
 
 !
 ! kernels output files
@@ -7657,7 +7663,7 @@
 
         if (myrank == 0) write(IOUT,*) 'Writing PostScript file'
 
-        if(imagetype == 1 .and. p_sv) then
+        if(imagetype_postscript == 1 .and. p_sv) then
 
           if (myrank == 0) write(IOUT,*) 'drawing displacement vector as small arrows...'
 
@@ -7673,7 +7679,7 @@
                       poroelastcoef,knods,kmato,ibool, &
                       numabs,codeabs,anyabs,nelem_acoustic_surface,acoustic_edges, &
                       simulation_title,nglob,npgeo,vpImin,vpImax,nrec,NSOURCES, &
-                      colors,numbers,subsamp_postscript,imagetype,interpol,meshvect,modelvect, &
+                      colors,numbers,subsamp_postscript,imagetype_postscript,interpol,meshvect,modelvect, &
                       boundvect,assign_external_model,cutsnaps,sizemax_arrows,nelemabs,numat,pointsdisp, &
                       nspec,ngnod,coupled_acoustic_elastic,coupled_acoustic_poro,coupled_elastic_poro, &
                       any_acoustic,any_poroelastic,plot_lowerleft_corner_only, &
@@ -7701,7 +7707,7 @@
                       d2_coorg_send_ps_vector_field,d2_coorg_recv_ps_vector_field, &
                       coorg_send_ps_vector_field,coorg_recv_ps_vector_field,US_LETTER)
 
-        else if(imagetype == 2 .and. p_sv) then
+        else if(imagetype_postscript == 2 .and. p_sv) then
 
           if (myrank == 0) write(IOUT,*) 'drawing velocity vector as small arrows...'
 
@@ -7717,7 +7723,7 @@
                       poroelastcoef,knods,kmato,ibool, &
                       numabs,codeabs,anyabs,nelem_acoustic_surface,acoustic_edges, &
                       simulation_title,nglob,npgeo,vpImin,vpImax,nrec,NSOURCES, &
-                      colors,numbers,subsamp_postscript,imagetype,interpol,meshvect,modelvect, &
+                      colors,numbers,subsamp_postscript,imagetype_postscript,interpol,meshvect,modelvect, &
                       boundvect,assign_external_model,cutsnaps,sizemax_arrows,nelemabs,numat,pointsdisp, &
                       nspec,ngnod,coupled_acoustic_elastic,coupled_acoustic_poro,coupled_elastic_poro, &
                       any_acoustic,any_poroelastic,plot_lowerleft_corner_only, &
@@ -7745,7 +7751,7 @@
                       d2_coorg_send_ps_vector_field,d2_coorg_recv_ps_vector_field, &
                       coorg_send_ps_vector_field,coorg_recv_ps_vector_field,US_LETTER)
 
-        else if(imagetype == 3 .and. p_sv) then
+        else if(imagetype_postscript == 3 .and. p_sv) then
 
           if (myrank == 0) write(IOUT,*) 'drawing acceleration vector as small arrows...'
 
@@ -7761,7 +7767,7 @@
                       poroelastcoef,knods,kmato,ibool, &
                       numabs,codeabs,anyabs,nelem_acoustic_surface,acoustic_edges, &
                       simulation_title,nglob,npgeo,vpImin,vpImax,nrec,NSOURCES, &
-                      colors,numbers,subsamp_postscript,imagetype,interpol,meshvect,modelvect, &
+                      colors,numbers,subsamp_postscript,imagetype_postscript,interpol,meshvect,modelvect, &
                       boundvect,assign_external_model,cutsnaps,sizemax_arrows,nelemabs,numat,pointsdisp, &
                       nspec,ngnod,coupled_acoustic_elastic,coupled_acoustic_poro,coupled_elastic_poro, &
                       any_acoustic,any_poroelastic,plot_lowerleft_corner_only, &
@@ -7789,7 +7795,7 @@
                       d2_coorg_send_ps_vector_field,d2_coorg_recv_ps_vector_field, &
                       coorg_send_ps_vector_field,coorg_recv_ps_vector_field,US_LETTER)
 
-        else if(imagetype == 4 .or. .not. p_sv) then
+        else if(imagetype_postscript == 4 .or. .not. p_sv) then
 
           if (myrank == 0) &
             write(IOUT,*) 'cannot draw scalar pressure field or y-component field as a vector plot, skipping...'
@@ -7798,7 +7804,7 @@
           call exit_MPI('wrong type for snapshots')
         endif
 
-        if (myrank == 0 .and. imagetype /= 4 .and. p_sv) write(IOUT,*) 'PostScript file written'
+        if (myrank == 0 .and. imagetype_postscript /= 4 .and. p_sv) write(IOUT,*) 'PostScript file written'
 
       endif
 
@@ -7810,7 +7816,7 @@
         if (myrank == 0) &
           write(IOUT,*) 'Creating color image of size ',NX_IMAGE_color,' x ',NZ_IMAGE_color,' for time step ',it
 
-        if(imagetype == 1) then
+        if(imagetype_JPEG == 1) then
 
           if (myrank == 0) &
             write(IOUT,*) 'drawing image of z (if P-SV) or y (if SH) component of displacement vector...'
@@ -7821,7 +7827,7 @@
                           nspec,nglob,nglob_acoustic,nglob_elastic,nglob_poroelastic, &
                           numat,kmato,density,rhoext,assign_external_model)
 
-        else if(imagetype == 2) then
+        else if(imagetype_JPEG == 2) then
 
           if (myrank == 0) &
             write(IOUT,*) 'drawing image of z (if P-SV) or y (if SH) component of velocity vector...'
@@ -7832,7 +7838,7 @@
                           nspec,nglob,nglob_acoustic,nglob_elastic,nglob_poroelastic, &
                           numat,kmato,density,rhoext,assign_external_model)
 
-        else if(imagetype == 3) then
+        else if(imagetype_JPEG == 3) then
 
           if (myrank == 0) &
             write(IOUT,*) 'drawing image of z (if P-SV) or y (if SH) component of acceleration vector...'
@@ -7843,7 +7849,7 @@
                           nspec,nglob,nglob_acoustic,nglob_elastic,nglob_poroelastic, &
                           numat,kmato,density,rhoext,assign_external_model)
 
-        else if(imagetype == 4 .and. p_sv) then
+        else if(imagetype_JPEG == 4 .and. p_sv) then
 
           if (myrank == 0) write(IOUT,*) 'drawing image of pressure field...'
 
@@ -7855,7 +7861,7 @@
                      c11ext,c13ext,c15ext,c33ext,c35ext,c55ext,anisotropic,anisotropy,e1,e11, &
                      ATTENUATION_VISCOELASTIC_SOLID,Mu_nu1,Mu_nu2,N_SLS)
 
-        else if(imagetype == 4 .and. .not. p_sv) then
+        else if(imagetype_JPEG == 4 .and. .not. p_sv) then
           call exit_MPI('cannot draw pressure field for SH (membrane) waves')
         else
           call exit_MPI('wrong type for snapshots')
@@ -7943,7 +7949,7 @@
 ! note 1: for SH case, this requires output_color_image = .true. in order to have vector_field_display
 ! note 2: for MPI, it would be more convenient to output a single file rather than one for each myrank
 
-      if (output_wavefield_snapshot) then
+      if (output_TEXT_wavefield_dumps) then
         write(wavefield_file,"('OUTPUT_FILES/wavefield',i7.7,'_',i2.2,'_',i3.3,'.txt')") it,SIMULATION_TYPE,myrank
         open(unit=27,file=wavefield_file,status='unknown')
         do ispec = 1,nspec
@@ -7965,7 +7971,7 @@
       if(.not. GENERATE_PARAVER_TRACES) &
         call write_seismograms(sisux,sisuz,siscurl,station_name,network_name,NSTEP, &
                             nrecloc,which_proc_receiver,nrec,myrank,deltat,seismotype,st_xval,t0, &
-                            NTSTEP_BETWEEN_OUTPUT_SEISMO,seismo_offset,seismo_current,p_sv,&
+                            NSTEP_BETWEEN_OUTPUT_SEISMOS,seismo_offset,seismo_current,p_sv,&
                             st_zval,x_source(1),z_source(1),SU_FORMAT)
 
       seismo_offset = seismo_offset + seismo_current

Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/write_seismograms.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/write_seismograms.F90	2012-06-04 22:14:05 UTC (rev 20306)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/write_seismograms.F90	2012-06-04 23:45:24 UTC (rev 20307)
@@ -46,7 +46,7 @@
 
   subroutine write_seismograms(sisux,sisuz,siscurl,station_name,network_name, &
       NSTEP,nrecloc,which_proc_receiver,nrec,myrank,deltat,seismotype,st_xval,t0, &
-      NTSTEP_BETWEEN_OUTPUT_SEISMO,seismo_offset,seismo_current,p_sv, &
+      NSTEP_BETWEEN_OUTPUT_SEISMOS,seismo_offset,seismo_current,p_sv, &
       st_zval,x_source,z_source,SU_FORMAT)
 
   implicit none
@@ -57,7 +57,7 @@
 #endif
 
   integer :: nrec,NSTEP,seismotype
-  integer :: NTSTEP_BETWEEN_OUTPUT_SEISMO,seismo_offset,seismo_current
+  integer :: NSTEP_BETWEEN_OUTPUT_SEISMOS,seismo_offset,seismo_current
   double precision :: t0,deltat
 
 ! output seismograms in Seismic Unix format (adjoint traces will be read in the same format)
@@ -68,7 +68,7 @@
   integer, intent(in) :: nrecloc,myrank
   integer, dimension(nrec),intent(in) :: which_proc_receiver
 
-  double precision, dimension(NTSTEP_BETWEEN_OUTPUT_SEISMO,nrecloc), intent(in) :: sisux,sisuz,siscurl
+  double precision, dimension(NSTEP_BETWEEN_OUTPUT_SEISMOS,nrecloc), intent(in) :: sisux,sisuz,siscurl
 
   double precision :: st_xval(nrec)
 
@@ -129,7 +129,7 @@
      number_of_components = NDIM
   endif
 
-  allocate(buffer_binary(NTSTEP_BETWEEN_OUTPUT_SEISMO,number_of_components))
+  allocate(buffer_binary(NSTEP_BETWEEN_OUTPUT_SEISMOS,number_of_components))
 
 
   if ( myrank == 0 .and. seismo_offset == 0 ) then
@@ -214,16 +214,16 @@
 
 #ifdef USE_MPI
         else
-           call MPI_RECV(buffer_binary(1,1),NTSTEP_BETWEEN_OUTPUT_SEISMO,MPI_DOUBLE_PRECISION,&
+           call MPI_RECV(buffer_binary(1,1),NSTEP_BETWEEN_OUTPUT_SEISMOS,MPI_DOUBLE_PRECISION,&
                 which_proc_receiver(irec),irec,MPI_COMM_WORLD,status,ierror)
            if ( number_of_components == 2 ) then
-              call MPI_RECV(buffer_binary(1,2),NTSTEP_BETWEEN_OUTPUT_SEISMO,MPI_DOUBLE_PRECISION,&
+              call MPI_RECV(buffer_binary(1,2),NSTEP_BETWEEN_OUTPUT_SEISMOS,MPI_DOUBLE_PRECISION,&
                    which_proc_receiver(irec),irec,MPI_COMM_WORLD,status,ierror)
            end if
            if ( number_of_components == 3 ) then
-              call MPI_RECV(buffer_binary(1,2),NTSTEP_BETWEEN_OUTPUT_SEISMO,MPI_DOUBLE_PRECISION,&
+              call MPI_RECV(buffer_binary(1,2),NSTEP_BETWEEN_OUTPUT_SEISMOS,MPI_DOUBLE_PRECISION,&
                    which_proc_receiver(irec),irec,MPI_COMM_WORLD,status,ierror)
-              call MPI_RECV(buffer_binary(1,3),NTSTEP_BETWEEN_OUTPUT_SEISMO,MPI_DOUBLE_PRECISION,&
+              call MPI_RECV(buffer_binary(1,3),NSTEP_BETWEEN_OUTPUT_SEISMOS,MPI_DOUBLE_PRECISION,&
                    which_proc_receiver(irec),irec,MPI_COMM_WORLD,status,ierror)
            end if
 #endif
@@ -350,12 +350,12 @@
      else
         if ( which_proc_receiver(irec) == myrank ) then
            irecloc = irecloc + 1
-           call MPI_SEND(sisux(1,irecloc),NTSTEP_BETWEEN_OUTPUT_SEISMO,MPI_DOUBLE_PRECISION,0,irec,MPI_COMM_WORLD,ierror)
+           call MPI_SEND(sisux(1,irecloc),NSTEP_BETWEEN_OUTPUT_SEISMOS,MPI_DOUBLE_PRECISION,0,irec,MPI_COMM_WORLD,ierror)
            if ( number_of_components >= 2 ) then
-              call MPI_SEND(sisuz(1,irecloc),NTSTEP_BETWEEN_OUTPUT_SEISMO,MPI_DOUBLE_PRECISION,0,irec,MPI_COMM_WORLD,ierror)
+              call MPI_SEND(sisuz(1,irecloc),NSTEP_BETWEEN_OUTPUT_SEISMOS,MPI_DOUBLE_PRECISION,0,irec,MPI_COMM_WORLD,ierror)
            end if
            if ( number_of_components == 3 ) then
-              call MPI_SEND(siscurl(1,irecloc),NTSTEP_BETWEEN_OUTPUT_SEISMO,MPI_DOUBLE_PRECISION,0,irec,MPI_COMM_WORLD,ierror)
+              call MPI_SEND(siscurl(1,irecloc),NSTEP_BETWEEN_OUTPUT_SEISMOS,MPI_DOUBLE_PRECISION,0,irec,MPI_COMM_WORLD,ierror)
            end if
         end if
 #endif



More information about the CIG-COMMITS mailing list