[cig-commits] [commit] devel: Pass the test of LuoYang_fluid_solid_kernel example, which has been reported unstable when Stacey ABC is used (7b13894)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Thu Jan 1 07:16:12 PST 2015
Repository : https://github.com/geodynamics/specfem2d
On branch : devel
Link : https://github.com/geodynamics/specfem2d/compare/a7ad0d4491b67c622ec71c8e6297e93ff3bf4807...ab07bc52af96700aac5633340aecf9ec9b8a1058
>---------------------------------------------------------------
commit 7b138947db0f3de5ebbfa83d1bfaf2b3248ffae7
Author: Xie Zhinan <xiezhinan1984 at gmail.com>
Date: Thu Jan 1 13:14:38 2015 +0800
Pass the test of LuoYang_fluid_solid_kernel example, which has been reported unstable when Stacey ABC is used
>---------------------------------------------------------------
7b138947db0f3de5ebbfa83d1bfaf2b3248ffae7
EXAMPLES/LuoYang_fluid_solid_kernel/Par_file | 16 +++---
EXAMPLES/LuoYang_fluid_solid_kernel/adj_source.f90 | 20 +++----
list_for_Zhinan_for_SPECFEM2D_PMLs.txt | 67 +---------------------
src/specfem2D/compute_arrays_source.f90 | 11 ++++
4 files changed, 28 insertions(+), 86 deletions(-)
diff --git a/EXAMPLES/LuoYang_fluid_solid_kernel/Par_file b/EXAMPLES/LuoYang_fluid_solid_kernel/Par_file
index 8ede920..7d4a0c3 100644
--- a/EXAMPLES/LuoYang_fluid_solid_kernel/Par_file
+++ b/EXAMPLES/LuoYang_fluid_solid_kernel/Par_file
@@ -5,9 +5,9 @@ title = Test
AXISYM = .false.
# forward or adjoint simulation
-SIMULATION_TYPE = 1 # 1 = forward, 3 = adjoint + kernels; 2 is purposely UNUSED (for compatibility with the numbering of our 3D codes)
+SIMULATION_TYPE = 3 # 1 = forward, 3 = adjoint + kernels; 2 is purposely UNUSED (for compatibility with the numbering of our 3D codes)
NOISE_TOMOGRAPHY = 0 # 0 = earthquake simulation, 1/2/3 = noise simulation
-SAVE_FORWARD = .true. # save the last frame, needed for adjoint simulation
+SAVE_FORWARD = .false. # save the last frame, needed for adjoint simulation
# parameters concerning partitioning
nproc = 1 # number of processes
@@ -76,7 +76,7 @@ NSTEP_BETWEEN_OUTPUT_IMAGES = 100 # every how many time steps we
cutsnaps = 1. # minimum amplitude kept in % for the JPEG and PostScript snapshots; amplitudes below that are muted
#### for JPEG color images ####
output_color_image = .true. # output JPEG color image of the results every NSTEP_BETWEEN_OUTPUT_IMAGES time steps or not
-imagetype_JPEG = 10 # display 1=displ_Ux 2=displ_Uz 3=displ_norm 4=veloc_Vx 5=veloc_Vz 6=veloc_norm 7=accel_Ax 8=accel_Az 9=accel_norm 10=pressure
+imagetype_JPEG = 1 # display 1=displ_Ux 2=displ_Uz 3=displ_norm 4=veloc_Vx 5=veloc_Vz 6=veloc_norm 7=accel_Ax 8=accel_Az 9=accel_norm 10=pressure
factor_subsample_image = 1.0d0 # (double precision) factor to subsample color images output by the code (useful for very large models)
USE_CONSTANT_MAX_AMPLITUDE = .false. # by default the code normalizes each image independently to its maximum; use this option to use the global maximum below instead
CONSTANT_MAX_AMPLITUDE_TO_USE = 1.17d4 # constant maximum amplitude to use for all color images if the above USE_CONSTANT_MAX_AMPLITUDE option is true
@@ -144,7 +144,7 @@ PML_BOUNDARY_CONDITIONS = .false.
NELEM_PML_THICKNESS = 3
ROTATE_PML_ACTIVATE = .false.
ROTATE_PML_ANGLE = 30.
-STACEY_ABSORBING_CONDITIONS = .false.
+STACEY_ABSORBING_CONDITIONS = .true.
ADD_SPRING_TO_STACEY = .false.
# for horizontal periodic conditions: detect common points between left and right edges
@@ -180,10 +180,10 @@ xmax = 5000.d0 # abscissa of right side of the
nx = 100 # number of elements along X
# absorbing boundary parameters (see absorbing_conditions above)
-absorbbottom = .false.
-absorbright = .false.
-absorbtop = .false.
-absorbleft = .false.
+absorbbottom = .true.
+absorbright = .true.
+absorbtop = .true.
+absorbleft = .true.
# define the different regions of the model in the (nx,nz) spectral element mesh
nbregions = 3 # nb of regions and model number for each
diff --git a/EXAMPLES/LuoYang_fluid_solid_kernel/adj_source.f90 b/EXAMPLES/LuoYang_fluid_solid_kernel/adj_source.f90
index 0f756a8..2fbc6d4 100644
--- a/EXAMPLES/LuoYang_fluid_solid_kernel/adj_source.f90
+++ b/EXAMPLES/LuoYang_fluid_solid_kernel/adj_source.f90
@@ -1,25 +1,21 @@
implicit none
-double precision :: time,pressure
+double precision :: time,displ_potential
integer,parameter :: NSTEP = 1600
integer :: i
-open(1,file="OUTPUT_FILES/S0001.AA.PRE.semp",status="old")
+open(1,file="OUTPUT_FILES/AA.S0001.PRE.semp",status="old")
-open(10,file="SEM/S0001.AA.BXX.adj",status="unknown")
-
-open(20,file="SEM/S0001.AA.BXY.adj",status="unknown")
-
-open(30,file="SEM/S0001.AA.BXZ.adj",status="unknown")
+open(10,file="SEM/AA.S0001.POT.adj",status="unknown")
do i=1,NSTEP
- read(1,*)time,pressure
- if(time>1.274)pressure=0.d0
- write(10,*)time,pressure
- write(20,*)time,pressure
- write(30,*)time,pressure
+ read(1,*)time,displ_potential
+ if(time>1.274)displ_potential=0.d0
+ write(10,*)time,displ_potential
enddo
+close(10)
+
end
diff --git a/list_for_Zhinan_for_SPECFEM2D_PMLs.txt b/list_for_Zhinan_for_SPECFEM2D_PMLs.txt
index 4f9649a..9653b34 100644
--- a/list_for_Zhinan_for_SPECFEM2D_PMLs.txt
+++ b/list_for_Zhinan_for_SPECFEM2D_PMLs.txt
@@ -4,72 +4,7 @@ For SPECFEM2D PMLs:
2/ example "LuoYang_fluid_solid_kernel" of the 2D code seems to blow up when Stacey conditions are used:
-Date: Thu, 04 Sep 2014 13:38:22 +0200
-From: Dimitri Komatitsch
-Organization: CNRS, Marseille, France
-To: xiezhinan
-CC: Yingzi Ying, Paul Cristini
-
-Dear Zhinan,
-
-Great, thanks a lot for checking! This will be very useful. Please keep
-us informed if you manage to fix the problem.
-
-Thank you,
-Best regards,
-
-Dimitri.
-
->
-> At 2014-09-04 05:56:50, "Dimitri Komatitsch" wrote:
->>
->>Dear Zhinan,
->>
->>Yingzi Ying (cc'ed) noticed that the example
->>"LuoYang_fluid_solid_kernel" of the 2D code seems to blow up when Stacey
->>conditions are used. Do you have an idea of what could be wrong?
->>(I remember you used that example last year when you were here for
->>several tests, thus maybe you know how to check it?).
->>
->>Thank you very much,
->>Best wishes,
->>
->>Dimitri.
->>
->>
->>> On 09/03/2014 10:56 AM, Yingzi Ying wrote:
->>>> Hi Dimitri,
->>>>
->>>> Thanks for replying.
->>>>
->>>> I also have a fluid-solid coupled Stacey boundary condition, i.e., in
->>>> the example "LuoYang_fluid_solid_kernel" I set
->>>>
->>>> STACEY_ABSORBING_CONDITIONS = .true.
->>>> and
->>>> absorbbottom = .true.
->>>> absorbright = .true.
->>>> absorbtop = .false.
->>>> absorbleft = .true.
->>>> and do
->>>> ./run_this_example.sh (forward simulation)
->>>>
->>>> I got an error:
->>>>
->>>> ./run_this_example.sh: line 59: 9260 Floating point exception(core
->>>> dumped) ./xspecfem2D
->>>>
->>>> (Every thing goes well if I set STACEY_ABSORBING_CONDITIONS = .false)
->>>>
->>>>
->>>> I don't have such problem in using 7.0.2 tar ball(mostly this version,
->>>> as I can not remember well and can not find it online again).
->>>>
->>>> Can you help me to have a look what is the problem. I am targeting to do
->>>> calculate some kernels of fluid-solid coupled media.
->>>>
->>>> Best,
->>>> Yingzi
+currently, we still use potential as the adjoint source, we need to change to pressure in future.
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
diff --git a/src/specfem2D/compute_arrays_source.f90 b/src/specfem2D/compute_arrays_source.f90
index 4116baf..cb8d23e 100644
--- a/src/specfem2D/compute_arrays_source.f90
+++ b/src/specfem2D/compute_arrays_source.f90
@@ -182,6 +182,17 @@
enddo
close(IIN)
+ else if (seismotype == 6 ) then
+
+ filename = 'SEM/'//trim(adj_source_file) // '.POT.adj'
+ open(unit = IIN, file = trim(filename), iostat = ios)
+ if (ios /= 0) call exit_MPI(' file '//trim(filename)//'does not exist')
+
+ do itime = 1, NSTEP
+ read(IIN,*) junk, adj_src_s(itime,1)
+ enddo
+ close(IIN)
+
endif
do k = 1, NGLLZ
More information about the CIG-COMMITS
mailing list