[cig-commits] r18519 - in seismo/3D/SPECFEM3D/trunk/src: generate_databases shared specfem3D
dkomati1 at geodynamics.org
dkomati1 at geodynamics.org
Wed Jun 1 06:37:22 PDT 2011
Author: dkomati1
Date: 2011-06-01 06:37:21 -0700 (Wed, 01 Jun 2011)
New Revision: 18519
Added:
seismo/3D/SPECFEM3D/trunk/src/shared/multiply_arrays_source.f90
Modified:
seismo/3D/SPECFEM3D/trunk/src/generate_databases/Makefile.in
seismo/3D/SPECFEM3D/trunk/src/shared/compute_arrays_source.f90
seismo/3D/SPECFEM3D/trunk/src/specfem3D/Makefile.in
Log:
moved src/shared/multiply_arrays_source.f90 to a separate file to avoid subroutine inlining by the compiler inside the same file
Modified: seismo/3D/SPECFEM3D/trunk/src/generate_databases/Makefile.in
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/generate_databases/Makefile.in 2011-06-01 11:26:54 UTC (rev 18518)
+++ seismo/3D/SPECFEM3D/trunk/src/generate_databases/Makefile.in 2011-06-01 13:37:21 UTC (rev 18519)
@@ -69,6 +69,7 @@
$O/calc_jacobian.o \
$O/check_mesh_resolution.o \
$O/compute_arrays_source.o \
+ $O/multiply_arrays_source.o \
$O/create_name_database.o \
$O/create_regions_mesh.o \
$O/create_mass_matrices.o \
@@ -330,6 +331,9 @@
$O/compute_arrays_source.o: ${SHARED}/constants.h ${SHARED}/compute_arrays_source.f90
${FCCOMPILE_CHECK} -c -o $O/compute_arrays_source.o ${SHARED}/compute_arrays_source.f90
+$O/multiply_arrays_source.o: ${SHARED}/constants.h ${SHARED}/multiply_arrays_source.f90
+ ${FCCOMPILE_CHECK} -c -o $O/multiply_arrays_source.o ${SHARED}/multiply_arrays_source.f90
+
$O/get_attenuation_model.o: ${SHARED}/constants.h ${SHARED}/get_attenuation_model.f90
${FCCOMPILE_CHECK} -c -o $O/get_attenuation_model.o ${SHARED}/get_attenuation_model.f90
Modified: seismo/3D/SPECFEM3D/trunk/src/shared/compute_arrays_source.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/shared/compute_arrays_source.f90 2011-06-01 11:26:54 UTC (rev 18518)
+++ seismo/3D/SPECFEM3D/trunk/src/shared/compute_arrays_source.f90 2011-06-01 13:37:21 UTC (rev 18519)
@@ -115,55 +115,6 @@
end subroutine compute_arrays_source
-!================================================================
-
-! we put these multiplications in a separate routine because otherwise
-! some compilers try to unroll the six loops above and take forever to compile
- subroutine multiply_arrays_source(sourcearrayd,G11,G12,G13,G21,G22,G23, &
- G31,G32,G33,hxis,hpxis,hetas,hpetas,hgammas,hpgammas,k,l,m)
-
- implicit none
-
- include "constants.h"
-
-! source arrays
- double precision, dimension(NDIM,NGLLX,NGLLY,NGLLZ) :: sourcearrayd
- double precision, dimension(NGLLX,NGLLY,NGLLZ) :: G11,G12,G13,G21,G22,G23,G31,G32,G33
- double precision, dimension(NGLLX) :: hxis,hpxis
- double precision, dimension(NGLLY) :: hetas,hpetas
- double precision, dimension(NGLLZ) :: hgammas,hpgammas
-
- integer k,l,m
-
- integer ir,it,iv
-
- sourcearrayd(:,k,l,m) = ZERO
-
- do iv=1,NGLLZ
- do it=1,NGLLY
- do ir=1,NGLLX
-
- sourcearrayd(1,k,l,m) = sourcearrayd(1,k,l,m) + hxis(ir)*hetas(it)*hgammas(iv) &
- *(G11(ir,it,iv)*hpxis(k)*hetas(l)*hgammas(m) &
- +G12(ir,it,iv)*hxis(k)*hpetas(l)*hgammas(m) &
- +G13(ir,it,iv)*hxis(k)*hetas(l)*hpgammas(m))
-
- sourcearrayd(2,k,l,m) = sourcearrayd(2,k,l,m) + hxis(ir)*hetas(it)*hgammas(iv) &
- *(G21(ir,it,iv)*hpxis(k)*hetas(l)*hgammas(m) &
- +G22(ir,it,iv)*hxis(k)*hpetas(l)*hgammas(m) &
- +G23(ir,it,iv)*hxis(k)*hetas(l)*hpgammas(m))
-
- sourcearrayd(3,k,l,m) = sourcearrayd(3,k,l,m) + hxis(ir)*hetas(it)*hgammas(iv) &
- *(G31(ir,it,iv)*hpxis(k)*hetas(l)*hgammas(m) &
- +G32(ir,it,iv)*hxis(k)*hpetas(l)*hgammas(m) &
- +G33(ir,it,iv)*hxis(k)*hetas(l)*hpgammas(m))
-
- enddo
- enddo
- enddo
-
- end subroutine multiply_arrays_source
-
!=============================================================================
subroutine compute_arrays_adjoint_source(myrank, adj_source_file, &
Added: seismo/3D/SPECFEM3D/trunk/src/shared/multiply_arrays_source.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/shared/multiply_arrays_source.f90 (rev 0)
+++ seismo/3D/SPECFEM3D/trunk/src/shared/multiply_arrays_source.f90 2011-06-01 13:37:21 UTC (rev 18519)
@@ -0,0 +1,76 @@
+!=====================================================================
+!
+! S p e c f e m 3 D V e r s i o n 2 . 0
+! ---------------------------------------
+!
+! Main authors: Dimitri Komatitsch and Jeroen Tromp
+! Princeton University, USA and University of Pau / CNRS / INRIA
+! (c) Princeton University / California Institute of Technology and University of Pau / CNRS / INRIA
+! April 2011
+!
+! This program is free software; you can redistribute it and/or modify
+! it under the terms of the GNU General Public License as published by
+! the Free Software Foundation; either version 2 of the License, or
+! (at your option) any later version.
+!
+! This program is distributed in the hope that it will be useful,
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+! GNU General Public License for more details.
+!
+! You should have received a copy of the GNU General Public License along
+! with this program; if not, write to the Free Software Foundation, Inc.,
+! 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+!
+!=====================================================================
+
+! we put these multiplications in a separate routine AND IN A SEPARATE FILE because otherwise
+! some compilers try to unroll the six loops above and take forever to compile
+
+! we leave this in a separate file otherwise many compilers perform subroutine inlining when
+! two subroutines are in the same file and one calls the other
+ subroutine multiply_arrays_source(sourcearrayd,G11,G12,G13,G21,G22,G23, &
+ G31,G32,G33,hxis,hpxis,hetas,hpetas,hgammas,hpgammas,k,l,m)
+
+ implicit none
+
+ include "constants.h"
+
+! source arrays
+ double precision, dimension(NDIM,NGLLX,NGLLY,NGLLZ) :: sourcearrayd
+ double precision, dimension(NGLLX,NGLLY,NGLLZ) :: G11,G12,G13,G21,G22,G23,G31,G32,G33
+ double precision, dimension(NGLLX) :: hxis,hpxis
+ double precision, dimension(NGLLY) :: hetas,hpetas
+ double precision, dimension(NGLLZ) :: hgammas,hpgammas
+
+ integer k,l,m
+
+ integer ir,it,iv
+
+ sourcearrayd(:,k,l,m) = ZERO
+
+ do iv=1,NGLLZ
+ do it=1,NGLLY
+ do ir=1,NGLLX
+
+ sourcearrayd(1,k,l,m) = sourcearrayd(1,k,l,m) + hxis(ir)*hetas(it)*hgammas(iv) &
+ *(G11(ir,it,iv)*hpxis(k)*hetas(l)*hgammas(m) &
+ +G12(ir,it,iv)*hxis(k)*hpetas(l)*hgammas(m) &
+ +G13(ir,it,iv)*hxis(k)*hetas(l)*hpgammas(m))
+
+ sourcearrayd(2,k,l,m) = sourcearrayd(2,k,l,m) + hxis(ir)*hetas(it)*hgammas(iv) &
+ *(G21(ir,it,iv)*hpxis(k)*hetas(l)*hgammas(m) &
+ +G22(ir,it,iv)*hxis(k)*hpetas(l)*hgammas(m) &
+ +G23(ir,it,iv)*hxis(k)*hetas(l)*hpgammas(m))
+
+ sourcearrayd(3,k,l,m) = sourcearrayd(3,k,l,m) + hxis(ir)*hetas(it)*hgammas(iv) &
+ *(G31(ir,it,iv)*hpxis(k)*hetas(l)*hgammas(m) &
+ +G32(ir,it,iv)*hxis(k)*hpetas(l)*hgammas(m) &
+ +G33(ir,it,iv)*hxis(k)*hetas(l)*hpgammas(m))
+
+ enddo
+ enddo
+ enddo
+
+ end subroutine multiply_arrays_source
+
Modified: seismo/3D/SPECFEM3D/trunk/src/specfem3D/Makefile.in
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/specfem3D/Makefile.in 2011-06-01 11:26:54 UTC (rev 18518)
+++ seismo/3D/SPECFEM3D/trunk/src/specfem3D/Makefile.in 2011-06-01 13:37:21 UTC (rev 18519)
@@ -70,6 +70,7 @@
$O/comp_source_time_function.o \
$O/compute_adj_source_frechet.o \
$O/compute_arrays_source.o \
+ $O/multiply_arrays_source.o \
$O/create_name_database.o \
$O/create_serial_name_database.o \
$O/define_derivation_matrices.o \
@@ -452,6 +453,9 @@
$O/compute_arrays_source.o: $(SHARED)constants.h ${SHARED}/compute_arrays_source.f90
${FCCOMPILE_CHECK} -c -o $O/compute_arrays_source.o ${SHARED}/compute_arrays_source.f90
+$O/multiply_arrays_source.o: ${SHARED}/constants.h ${SHARED}/multiply_arrays_source.f90
+ ${FCCOMPILE_CHECK} -c -o $O/multiply_arrays_source.o ${SHARED}/multiply_arrays_source.f90
+
$O/get_attenuation_model.o: $(SHARED)constants.h ${SHARED}/get_attenuation_model.f90
${FCCOMPILE_CHECK} -c -o $O/get_attenuation_model.o ${SHARED}/get_attenuation_model.f90
More information about the CIG-COMMITS
mailing list