[cig-commits] r13098 - in seismo/3D/ADJOINT_TOMO/flexwin: . scripts user_files/socal_3D

carltape at geodynamics.org carltape at geodynamics.org
Thu Oct 16 16:17:32 PDT 2008


Author: carltape
Date: 2008-10-16 16:17:31 -0700 (Thu, 16 Oct 2008)
New Revision: 13098

Added:
   seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T002_T030_m11
   seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T003_T030_m11
   seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T006_T030_m00
   seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T006_T030_m11
   seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/user_functions_m11.f90
Modified:
   seismo/3D/ADJOINT_TOMO/flexwin/PAR_FILE
   seismo/3D/ADJOINT_TOMO/flexwin/scripts/pick_all_windows.pl
   seismo/3D/ADJOINT_TOMO/flexwin/seismo_subs.f90
   seismo/3D/ADJOINT_TOMO/flexwin/select_windows_stalta2.f90
Log:
Important modification that affects PAR_FILE.  I added the parameters TSHIFT_REFERENCE and DLNA_REFERENCE to allow for the systematic bias of measurements that is typical in datasets.  These values are set to 0.0 in default mode, which then makes it operate identically as before.  They complement TSHIFT_BASE and DLNA_BASE by allowing the reference measurement to be non-zero.  For examle, for the socal model TSHIFT_BASE = 4.0 s and DLNA_BASE = 0.5.


Modified: seismo/3D/ADJOINT_TOMO/flexwin/PAR_FILE
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/PAR_FILE	2008-10-16 13:09:19 UTC (rev 13097)
+++ seismo/3D/ADJOINT_TOMO/flexwin/PAR_FILE	2008-10-16 23:17:31 UTC (rev 13098)
@@ -29,18 +29,20 @@
 STALTA_BASE                     = 0.08
 
 # -------------------------------------------------------------
-# TSHIFT
+# maximum allowable time shift from reference TSHIFT
 TSHIFT_BASE                     = 15.0
+TSHIFT_REFERENCE                = 0.0
 
 # -------------------------------------------------------------
+# maximum allowable amplitude measurement relative to reference DLNA
+DLNA_BASE                       = 1.0
+DLNA_REFERENCE                  = 0.0
+
+# -------------------------------------------------------------
 # limit on CC for window acceptance
 CC_BASE                         = 0.85
 
 # -------------------------------------------------------------
-# limit on dlnA (dA/A) for window acceptance
-DLNA_BASE                       = 1.0
-
-# -------------------------------------------------------------
 # boolean switch for check_data_quality
 DATA_QUALITY                    = .true.
 

Modified: seismo/3D/ADJOINT_TOMO/flexwin/scripts/pick_all_windows.pl
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/scripts/pick_all_windows.pl	2008-10-16 13:09:19 UTC (rev 13097)
+++ seismo/3D/ADJOINT_TOMO/flexwin/scripts/pick_all_windows.pl	2008-10-16 23:17:31 UTC (rev 13098)
@@ -38,9 +38,9 @@
 #     prepare_meas_all.pl
 #
 #  EXAMPLES:
-#    pick_all_windows.pl m10 0 6/30   1/204 1/1/1/0 1 0     # make plots and WINDOWS file, T = 6-40s
-#    pick_all_windows.pl m10 0 3/30   1/204 1/1/1/1 1 0     # 
-#    pick_all_windows.pl m10 0 2/30   1/204 1/1/1/1 1 0     # make plots and WINDOWS file, T = 2-40s
+#    pick_all_windows.pl m11 0 6/30   1/204 1/1/1/0 1 0     # make plots and WINDOWS file, T = 6-40s
+#    pick_all_windows.pl m11 0 3/30   1/204 1/1/1/1 1 0     # 
+#    pick_all_windows.pl m11 0 2/30   1/204 1/1/1/1 1 0     # make plots and WINDOWS file, T = 2-40s
 #
 #    pick_all_windows.pl m00 0 6/30 179/179 1/1/0/0 1 0     # make plots only, T = 6-40s
 #    pick_all_windows.pl m00 0 6/30 179/179 0/0/1/0 1 0     # make WINDOWS file, T = 6-40s

