[cig-commits] r12809 - in seismo/3D/SPECFEM3D_GLOBE/trunk: . version41_beta/setup version41_beta/src

dkomati1 at geodynamics.org dkomati1 at geodynamics.org
Thu Sep 4 14:17:53 PDT 2008


Author: dkomati1
Date: 2008-09-04 14:17:52 -0700 (Thu, 04 Sep 2008)
New Revision: 12809

Modified:
   seismo/3D/SPECFEM3D_GLOBE/trunk/constants.h.in
   seismo/3D/SPECFEM3D_GLOBE/trunk/locate_receivers.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/locate_sources.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/version41_beta/setup/constants.h
   seismo/3D/SPECFEM3D_GLOBE/trunk/version41_beta/src/locate_receivers.F90
   seismo/3D/SPECFEM3D_GLOBE/trunk/version41_beta/src/locate_sources.F90
Log:
added ASSUME_PERFECT_SPHERE flag to turn off the conversion of geographic to geocentric coordinates for the seismic source and the stations; i.e. assume a perfect sphere, which can be useful for benchmarks of a spherical Earth with fictitious sources and stations.


Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/constants.h.in
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/constants.h.in	2008-09-04 21:05:58 UTC (rev 12808)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/constants.h.in	2008-09-04 21:17:52 UTC (rev 12809)
@@ -179,6 +179,11 @@
   logical, parameter :: ACTUALLY_COUPLE_FLUID_CMB = .true.
   logical, parameter :: ACTUALLY_COUPLE_FLUID_ICB = .true.
 
+! flag to turn off the conversion of geographic to geocentric coordinates for
+! the seismic source and the stations; i.e. assume a perfect sphere, which
+! can be useful for benchmarks of a spherical Earth with fictitious sources and stations
+  logical, parameter :: ASSUME_PERFECT_SPHERE = .false.
+
 !! DK DK UGLY added this in case we are running on MareNostrum in Barcelona
 !! DK DK UGLY because we then need some calls to the system to use GPFS
   logical, parameter :: RUN_ON_MARENOSTRUM_BARCELONA = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/locate_receivers.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/locate_receivers.f90	2008-09-04 21:05:58 UTC (rev 12808)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/locate_receivers.f90	2008-09-04 21:17:52 UTC (rev 12809)
@@ -222,12 +222,16 @@
   do irec=1,nrec
 
 ! set distance to huge initial value
-    distmin=HUGEVAL
+    distmin = HUGEVAL
 
-! convert geographic latitude stlat (degrees)
-! to geocentric colatitude theta (radians)
-    theta=PI/2.0d0-atan(0.99329534d0*dtan(stlat(irec)*PI/180.0d0))
-    phi=stlon(irec)*PI/180.0d0
+! convert geographic latitude stlat (degrees) to geocentric colatitude theta (radians)
+    if(ASSUME_PERFECT_SPHERE) then
+      theta = PI/2.0d0 - stlat(irec)*PI/180.0d0
+    else
+      theta = PI/2.0d0 - atan(0.99329534d0*dtan(stlat(irec)*PI/180.0d0))
+    endif
+
+    phi = stlon(irec)*PI/180.0d0
     call reduce(theta,phi)
 
 ! compute epicentral distance

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/locate_sources.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/locate_sources.f90	2008-09-04 21:05:58 UTC (rev 12808)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/locate_sources.f90	2008-09-04 21:17:52 UTC (rev 12809)
@@ -243,10 +243,14 @@
 ! mapping from source number in current subset to real source number in all the subsets
   isource = isource_in_this_subset + isources_already_done
 
-! convert geographic latitude lat (degrees)
-! to geocentric colatitude theta (radians)
-  theta=PI/2.0d0-atan(0.99329534d0*dtan(lat(isource)*PI/180.0d0))
-  phi=long(isource)*PI/180.0d0
+! convert geographic latitude lat (degrees) to geocentric colatitude theta (radians)
+  if(ASSUME_PERFECT_SPHERE) then
+    theta = PI/2.0d0 - lat(isource)*PI/180.0d0
+  else
+    theta = PI/2.0d0 - atan(0.99329534d0*dtan(lat(isource)*PI/180.0d0))
+  endif
+
+  phi = long(isource)*PI/180.0d0
   call reduce(theta,phi)
 
 ! get the moment tensor

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/version41_beta/setup/constants.h
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/version41_beta/setup/constants.h	2008-09-04 21:05:58 UTC (rev 12808)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/version41_beta/setup/constants.h	2008-09-04 21:17:52 UTC (rev 12809)
@@ -175,6 +175,11 @@
   logical, parameter :: ACTUALLY_COUPLE_FLUID_CMB = .true.
   logical, parameter :: ACTUALLY_COUPLE_FLUID_ICB = .true.
 
+! flag to turn off the conversion of geographic to geocentric coordinates for
+! the seismic source and the stations; i.e. assume a perfect sphere, which
+! can be useful for benchmarks of a spherical Earth with fictitious sources and stations
+  logical, parameter :: ASSUME_PERFECT_SPHERE = .false.
+
 ! flag to only create the mesh but not start the solver (for instance to check the mesh obtained)
   logical, parameter :: MESHER_ONLY = .false.
 

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/version41_beta/src/locate_receivers.F90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/version41_beta/src/locate_receivers.F90	2008-09-04 21:05:58 UTC (rev 12808)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/version41_beta/src/locate_receivers.F90	2008-09-04 21:17:52 UTC (rev 12809)
@@ -222,9 +222,13 @@
 ! set distance to huge initial value
     distmin = HUGEVAL
 
-! convert geographic latitude stlat (degrees)
-! to geocentric colatitude theta (radians)
-    theta = PI/2.0d0-atan(0.99329534d0*dtan(stlat(irec)*PI/180.0d0))
+! convert geographic latitude stlat (degrees) to geocentric colatitude theta (radians)
+    if(ASSUME_PERFECT_SPHERE) then
+      theta = PI/2.0d0 - stlat(irec)*PI/180.0d0
+    else
+      theta = PI/2.0d0 - atan(0.99329534d0*dtan(stlat(irec)*PI/180.0d0))
+    endif
+
     phi = stlon(irec)*PI/180.0d0
     call reduce(theta,phi)
 

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/version41_beta/src/locate_sources.F90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/version41_beta/src/locate_sources.F90	2008-09-04 21:05:58 UTC (rev 12808)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/version41_beta/src/locate_sources.F90	2008-09-04 21:17:52 UTC (rev 12809)
@@ -237,10 +237,14 @@
 ! mapping from source number in current subset to real source number in all the subsets
   isource = isource_in_this_subset + isources_already_done
 
-! convert geographic latitude lat (degrees)
-! to geocentric colatitude theta (radians)
-  theta=PI/2.0d0-atan(0.99329534d0*dtan(lat(isource)*PI/180.0d0))
-  phi=long(isource)*PI/180.0d0
+! convert geographic latitude lat (degrees) to geocentric colatitude theta (radians)
+  if(ASSUME_PERFECT_SPHERE) then
+    theta = PI/2.0d0 - lat(isource)*PI/180.0d0
+  else
+    theta = PI/2.0d0 - atan(0.99329534d0*dtan(lat(isource)*PI/180.0d0))
+  endif
+
+  phi = long(isource)*PI/180.0d0
   call reduce(theta,phi)
 
 ! get the moment tensor



More information about the cig-commits mailing list