[cig-commits] r22699 - in seismo/3D/SPECFEM3D_GLOBE: branches/SPECFEM3D_GLOBE_SUNFLOWER/src/compute_optimized_dumping_undo_att branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared trunk/src/meshfem3D

dkomati1 at geodynamics.org dkomati1 at geodynamics.org
Mon Aug 5 12:48:04 PDT 2013


Author: dkomati1
Date: 2013-08-05 12:48:03 -0700 (Mon, 05 Aug 2013)
New Revision: 22699

Modified:
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/compute_optimized_dumping_undo_att/compute_optimized_dumping_undo_att.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/create_mass_matrices.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/create_regions_mesh.F90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/save_header_file.F90
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/meshfem3D/create_regions_mesh.F90
Log:
merged changes made in the trunk to fix small bugs mentioned by Min Chen into the branch


Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/compute_optimized_dumping_undo_att/compute_optimized_dumping_undo_att.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/compute_optimized_dumping_undo_att/compute_optimized_dumping_undo_att.f90	2013-08-05 00:04:40 UTC (rev 22698)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/compute_optimized_dumping_undo_att/compute_optimized_dumping_undo_att.f90	2013-08-05 19:48:03 UTC (rev 22699)
@@ -248,7 +248,8 @@
   print *,'  -  4 GB or 2 GB on the non-GPU part of Titan at ORNL i.e. when using CPUs only there'
   print *,'            depending on whether you use 8 or 16 MPI tasks per compute node'
   print *,'  - 32 GB on the GPU part of Titan at ORNL'
-  print *,'  -  2 GB on the machine used by Christina Morency)'
+  print *,'  -  2 GB on the machine used by Christina Morency'
+  print *,'  -  2 GB on the TACC machine used by Min Chen'
   print *,'  -  1.5 GB on the GPU cluster in Marseille)'
   read(*,*) gigabytes_avail_per_core
 

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/create_mass_matrices.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/create_mass_matrices.f90	2013-08-05 00:04:40 UTC (rev 22698)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/create_mass_matrices.f90	2013-08-05 19:48:03 UTC (rev 22699)
@@ -31,6 +31,16 @@
 
   ! creates rmassx, rmassy, rmassz and rmass_ocean_load
 
+!
+! ****************************************************************************************************
+! IMPORTANT: this routine must *NOT* use flag SIMULATION_TYPE (nor SAVE_FORWARD), i.e. none of the parameters it computes
+! should depend on SIMULATION_TYPE, because most users do not recompile the code nor rerun the mesher
+! when switching from SIMULATION_TYPE == 1 to SIMULATION_TYPE == 3 and thus the header file created
+! by this routine would become wrong in the case of a run with SIMULATION_TYPE == 3 if the code
+! was compiled with SIMULATION_TYPE == 1
+! ****************************************************************************************************
+!
+
   use constants
 
   use meshfem3D_models_par,only: &
@@ -79,12 +89,17 @@
   ! thus the mass matrix must be replaced by three mass matrices including the "C" damping matrix
   !
   ! if absorbing_conditions are not set or if NCHUNKS=6, only one mass matrix is needed
-  ! for the sake of performance, only "rmassz" array will be filled and "rmassx" & "rmassy" will be obsolete
+  ! for the sake of performance, only "rmassz" array will be filled and "rmassx" & "rmassy" will be fictitious / unused
+  !
+  ! Now also handle EXACT_MASS_MATRIX_FOR_ROTATION, which requires similar corrections
 
   rmassx(:) = 0._CUSTOM_REAL
   rmassy(:) = 0._CUSTOM_REAL
   rmassz(:) = 0._CUSTOM_REAL
 
+!----------------------------------------------------------------
+
+! first create the main standard mass matrix with no corrections
   do ispec=1,nspec
 
     ! suppress fictitious elements in central cube
@@ -146,8 +161,10 @@
         enddo
       enddo
     enddo
-  enddo
+  enddo ! of loop on ispec
 
