[cig-commits] r18026 - in seismo/2D/SPECFEM2D/trunk/src: meshfem2D specfem2D

carltape at geodynamics.org carltape at geodynamics.org
Thu Mar 3 14:25:32 PST 2011


Author: carltape
Date: 2011-03-03 14:25:32 -0800 (Thu, 03 Mar 2011)
New Revision: 18026

Modified:
   seismo/2D/SPECFEM2D/trunk/src/meshfem2D/meshfem2D.F90
   seismo/2D/SPECFEM2D/trunk/src/meshfem2D/save_stations_file.f90
   seismo/2D/SPECFEM2D/trunk/src/specfem2D/locate_receivers.F90
   seismo/2D/SPECFEM2D/trunk/src/specfem2D/setup_sources_receivers.f90
Log:
write actual source locations and actual station locations to files (SOURCE_xz.dat, STATIONS) from setup_sources_receivers.f90; updated related print statements.


Modified: seismo/2D/SPECFEM2D/trunk/src/meshfem2D/meshfem2D.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/meshfem2D/meshfem2D.F90	2011-03-03 20:55:23 UTC (rev 18025)
+++ seismo/2D/SPECFEM2D/trunk/src/meshfem2D/meshfem2D.F90	2011-03-03 22:25:32 UTC (rev 18026)
@@ -506,8 +506,12 @@
         ! check if we are in the last layer, which contains topography,
         ! and modify the position of the source accordingly if it is located exactly at the surface
         do i_source=1,NSOURCES
-           if(source_surf(i_source) .and. ilayer == number_of_layers) &
+           if(source_surf(i_source) .and. ilayer == number_of_layers ) then
+                print *, 'source ', i_source
+                print *, '  target (input) z: ', zs(i_source)
                 zs(i_source) = value_spline(xs(i_source),xinterface_top,zinterface_top,coefs_interface_top,npoints_interface_top)
+                print *, '  surface (actual) z: ', zs(i_source)
+           endif
         enddo
 
         ! compute the offset of this layer in terms of number of spectral elements below along Z

Modified: seismo/2D/SPECFEM2D/trunk/src/meshfem2D/save_stations_file.f90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/meshfem2D/save_stations_file.f90	2011-03-03 20:55:23 UTC (rev 18025)
+++ seismo/2D/SPECFEM2D/trunk/src/meshfem2D/save_stations_file.f90	2011-03-03 22:25:32 UTC (rev 18026)
@@ -75,7 +75,7 @@
   print *,'There are ',nrec_total,' receivers'
 
   print *
-  print *,'Position (x,z) of the ',nrec_total,' receivers'
+  print *,'Target positions (x,z) of the ',nrec_total,' receivers'
   print *
 
   open(unit=15,file='DATA/STATIONS_target',status='unknown',iostat=ios)

Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/locate_receivers.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/locate_receivers.F90	2011-03-03 20:55:23 UTC (rev 18025)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/locate_receivers.F90	2011-03-03 22:25:32 UTC (rev 18026)
@@ -295,15 +295,6 @@
     write(IOUT,*) 'end of receiver detection'
     write(IOUT,*)
 
-    ! write out actual station locations (compare with STATIONS_target from meshfem2D)
-    ! NOTE: this will be written out even if generate_STATIONS = .false.
-    open(unit=15,file='DATA/STATIONS',status='unknown')
-    do irec = 1,nrec
-      write(15,"('S',i4.4,'    AA ',f20.7,1x,f20.7,'       0.0         0.0')") &
-          irec,x_final_receiver(irec),z_final_receiver(irec)
-    enddo
-    close(15)
-
   endif
 
   ! deallocate arrays

Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/setup_sources_receivers.f90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/setup_sources_receivers.f90	2011-03-03 20:55:23 UTC (rev 18025)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/setup_sources_receivers.f90	2011-03-03 22:25:32 UTC (rev 18026)
@@ -93,7 +93,7 @@
   integer  :: ixmin, ixmax, izmin, izmax
 
   ! Local variables
-  integer i_source,ispec,ispec_acoustic_surface
+  integer irec,i_source,ispec,ispec_acoustic_surface
 
   do i_source=1,NSOURCES
 
@@ -166,5 +166,27 @@
                       coorg,knods,ngnod,npgeo,ipass, &
                       x_final_receiver,z_final_receiver)
 
+  if (myrank == 0 .and. ipass == 1) then
+
+     ! write actual source locations to file
+     ! note that these may differ from input values, especially if source_surf = .true. in SOURCE
+     ! note that the exact source locations are determined from (ispec,xi,gamma) values
+     open(unit=14,file='DATA/SOURCE_xz.dat',status='unknown')
+     do i_source=1,NSOURCES
+        write(14,*) x_source(i_source), z_source(i_source)
+     enddo
+     close(14)
+
+     ! write out actual station locations (compare with STATIONS_target from meshfem2D)
+     ! NOTE: this will be written out even if generate_STATIONS = .false.
+     open(unit=15,file='DATA/STATIONS',status='unknown')
+     do irec = 1,nrec
+        write(15,"('S',i4.4,'    AA ',f20.7,1x,f20.7,'       0.0         0.0')") &
+             irec,x_final_receiver(irec),z_final_receiver(irec)
+     enddo
+     close(15)
+
+  endif
+
   end subroutine setup_sources_receivers
 



More information about the CIG-COMMITS mailing list