Modified: seismo/3D/ADJOINT_TOMO/flexwin/seismo_subs.f90
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/seismo_subs.f90	2008-10-16 13:09:19 UTC (rev 13097)
+++ seismo/3D/ADJOINT_TOMO/flexwin/seismo_subs.f90	2008-10-16 23:17:31 UTC (rev 13098)
@@ -29,17 +29,17 @@
 
   ! -------------------------------------------------------------
   ! TSHIFT
-    double precision :: TSHIFT_BASE 
+    double precision :: TSHIFT_BASE, TSHIFT_REFERENCE
 
   ! -------------------------------------------------------------
+  ! limit on dlnA (dA/A) for window acceptance
+    double precision :: DLNA_BASE, DLNA_REFERENCE
+
+  ! -------------------------------------------------------------
   ! limit on CC for window acceptance
     double precision :: CC_BASE 
 
   ! -------------------------------------------------------------
-  ! limit on dlnA (dA/A) for window acceptance
-    double precision :: DLNA_BASE 
-
-  ! -------------------------------------------------------------
   ! limit on signal-to-noise on the observed data
 
   ! boolean switch for check_data_quality
@@ -181,21 +181,25 @@
   read(IIN,*)
   read(IIN,*)
   read(IIN,2) junk,TSHIFT_BASE
+  read(IIN,2) junk,TSHIFT_REFERENCE
   if (DEBUG) write(*,*) '       TSHIFT_BASE',TSHIFT_BASE
+  if (DEBUG) write(*,*) '       TSHIFT_REFERENCE',TSHIFT_REFERENCE
 
-  ! limit on CC 
+  ! limit on dlnA for window acceptance
   read(IIN,*)
   read(IIN,*)
   read(IIN,*)
-  read(IIN,2) junk,CC_BASE
-  if (DEBUG) write(*,*) '       CC_BASE',CC_BASE
+  read(IIN,2) junk,DLNA_BASE
+  read(IIN,2) junk,DLNA_REFERENCE
+  if (DEBUG) write(*,*) '       DLNA_BASE',DLNA_BASE
+  if (DEBUG) write(*,*) '       DLNA_REFERENCE',DLNA_REFERENCE
 
-  ! limit on dlnA (dA/A) for window acceptance
+  ! limit on CC 
   read(IIN,*)
   read(IIN,*)
   read(IIN,*)
-  read(IIN,2) junk,DLNA_BASE
-  if (DEBUG) write(*,*) '       DLNA_BASE',DLNA_BASE
+  read(IIN,2) junk,CC_BASE
+  if (DEBUG) write(*,*) '       CC_BASE',CC_BASE
 
   ! boolean switch for check_data_quality
   read(IIN,*)

Modified: seismo/3D/ADJOINT_TOMO/flexwin/select_windows_stalta2.f90
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/select_windows_stalta2.f90	2008-10-16 13:09:19 UTC (rev 13097)
+++ seismo/3D/ADJOINT_TOMO/flexwin/select_windows_stalta2.f90	2008-10-16 23:17:31 UTC (rev 13098)
@@ -805,6 +805,7 @@
   integer :: nwin_new
   integer, dimension(NWINDOWS) :: iM_new, iL_new, iR_new
   double precision :: CC_temp, Tshift_temp, dlnA_temp
+  double precision :: tshift_min, tshift_max, dlnA_min, dlnA_max
   logical :: accept
   
 
@@ -817,21 +818,30 @@
     ! check the conditions, and set accept to false if rejection
     call calc_criteria(obs_lp,synt_lp,npts,iL(iwin),iR(iwin),dt,Tshift_temp,CC_temp,dlnA_temp)
 
