[cig-commits] r22093 - in seismo/3D/SPECFEM3D_GLOBE/branches/undo_att: . setup src/shared src/specfem3D
dkomati1 at geodynamics.org
dkomati1 at geodynamics.org
Fri May 17 12:23:05 PDT 2013
Author: dkomati1
Date: 2013-05-17 12:23:05 -0700 (Fri, 17 May 2013)
New Revision: 22093
Modified:
seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/part1.f90
seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/part2.f90
seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/setup/constants.h.in
seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/shared/read_compute_parameters.f90
seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/check_simulation_stability.f90
Log:
fixed a bug about how the adjoint source was put back;
also started to split the main time loop into two sub-loops;
made sure that the code split in two parts now gives the same results as the original adjoint code
Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/part1.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/part1.f90 2013-05-17 18:40:43 UTC (rev 22092)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/part1.f90 2013-05-17 19:23:05 UTC (rev 22093)
@@ -77,7 +77,8 @@
if(mod(it,NTSTEP_BETWEEN_OUTPUT_INFO) == 0 .or. it == it_begin+4 .or. it == it_end) then
call check_simulation_stability(it,displ_crust_mantle,displ_inner_core,displ_outer_core, &
eps_trace_over_3_crust_mantle,epsilondev_crust_mantle, &
- SIMULATION_TYPE,OUTPUT_FILES,time_start,DT,t0,NSTEP, &
+!!!!! DK DK UNDO_ATT SIMULATION_TYPE,OUTPUT_FILES,time_start,DT,t0,NSTEP, &
+ 1,OUTPUT_FILES,time_start,DT,t0,NSTEP, & !!!!! DK DK UNDO_ATT
it_begin,it_end,NUMBER_OF_THIS_RUN,NUMBER_OF_RUNS,myrank)
! if (SIMULATION_TYPE == 3) then
! call check_simulation_stability(it,b_displ_crust_mantle,b_displ_inner_core,b_displ_outer_core, &
@@ -915,7 +916,9 @@
hdur,xi_source,eta_source,gamma_source,nu_source)
! add adjoint sources only if adjoint simulation is performed for source inversion only
- if (SIMULATION_TYPE == 2) then
+!! DK DK UNDO_ATT this must remain here even when SIMULATION_TYPE == 3 because it applies to array
+!! DK DK UNDO_ATT accel_crust_mantle rather than b_accel_crust_mantle
+ if (SIMULATION_TYPE == 2 .or. SIMULATION_TYPE == 3) then
if( nadj_rec_local > 0 ) &
call compute_add_sources_adjoint(myrank,nrec, &
nadj_rec_local,NSTEP,NTSTEP_BETWEEN_READ_ADJSRC, &
@@ -928,22 +931,12 @@
endif
! ! add adjoint sources and add sources for backward/reconstructed wavefield
-! if (SIMULATION_TYPE == 3) then
-! if( nadj_rec_local > 0 ) &
-! call compute_add_sources_adjoint(myrank,nrec, &
-! nadj_rec_local,NSTEP,NTSTEP_BETWEEN_READ_ADJSRC, &
-! accel_crust_mantle,adj_sourcearrays, &
-! nu,xi_receiver,eta_receiver,gamma_receiver, &
-! xigll,yigll,zigll,ibool_crust_mantle, &
-! islice_selected_rec,ispec_selected_rec, &
-! NSTEP_SUB_ADJ,iadjsrc_len,iadjsrc,iadj_vec, &
-! it,it_begin,station_name,network_name,DT)
+! if (SIMULATION_TYPE == 3) &
! call compute_add_sources_backward(myrank,NSOURCES,NSTEP, &
! b_accel_crust_mantle,sourcearrays, &
! DT,t0,tshift_cmt,hdur_gaussian,ibool_crust_mantle, &
! islice_selected_source,ispec_selected_source,it, &
! hdur,xi_source,eta_source,gamma_source,nu_source)
-! endif
! NOISE_TOMOGRAPHY
if ( NOISE_TOMOGRAPHY == 1 ) then
Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/part2.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/part2.f90 2013-05-17 18:40:43 UTC (rev 22092)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/part2.f90 2013-05-17 19:23:05 UTC (rev 22093)
@@ -509,22 +509,12 @@
endif ! Stacey conditions
! add adjoint sources and add sources for backward/reconstructed wavefield
- if (SIMULATION_TYPE == 3) then
- if( nadj_rec_local > 0 ) &
- call compute_add_sources_adjoint(myrank,nrec, &
- nadj_rec_local,NSTEP,NTSTEP_BETWEEN_READ_ADJSRC, &
- accel_crust_mantle,adj_sourcearrays, &
- nu,xi_receiver,eta_receiver,gamma_receiver, &
- xigll,yigll,zigll,ibool_crust_mantle, &
- islice_selected_rec,ispec_selected_rec, &
- NSTEP_SUB_ADJ,iadjsrc_len,iadjsrc,iadj_vec, &
- it,it_begin,station_name,network_name,DT)
+ if (SIMULATION_TYPE == 3) &
call compute_add_sources_backward(myrank,NSOURCES,NSTEP, &
b_accel_crust_mantle,sourcearrays, &
DT,t0,tshift_cmt,hdur_gaussian,ibool_crust_mantle, &
islice_selected_source,ispec_selected_source,it, &
hdur,xi_source,eta_source,gamma_source,nu_source)
- endif
! NOISE_TOMOGRAPHY
! if ( NOISE_TOMOGRAPHY == 1 ) then
@@ -638,9 +628,9 @@
b_icall = 2 ! now compute all the inner elements in the case of non blocking MPI
-! ! compute internal forces in the solid regions
+ ! compute internal forces in the solid regions
-! ! for anisotropy and gravity, x y and z contain r theta and phi
+ ! for anisotropy and gravity, x y and z contain r theta and phi
if( USE_DEVILLE_PRODUCTS_VAL ) then
call compute_forces_crust_mantle_Dev(minus_gravity_table,density_table,minus_deriv_gravity_table, &
Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/setup/constants.h.in
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/setup/constants.h.in 2013-05-17 18:40:43 UTC (rev 22092)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/setup/constants.h.in 2013-05-17 19:23:05 UTC (rev 22093)
@@ -50,6 +50,9 @@
integer, parameter :: ELEMENTS_NONBLOCKING_CM_IC = 1500
integer, parameter :: ELEMENTS_NONBLOCKING_OC = 3000
+!! DK DK UNDO_ATT
+ integer, parameter :: NT_500 = 50 !! DK DK how often we dump restart files to undo attenuation
+
!*********************************************************************************************************
! added these parameters for the future GPU version of the solver with mesh coloring
Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/shared/read_compute_parameters.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/shared/read_compute_parameters.f90 2013-05-17 18:40:43 UTC (rev 22092)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/shared/read_compute_parameters.f90 2013-05-17 19:23:05 UTC (rev 22093)
@@ -227,6 +227,9 @@
! compute total number of time steps, rounded to next multiple of 100
NSTEP = 100 * (int(RECORD_LENGTH_IN_MINUTES * 60.d0 / (100.d0*DT)) + 1)
+!! DK DK UNDO_ATT make sure NSTEP is a multiple of NT_500
+ if(mod(NSTEP,NT_500) /= 0) NSTEP = (NSTEP/NT_500 + 1)*NT_500
+
! if doing benchmark runs to measure scaling of the code for a limited number of time steps only
if (DO_BENCHMARK_RUN_ONLY) NSTEP = NSTEP_FOR_BENCHMARK
Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/check_simulation_stability.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/check_simulation_stability.f90 2013-05-17 18:40:43 UTC (rev 22092)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/check_simulation_stability.f90 2013-05-17 19:23:05 UTC (rev 22093)
@@ -125,7 +125,9 @@
write(IMAIN,*) 'Max non-dimensional potential Ufluid in fluid in all slices for back prop.= ',Ufluidnorm_all
endif
- if(COMPUTE_AND_STORE_STRAIN) then
+!! DK DK UNDO_ATT
+! if(COMPUTE_AND_STORE_STRAIN) then
+ if(SIMULATION_TYPE == 1 .and. COMPUTE_AND_STORE_STRAIN) then
write(IMAIN,*) 'Max of strain, eps_trace_over_3_crust_mantle =',Strain_norm_all
write(IMAIN,*) 'Max of strain, epsilondev_crust_mantle =',Strain2_norm_all
endif
@@ -285,7 +287,13 @@
write(IMAIN,*)
! write time stamp file to give information about progression of simulation
- write(outputname,"('/timestamp',i6.6)") it
+!! DK DK UNDO_ATT
+ if(SIMULATION_TYPE == 1) then
+! write(outputname,"('/timestamp',i6.6)") it
+ write(outputname,"('/timestamp_forward',i6.6)") it
+ else
+ write(outputname,"('/timestamp_backward',i6.6)") it
+ endif
open(unit=IOUT,file=trim(OUTPUT_FILES)//outputname,status='unknown',action='write')
More information about the CIG-COMMITS
mailing list