[cig-commits] r22701 - in seismo/3D/SPECFEM3D/trunk: examples/meshfem3D_examples/many_interfaces examples/meshfem3D_examples/many_interfaces/DATA examples/meshfem3D_examples/many_interfaces/DATA/meshfem3D_files src/specfem3D

dkomati1 at geodynamics.org dkomati1 at geodynamics.org
Tue Aug 6 14:02:18 PDT 2013


Author: dkomati1
Date: 2013-08-06 14:02:17 -0700 (Tue, 06 Aug 2013)
New Revision: 22701

Modified:
   seismo/3D/SPECFEM3D/trunk/examples/meshfem3D_examples/many_interfaces/DATA/Par_file
   seismo/3D/SPECFEM3D/trunk/examples/meshfem3D_examples/many_interfaces/DATA/meshfem3D_files/Mesh_Par_file
   seismo/3D/SPECFEM3D/trunk/examples/meshfem3D_examples/many_interfaces/process.sh
   seismo/3D/SPECFEM3D/trunk/src/specfem3D/pml_allocate_arrays.f90
   seismo/3D/SPECFEM3D/trunk/src/specfem3D/prepare_timerun.F90
   seismo/3D/SPECFEM3D/trunk/src/specfem3D/read_mesh_databases.f90
Log:
fixed unallocated CPML arrays when PML_CONDITIONS is off.
Also fixed examples/meshfem3D_examples/many_interfaces.


Modified: seismo/3D/SPECFEM3D/trunk/examples/meshfem3D_examples/many_interfaces/DATA/Par_file
===================================================================
--- seismo/3D/SPECFEM3D/trunk/examples/meshfem3D_examples/many_interfaces/DATA/Par_file	2013-08-06 00:18:52 UTC (rev 22700)
+++ seismo/3D/SPECFEM3D/trunk/examples/meshfem3D_examples/many_interfaces/DATA/Par_file	2013-08-06 21:02:17 UTC (rev 22701)
@@ -12,11 +12,11 @@
 SUPPRESS_UTM_PROJECTION         = .true.
 
 # number of MPI processors
-NPROC                           = 81
+NPROC                           = 405
 
 # time step parameters
 NSTEP                           = 2000
-DT                              = 0.03
+DT                              = 0.0015
 
 # number of nodes for 2D and 3D shape functions for hexahedra
 # we use either 8-node mesh elements (bricks) or 27-node elements.
@@ -81,7 +81,7 @@
 HDUR_MOVIE                      = 0.0
 
 # save AVS or OpenDX mesh files to check the mesh
-SAVE_MESH_FILES                 = .true.
+SAVE_MESH_FILES                 = .false.
 
 # path to store the local database file on each node
 LOCAL_PATH                      = ../OUTPUT_FILES/DATABASES_MPI

Modified: seismo/3D/SPECFEM3D/trunk/examples/meshfem3D_examples/many_interfaces/DATA/meshfem3D_files/Mesh_Par_file
===================================================================
--- seismo/3D/SPECFEM3D/trunk/examples/meshfem3D_examples/many_interfaces/DATA/meshfem3D_files/Mesh_Par_file	2013-08-06 00:18:52 UTC (rev 22700)
+++ seismo/3D/SPECFEM3D/trunk/examples/meshfem3D_examples/many_interfaces/DATA/meshfem3D_files/Mesh_Par_file	2013-08-06 21:02:17 UTC (rev 22701)
@@ -19,7 +19,7 @@
 
 # number of MPI processors along xi and eta (can be different)
 NPROC_XI                        = 9
-NPROC_ETA                       = 9
+NPROC_ETA                       = 45
 
 # Regular/irregular mesh
 USE_REGULAR_MESH                = .false.

Modified: seismo/3D/SPECFEM3D/trunk/examples/meshfem3D_examples/many_interfaces/process.sh
===================================================================
--- seismo/3D/SPECFEM3D/trunk/examples/meshfem3D_examples/many_interfaces/process.sh	2013-08-06 00:18:52 UTC (rev 22700)
+++ seismo/3D/SPECFEM3D/trunk/examples/meshfem3D_examples/many_interfaces/process.sh	2013-08-06 21:02:17 UTC (rev 22701)
@@ -7,7 +7,7 @@
 ###################################################
 
 # number of processes
-NPROC=81
+NPROC=405
 
 ##################################################
 

