[cig-commits] [commit] devel: switched to the right version of the EXAMPLES; and fixed a small bug in the allocation of is_PML(), which is used in plotpost.f90 even when the PMLs are off (2337e21)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Tue Apr 8 03:02:02 PDT 2014
Repository : ssh://geoshell/specfem2d
On branch : devel
Link : https://github.com/geodynamics/specfem2d/compare/e4fa9d03bf2b0fc1837c42aa51eeb63f360575fe...fc67e6fd7ad890705b2b72b4b3c509accb22249e
>---------------------------------------------------------------
commit 2337e21f9e89c4b6edcb7330765227496cfdecbe
Author: Dimitri Komatitsch <komatitsch at lma.cnrs-mrs.fr>
Date: Tue Mar 18 04:28:25 2014 +0100
switched to the right version of the EXAMPLES; and fixed a small bug in the allocation of is_PML(), which is used in plotpost.f90 even when the PMLs are off
>---------------------------------------------------------------
2337e21f9e89c4b6edcb7330765227496cfdecbe
EXAMPLES | 2 +-
src/specfem2D/define_external_model.f90 | 16 ++++++++++++----
src/specfem2D/specfem2D.F90 | 9 +++++----
3 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/EXAMPLES b/EXAMPLES
index 97278fd..3f66877 160000
--- a/EXAMPLES
+++ b/EXAMPLES
@@ -1 +1 @@
-Subproject commit 97278fdba59533c8051ce8e771ceb2351f1b5157
+Subproject commit 3f668770e35719b31929f1d6e23f4fdc0e81d13b
diff --git a/src/specfem2D/define_external_model.f90 b/src/specfem2D/define_external_model.f90
index d68cddd..70c4645 100644
--- a/src/specfem2D/define_external_model.f90
+++ b/src/specfem2D/define_external_model.f90
@@ -42,13 +42,17 @@
!
!========================================================================
- subroutine define_external_model(coord,material_element,ibool,rho,vp,vs,QKappa_attenuation,Qmu_attenuation, &
+ subroutine define_external_model_dummy(coord,material_element,ibool,rho,vp,vs,QKappa_attenuation,Qmu_attenuation, &
c11,c13,c15,c33,c35,c55,c12,c23,c25,nspec,nglob)
implicit none
include "constants.h"
+! -------------------------------------------------------------------------------------
+! Dummy example of this routine, to be used as a template that can be modified by users
+! -------------------------------------------------------------------------------------
+
! user can modify this routine to assign any different external model (rho, vp, vs)
! based on the x and y coordinates of that grid point and the material number of the region it belongs to
@@ -121,7 +125,7 @@
enddo
enddo
- end subroutine define_external_model
+ end subroutine define_external_model_dummy
!========================================================================
@@ -130,9 +134,13 @@
!
!========================================================================
- subroutine define_external_model_ak135f(coord,material_element,ibool,rho,vp,vs,QKappa_attenuation,Qmu_attenuation, &
+ subroutine define_external_model(coord,material_element,ibool,rho,vp,vs,QKappa_attenuation,Qmu_attenuation, &
c11,c13,c15,c33,c35,c55,c12,c23,c25,nspec,nglob)
+! -------------------------------------------------------------------------------------
+! true example of this routine that implements the AK135F global Earth model
+! -------------------------------------------------------------------------------------
+
implicit none
include "constants.h"
@@ -1111,5 +1119,5 @@
c23(:,:,:) = 0.d0
c25(:,:,:) = 0.d0
- end subroutine define_external_model_ak135f
+ end subroutine define_external_model
diff --git a/src/specfem2D/specfem2D.F90 b/src/specfem2D/specfem2D.F90
index b90ccd6..88923bf 100644
--- a/src/specfem2D/specfem2D.F90
+++ b/src/specfem2D/specfem2D.F90
@@ -2771,12 +2771,14 @@
call MPI_ALLREDUCE(anyabs, anyabs_glob, 1, MPI_LOGICAL, MPI_LOR, MPI_COMM_WORLD, ier)
#endif
+ ! allocate this in all cases, even if PML is not set, because we use it for PostScript display as well
+ allocate(is_PML(nspec),stat=ier)
+ if(ier /= 0) stop 'error: not enough memory to allocate array is_PML'
+ is_PML(:) = .false.
+
if(PML_BOUNDARY_CONDITIONS .and. anyabs_glob ) then
- allocate(is_PML(nspec),stat=ier)
- if(ier /= 0) stop 'error: not enough memory to allocate array is_PML'
allocate(spec_to_PML(nspec),stat=ier)
if(ier /= 0) stop 'error: not enough memory to allocate array spec_to_PML'
- is_PML(:) = .false.
allocate(which_PML_elem(4,nspec),stat=ier)
if(ier /= 0) stop 'error: not enough memory to allocate array which_PML_elem'
@@ -3092,7 +3094,6 @@
allocate(rmemory_acoustic_dux_dx_LDDRK(1,1,1,1))
allocate(rmemory_acoustic_dux_dz_LDDRK(1,1,1,1))
- allocate(is_PML(1))
allocate(spec_to_PML(1))
allocate(K_x_store(1,1,1))
More information about the CIG-COMMITS
mailing list