[cig-commits] r22401 - in seismo/3D/SPECFEM3D/trunk/src: generate_databases specfem3D
danielpeter at geodynamics.org
danielpeter at geodynamics.org
Mon Jun 24 04:25:19 PDT 2013
Author: danielpeter
Date: 2013-06-24 04:25:18 -0700 (Mon, 24 Jun 2013)
New Revision: 22401
Modified:
seismo/3D/SPECFEM3D/trunk/src/generate_databases/read_partition_files.f90
seismo/3D/SPECFEM3D/trunk/src/generate_databases/save_arrays_solver.f90
seismo/3D/SPECFEM3D/trunk/src/specfem3D/read_mesh_databases.f90
Log:
bug fix for reading databases in save_arrays_solver.f90 and read_mesh_databases.f90
Modified: seismo/3D/SPECFEM3D/trunk/src/generate_databases/read_partition_files.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/generate_databases/read_partition_files.f90 2013-06-21 23:55:36 UTC (rev 22400)
+++ seismo/3D/SPECFEM3D/trunk/src/generate_databases/read_partition_files.f90 2013-06-24 11:25:18 UTC (rev 22401)
@@ -209,6 +209,9 @@
call sync_all()
! reads number of C-PML elements in the global mesh
+ nspec_cpml_tot = 0
+ nspec_cpml = 0
+
read(IIN) nspec_cpml_tot
if(myrank == 0) then
write(IMAIN,*) ' total number of C-PML elements in the global mesh: ',nspec_cpml_tot
Modified: seismo/3D/SPECFEM3D/trunk/src/generate_databases/save_arrays_solver.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/generate_databases/save_arrays_solver.f90 2013-06-21 23:55:36 UTC (rev 22400)
+++ seismo/3D/SPECFEM3D/trunk/src/generate_databases/save_arrays_solver.f90 2013-06-24 11:25:18 UTC (rev 22401)
@@ -40,7 +40,8 @@
!for adjoint tomography
SIMULATION_TYPE,SAVE_FORWARD,mask_ibool_interior_domain, &
nglob_interface_PML_acoustic,points_interface_PML_acoustic,&
- nglob_interface_PML_elastic,points_interface_PML_elastic
+ nglob_interface_PML_elastic,points_interface_PML_elastic, &
+ STACEY_ABSORBING_CONDITIONS
use create_regions_mesh_ext_par
implicit none
@@ -141,58 +142,62 @@
endif
! C-PML absorbing boundary conditions
- write(IOUT) nspec_cpml
- write(IOUT) CPML_width_x
- write(IOUT) CPML_width_y
- write(IOUT) CPML_width_z
- if( nspec_cpml > 0 ) then
- write(IOUT) CPML_regions
- write(IOUT) CPML_to_spec
- write(IOUT) is_CPML
- write(IOUT) d_store_x
- write(IOUT) d_store_y
- write(IOUT) d_store_z
- write(IOUT) k_store_x
- write(IOUT) k_store_y
- write(IOUT) k_store_z
- write(IOUT) alpha_store
- ! --------------------------------------------------------------------------------------------
- ! for adjoint tomography
- ! save the array stored the points on interface between PML and interior computational domain
- ! --------------------------------------------------------------------------------------------
- if((SIMULATION_TYPE == 1 .and. SAVE_FORWARD) .or. SIMULATION_TYPE == 3) then
- write(IOUT) nglob_interface_PML_acoustic
- write(IOUT) nglob_interface_PML_elastic
- if(nglob_interface_PML_acoustic > 0) write(IOUT) points_interface_PML_acoustic
- if(nglob_interface_PML_elastic > 0) write(IOUT) points_interface_PML_elastic
- endif
+ if( PML_CONDITIONS ) then
+ write(IOUT) nspec_cpml
+ write(IOUT) CPML_width_x
+ write(IOUT) CPML_width_y
+ write(IOUT) CPML_width_z
+ if( nspec_cpml > 0 ) then
+ write(IOUT) CPML_regions
+ write(IOUT) CPML_to_spec
+ write(IOUT) is_CPML
+ write(IOUT) d_store_x
+ write(IOUT) d_store_y
+ write(IOUT) d_store_z
+ write(IOUT) k_store_x
+ write(IOUT) k_store_y
+ write(IOUT) k_store_z
+ write(IOUT) alpha_store
+ ! --------------------------------------------------------------------------------------------
+ ! for adjoint tomography
+ ! save the array stored the points on interface between PML and interior computational domain
+ ! --------------------------------------------------------------------------------------------
+ if((SIMULATION_TYPE == 1 .and. SAVE_FORWARD) .or. SIMULATION_TYPE == 3) then
+ write(IOUT) nglob_interface_PML_acoustic
+ write(IOUT) nglob_interface_PML_elastic
+ if(nglob_interface_PML_acoustic > 0) write(IOUT) points_interface_PML_acoustic
+ if(nglob_interface_PML_elastic > 0) write(IOUT) points_interface_PML_elastic
+ endif
+ endif
endif
! absorbing boundary surface
write(IOUT) num_abs_boundary_faces
if(PML_CONDITIONS)then
- if( num_abs_boundary_faces > 0 ) then
- write(IOUT) abs_boundary_ispec
- write(IOUT) abs_boundary_ijk
- write(IOUT) abs_boundary_jacobian2Dw
- write(IOUT) abs_boundary_normal
- endif
+ if( num_abs_boundary_faces > 0 ) then
+ write(IOUT) abs_boundary_ispec
+ write(IOUT) abs_boundary_ijk
+ write(IOUT) abs_boundary_jacobian2Dw
+ write(IOUT) abs_boundary_normal
+ endif
else
- if( num_abs_boundary_faces > 0 ) then
- write(IOUT) abs_boundary_ispec
- write(IOUT) abs_boundary_ijk
- write(IOUT) abs_boundary_jacobian2Dw
- write(IOUT) abs_boundary_normal
- ! store mass matrix contributions
- if(ELASTIC_SIMULATION) then
- write(IOUT) rmassx
- write(IOUT) rmassy
- write(IOUT) rmassz
- endif
- if(ACOUSTIC_SIMULATION) then
- write(IOUT) rmassz_acoustic
- endif
- endif
+ if( num_abs_boundary_faces > 0 ) then
+ write(IOUT) abs_boundary_ispec
+ write(IOUT) abs_boundary_ijk
+ write(IOUT) abs_boundary_jacobian2Dw
+ write(IOUT) abs_boundary_normal
+ if( STACEY_ABSORBING_CONDITIONS ) then
+ ! store mass matrix contributions
+ if(ELASTIC_SIMULATION ) then
+ write(IOUT) rmassx
+ write(IOUT) rmassy
+ write(IOUT) rmassz
+ endif
+ if(ACOUSTIC_SIMULATION) then
+ write(IOUT) rmassz_acoustic
+ endif
+ endif
+ endif
endif
write(IOUT) nspec2D_xmin
Modified: seismo/3D/SPECFEM3D/trunk/src/specfem3D/read_mesh_databases.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/specfem3D/read_mesh_databases.f90 2013-06-21 23:55:36 UTC (rev 22400)
+++ seismo/3D/SPECFEM3D/trunk/src/specfem3D/read_mesh_databases.f90 2013-06-24 11:25:18 UTC (rev 22401)
@@ -226,6 +226,7 @@
! reads mass matrices
read(27,iostat=ier) rmass
if( ier /= 0 ) stop 'error reading in array rmass'
+
if(PML_CONDITIONS)then !ZN
if(ACOUSTIC_SIMULATION)then !ZN
read(27,iostat=ier) rmass_elastic_interface !ZN
@@ -356,58 +357,60 @@
endif
! C-PML absorbing boundary conditions
- read(27) NSPEC_CPML
- read(27) CPML_width_x
- read(27) CPML_width_y
- read(27) CPML_width_z
- if( PML_CONDITIONS .and. NSPEC_CPML > 0 ) then
- allocate(CPML_regions(NSPEC_CPML),stat=ier)
- if(ier /= 0) stop 'error allocating array CPML_regions'
- allocate(CPML_to_spec(NSPEC_CPML),stat=ier)
- if(ier /= 0) stop 'error allocating array CPML_to_spec'
- allocate(is_CPML(NSPEC_AB),stat=ier)
- if(ier /= 0) stop 'error allocating array is_CPML'
- allocate(d_store_x(NGLLX,NGLLY,NGLLZ,NSPEC_CPML),stat=ier)
- if(ier /= 0) stop 'error allocating array d_store_x'
- allocate(d_store_y(NGLLX,NGLLY,NGLLZ,NSPEC_CPML),stat=ier)
- if(ier /= 0) stop 'error allocating array d_store_y'
- allocate(d_store_z(NGLLX,NGLLY,NGLLZ,NSPEC_CPML),stat=ier)
- if(ier /= 0) stop 'error allocating array d_store_z'
- allocate(K_store_x(NGLLX,NGLLY,NGLLZ,NSPEC_CPML),stat=ier)
- if(ier /= 0) stop 'error allocating array K_store_x'
- allocate(K_store_y(NGLLX,NGLLY,NGLLZ,NSPEC_CPML),stat=ier)
- if(ier /= 0) stop 'error allocating array K_store_y'
- allocate(K_store_z(NGLLX,NGLLY,NGLLZ,NSPEC_CPML),stat=ier)
- if(ier /= 0) stop 'error allocating array K_store_z'
- allocate(alpha_store(NGLLX,NGLLY,NGLLZ,NSPEC_CPML),stat=ier)
- if(ier /= 0) stop 'error allocating array alpha_store'
+ NSPEC_CPML = 0
+ if( PML_CONDITIONS ) then
+ read(27) NSPEC_CPML
+ read(27) CPML_width_x
+ read(27) CPML_width_y
+ read(27) CPML_width_z
+ if( NSPEC_CPML > 0 ) then
+ allocate(CPML_regions(NSPEC_CPML),stat=ier)
+ if(ier /= 0) stop 'error allocating array CPML_regions'
+ allocate(CPML_to_spec(NSPEC_CPML),stat=ier)
+ if(ier /= 0) stop 'error allocating array CPML_to_spec'
+ allocate(is_CPML(NSPEC_AB),stat=ier)
+ if(ier /= 0) stop 'error allocating array is_CPML'
+ allocate(d_store_x(NGLLX,NGLLY,NGLLZ,NSPEC_CPML),stat=ier)
+ if(ier /= 0) stop 'error allocating array d_store_x'
+ allocate(d_store_y(NGLLX,NGLLY,NGLLZ,NSPEC_CPML),stat=ier)
+ if(ier /= 0) stop 'error allocating array d_store_y'
+ allocate(d_store_z(NGLLX,NGLLY,NGLLZ,NSPEC_CPML),stat=ier)
+ if(ier /= 0) stop 'error allocating array d_store_z'
+ allocate(K_store_x(NGLLX,NGLLY,NGLLZ,NSPEC_CPML),stat=ier)
+ if(ier /= 0) stop 'error allocating array K_store_x'
+ allocate(K_store_y(NGLLX,NGLLY,NGLLZ,NSPEC_CPML),stat=ier)
+ if(ier /= 0) stop 'error allocating array K_store_y'
+ allocate(K_store_z(NGLLX,NGLLY,NGLLZ,NSPEC_CPML),stat=ier)
+ if(ier /= 0) stop 'error allocating array K_store_z'
+ allocate(alpha_store(NGLLX,NGLLY,NGLLZ,NSPEC_CPML),stat=ier)
+ if(ier /= 0) stop 'error allocating array alpha_store'
- read(27) CPML_regions
- read(27) CPML_to_spec
- read(27) is_CPML
- read(27) d_store_x
- read(27) d_store_y
- read(27) d_store_z
- read(27) k_store_x
- read(27) k_store_y
- read(27) k_store_z
- read(27) alpha_store
+ read(27) CPML_regions
+ read(27) CPML_to_spec
+ read(27) is_CPML
+ read(27) d_store_x
+ read(27) d_store_y
+ read(27) d_store_z
+ read(27) k_store_x
+ read(27) k_store_y
+ read(27) k_store_z
+ read(27) alpha_store
- if((SIMULATION_TYPE == 1 .and. SAVE_FORWARD) .or. SIMULATION_TYPE == 3) then
- read(27) nglob_interface_PML_acoustic
- read(27) nglob_interface_PML_elastic
- if(nglob_interface_PML_acoustic > 0) then
- allocate(points_interface_PML_acoustic(nglob_interface_PML_acoustic),stat=ier)
- if(ier /= 0) stop 'error allocating array points_interface_PML_acoustic'
- read(27) points_interface_PML_acoustic
- endif
-
- if(nglob_interface_PML_elastic > 0) then
- allocate(points_interface_PML_elastic(nglob_interface_PML_elastic),stat=ier)
- if(ier /= 0) stop 'error allocating array points_interface_PML_elastic'
- read(27) points_interface_PML_elastic
- endif
- endif
+ if((SIMULATION_TYPE == 1 .and. SAVE_FORWARD) .or. SIMULATION_TYPE == 3) then
+ read(27) nglob_interface_PML_acoustic
+ read(27) nglob_interface_PML_elastic
+ if(nglob_interface_PML_acoustic > 0) then
+ allocate(points_interface_PML_acoustic(nglob_interface_PML_acoustic),stat=ier)
+ if(ier /= 0) stop 'error allocating array points_interface_PML_acoustic'
+ read(27) points_interface_PML_acoustic
+ endif
+ if(nglob_interface_PML_elastic > 0) then
+ allocate(points_interface_PML_elastic(nglob_interface_PML_elastic),stat=ier)
+ if(ier /= 0) stop 'error allocating array points_interface_PML_elastic'
+ read(27) points_interface_PML_elastic
+ endif
+ endif
+ endif
endif
! absorbing boundary surface
@@ -446,15 +449,17 @@
read(27) abs_boundary_ijk
read(27) abs_boundary_jacobian2Dw
read(27) abs_boundary_normal
- ! store mass matrix contributions
- if(ELASTIC_SIMULATION) then
- read(27) rmassx
- read(27) rmassy
- read(27) rmassz
+ if( STACEY_ABSORBING_CONDITIONS ) then
+ ! store mass matrix contributions
+ if(ELASTIC_SIMULATION) then
+ read(27) rmassx
+ read(27) rmassy
+ read(27) rmassz
+ endif
+ if(ACOUSTIC_SIMULATION) then
+ read(27) rmassz_acoustic
+ endif
endif
- if(ACOUSTIC_SIMULATION) then
- read(27) rmassz_acoustic
- endif
endif
endif
@@ -464,6 +469,7 @@
read(27) nspec2D_ymax
read(27) NSPEC2D_BOTTOM
read(27) NSPEC2D_TOP
+
allocate(ibelm_xmin(nspec2D_xmin),ibelm_xmax(nspec2D_xmax), &
ibelm_ymin(nspec2D_ymin),ibelm_ymax(nspec2D_ymax), &
ibelm_bottom(NSPEC2D_BOTTOM),ibelm_top(NSPEC2D_TOP),stat=ier)
More information about the CIG-COMMITS
mailing list