[cig-commits] [commit] devel, master: changed processing script for EXAMPLES/noise_uniform so that it computes both kernel contributions instead of just one (9093091)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Jun 18 15:19:30 PDT 2014


Repository : https://github.com/geodynamics/specfem2d

On branches: devel,master
Link       : https://github.com/geodynamics/specfem2d/compare/fc67e6fd7ad890705b2b72b4b3c509accb22249e...e9ca46c40131588d89d7b0883250bc6584ce6b4c

>---------------------------------------------------------------

commit 909309115696bd7f96b9f2dd14292eb0b99e5115
Author: Ryan Modrak <rmodrak at princeton.edu>
Date:   Tue Sep 13 02:20:10 2011 +0000

    changed processing script for EXAMPLES/noise_uniform so that it computes both kernel contributions instead of just one


>---------------------------------------------------------------

909309115696bd7f96b9f2dd14292eb0b99e5115
 noise_uniform/Par_file_noise_1               | 26 ++++-----
 noise_uniform/Par_file_noise_2               | 26 ++++-----
 noise_uniform/Par_file_noise_3               | 26 ++++-----
 noise_uniform/STATIONS_target_noise          |  6 +--
 noise_uniform/adj_cc.f90                     | 79 +++++++++++++---------------
 noise_uniform/clean                          |  2 +-
 noise_uniform/{process.sh => contribution_1} | 46 +++++++++-------
 noise_uniform/contribution_2                 | 75 ++++++++++++++++++++++++++
 noise_uniform/process.sh                     | 69 +++---------------------
 noise_uniform/uniform.dat                    |  8 +--
 10 files changed, 194 insertions(+), 169 deletions(-)

diff --git a/noise_uniform/Par_file_noise_1 b/noise_uniform/Par_file_noise_1
index 79b14b3..1892fb1 100644
--- a/noise_uniform/Par_file_noise_1
+++ b/noise_uniform/Par_file_noise_1
@@ -13,7 +13,7 @@ partitioning_method             = 3              # SCOTCH = 3, ascending order (
 ngnod                           = 9              # number of control nodes per element (4 or 9)
 initialfield                    = .false.        # use a plane wave as source or not
 add_Bielak_conditions           = .false.        # add Bielak conditions or not if initial plane wave
-assign_external_model           = .false.        # define external earth model or not
+assign_external_model           = .false.         # define external earth model or not
 READ_EXTERNAL_SEP_FILE          = .false.        # Read external SEP file from DATA/model_velocity.dat_input, or use routine
 TURN_ATTENUATION_ON             = .false.        # turn attenuation on or off for solid medium
 TURN_VISCATTENUATION_ON         = .false.        # turn viscous attenuation on or off
@@ -22,8 +22,8 @@ freq0                           =  10            # frequency for viscous attenua
 p_sv                            = .false.        # set the type of calculation (P-SV or SH/membrane waves)
 
 # time step parameters
-nt                              = 6000           # total number of time steps
-deltat                          = 1.d-3          # duration of a time step
+nt                              = 4000           # total number of time steps
+deltat                          = 4.d-2          # duration of a time step
 
 # source parameters
 NSOURCES                        = 1              # number of sources [source info read in CMTSOLUTION file]
@@ -49,9 +49,9 @@ zfin                            = 1500.          # last receiver z in meters (ig
 enreg_surf_same_vertical        = .false.        # receivers inside the medium or at the surface
 
 # display parameters
-NTSTEP_BETWEEN_OUTPUT_INFO      = 100            # display frequency in time steps
-output_postscript_snapshot      = .true.         # output Postscript snapshot of the results
-output_color_image              = .true.         # output color image of the results
+NTSTEP_BETWEEN_OUTPUT_INFO      = 250            # display frequency in time steps
+output_postscript_snapshot      = .false.        # output Postscript snapshot of the results
+output_color_image              = .false.        # output color image of the results
 imagetype                       = 1              # display 1=displ 2=veloc 3=accel 4=pressure
 cutsnaps                        = 1.             # minimum amplitude in % for snapshots
 meshvect                        = .true.         # display mesh on vector plots or not
@@ -69,12 +69,12 @@ output_wavefield_snapshot       = .false.        # output Ux,Uy,Uz text file for
 # velocity and density models
 nbmodels                        = 1              # nb of different models
 # define models as
-# I:   (model_number 1 rho Vp Vs 0 0 QKappa Qmu 0 0 0 0 0 0) or
+# I:   (model_number 1 rho Vp Vs 0 0 Qp Qs 0 0 0 0 0 0) or
 # II:  (model_number 2 rho c11 c13 c15 c33 c35 c55 0 0 0 0 0 0) or
