Skip to content

Commit

Permalink
Merging BIOT: modif write_seismograms.F90 to write acoustic potential…
Browse files Browse the repository at this point in the history
… in case of adjoint calculation
  • Loading branch information
cmorency1 committed Aug 3, 2009
1 parent 91047cb commit a518aa0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
13 changes: 2 additions & 11 deletions DATA/STATIONS
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
S0001 AA 300.0000000 2997.7298909 0.0 0.0
S0002 AA 640.0000000 3008.0430011 0.0 0.0
S0003 AA 980.0000000 3090.8224062 0.0 0.0
S0004 AA 1320.0000000 3283.0303923 0.0 0.0
S0005 AA 1660.0000000 3347.8768862 0.0 0.0
S0006 AA 2000.0000000 3250.0000000 0.0 0.0
S0007 AA 2340.0000000 3197.3138031 0.0 0.0
S0008 AA 2680.0000000 3150.9619873 0.0 0.0
S0009 AA 3020.0000000 3086.5939051 0.0 0.0
S0010 AA 3360.0000000 3042.8523748 0.0 0.0
S0011 AA 3700.0000000 3020.6886768 0.0 0.0
S0001 AA 2000.0000000 2933.3300000 0.0 0.0
S0002 AA 2000.0000000 1866.6700000 0.0 0.0
2 changes: 1 addition & 1 deletion specfem2D.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6706,7 +6706,7 @@ program specfem2D
!---- save temporary or final seismograms
! suppress seismograms if we generate traces of the run for analysis with "ParaVer", because time consuming
if(.not. GENERATE_PARAVER_TRACES) call write_seismograms(sisux,sisuz,siscurl,station_name,network_name,NSTEP, &
nrecloc,which_proc_receiver,nrec,myrank,deltat,seismotype,st_xval,t0, &
nrecloc,which_proc_receiver,nrec,myrank,deltat,seismotype,st_xval,t0(1), &
NTSTEP_BETWEEN_OUTPUT_SEISMO,seismo_offset,seismo_current)

seismo_offset = seismo_offset + seismo_current
Expand Down
16 changes: 8 additions & 8 deletions write_seismograms.F90
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ subroutine write_seismograms(sisux,sisuz,siscurl,station_name,network_name, &
component = 'v'
else if(seismotype == 3) then
component = 'a'
else if(seismotype == 4) then
else if(seismotype == 4 .or. seismotype == 6) then
component = 'p'
else if(seismotype == 5) then
component = 'c'
Expand All @@ -109,7 +109,7 @@ subroutine write_seismograms(sisux,sisuz,siscurl,station_name,network_name, &


! only one seismogram if pressurs
if(seismotype == 4) then
if(seismotype == 4 .or. seismotype == 6) then
number_of_components = 1
else if(seismotype == 5) then
number_of_components = NDIM+1
Expand Down Expand Up @@ -152,20 +152,20 @@ subroutine write_seismograms(sisux,sisuz,siscurl,station_name,network_name, &
if ( myrank == 0 ) then

! write the new files
if(seismotype == 4) then
if(seismotype == 4 .or. seismotype == 6) then
open(unit=12,file='OUTPUT_FILES/pressure_file_single.bin',status='unknown',access='direct',recl=4)
else
open(unit=12,file='OUTPUT_FILES/Ux_file_single.bin',status='unknown',access='direct',recl=4)
endif

if(seismotype == 4) then
if(seismotype == 4 .or. seismotype == 6) then
open(unit=13,file='OUTPUT_FILES/pressure_file_double.bin',status='unknown',access='direct',recl=8)
else
open(unit=13,file='OUTPUT_FILES/Ux_file_double.bin',status='unknown',access='direct',recl=8)
endif

! no Z component seismogram if pressure
if(seismotype /= 4) then
if(seismotype /= 4 .and. seismotype /= 6) then
open(unit=14,file='OUTPUT_FILES/Uz_file_single.bin',status='unknown',access='direct',recl=4)
open(unit=15,file='OUTPUT_FILES/Uz_file_double.bin',status='unknown',access='direct',recl=8)

Expand Down Expand Up @@ -229,7 +229,7 @@ subroutine write_seismograms(sisux,sisuz,siscurl,station_name,network_name, &
endif

! in case of pressure, use different abbreviation
if(seismotype == 4) chn = 'PRE'
if(seismotype == 4 .or. seismotype == 6) chn = 'PRE'

! create the name of the seismogram file for each slice
! file name includes the name of the station, the network and the component
Expand Down Expand Up @@ -275,7 +275,7 @@ subroutine write_seismograms(sisux,sisuz,siscurl,station_name,network_name, &
do isample = 1, seismo_current
write(12,rec=(irec-1)*NSTEP+seismo_offset+isample) sngl(buffer_binary(isample,1))
write(13,rec=(irec-1)*NSTEP+seismo_offset+isample) buffer_binary(isample,1)
if ( seismotype /= 4 ) then
if ( seismotype /= 4 .and. seismotype /= 6) then
write(14,rec=(irec-1)*NSTEP+seismo_offset+isample) sngl(buffer_binary(isample,2))
write(15,rec=(irec-1)*NSTEP+seismo_offset+isample) buffer_binary(isample,2)
end if
Expand Down Expand Up @@ -306,7 +306,7 @@ subroutine write_seismograms(sisux,sisuz,siscurl,station_name,network_name, &

close(12)
close(13)
if ( seismotype /= 4 ) then
if ( seismotype /= 4 .and. seismotype /= 6) then
close(14)
close(15)
end if
Expand Down

0 comments on commit a518aa0

Please sign in to comment.