-    if ( abs(Tshift_temp) .gt. TSHIFT_LIMIT(iM(iwin)) &
-        .or. CC_temp .lt. CC_LIMIT(iM(iwin)) &
-        .or. abs(dlnA_temp) .gt. DLNA_LIMIT(iM(iwin))   ) then
-      if (1==1) then
-          write(*,*) iwin, ' : rejection based on LEFT > RIGHT'
-          if(abs(Tshift_temp) .gt. TSHIFT_LIMIT(iM(iwin))) &
-              write(*,*) 'Tshift : ', abs(Tshift_temp), TSHIFT_LIMIT(iM(iwin))
-          if(CC_LIMIT(iM(iwin)) .gt. CC_temp) &
-              write(*,*) 'CC : ', CC_LIMIT(iM(iwin)), CC_temp
-          if(abs(dlnA_temp) .gt. DLNA_LIMIT(iM(iwin))) &
-              write(*,*) 'dlnA : ', abs(dlnA_temp), DLNA_LIMIT(iM(iwin))
-      endif
-      accept = .false.
+    ! here we allow for a systematic shift in the time shift and amplitude measurements
+    tshift_min = TSHIFT_REFERENCE - TSHIFT_LIMIT(iM(iwin))
+    tshift_max = TSHIFT_REFERENCE + TSHIFT_LIMIT(iM(iwin))
+    dlnA_min   = DLNA_REFERENCE - DLNA_LIMIT(iM(iwin))
+    dlnA_max   = DLNA_REFERENCE + DLNA_LIMIT(iM(iwin))
+
+    if ( (Tshift_temp .lt. tshift_min) .or. (Tshift_temp .gt.tshift_max ) ) then
+       write(*,*) iwin, ' : rejection based on not satisfying TSHIFT_MIN < TSHIFT < TSHIFT_MAX'
+       write(*,*) 'Tshift : ',tshift_min , Tshift_temp, tshift_max
+       accept = .false.
     endif
 
+    if ( accept .and. ( (dlnA_temp .lt. dlnA_min) .or. (dlnA_temp .gt. dlnA_max ) )) then
+       write(*,*) iwin, ' : rejection based on not satisfying DLNA_MIN < DLNA < DLNA_MAX'
+       write(*,*) 'dlnA : ', dlnA_min , dlnA_temp, dlnA_max
+       accept = .false.
+    endif
+
+    if( accept .and. (CC_temp .lt. CC_LIMIT(iM(iwin))) ) then
+       write(*,*) iwin, ' : rejection based on CC < CC_MIN'
+       write(*,*) 'CC : ', CC_temp, CC_LIMIT(iM(iwin))
+       accept = .false.
+    endif
+
     ! if the proto-window is acceptable, then accept it
     if (accept) then
       nwin_new = nwin_new + 1

Added: seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T002_T030_m11
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T002_T030_m11	                        (rev 0)
+++ seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T002_T030_m11	2008-10-16 23:17:31 UTC (rev 13098)
@@ -0,0 +1,71 @@
+# -------------------------------------------------------------
+#
+#    This is the parameter file for FLEXWIN.  It is based on the
+#    same syntax as the Par_file for SPECFEM.  Variable names are
+#    put first, values are placed after the 34th column.
+#
+#    Comment lines and blank lines are significant.  If you
+#    change the layout of this file or add/remove parameters
+#    you must also modify the user_variables module and the 
+#    read_parameter_file subroutine at the start of seismo_subs.f90.
+#    
+# -------------------------------------------------------------
+ 
+# -------------------------------------------------------------
+# boolean parameters
+DEBUG                           = .true.
+MAKE_SEISMO_PLOTS               = .true.
+MAKE_WINDOW_FILES               = .true.
+BODY_WAVE_ONLY                  = .true.
+
+# -------------------------------------------------------------
+# period min/max for filtering
+RUN_BANDPASS                    = .false.
+WIN_MIN_PERIOD                  = 2.00
+WIN_MAX_PERIOD                  = 30.00
+
+# -------------------------------------------------------------
+# E(t) water level
+STALTA_BASE                     = 0.07
+
+# -------------------------------------------------------------
+# maximum allowable time shift from reference TSHIFT
+TSHIFT_BASE                     = 2.0
+TSHIFT_REFERENCE                = 0.0
+
+# -------------------------------------------------------------
+# maximum allowable amplitude measurement relative to reference DLNA
+DLNA_BASE                       = 1.0
+DLNA_REFERENCE                  = 0.0
+
+# -------------------------------------------------------------
+# limit on CC for window acceptance
+CC_BASE                         = 0.85
+
+# -------------------------------------------------------------
+# boolean switch for check_data_quality
+DATA_QUALITY                    = .true.
+
+# if DATA_QUALITY = .true. and if two different measurements of
+# signal-to-noise ratios exceeds these two base levels,
+# then the data time series (and syn) is kept
+SNR_INTEGRATE_BASE              = 2.5  
+SNR_MAX_BASE                    = 3.5
+
+# -------------------------------------------------------------
+# limit on signal to noise ratio in a particular window.
+WINDOW_SNR_BASE                 = 4.0
+
+# -------------------------------------------------------------
+# Fine tuning constants 
+C_0  (internal minima)          = 1.0
+C_1  (small windows)            = 5.0
+C_2  (prominence)               = 0.0
+C_3a (separation height)        = 4.0 
+C_3b (separation time)          = 2.5 
+C_4a (curtail on left)          = 2.0 
+C_4b (curtail on right)         = 6.0 
+
+WEIGHT_SPACE_COVERAGE           = 1.0
+WEIGHT_AVERAGE_CC               = 0.0
+WEIGHT_N_WINDOWS                = 5.0