-# III: (model_number 3 rhos rhof phi c kxx kxz kzz Ks Kf Kfr etaf mufr Qmu).
+# III: (model_number 3 rhos rhof phi c kxx kxz kzz Ks Kf Kfr etaf mufr Qs).
 # For istropic elastic/acoustic material use I and set Vs to zero to make a given model acoustic, for anisotropic elastic use II,
 # and for isotropic poroelastic material use III. The mesh can contain acoustic, elastic, and poroelastic models simultaneously.
-1 1 2300.d0 2450.d0 1425.d0 0 0 9999 9999 0 0 0 0 0 0
+1 1 3000.d0 5196.d0 3000.d0 0 0 1e6 1e6 0 0 0 0 0 0
 
 # external mesh or not
 read_external_mesh              = .false.
@@ -101,9 +101,9 @@ tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the
 interfacesfile                  = uniform.dat
 
 # geometry of the model (origin lower-left corner = 0,0) and mesh description
-xmin                            = 0.d0           # abscissa of left side of the model
-xmax                            = 4000.d0        # abscissa of right side of the model
-nx                              = 80             # number of elements along X
+xmin                            = 0.d0             # abscissa of left side of the model
+xmax                            = 300000.d0        # abscissa of right side of the model
+nx                              = 100              # number of elements along X
 
 # absorbing boundary parameters (see absorbing_conditions above)
 absorbbottom                    = .true.
@@ -113,4 +113,4 @@ absorbleft                      = .true.
 
 # define the different regions of the model in the (nx,nz) spectral element mesh
 nbregions                       = 1              # nb of regions and model number for each
-1 80  1 60 1
+1 100  1 80 1
diff --git a/noise_uniform/Par_file_noise_2 b/noise_uniform/Par_file_noise_2
index 48cfc53..4afa899 100644
--- a/noise_uniform/Par_file_noise_2
+++ b/noise_uniform/Par_file_noise_2
@@ -13,7 +13,7 @@ partitioning_method             = 3              # SCOTCH = 3, ascending order (
 ngnod                           = 9              # number of control nodes per element (4 or 9)
 initialfield                    = .false.        # use a plane wave as source or not
 add_Bielak_conditions           = .false.        # add Bielak conditions or not if initial plane wave
-assign_external_model           = .false.        # define external earth model or not
+assign_external_model           = .false.         # define external earth model or not
 READ_EXTERNAL_SEP_FILE          = .false.        # Read external SEP file from DATA/model_velocity.dat_input, or use routine
 TURN_ATTENUATION_ON             = .false.        # turn attenuation on or off for solid medium
 TURN_VISCATTENUATION_ON         = .false.        # turn viscous attenuation on or off
@@ -22,8 +22,8 @@ freq0                           =  10            # frequency for viscous attenua
 p_sv                            = .false.        # set the type of calculation (P-SV or SH/membrane waves)
 
 # time step parameters
-nt                              = 6000           # total number of time steps
-deltat                          = 1.d-3          # duration of a time step
+nt                              = 4000           # total number of time steps
+deltat                          = 4.d-2          # duration of a time step
 
 # source parameters
 NSOURCES                        = 1              # number of sources [source info read in CMTSOLUTION file]
@@ -49,9 +49,9 @@ zfin                            = 1500.          # last receiver z in meters (ig
 enreg_surf_same_vertical        = .false.        # receivers inside the medium or at the surface
 
 # display parameters
-NTSTEP_BETWEEN_OUTPUT_INFO      = 100            # display frequency in time steps
-output_postscript_snapshot      = .true.         # output Postscript snapshot of the results
-output_color_image              = .true.         # output color image of the results
+NTSTEP_BETWEEN_OUTPUT_INFO      = 250            # display frequency in time steps
+output_postscript_snapshot      = .false.        # output Postscript snapshot of the results
+output_color_image              = .false.        # output color image of the results
 imagetype                       = 1              # display 1=displ 2=veloc 3=accel 4=pressure
 cutsnaps                        = 1.             # minimum amplitude in % for snapshots
 meshvect                        = .true.         # display mesh on vector plots or not
@@ -69,12 +69,12 @@ output_wavefield_snapshot       = .false.        # output Ux,Uy,Uz text file for
 # velocity and density models
 nbmodels                        = 1              # nb of different models
 # define models as
-# I:   (model_number 1 rho Vp Vs 0 0 QKappa Qmu 0 0 0 0 0 0) or
+# I:   (model_number 1 rho Vp Vs 0 0 Qp Qs 0 0 0 0 0 0) or
 # II:  (model_number 2 rho c11 c13 c15 c33 c35 c55 0 0 0 0 0 0) or
