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

dkomati1 at geodynamics.org dkomati1 at geodynamics.org
Wed Nov 9 09:59:28 PST 2011


Author: dkomati1
Date: 2011-11-09 09:59:27 -0800 (Wed, 09 Nov 2011)
New Revision: 19167

Modified:
   seismo/2D/SPECFEM2D/trunk/setup/constants.h.in
   seismo/2D/SPECFEM2D/trunk/src/specfem2D/create_color_image.f90
   seismo/2D/SPECFEM2D/trunk/src/specfem2D/prepare_color_image.F90
   seismo/2D/SPECFEM2D/trunk/src/specfem2D/specfem2D.F90
Log:
added option DRAW_WATER_CONSTANT_BLUE_IN_JPG in setup/constants.h to display a water layer as a constant blue region rather than showing the acoustic wave speed model as a grey scale.


Modified: seismo/2D/SPECFEM2D/trunk/setup/constants.h.in
===================================================================
--- seismo/2D/SPECFEM2D/trunk/setup/constants.h.in	2011-11-09 16:56:39 UTC (rev 19166)
+++ seismo/2D/SPECFEM2D/trunk/setup/constants.h.in	2011-11-09 17:59:27 UTC (rev 19167)
@@ -58,6 +58,11 @@
 ! factor to subsample color images output by the code (useful for very large models)
   integer, parameter :: factor_subsample_image = 1
 
+! 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, parameter :: DRAW_WATER_CONSTANT_BLUE_IN_JPG = .true.
+
 ! option to display only part of the mesh and not the whole mesh,
 ! for instance to analyze Cuthill-McKee mesh partitioning etc.
 ! Possible values are:

Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/create_color_image.f90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/create_color_image.f90	2011-11-09 16:56:39 UTC (rev 19166)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/create_color_image.f90	2011-11-09 17:59:27 UTC (rev 19167)
@@ -80,7 +80,8 @@
   vpmax = TINYVAL
   do iy=1,NY
     do ix=1,NX
-      if ( iglob_image_color_2D(ix,iy) > -1 ) then
+! negative values in image_color_vp_display are a flag indicating a water layer to color in light blue later
+      if ( iglob_image_color_2D(ix,iy) > -1 .and. image_color_vp_display(ix,iy) >= 0) then
         vpmin = min(vpmin,image_color_vp_display(ix,iy))
         vpmax = max(vpmax,image_color_vp_display(ix,iy))
       endif
@@ -95,16 +96,12 @@
 ! check if pixel is defined or not (can be above topography for instance)
       if(iglob_image_color_2D(ix,iy) == -1) then
 
-!!! use light blue to display undefined region above topography
-!!        R = 204
-!!        G = 255
-!!        B = 255
-! now use white to display undefined region above topography to avoid visual confusion with a water layer
+! use white to display undefined region above topography to avoid visual confusion with a water layer
         R = 255
         G = 255
         B = 255
 
-! suppress small amplitudes considered as noise
+! suppress small amplitudes considered as noise and display the background velocity model instead
       else if (abs(color_image_2D_data(ix,iy)) < amplitude_max * cutsnaps) then
 
 ! use P velocity model as background where amplitude is negligible
@@ -130,6 +127,17 @@
         G = R
         B = R
 
+! negative values in image_color_vp_display are a flag indicating a water layer to color in light blue
+        if (image_color_vp_display(ix,iy) < 0) then
+! use light blue to display water
+!!!!!!          R = 204
+!!!!!!          G = 255
+!!!!!!          B = 255
+          R = 135 !!! LightSkyBlue
+          G = 206
+          B = 250
+        endif
+
       else
 
 ! define normalized image data in [-1:1] and convert to nearest integer

Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/prepare_color_image.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/prepare_color_image.F90	2011-11-09 16:56:39 UTC (rev 19166)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/prepare_color_image.F90	2011-11-09 17:59:27 UTC (rev 19167)
@@ -232,7 +232,7 @@
 
   subroutine prepare_color_image_vp(nglob,image_color_vp_display,iglob_image_color, &
                             NX_IMAGE_color,NZ_IMAGE_color,nb_pixel_loc, &
-                            num_pixel_loc,nspec,poroelastic,ibool,kmato, &
+                            num_pixel_loc,nspec,elastic,poroelastic,ibool,kmato, &
                             numat,density,poroelastcoef,porosity,tortuosity, &
                             nproc,myrank,assign_external_model,vpext)
 
@@ -252,7 +252,7 @@
   integer, dimension(NGLLX,NGLLZ,nspec) :: ibool
   integer, dimension(nspec) :: kmato
 
-  logical, dimension(nspec) :: poroelastic
+  logical, dimension(nspec) :: elastic,poroelastic
 
   integer :: nb_pixel_loc
   integer, dimension(nb_pixel_loc) :: num_pixel_loc
@@ -353,6 +353,21 @@
         enddo
       enddo
     endif !if(poroelastic(ispec)) then
+
+! 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
+!  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
+      do j = 1,NGLLZ
+        do i = 1,NGLLX
+          vp_display(ibool(i,j,ispec)) = -1
+        enddo
+      enddo
+    endif
+
   enddo
 
   ! getting velocity for each local pixels

Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/specfem2D.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/specfem2D.F90	2011-11-09 16:56:39 UTC (rev 19166)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/specfem2D.F90	2011-11-09 17:59:27 UTC (rev 19167)
@@ -3731,7 +3731,7 @@
   if(output_color_image) then
     call prepare_color_image_vp(nglob,image_color_vp_display,iglob_image_color, &
                             NX_IMAGE_color,NZ_IMAGE_color,nb_pixel_loc, &
-                            num_pixel_loc,nspec,poroelastic,ibool,kmato, &
+                            num_pixel_loc,nspec,elastic,poroelastic,ibool,kmato, &
                             numat,density,poroelastcoef,porosity,tortuosity, &
                             nproc,myrank,assign_external_model,vpext)
 



More information about the CIG-COMMITS mailing list