Added: seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T003_T030_m11
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T003_T030_m11	                        (rev 0)
+++ seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T003_T030_m11	2008-10-16 23:17:31 UTC (rev 13098)
@@ -0,0 +1,71 @@
+# -------------------------------------------------------------
+#
+#    This is the parameter file for FLEXWIN.  It is based on the
+#    same syntax as the Par_file for SPECFEM.  Variable names are
+#    put first, values are placed after the 34th column.
+#
+#    Comment lines and blank lines are significant.  If you
+#    change the layout of this file or add/remove parameters
+#    you must also modify the user_variables module and the 
+#    read_parameter_file subroutine at the start of seismo_subs.f90.
+#    
+# -------------------------------------------------------------
+ 
+# -------------------------------------------------------------
+# boolean parameters
+DEBUG                           = .true.
+MAKE_SEISMO_PLOTS               = .true.
+MAKE_WINDOW_FILES               = .true.
+BODY_WAVE_ONLY                  = .true.
+
+# -------------------------------------------------------------
+# period min/max for filtering
+RUN_BANDPASS                    = .false.
+WIN_MIN_PERIOD                  = 3.00
+WIN_MAX_PERIOD                  = 30.00
+
+# -------------------------------------------------------------
+# E(t) water level
+STALTA_BASE                     = 0.11
+
+# -------------------------------------------------------------
+# maximum allowable time shift from reference TSHIFT
+TSHIFT_BASE                     = 3.0
+TSHIFT_REFERENCE                = 0.0
+
+# -------------------------------------------------------------
+# maximum allowable amplitude measurement relative to reference DLNA
+DLNA_BASE                       = 1.0
+DLNA_REFERENCE                  = 0.0
+
+# -------------------------------------------------------------
+# limit on CC for window acceptance
+CC_BASE                         = 0.80
+
+# -------------------------------------------------------------
+# boolean switch for check_data_quality
+DATA_QUALITY                    = .true.
+
+# if DATA_QUALITY = .true. and if two different measurements of
+# signal-to-noise ratios exceeds these two base levels,
+# then the data time series (and syn) is kept
+SNR_INTEGRATE_BASE              = 2.5  
+SNR_MAX_BASE                    = 3.5
+
+# -------------------------------------------------------------
+# limit on signal to noise ratio in a particular window.
+WINDOW_SNR_BASE                 = 4.0
+
+# -------------------------------------------------------------
+# Fine tuning constants 
+C_0  (internal minima)          = 1.3
+C_1  (small windows)            = 4.0
+C_2  (prominence)               = 0.0
+C_3a (separation height)        = 4.0 
+C_3b (separation time)          = 2.5 
+C_4a (curtail on left)          = 2.0 
+C_4b (curtail on right)         = 6.0 
+
+WEIGHT_SPACE_COVERAGE           = 0.70
+WEIGHT_AVERAGE_CC               = 0.25
+WEIGHT_N_WINDOWS                = 0.05