-# III: (model_number 3 rhos rhof phi c kxx kxz kzz Ks Kf Kfr etaf mufr Qmu).
+# III: (model_number 3 rhos rhof phi c kxx kxz kzz Ks Kf Kfr etaf mufr Qs).
 # For istropic elastic/acoustic material use I and set Vs to zero to make a given model acoustic, for anisotropic elastic use II,
 # and for isotropic poroelastic material use III. The mesh can contain acoustic, elastic, and poroelastic models simultaneously.
-1 1 2300.d0 2450.d0 1425.d0 0 0 9999 9999 0 0 0 0 0 0
+1 1 3000.d0 5196.d0 3000.d0 0 0 1e6 1e6 0 0 0 0 0 0
 
 # external mesh or not
 read_external_mesh              = .false.
@@ -101,9 +101,9 @@ tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the
 interfacesfile                  = uniform.dat
 
 # geometry of the model (origin lower-left corner = 0,0) and mesh description
-xmin                            = 0.d0           # abscissa of left side of the model
-xmax                            = 4000.d0        # abscissa of right side of the model
-nx                              = 80             # number of elements along X
+xmin                            = 0.d0             # abscissa of left side of the model
+xmax                            = 300000.d0        # abscissa of right side of the model
+nx                              = 100              # number of elements along X
 
 # absorbing boundary parameters (see absorbing_conditions above)
 absorbbottom                    = .true.
@@ -113,4 +113,4 @@ absorbleft                      = .true.
 
 # define the different regions of the model in the (nx,nz) spectral element mesh
 nbregions                       = 1              # nb of regions and model number for each
-1 80  1 60 1
+1 100  1 80 1
diff --git a/noise_uniform/Par_file_noise_3 b/noise_uniform/Par_file_noise_3
index a90fba6..f45ec1f 100644
--- a/noise_uniform/Par_file_noise_3
+++ b/noise_uniform/Par_file_noise_3
@@ -13,7 +13,7 @@ partitioning_method             = 3              # SCOTCH = 3, ascending order (
 ngnod                           = 9              # number of control nodes per element (4 or 9)
 initialfield                    = .false.        # use a plane wave as source or not
 add_Bielak_conditions           = .false.        # add Bielak conditions or not if initial plane wave
-assign_external_model           = .false.        # define external earth model or not
+assign_external_model           = .false.         # define external earth model or not
 READ_EXTERNAL_SEP_FILE          = .false.        # Read external SEP file from DATA/model_velocity.dat_input, or use routine
 TURN_ATTENUATION_ON             = .false.        # turn attenuation on or off for solid medium
 TURN_VISCATTENUATION_ON         = .false.        # turn viscous attenuation on or off
@@ -22,8 +22,8 @@ freq0                           =  10            # frequency for viscous attenua
 p_sv                            = .false.        # set the type of calculation (P-SV or SH/membrane waves)
 
 # time step parameters
-nt                              = 6000           # total number of time steps
-deltat                          = 1.d-3          # duration of a time step
+nt                              = 4000           # total number of time steps
+deltat                          = 4.d-2          # duration of a time step
 
 # source parameters
 NSOURCES                        = 1              # number of sources [source info read in CMTSOLUTION file]
@@ -49,9 +49,9 @@ zfin                            = 1500.          # last receiver z in meters (ig
 enreg_surf_same_vertical        = .false.        # receivers inside the medium or at the surface
 
 # display parameters
-NTSTEP_BETWEEN_OUTPUT_INFO      = 100            # display frequency in time steps
-output_postscript_snapshot      = .true.         # output Postscript snapshot of the results
-output_color_image              = .true.         # output color image of the results
+NTSTEP_BETWEEN_OUTPUT_INFO      = 250            # display frequency in time steps
+output_postscript_snapshot      = .false.        # output Postscript snapshot of the results
+output_color_image              = .false.        # output color image of the results
 imagetype                       = 1              # display 1=displ 2=veloc 3=accel 4=pressure
 cutsnaps                        = 1.             # minimum amplitude in % for snapshots
 meshvect                        = .true.         # display mesh on vector plots or not
@@ -69,12 +69,12 @@ output_wavefield_snapshot       = .false.        # output Ux,Uy,Uz text file for
 # velocity and density models
 nbmodels                        = 1              # nb of different models
 # define models as