+!----------------------------------------------------------------
+
   ! save ocean load mass matrix as well if oceans
   if(OCEANS .and. iregion_code == IREGION_CRUST_MANTLE) then
 

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/create_regions_mesh.F90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/create_regions_mesh.F90	2013-08-05 00:04:40 UTC (rev 22698)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/create_regions_mesh.F90	2013-08-05 19:48:03 UTC (rev 22699)
@@ -35,6 +35,16 @@
 
 ! creates the different regions of the mesh
 
+!
+! ****************************************************************************************************
+! IMPORTANT: this routine must *NOT* use flag SIMULATION_TYPE (nor SAVE_FORWARD), i.e. none of the parameters it computes
+! should depend on SIMULATION_TYPE, because most users do not recompile the code nor rerun the mesher
+! when switching from SIMULATION_TYPE == 1 to SIMULATION_TYPE == 3 and thus the header file created
+! by this routine would become wrong in the case of a run with SIMULATION_TYPE == 3 if the code
+! was compiled with SIMULATION_TYPE == 1
+! ****************************************************************************************************
+!
+
   use meshfem3D_par,only: &
     ibool,idoubling,xstore,ystore,zstore, &
     IMAIN,volume_total,myrank,LOCAL_PATH, &
@@ -471,7 +481,7 @@
   ! local parameters
   integer :: ier
 
-  ! new Attenuation definition on all GLL points
+  ! new attenuation definition on all GLL points
   ! attenuation
   if (ATTENUATION) then
     T_c_source = AM_V%QT_c_source
@@ -944,7 +954,7 @@
       call flush_IMAIN()
     endif
 
-  enddo !ilayer_loop
+  enddo ! of ilayer_loop
 
   deallocate(stretch_tab)
   deallocate(perm_layer)

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/save_header_file.F90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/save_header_file.F90	2013-08-05 00:04:40 UTC (rev 22698)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/save_header_file.F90	2013-08-05 19:48:03 UTC (rev 22699)
@@ -50,8 +50,18 @@
                         NGLOB_INNER_CORE_ADJOINT,NSPEC_OUTER_CORE_ROT_ADJOINT, &
                         NSPEC_CRUST_MANTLE_STACEY,NSPEC_OUTER_CORE_STACEY, &
                         NGLOB_CRUST_MANTLE_OCEANS,NSPEC_OUTER_CORE_ROTATION, &
-                        SIMULATION_TYPE,SAVE_FORWARD,MOVIE_VOLUME)
+                        MOVIE_VOLUME)
 
+!
+! ****************************************************************************************************
+! IMPORTANT: this routine must *NOT* use flag SIMULATION_TYPE (nor SAVE_FORWARD), i.e. none of the parameters it computes
+! should depend on SIMULATION_TYPE, because most users do not recompile the code nor rerun the mesher
+! when switching from SIMULATION_TYPE == 1 to SIMULATION_TYPE == 3 and thus the header file created
+! by this routine would become wrong in the case of a run with SIMULATION_TYPE == 3 if the code
+! was compiled with SIMULATION_TYPE == 1
+! ****************************************************************************************************
+!
+
   implicit none
 
   include "constants.h"
@@ -87,8 +97,7 @@
          NGLOB_CRUST_MANTLE_OCEANS,NSPEC_OUTER_CORE_ROTATION, &
          NSPEC2D_MOHO, NSPEC2D_400, NSPEC2D_670, NSPEC2D_CMB, NSPEC2D_ICB
 
-  integer :: SIMULATION_TYPE
-  logical :: SAVE_FORWARD,MOVIE_VOLUME
+  logical :: MOVIE_VOLUME
 
   ! local parameters
   double precision :: subtract_central_cube_elems,subtract_central_cube_points
@@ -335,6 +344,24 @@
   write(IOUT,*) 'integer, parameter :: NSPEC_OUTER_CORE_ADJOINT = ',NSPEC_OUTER_CORE_ADJOINT
   write(IOUT,*) 'integer, parameter :: NSPEC_INNER_CORE_ADJOINT = ',NSPEC_INNER_CORE_ADJOINT
 