Modified: seismo/3D/SPECFEM3D/trunk/src/specfem3D/pml_allocate_arrays.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/specfem3D/pml_allocate_arrays.f90	2013-08-06 00:18:52 UTC (rev 22700)
+++ seismo/3D/SPECFEM3D/trunk/src/specfem3D/pml_allocate_arrays.f90	2013-08-06 21:02:17 UTC (rev 22701)
@@ -384,3 +384,82 @@
   endif
 
 end subroutine pml_allocate_arrays
+
+!=====================================================================
+
+subroutine pml_allocate_arrays_dummy()
+
+  use pml_par
+
+  implicit none
+
+  ! local parameters
+  integer :: ier
+
+     allocate(spec_to_CPML(1),stat=ier)
+     allocate(CPML_type(1),stat=ier)
+     allocate(PML_dux_dxl(1,1,1),stat=ier)
+     allocate(PML_dux_dyl(1,1,1),stat=ier)
+     allocate(PML_dux_dzl(1,1,1),stat=ier)
+     allocate(PML_duy_dxl(1,1,1),stat=ier)
+     allocate(PML_duy_dyl(1,1,1),stat=ier)
+     allocate(PML_duy_dzl(1,1,1),stat=ier)
+     allocate(PML_duz_dxl(1,1,1),stat=ier)
+     allocate(PML_duz_dyl(1,1,1),stat=ier)
+     allocate(PML_duz_dzl(1,1,1),stat=ier)
+     allocate(PML_dux_dxl_new(1,1,1),stat=ier)
+     allocate(PML_dux_dyl_new(1,1,1),stat=ier)
+     allocate(PML_dux_dzl_new(1,1,1),stat=ier)
+     allocate(PML_duy_dxl_new(1,1,1),stat=ier)
+     allocate(PML_duy_dyl_new(1,1,1),stat=ier)
+     allocate(PML_duy_dzl_new(1,1,1),stat=ier)
+     allocate(PML_duz_dxl_new(1,1,1),stat=ier)
+     allocate(PML_duz_dyl_new(1,1,1),stat=ier)
+     allocate(PML_duz_dzl_new(1,1,1),stat=ier)
+     allocate(rmemory_dux_dxl_x(1,1,1,1,2),stat=ier)
+     allocate(rmemory_dux_dyl_x(1,1,1,1,2),stat=ier)
+     allocate(rmemory_dux_dzl_x(1,1,1,1,2),stat=ier)
+     allocate(rmemory_duy_dxl_x(1,1,1,1),stat=ier)
+     allocate(rmemory_duy_dyl_x(1,1,1,1),stat=ier)
+     allocate(rmemory_duz_dxl_x(1,1,1,1),stat=ier)
+     allocate(rmemory_duz_dzl_x(1,1,1,1),stat=ier)
+     allocate(rmemory_dux_dxl_y(1,1,1,1),stat=ier)
+     allocate(rmemory_dux_dyl_y(1,1,1,1),stat=ier)
+     allocate(rmemory_duy_dxl_y(1,1,1,1,2),stat=ier)
+     allocate(rmemory_duy_dyl_y(1,1,1,1,2),stat=ier)
+     allocate(rmemory_duy_dzl_y(1,1,1,1,2),stat=ier)
+     allocate(rmemory_duz_dyl_y(1,1,1,1),stat=ier)
+     allocate(rmemory_duz_dzl_y(1,1,1,1),stat=ier)
+     allocate(rmemory_dux_dxl_z(1,1,1,1),stat=ier)
+     allocate(rmemory_dux_dzl_z(1,1,1,1),stat=ier)
+     allocate(rmemory_duy_dyl_z(1,1,1,1),stat=ier)
+     allocate(rmemory_duy_dzl_z(1,1,1,1),stat=ier)
+     allocate(rmemory_duz_dxl_z(1,1,1,1,2),stat=ier)
+     allocate(rmemory_duz_dyl_z(1,1,1,1,2),stat=ier)
+     allocate(rmemory_duz_dzl_z(1,1,1,1,2),stat=ier)
+     allocate(rmemory_displ_elastic(1,1,1,1,1,3),stat=ier)
+     allocate(accel_elastic_CPML(1,1,1,1),stat=ier)
+     allocate(PML_dpotential_dxl(1,1,1),stat=ier)
+     allocate(PML_dpotential_dyl(1,1,1),stat=ier)
+     allocate(PML_dpotential_dzl(1,1,1),stat=ier)
+     allocate(PML_dpotential_dxl_new(1,1,1),stat=ier)
+     allocate(PML_dpotential_dyl_new(1,1,1),stat=ier)
+     allocate(PML_dpotential_dzl_new(1,1,1),stat=ier)
+     allocate(rmemory_dpotential_dxl(1,1,1,1,2),stat=ier)
+     allocate(rmemory_dpotential_dyl(1,1,1,1,2),stat=ier)
+     allocate(rmemory_dpotential_dzl(1,1,1,1,2),stat=ier)
+     allocate(rmemory_potential_acoustic(1,1,1,1,3),stat=ier)
+     allocate(potential_dot_dot_acoustic_CPML(1,1,1),stat=ier)
+     allocate(rmemory_coupling_ac_el_displ(3,1,1,1,1,2),stat=ier)
+     allocate(rmemory_coupling_el_ac_potential(1,1,1,1,2),stat=ier)
+     ! allocates wavefield
+     allocate(b_PML_field(9,1),stat=ier)
+     allocate(b_PML_field(9,1),stat=ier)
+     allocate(b_PML_field(9,1),stat=ier)
+     ! allocates wavefield
+     allocate(b_PML_potential(3,1),stat=ier)
+     allocate(b_PML_potential(3,1),stat=ier)
+     allocate(b_PML_potential(3,1),stat=ier)
+
+end subroutine pml_allocate_arrays_dummy
+