-# I:   (model_number 1 rho Vp Vs 0 0 QKappa Qmu 0 0 0 0 0 0) or
+# I:   (model_number 1 rho Vp Vs 0 0 Qp Qs 0 0 0 0 0 0) or
 # II:  (model_number 2 rho c11 c13 c15 c33 c35 c55 0 0 0 0 0 0) or
-# III: (model_number 3 rhos rhof phi c kxx kxz kzz Ks Kf Kfr etaf mufr Qmu).
+# III: (model_number 3 rhos rhof phi c kxx kxz kzz Ks Kf Kfr etaf mufr Qs).
 # For istropic elastic/acoustic material use I and set Vs to zero to make a given model acoustic, for anisotropic elastic use II,
 # and for isotropic poroelastic material use III. The mesh can contain acoustic, elastic, and poroelastic models simultaneously.
-1 1 2300.d0 2450.d0 1425.d0 0 0 9999 9999 0 0 0 0 0 0
+1 1 3000.d0 5196.d0 3000.d0 0 0 1e6 1e6 0 0 0 0 0 0
 
 # external mesh or not
 read_external_mesh              = .false.
@@ -101,9 +101,9 @@ tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the
 interfacesfile                  = uniform.dat
 
 # geometry of the model (origin lower-left corner = 0,0) and mesh description
-xmin                            = 0.d0           # abscissa of left side of the model
-xmax                            = 4000.d0        # abscissa of right side of the model
-nx                              = 80             # number of elements along X
+xmin                            = 0.d0             # abscissa of left side of the model
+xmax                            = 300000.d0        # abscissa of right side of the model
+nx                              = 100              # number of elements along X
 
 # absorbing boundary parameters (see absorbing_conditions above)
 absorbbottom                    = .true.
@@ -113,4 +113,4 @@ absorbleft                      = .true.
 
 # define the different regions of the model in the (nx,nz) spectral element mesh
 nbregions                       = 1              # nb of regions and model number for each
-1 80  1 60 1
+1 100  1 80 1
diff --git a/noise_uniform/STATIONS_target_noise b/noise_uniform/STATIONS_target_noise
index ea64c3f..96117a7 100644
--- a/noise_uniform/STATIONS_target_noise
+++ b/noise_uniform/STATIONS_target_noise
@@ -1,3 +1,3 @@
-S0001    AA         1000.0000000         1500.0000000       0.0         0.0
-S0002    AA         2000.0000000         1500.0000000       0.0         0.0
-S0003    AA         3000.0000000         1500.0000000       0.0         0.0
+S0001    AA       100000.0000000       120000.0000000       0.0         0.0
+S0002    AA       150000.0000000       120000.0000000       0.0         0.0
+S0003    AA       200000.0000000       120000.0000000       0.0         0.0
diff --git a/noise_uniform/adj_cc.f90 b/noise_uniform/adj_cc.f90
index 5406eff..a786a67 100644
--- a/noise_uniform/adj_cc.f90
+++ b/noise_uniform/adj_cc.f90
@@ -2,23 +2,32 @@ program adj_cc
 
 implicit none
 
-! flags
+!choose whether to differentiate traces 0, 1, or 2 times
+integer, parameter :: differentiate = 1
+
+!choose whether to bandpass filter
 logical, parameter :: use_filtering = .true.
+
+!choose exactly one of the following window options
+logical, parameter :: use_negative_branch = .true.
 logical, parameter :: use_positive_branch = .false.
 logical, parameter :: use_custom_window = .false.
+
+!choose whether to time reverse (carried out subsequent to all other processing)
 logical, parameter :: reverse = .true.
-integer, parameter :: differentiate = 1
+
+
 
 ! FILTERING PARAMETERS
 real  freq_low,freq_high
-data  freq_low  / 1.d-2 /
-data  freq_high / 1.5d1  /
-
-! CUSTOM WINDOW PARAMETERS
-real :: w_delay, w_width, w_tukey
-data w_delay / 1.d0 /
-data w_width / 1.d2 /
-data w_tukey / 0.4 /
+data  freq_low  / 2.d-4 /
+data  freq_high / 5.d-1 /
+
+! WINDOW PARAMETERS
+real :: t_begin, t_end, w_tukey
+data t_begin / 45.d0  /
+data t_end   / 65.d0 /
+data w_tukey / 0.4    /
 !see explanation below
 
 ! time variables
@@ -41,17 +50,9 @@ real :: F1,F2,D(8),G,DELT
 real :: alpha, beta
 
 