+  if(ANISOTROPIC_KL) then
+    write(IOUT,*) 'integer, parameter :: NSPEC_CRUST_MANTLE_ADJOINT_ANISO_KL = ',NSPEC_CRUST_MANTLE_ADJOINT
+  else
+    write(IOUT,*) 'integer, parameter :: NSPEC_CRUST_MANTLE_ADJOINT_ANISO_KL = ',1
+  endif
+
+  if(APPROXIMATE_HESS_KL) then
+    write(IOUT,*) 'integer, parameter :: NSPEC_CRUST_MANTLE_ADJOINT_HESS = ',NSPEC_CRUST_MANTLE_ADJOINT
+  else
+    write(IOUT,*) 'integer, parameter :: NSPEC_CRUST_MANTLE_ADJOINT_HESS = ',1
+  endif
+
+  if(NOISE_TOMOGRAPHY > 0) then
+    write(IOUT,*) 'integer, parameter :: NSPEC_CRUST_MANTLE_ADJOINT_NOISE = ',NSPEC_CRUST_MANTLE_ADJOINT
+  else
+    write(IOUT,*) 'integer, parameter :: NSPEC_CRUST_MANTLE_ADJOINT_NOISE = ',1
+  endif
+
   write(IOUT,*) 'integer, parameter :: NGLOB_CRUST_MANTLE_ADJOINT = ',NGLOB_CRUST_MANTLE_ADJOINT
   write(IOUT,*) 'integer, parameter :: NGLOB_OUTER_CORE_ADJOINT = ',NGLOB_OUTER_CORE_ADJOINT
   write(IOUT,*) 'integer, parameter :: NGLOB_INNER_CORE_ADJOINT = ',NGLOB_INNER_CORE_ADJOINT
@@ -414,6 +441,15 @@
   endif
   write(IOUT,*)
 
+  if(TOPOGRAPHY .or. OCEANS) then
+    write(IOUT,*) 'integer, parameter :: NX_BATHY_VAL = NX_BATHY'
+    write(IOUT,*) 'integer, parameter :: NY_BATHY_VAL = NY_BATHY'
+  else
+    write(IOUT,*) 'integer, parameter :: NX_BATHY_VAL = 1'
+    write(IOUT,*) 'integer, parameter :: NY_BATHY_VAL = 1'
+  endif
+  write(IOUT,*)
+
   if(ROTATION) then
     write(IOUT,*) 'logical, parameter :: ROTATION_VAL = .true.'
   else
@@ -422,6 +458,24 @@
   write(IOUT,*) 'integer, parameter :: NSPEC_OUTER_CORE_ROTATION = ',NSPEC_OUTER_CORE_ROTATION
   write(IOUT,*)
 
+  if(PARTIAL_PHYS_DISPERSION_ONLY) then
+    write(IOUT,*) 'logical, parameter :: PARTIAL_PHYS_DISPERSION_ONLY_VAL = .true.'
+  else
+    write(IOUT,*) 'logical, parameter :: PARTIAL_PHYS_DISPERSION_ONLY_VAL = .false.'
+  endif
+
+  write(IOUT,*) 'integer, parameter :: NGLOB1D_RADIAL_CM = ',NGLOB1D_RADIAL(IREGION_CRUST_MANTLE)
+  write(IOUT,*) 'integer, parameter :: NGLOB1D_RADIAL_OC = ',NGLOB1D_RADIAL(IREGION_OUTER_CORE)
+  write(IOUT,*) 'integer, parameter :: NGLOB1D_RADIAL_IC = ',NGLOB1D_RADIAL(IREGION_INNER_CORE)
+
+  write(IOUT,*) 'integer, parameter :: NGLOB2DMAX_XMIN_XMAX_CM = ',NGLOB2DMAX_XMIN_XMAX(IREGION_CRUST_MANTLE)
+  write(IOUT,*) 'integer, parameter :: NGLOB2DMAX_XMIN_XMAX_OC = ',NGLOB2DMAX_XMIN_XMAX(IREGION_OUTER_CORE)
+  write(IOUT,*) 'integer, parameter :: NGLOB2DMAX_XMIN_XMAX_IC = ',NGLOB2DMAX_XMIN_XMAX(IREGION_INNER_CORE)
+
+  write(IOUT,*) 'integer, parameter :: NGLOB2DMAX_YMIN_YMAX_CM = ',NGLOB2DMAX_YMIN_YMAX(IREGION_CRUST_MANTLE)
+  write(IOUT,*) 'integer, parameter :: NGLOB2DMAX_YMIN_YMAX_OC = ',NGLOB2DMAX_YMIN_YMAX(IREGION_OUTER_CORE)
+  write(IOUT,*) 'integer, parameter :: NGLOB2DMAX_YMIN_YMAX_IC = ',NGLOB2DMAX_YMIN_YMAX(IREGION_INNER_CORE)
+
   write(IOUT,*) 'integer, parameter :: NPROC_XI_VAL = ',NPROC_XI
   write(IOUT,*) 'integer, parameter :: NPROC_ETA_VAL = ',NPROC_ETA
   write(IOUT,*) 'integer, parameter :: NCHUNKS_VAL = ',NCHUNKS