Added: seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T006_T030_m00
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T006_T030_m00	                        (rev 0)
+++ seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T006_T030_m00	2008-10-16 23:17:31 UTC (rev 13098)
@@ -0,0 +1,71 @@
+# -------------------------------------------------------------
+#
+#    This is the parameter file for FLEXWIN.  It is based on the
+#    same syntax as the Par_file for SPECFEM.  Variable names are
+#    put first, values are placed after the 34th column.
+#
+#    Comment lines and blank lines are significant.  If you
+#    change the layout of this file or add/remove parameters
+#    you must also modify the user_variables module and the 
+#    read_parameter_file subroutine at the start of seismo_subs.f90.
+#    
+# -------------------------------------------------------------
+ 
+# -------------------------------------------------------------
+# boolean parameters
+DEBUG                           = .true.
+MAKE_SEISMO_PLOTS               = .true.
+MAKE_WINDOW_FILES               = .true.
+BODY_WAVE_ONLY                  = .false.
+
+# -------------------------------------------------------------
+# period min/max for filtering
+RUN_BANDPASS                    = .false.
+WIN_MIN_PERIOD                  = 6.00
+WIN_MAX_PERIOD                  = 30.00
+
+# -------------------------------------------------------------
+# E(t) water level  (0.23)
+STALTA_BASE                     = 0.18
+
+# -------------------------------------------------------------
+# maximum allowable time shift from reference TSHIFT
+TSHIFT_BASE                     = 8.0
+TSHIFT_REFERENCE                = 4.0
+
+# -------------------------------------------------------------
+# maximum allowable amplitude measurement relative to reference DLNA
+DLNA_BASE                       = 1.0
+DLNA_REFERENCE                  = 0.5
+
+# -------------------------------------------------------------
+# limit on CC for window acceptance
+CC_BASE                         = 0.71
+
+# -------------------------------------------------------------
+# boolean switch for check_data_quality
+DATA_QUALITY                    = .true.
+
+# if DATA_QUALITY = .true. and if two different measurements of
+# signal-to-noise ratios exceeds these two base levels,
+# then the data time series (and syn) is kept
+SNR_INTEGRATE_BASE              = 3.0  
+SNR_MAX_BASE                    = 2.5
+
+# -------------------------------------------------------------
+# limit on signal to noise ratio in a particular window.
+WINDOW_SNR_BASE                 = 2.5
+
+# -------------------------------------------------------------
+# Fine tuning constants 
+C_0  (internal minima)          = 0.7
+C_1  (small windows)            = 2.0
+C_2  (prominence)               = 0.0
+C_3a (separation height)        = 3.0 
+C_3b (separation time)          = 2.0 
+C_4a (curtail on left)          = 2.5
+C_4b (curtail on right)         = 12.0 
+
+WEIGHT_SPACE_COVERAGE           = 1.0
+WEIGHT_AVERAGE_CC               = 0.0
+WEIGHT_N_WINDOWS                = 0.0