-! EXPLANATION OF CUSTOM WINDOW PARAMETERS
-
-!To select the desired branch of the cross-correlogram, we employ a Tukey window.  A Tukey taper is just a variant of a cosine taper.  We use three control parameters
-
-!W_DELAY controls the time offset of the window
-!W_WIDTH controls the width of the window (i.e., the total time range over which the window has non-zero support)
-!W_TUKEY controls the sharpness of the drop-off 
-
-!In noise tomography applications, W_DELAY should be roughly equal to the surface wave travel time from the one receiver to the other.
+! EXPLANATION OF WINDOW PARAMETERS
 
-!Checks on W_WIDTH are carried out to make sure that the window makes sense and lies within a single branch of the cross-correlogram. If the the window falls outside these bounds, it will be adjusted.
+!To select the desired branch of the cross-correlogram, we employ a Tukey window.  A Tukey taper is just a variant of a cosine taper.
 
 !W_TUKEY is a number between 0 and 1, 0 being pure boxcar and 1 being pure cosine
 
@@ -89,8 +90,7 @@ seismo_adj(:) = 0.0d0
 !!!!!!!!!! READ INPUT !!!!!!!!!!!!!!!!!!!!
 open(unit=1001,file=trim(file_in),status='old',action='read')
 do it = 1, nt
-    if (.not. reverse) read(1001,*) t(it), seismo_1(it)
-    if (reverse) read(1001,*) t(it), seismo_1(nt-it+1)
+    read(1001,*) t(it), seismo_1(it)
 end do
 close(1001)
 
@@ -131,26 +131,21 @@ end if
 
 !!!!!!!!!! WINDOW !!!!!!!!!!!!!!!!!!!!
 if (use_custom_window) then
-  it_off = floor(w_delay/dt)
-  it_wdt = 2*floor(w_width/(2.*dt))
-else
-  it_off = int(nthalf/2)
-  it_wdt = int(nthalf) + 1
-endif
-alpha = w_tukey
-
-if (use_positive_branch) then
-  write(*,*) 'Choosing positive branch'
-  it_begin = nthalf + it_off - it_wdt/2
-  it_end   = nthalf + it_off + it_wdt/2
-  if (it_begin < nthalf) it_begin = nthalf 
+  it_begin = floor((t_begin - t(1))/dt)
+  it_end   = ceiling((t_end - t(1))/dt)
+  if (it_begin < 1) it_begin = 1
   if (it_end > nt) it_end = nt
-else
+elseif (use_positive_branch) then
+  write(*,*) 'Choosing positive branch'
+  it_begin = nthalf+1
+  it_end   = nt
+elseif (use_negative_branch) then
   write(*,*) 'Choosing negative branch'
-  it_begin = nthalf - it_off - it_wdt/2
-  it_end   = nthalf - it_off + it_wdt/2
-  if (it_begin < 1) it_begin = 1
-  if (it_end > nthalf) it_end = nthalf
+  it_begin = 1
+  it_end   = nthalf
+else
+  write(*,*) 'Must select one of the following: positive_branch, &
+              negative_branch, custom_window.'
 endif
 
 write(*,'(a,2f10.3)') ' Time range: ', t(1), t(nt)
@@ -180,7 +175,6 @@ seismo_4 = w * seismo_3
 !!!!!!!!!! NORMALIZE !!!!!!!!!!!!!!!!!!!!
 seismo_adj = - seismo_4/(DOT_PRODUCT(seismo_4,seismo_4)*dt)
 