@@ -500,44 +554,71 @@
     write(IOUT,*) 'logical, parameter :: USE_DEVILLE_PRODUCTS_VAL = .false.'
   endif
 
-  ! backward/reconstruction of forward wavefield:
-  ! can only mimic attenuation effects on velocity at this point, since no full wavefield snapshots are stored
-  if((SIMULATION_TYPE == 1 .and. SAVE_FORWARD) .or. SIMULATION_TYPE == 3) then
+  if (MOVIE_VOLUME) then
+    write(IOUT,*) 'integer, parameter :: NSPEC_CRUST_MANTLE_3DMOVIE = NSPEC_CRUST_MANTLE'
+    write(IOUT,*) 'integer, parameter :: NGLOB_CRUST_MANTLE_3DMOVIE = NGLOB_CRUST_MANTLE'
+  else
+    write(IOUT,*) 'integer, parameter :: NSPEC_CRUST_MANTLE_3DMOVIE = 1'
+    write(IOUT,*) 'integer, parameter :: NGLOB_CRUST_MANTLE_3DMOVIE = 1'
+  endif
+  write(IOUT,*)
 
-    ! attenuation mimic:
-    ! mimicking effect of attenuation on apparent velocities, not amplitudes. that is,
-    ! phase shifts should be correctly accounted for, but amplitudes will differ in adjoint simulations
+  if (SAVE_REGULAR_KL) then
+    write(IOUT,*) 'integer, parameter :: NM_KL_REG_PTS_VAL = NM_KL_REG_PTS'
+  else
+    write(IOUT,*) 'integer, parameter :: NM_KL_REG_PTS_VAL = 1'
+  endif
+  write(IOUT,*)
 
-!daniel: att - debug - check if mimic is still needed
-    if( ATTENUATION ) then
-      write(IOUT,*) 'logical, parameter :: PARTIAL_PHYS_DISPERSION_ONLY = .true.'
-    else
-      write(IOUT,*) 'logical, parameter :: PARTIAL_PHYS_DISPERSION_ONLY = .false.'
-    endif
+  if (SAVE_SOURCE_MASK) then
+    write(IOUT,*) 'integer, parameter :: NSPEC_CRUST_MANTLE_MASK_SOURCE = NSPEC_CRUST_MANTLE'
+  else
+    write(IOUT,*) 'integer, parameter :: NSPEC_CRUST_MANTLE_MASK_SOURCE = 1'
+  endif
+  write(IOUT,*)
 
+  ! in the case of Stacey boundary conditions, add C*delta/2 contribution to the mass matrix
+  ! on the Stacey edges for the crust_mantle and outer_core regions but not for the inner_core region
+  ! thus the mass matrix must be replaced by three mass matrices including the "C" damping matrix
+  !
+  ! if absorbing_conditions are not set or if NCHUNKS=6, only one mass matrix is needed
+  ! for the sake of performance, only "rmassz" array will be filled and "rmassx" & "rmassy" will be fictitious / unused
+
+  NGLOB_XY_CM = 1
+  NGLOB_XY_IC = 1
+
+  if(NCHUNKS /= 6 .and. ABSORBING_CONDITIONS .and. .not. USE_LDDRK) then
+     NGLOB_XY_CM = NGLOB(IREGION_CRUST_MANTLE)
   else