Added: seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T006_T030_m11
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T006_T030_m11	                        (rev 0)
+++ seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T006_T030_m11	2008-10-16 23:17:31 UTC (rev 13098)
@@ -0,0 +1,71 @@
+# -------------------------------------------------------------
+#
+#    This is the parameter file for FLEXWIN.  It is based on the
+#    same syntax as the Par_file for SPECFEM.  Variable names are
+#    put first, values are placed after the 34th column.
+#
+#    Comment lines and blank lines are significant.  If you
+#    change the layout of this file or add/remove parameters
+#    you must also modify the user_variables module and the 
+#    read_parameter_file subroutine at the start of seismo_subs.f90.
+#    
+# -------------------------------------------------------------
+ 
+# -------------------------------------------------------------
+# boolean parameters
+DEBUG                           = .true.
+MAKE_SEISMO_PLOTS               = .true.
+MAKE_WINDOW_FILES               = .true.
+BODY_WAVE_ONLY                  = .false.
+
+# -------------------------------------------------------------
+# period min/max for filtering
+RUN_BANDPASS                    = .false.
+WIN_MIN_PERIOD                  = 6.00
+WIN_MAX_PERIOD                  = 30.00
+
+# -------------------------------------------------------------
+# E(t) water level  (0.23)
+STALTA_BASE                     = 0.18
+
+# -------------------------------------------------------------
+# maximum allowable time shift from reference TSHIFT
+TSHIFT_BASE                     = 4.0
+TSHIFT_REFERENCE                = 0.0
+
+# -------------------------------------------------------------
+# maximum allowable amplitude measurement relative to reference DLNA
+DLNA_BASE                       = 1.5
+DLNA_REFERENCE                  = 0.0
+
+# -------------------------------------------------------------
+# limit on CC for window acceptance
+CC_BASE                         = 0.71
+
+# -------------------------------------------------------------
+# boolean switch for check_data_quality
+DATA_QUALITY                    = .true.
+
+# if DATA_QUALITY = .true. and if two different measurements of
+# signal-to-noise ratios exceeds these two base levels,
+# then the data time series (and syn) is kept
+SNR_INTEGRATE_BASE              = 3.0  
+SNR_MAX_BASE                    = 2.5
+
+# -------------------------------------------------------------
+# limit on signal to noise ratio in a particular window.
+WINDOW_SNR_BASE                 = 2.5
+
+# -------------------------------------------------------------
+# Fine tuning constants 
+C_0  (internal minima)          = 0.7
+C_1  (small windows)            = 2.0
+C_2  (prominence)               = 0.0
+C_3a (separation height)        = 3.0 
+C_3b (separation time)          = 2.0 
+C_4a (curtail on left)          = 2.5
+C_4b (curtail on right)         = 12.0 
+
+WEIGHT_SPACE_COVERAGE           = 1.0
+WEIGHT_AVERAGE_CC               = 0.0
+WEIGHT_N_WINDOWS                = 0.0

