[CIG-SEISMO] patch for precision issue with sign() with gfortran 4.6

Brad Aagaard baagaard at usgs.gov
Thu Feb 9 17:26:43 PST 2012


SPECFEM developers,

In order to build SPECFEM3D from the SVN repository with gfortran 4.6, I 
needed to explicitly specify double precision for the 1.0 argument in 
the call to the sign() function (see below). My config.log is attached 
in case that helps identify whether this is an actual issue or user error.

Thanks,
Brad


Index: src/specfem3D/setup_sources_receivers.f90
===================================================================
--- src/specfem3D/setup_sources_receivers.f90   (revision 19607)
+++ src/specfem3D/setup_sources_receivers.f90   (working copy)
@@ -570,7 +570,7 @@
            ! determines factor +/-1 depending on sign of moment tensor
            ! (see e.g. Krebs et al., 2009. Fast full-wavefield seismic 
inversion using encoded sources,
            !   Geophysics, 74 (6), WCC177-WCC188.)
-          pm1_source_encoding(isource) = sign(1.0,Mxx(isource))
+          pm1_source_encoding(isource) = sign(1.0d0,Mxx(isource))

            ! source array interpolated on all element gll points (only 
used for non point sources)
            call 
compute_arrays_source_acoustic(xi_source(isource),eta_source(isource),gamma_source(isource),&
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: config.log
Url: http://geodynamics.org/pipermail/cig-seismo/attachments/20120209/7f7c2be9/attachment-0001.txt 


More information about the CIG-SEISMO mailing list