+     NGLOB_XY_CM = 1
+  endif
 
-    ! calculates full attenuation (phase & amplitude effects) if used
-    write(IOUT,*) 'logical, parameter :: PARTIAL_PHYS_DISPERSION_ONLY = .false.'
+  if(.not. USE_LDDRK .and. EXACT_MASS_MATRIX_FOR_ROTATION) then
+    if(ROTATION) then
+      NGLOB_XY_CM = NGLOB(IREGION_CRUST_MANTLE)
+      NGLOB_XY_IC = NGLOB(IREGION_INNER_CORE)
+    endif
   endif
 
-  ! attenuation and/or adjoint simulations
-  if (ATTENUATION .or. SIMULATION_TYPE /= 1 .or. SAVE_FORWARD &
-    .or. (MOVIE_VOLUME .and. SIMULATION_TYPE /= 3)) then
-    write(IOUT,*) 'logical, parameter :: COMPUTE_AND_STORE_STRAIN_VAL = .true.'
-  else
-    write(IOUT,*) 'logical, parameter :: COMPUTE_AND_STORE_STRAIN_VAL = .false.'
-  endif
+  write(IOUT,*) 'integer, parameter :: NGLOB_XY_CM = ',NGLOB_XY_CM
+  write(IOUT,*) 'integer, parameter :: NGLOB_XY_IC = ',NGLOB_XY_IC
   write(IOUT,*)
 
-  if (MOVIE_VOLUME) then
-    write(IOUT,*) 'integer, parameter :: NSPEC_CRUST_MANTLE_3DMOVIE = NSPEC_CRUST_MANTLE'
-    write(IOUT,*) 'integer, parameter :: NGLOB_CRUST_MANTLE_3DMOVIE = NGLOB_CRUST_MANTLE'
+  if (ATTENUATION_1D_WITH_3D_STORAGE) then
+    write(IOUT,*) 'logical, parameter :: ATTENUATION_1D_WITH_3D_STORAGE_VAL = .true.'
   else
-    write(IOUT,*) 'integer, parameter :: NSPEC_CRUST_MANTLE_3DMOVIE = 1'
-    write(IOUT,*) 'integer, parameter :: NGLOB_CRUST_MANTLE_3DMOVIE = 1'
+    write(IOUT,*) 'logical, parameter :: ATTENUATION_1D_WITH_3D_STORAGE_VAL = .false.'
   endif
+  write(IOUT,*)
 
+!! DK DK Jul 2013: we need that for the part1_*.f90 and part2_*.f90 include files, which some compilers
+!! DK DK Jul 2013: refuse to preprocess even if we rename them *.F90
+#ifdef FORCE_VECTORIZATION
+  write(IOUT,*) 'logical, parameter :: FORCE_VECTORIZATION_VAL = .true.'
+#else
+  write(IOUT,*) 'logical, parameter :: FORCE_VECTORIZATION_VAL = .false.'
+#endif
+
   close(IOUT)
 
   end subroutine save_header_file

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/meshfem3D/create_regions_mesh.F90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/meshfem3D/create_regions_mesh.F90	2013-08-05 00:04:40 UTC (rev 22698)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/meshfem3D/create_regions_mesh.F90	2013-08-05 19:48:03 UTC (rev 22699)
@@ -269,7 +269,7 @@
   ! create the name for the database of the current slide and region
   call create_name_database(prname,myrank,iregion_code,LOCAL_PATH)
 
-  ! new Attenuation definition on all GLL points
+  ! new attenuation definition on all GLL points
   ! attenuation
   if (ATTENUATION) then
     T_c_source = AM_V%QT_c_source



More information about the CIG-COMMITS mailing list