Added: seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/user_functions_m11.f90
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/user_functions_m11.f90	                        (rev 0)
+++ seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/user_functions_m11.f90	2008-10-16 23:17:31 UTC (rev 13098)
@@ -0,0 +1,161 @@
+! -------------------------------------------------------------
+! edit here to change T0 and T1 on some condition 
+! Note, this function is called AFTER the seismogram has been 
+! read but before it is filtered.
+! -------------------------------------------------------------
+
+subroutine modify_T0_T1_on_condition
+  use seismo_variables
+
+  ! do nothing
+
+  ! adjust fstart and fend accordingly
+  !FSTART=1./WIN_MAX_PERIOD
+  !FEND=1./WIN_MIN_PERIOD
+
+end subroutine modify_T0_T1_on_condition
+
+! -------------------------------------------------------------
+! Edit here to change the time dependent properties of the selection criteria
+! Note, this function is called AFTER the seismogram has been read.
+! -------------------------------------------------------------
+subroutine set_up_criteria_arrays
+  use seismo_variables 
+
+  integer :: i
+  double precision :: time
+
+  ! for qinya's scsn picking
+  double precision :: Pnl_start, S_end, Sw_start, Sw_end
+ 
+!===========================
+
+! -----------------------------------------------------------------
+! This is the basic version of the subroutine - no variation with time
+! -----------------------------------------------------------------
+   do i = 1, npts
+     time = b+(i-1)*dt
+     DLNA_LIMIT(i) = DLNA_BASE
+     CC_LIMIT(i) = CC_BASE
+     TSHIFT_LIMIT(i) = TSHIFT_BASE       ! WIN_MIN_PERIOD/2.0
+     STALTA_W_LEVEL(i) = STALTA_BASE
+     S2N_LIMIT(i) = WINDOW_S2N_BASE
+   enddo
+
+!!$  if (.not. BODY_WAVE_ONLY) then
+!!$     Pnl_start =  -5.0 + dist_km/7.8
+!!$     Sw_start  = -15.0 + dist_km/3.5
+!!$     Sw_end    =  35.0 + dist_km/3.1
+!!$  else
+!!$     Pnl_start =  P_pick - 5.0
+!!$     S_end     =  S_pick + 5.0
+!!$     Sw_start  = -15.0 + dist_km/3.5
+!!$     Sw_end    =  35.0 + dist_km/3.1
+!!$  endif
+
+  ! regional (Qinya's formulation):
+  ! -------------------------------------------------------------
+  ! see Liu et al. (2004), p. 1755, but note that the PARENTHESES
+  ! that are listed in the publication should not be there
+  ! THESE ARE PROBABLY NOT ACCURATE ENOUGH FOR LONGER PATHS.
+
+  Sw_start  = -15.0 + dist_km/3.5
+  Sw_end    =  35.0 + dist_km/3.1
+
+  if (BODY_WAVE_ONLY) then
+     !Pnl_start =  P_pick - 5.0
+     !S_end     =  S_pick + 5.0
+     Pnl_start =  P_pick - 2.5*WIN_MIN_PERIOD
+     S_end     =  S_pick + 2.5*WIN_MIN_PERIOD
+
+  else
+     Pnl_start =  -5.0 + dist_km/7.8
+     S_end     =  Sw_start
+  endif
+
+  ! variables for signal to noise ratio criteria.
+  signal_end = Sw_end
+  noise_end  = Pnl_start
+  if(DEBUG) then
+     if (BODY_WAVE_ONLY) then
+         write(*,*) 'DEBUG : P_pick = ', P_pick
+         write(*,*) 'DEBUG : S_pick = ', S_pick
+     endif
+     write(*,*) 'DEBUG : signal_end = ', sngl(signal_end)
+     write(*,*) 'DEBUG : noise_end = ', sngl(noise_end)
+  endif
+
+ ! --------------------------------
+ ! modulate criteria in time
+  do i = 1, npts
+     time = b+(i-1)*dt     ! time
+
+     ! raises STA/LTA water level before P wave arrival.
+     if(time.lt.Pnl_start) then
+        STALTA_W_LEVEL(i) = 10.*STALTA_BASE
+     endif
+
+     ! raises STA/LTA water level after surface wave arrives
+     if (BODY_WAVE_ONLY) then
+        !if(time.gt.S_end) then
+        if(time.gt.Sw_end) then
+           STALTA_W_LEVEL(i) = 10.*STALTA_BASE
+        endif
+        
+     else
+!!$        ! set time- and distance-specific Tshift and DlnA to mimic Qinya's criteria
+!!$        ! (see Liu et al., 2004, p. 1755; note comment above)
+!!$        if(time.ge.Pnl_start .and. time.lt.Sw_start) then
+!!$           !DLNA_LIMIT(i) = 1.5  ! ratio is 2.5, and dlna is ratio-1
+!!$           TSHIFT_LIMIT(i) = 3.0 + dist_km/80.0
+!!$        endif
+!!$        if(time.ge.Sw_start .and. time.le.Sw_end) then
+!!$           !DLNA_LIMIT(i) = 1.5  ! ratio is 2.5, and dlna is ratio-1
+!!$           TSHIFT_LIMIT(i) = 3.0 + dist_km/50.0
+!!$        endif
+
+        ! double the STA/LTA water level after the surface waves
+        !if(time.gt.Sw_end) then
+        !   STALTA_W_LEVEL(i) = 2.0*STALTA_BASE
+        !endif
+
+        ! allow for 100s to possibly capture additional phases
+        if(time.gt. (Sw_end+100.0) ) then
+           STALTA_W_LEVEL(i) = 10.*STALTA_BASE
+        endif
+
+     endif
+
+  enddo
+
+! The following is for check_window quality_s2n
+
+! -----------------------------------------------------------------
+! Start of user-dependent portion
+
+! This is where you modulate the time dependence of the selection
+! criteria.  You have access to the following parameters from the 
+! seismogram itself:
+!
+! dt, b, kstnm, knetwk, kcmpnm
+! evla, evlo, stla, stlo, evdp, azimuth, backazimuth, dist_deg, dist_km
+! num_phases, ph_names, ph_times
+!
+! Example of modulation:
+!-----------------------
+! To increase s2n limit after arrival of R1 try
+!
+! R_vel=3.2
+! R_time=dist_km/R_vel
+! do i = 1, npts
+!   time=b+(i-1)*dt
+!   if (time.gt.R_time) then
+!     S2N_LIMIT(i)=2*WINDOW_S2N_BASE
+!   endif
+! enddo
+!
+! End of user-dependent portion
+! -----------------------------------------------------------------
+
+end subroutine set_up_criteria_arrays
+! -------------------------------------------------------------



More information about the CIG-COMMITS mailing list