Modified: seismo/3D/SPECFEM3D/trunk/src/specfem3D/prepare_timerun.F90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/specfem3D/prepare_timerun.F90	2013-08-06 00:18:52 UTC (rev 22700)
+++ seismo/3D/SPECFEM3D/trunk/src/specfem3D/prepare_timerun.F90	2013-08-06 21:02:17 UTC (rev 22701)
@@ -80,6 +80,9 @@
     else
        call prepare_timerun_pml()
     endif
+  else
+! dummy allocation with a size of 1 in order to be able to use the array as argument in subroutine calls
+    call pml_allocate_arrays_dummy()
   endif
 
   ! prepares ADJOINT simulations
@@ -749,7 +752,10 @@
 
     ! allocates and initializes C-PML arrays
     if( NSPEC_CPML > 0 ) then
-       call pml_allocate_arrays()
+      call pml_allocate_arrays()
+    else
+    ! dummy allocation with a size of 1 in order to be able to use the array as argument in subroutine calls
+      call pml_allocate_arrays_dummy()
     endif
 
     ! defines C-PML spectral elements local indexing

Modified: seismo/3D/SPECFEM3D/trunk/src/specfem3D/read_mesh_databases.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/specfem3D/read_mesh_databases.f90	2013-08-06 00:18:52 UTC (rev 22700)
+++ seismo/3D/SPECFEM3D/trunk/src/specfem3D/read_mesh_databases.f90	2013-08-06 21:02:17 UTC (rev 22701)
@@ -139,7 +139,8 @@
 
     ! allocates mass matrix
     allocate(rmass(NGLOB_AB),stat=ier)
-    if(PML_CONDITIONS)then ! need to be optimized
+
+    if(PML_CONDITIONS)then
        if(ACOUSTIC_SIMULATION)then
           allocate(rmass_elastic_interface(NGLOB_AB),stat=ier)
           if( ier /= 0 ) stop 'error allocating array rmass_elastic_interface'
@@ -157,7 +158,11 @@
           allocate(rmass_elastic_interface(1),stat=ier)
           allocate(accel_interface(NDIM,1),stat=ier)
        endif
+    else
+      allocate(rmass_elastic_interface(1),stat=ier)
+      allocate(accel_interface(NDIM,1),stat=ier)
     endif
+
     if( ier /= 0 ) stop 'error allocating array rmass'
     ! initializes mass matrix contributions
     allocate(rmassx(NGLOB_AB), &
@@ -371,7 +376,7 @@
     read(27) CPML_width_y
     read(27) CPML_width_z
 
-    allocate(is_CPML(NSPEC_AB),stat=ier) !need to be optimized
+    allocate(is_CPML(NSPEC_AB),stat=ier)
     if(ier /= 0) stop 'error allocating array is_CPML'
 
 ! make sure there are no PMLs by default,
@@ -424,6 +429,9 @@
         endif
       endif
     endif
+  else
+    ! allocate with a dummy size of zero just to be able to use this array as argument in subroutine calls
+    allocate(is_CPML(0),stat=ier)
   endif
 
   ! absorbing boundary surface



More information about the CIG-COMMITS mailing list