-
 !!!!!!!!!! WRITE ADJOINT SOURCE !!!!!!!!!!!!!!!!!!!!
 open(unit=1002,file=trim(file_in)//'.adj',status='unknown',iostat=ios)
 if (ios /= 0) write(*,*) 'Error opening output file.'
@@ -189,7 +183,8 @@ write(*,*) ''
 write(*,*) 'Writing to file: '//trim(file_in)//'.adj'
 
 do it = 1,nt
-    write(1002,'(f16.12,1pe18.8)'), t(it), seismo_adj(it)
+    if (.not. reverse) write(1002,'(f16.12,1pe18.8)'), t(it), seismo_adj(it)
+    if (reverse) write(1002,'(f16.12,1pe18.8)'), t(it), seismo_adj(nt+1-it)
 end do
 close(1002)
 
diff --git a/noise_uniform/clean b/noise_uniform/clean
index 652cdce..08d34f4 100755
--- a/noise_uniform/clean
+++ b/noise_uniform/clean
@@ -5,7 +5,7 @@
 
 echo "Cleaning up."
 
-rm -rf DATA SEM NOISE_TOMOGRAPHY OUTPUT_FILES OUTPUT_ALL &> /dev/null
+rm -rf DATA SEM NOISE_TOMOGRAPHY OUTPUT_FILES OUTPUT_ALL SNAPSHOTS &> /dev/null
 rm xmeshfem2D xspecfem2D &> /dev/null
 rm adj_run &> /dev/null
 rm log.* &> /dev/null
diff --git a/noise_uniform/process.sh b/noise_uniform/contribution_1
similarity index 52%
copy from noise_uniform/process.sh
copy to noise_uniform/contribution_1
index 96e9013..a6b7f45 100755
--- a/noise_uniform/process.sh
+++ b/noise_uniform/contribution_1
@@ -1,43 +1,57 @@
 #!/bin/sh
 
+
 RUN_DIR=$PWD
 
-# prepare directories
-rm -rf   DATA SEM NOISE_TOMOGRAPHY OUTPUT_FILES OUTPUT_ALL
-mkdir -p DATA SEM NOISE_TOMOGRAPHY OUTPUT_FILES OUTPUT_ALL DATA/NOISE_TOMOGRAPHY OUTPUT_FILES/NOISE_TOMOGRAPHY
+
+#prepare directories
+rm -rf   DATA SEM NOISE_TOMOGRAPHY OUTPUT_FILES OUTPUT_ALL SNAPSHOTS
+mkdir -p DATA SEM NOISE_TOMOGRAPHY OUTPUT_FILES OUTPUT_ALL SNAPSHOTS DATA/NOISE_TOMOGRAPHY OUTPUT_FILES/NOISE_TOMOGRAPHY
 
 
-# prepare files
+#prepare files
 cp SOURCE_noise           DATA/SOURCE
 cp STATIONS_target_noise  DATA/STATIONS_target
 cp uniform.dat            DATA/
 echo 1 >                  DATA/NOISE_TOMOGRAPHY/irec_master
 if [ -f S_squared ]; then cp S_squared DATA/NOISE_TOMOGRAPHY/; fi
 
-# compile
+
+#compile
+rm xmshefem2D
+rm xspecfem2D
 cd ../..
 make
 cd $RUN_DIR
 ln -s ../../bin/xmeshfem2D .
 ln -s ../../bin/xspecfem2D .
 
+
 #simulation 1
 cp Par_file_noise_1  DATA/Par_file
 ./xmeshfem2D; ./xspecfem2D
 mkdir OUTPUT_ALL/step_1
-mv OUTPUT_FILES/image*  OUTPUT_ALL/step_1
-mv OUTPUT_FILES/*.semd  OUTPUT_ALL/step_1
-mv DATA/Par_file  OUTPUT_ALL/step_1
+mv OUTPUT_FILES/image*     OUTPUT_ALL/step_1
+mv OUTPUT_FILES/*.semd     OUTPUT_ALL/step_1
+mv DATA/Par_file           OUTPUT_ALL/step_1
+#mv OUTPUT_FILES/snapshot*  SNAPSHOTS/
 
 
 #simulation 2
 cp Par_file_noise_2  DATA/Par_file
 ./xmeshfem2D; ./xspecfem2D
 mkdir OUTPUT_ALL/step_2
+mv OUTPUT_FILES/image*     OUTPUT_ALL/step_2
+mv OUTPUT_FILES/*.semd     OUTPUT_ALL/step_2
+mv DATA/Par_file           OUTPUT_ALL/step_2
+#mv OUTPUT_FILES/snapshot*  SNAPSHOTS/
 
+
+#prepare adjoint source
 ADJ_CODE=adj_cc.f90
+sed -i'.bak' 's/reverse = .[a-z]*./reverse = .false./' $ADJ_CODE
 gfortran $ADJ_CODE -o adj_run
-cp OUTPUT_FILES/*.semd  SEM
+cp OUTPUT_ALL/step_2/*.semd SEM/
 ./adj_run SEM/S0003.AA.BXY.semd
 
 cd SEM
@@ -46,20 +60,16 @@ awk '{printf(" %20.10f %20.10f\n",$1,0.)}' < S0003.AA.BXY.adj > ZEROS
 cp ZEROS S0001.AA.BXX.adj; cp ZEROS S0001.AA.BXY.adj; cp ZEROS S0001.AA.BXZ.adj
 cp ZEROS S0002.AA.BXX.adj; cp ZEROS S0002.AA.BXY.adj; cp ZEROS S0002.AA.BXZ.adj
 cp ZEROS S0003.AA.BXX.adj; cp ZEROS S0003.AA.BXZ.adj
-
 cd ..
 
-mv OUTPUT_FILES/image*  OUTPUT_ALL/step_2
-mv OUTPUT_FILES/*.semd  OUTPUT_ALL/step_2
-mv DATA/Par_file  OUTPUT_ALL/step_2
-
 
 #simulation 3
 cp Par_file_noise_3  DATA/Par_file
 ./xmeshfem2D; ./xspecfem2D
 mkdir OUTPUT_ALL/step_3
-mv OUTPUT_FILES/image*  OUTPUT_ALL/step_3
-mv SEM/*Y.adj           OUTPUT_ALL/step_3
-mv OUTPUT_FILES/proc*   OUTPUT_ALL/step_3
-mv DATA/Par_file        OUTPUT_ALL/step_3
+mv OUTPUT_FILES/image*     OUTPUT_ALL/step_3
+mv SEM/*Y.adj              OUTPUT_ALL/step_3
+mv OUTPUT_FILES/proc*      OUTPUT_ALL/step_3
+mv DATA/Par_file           OUTPUT_ALL/step_3
+mv OUTPUT_FILES/snapshot*  SNAPSHOTS/
 
diff --git a/noise_uniform/contribution_2 b/noise_uniform/contribution_2
new file mode 100755
index 0000000..7ea2448
--- /dev/null
+++ b/noise_uniform/contribution_2
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+
+RUN_DIR=$PWD
+
+
+#prepare directories
+rm -rf   DATA SEM NOISE_TOMOGRAPHY OUTPUT_FILES OUTPUT_ALL SNAPSHOTS
+mkdir -p DATA SEM NOISE_TOMOGRAPHY OUTPUT_FILES OUTPUT_ALL SNAPSHOTS DATA/NOISE_TOMOGRAPHY OUTPUT_FILES/NOISE_TOMOGRAPHY
+
+
+#prepare files
+cp SOURCE_noise           DATA/SOURCE
+cp STATIONS_target_noise  DATA/STATIONS_target
+cp uniform.dat            DATA/
+echo 3 >                  DATA/NOISE_TOMOGRAPHY/irec_master
+if [ -f S_squared ]; then cp S_squared DATA/NOISE_TOMOGRAPHY/; fi
+
+
+#compile
+rm xmshefem2D
+rm xspecfem2D
+cd ../..
+make
+cd $RUN_DIR
+ln -s ../../bin/xmeshfem2D .
+ln -s ../../bin/xspecfem2D .
+
+
+#simulation 1
+cp Par_file_noise_1  DATA/Par_file
+./xmeshfem2D; ./xspecfem2D
+mkdir OUTPUT_ALL/step_1
+mv OUTPUT_FILES/image*     OUTPUT_ALL/step_1
+mv OUTPUT_FILES/*.semd     OUTPUT_ALL/step_1
+mv DATA/Par_file           OUTPUT_ALL/step_1
+#mv OUTPUT_FILES/snapshot*  SNAPSHOTS/
+
+
+#simulation 2
+cp Par_file_noise_2  DATA/Par_file
+./xmeshfem2D; ./xspecfem2D
+mkdir OUTPUT_ALL/step_2
+mv OUTPUT_FILES/image*     OUTPUT_ALL/step_2
+mv OUTPUT_FILES/*.semd     OUTPUT_ALL/step_2
+mv DATA/Par_file           OUTPUT_ALL/step_2
+#mv OUTPUT_FILES/snapshot*  SNAPSHOTS/
+
+
+#prepare adjoint source
+ADJ_CODE=adj_cc.f90
+sed -i'.bak' 's/reverse = .[a-z]*./reverse = .true./' $ADJ_CODE
+gfortran $ADJ_CODE -o adj_run
+cp OUTPUT_ALL/step_2/*.semd SEM/
+./adj_run SEM/S0001.AA.BXY.semd
+
+cd SEM
+rename '.semd' '' *.adj
+awk '{printf(" %20.10f %20.10f\n",$1,0.)}' < S0001.AA.BXY.adj > ZEROS
+cp ZEROS S0001.AA.BXX.adj; cp ZEROS S0001.AA.BXZ.adj
+cp ZEROS S0002.AA.BXX.adj; cp ZEROS S0002.AA.BXY.adj; cp ZEROS S0002.AA.BXZ.adj
+cp ZEROS S0003.AA.BXX.adj; cp ZEROS S0003.AA.BXY.adj; cp ZEROS S0003.AA.BXZ.adj
+cd ..
+
+
+#simulation 3
+cp Par_file_noise_3  DATA/Par_file
+./xmeshfem2D; ./xspecfem2D
+mkdir OUTPUT_ALL/step_3
+mv OUTPUT_FILES/image*     OUTPUT_ALL/step_3
+mv SEM/*Y.adj              OUTPUT_ALL/step_3
+mv OUTPUT_FILES/proc*      OUTPUT_ALL/step_3
+mv DATA/Par_file           OUTPUT_ALL/step_3
+mv OUTPUT_FILES/snapshot*  SNAPSHOTS/
+
diff --git a/noise_uniform/process.sh b/noise_uniform/process.sh
index 96e9013..f50add9 100755
--- a/noise_uniform/process.sh
+++ b/noise_uniform/process.sh
@@ -1,65 +1,10 @@
-#!/bin/sh
+#!/bin/bash
 
-RUN_DIR=$PWD
+./contribution_1
+mv OUTPUT_ALL OUTPUT_ALL_1
+mv SNAPSHOT   SNAPSHOT_1
 
-# prepare directories
-rm -rf   DATA SEM NOISE_TOMOGRAPHY OUTPUT_FILES OUTPUT_ALL
-mkdir -p DATA SEM NOISE_TOMOGRAPHY OUTPUT_FILES OUTPUT_ALL DATA/NOISE_TOMOGRAPHY OUTPUT_FILES/NOISE_TOMOGRAPHY
-
-
-# prepare files
-cp SOURCE_noise           DATA/SOURCE
-cp STATIONS_target_noise  DATA/STATIONS_target
-cp uniform.dat            DATA/
-echo 1 >                  DATA/NOISE_TOMOGRAPHY/irec_master
-if [ -f S_squared ]; then cp S_squared DATA/NOISE_TOMOGRAPHY/; fi
-
-# compile
-cd ../..
-make
-cd $RUN_DIR
-ln -s ../../bin/xmeshfem2D .
-ln -s ../../bin/xspecfem2D .
-
-#simulation 1
-cp Par_file_noise_1  DATA/Par_file
-./xmeshfem2D; ./xspecfem2D
-mkdir OUTPUT_ALL/step_1
-mv OUTPUT_FILES/image*  OUTPUT_ALL/step_1
-mv OUTPUT_FILES/*.semd  OUTPUT_ALL/step_1
-mv DATA/Par_file  OUTPUT_ALL/step_1
-
-
-#simulation 2
-cp Par_file_noise_2  DATA/Par_file
-./xmeshfem2D; ./xspecfem2D
-mkdir OUTPUT_ALL/step_2
-
-ADJ_CODE=adj_cc.f90
-gfortran $ADJ_CODE -o adj_run
-cp OUTPUT_FILES/*.semd  SEM
-./adj_run SEM/S0003.AA.BXY.semd
-
-cd SEM
-rename '.semd' '' *.adj
-awk '{printf(" %20.10f %20.10f\n",$1,0.)}' < S0003.AA.BXY.adj > ZEROS
-cp ZEROS S0001.AA.BXX.adj; cp ZEROS S0001.AA.BXY.adj; cp ZEROS S0001.AA.BXZ.adj
-cp ZEROS S0002.AA.BXX.adj; cp ZEROS S0002.AA.BXY.adj; cp ZEROS S0002.AA.BXZ.adj
-cp ZEROS S0003.AA.BXX.adj; cp ZEROS S0003.AA.BXZ.adj
-
-cd ..
-
-mv OUTPUT_FILES/image*  OUTPUT_ALL/step_2
-mv OUTPUT_FILES/*.semd  OUTPUT_ALL/step_2
-mv DATA/Par_file  OUTPUT_ALL/step_2
-
-
-#simulation 3
-cp Par_file_noise_3  DATA/Par_file
-./xmeshfem2D; ./xspecfem2D
-mkdir OUTPUT_ALL/step_3
-mv OUTPUT_FILES/image*  OUTPUT_ALL/step_3
-mv SEM/*Y.adj           OUTPUT_ALL/step_3
-mv OUTPUT_FILES/proc*   OUTPUT_ALL/step_3
-mv DATA/Par_file        OUTPUT_ALL/step_3
+./contribution_2
+mv OUTPUT_ALL OUTPUT_ALL_2
+mv SNAPSHOT   SNAPSHOT_2
 
diff --git a/noise_uniform/uniform.dat b/noise_uniform/uniform.dat
index f444c9b..aaccc8b 100644
--- a/noise_uniform/uniform.dat
+++ b/noise_uniform/uniform.dat
@@ -10,17 +10,17 @@
 #
  2
  0 0
- 4000 0
+ 300000 0
 #
 # interface number 2
 #
  2
-    0 3000
- 4000 3000
+ 0 240000
+ 300000 240000
 #
 # for each layer, we give the number of spectral elements in the vertical direction
 #
 #
 # layer number 1
 #
- 60
+ 80



More information about the CIG-COMMITS mailing list