Skip to content

Commit edd15e0

Browse files
author
Simon Stähler
committed
Merge branch 'master' into release_1.1
Pull intermediate updates of master branch into release branch. In case that should ever be released, it might be useful to have the latest version. Conflicts: MANUAL/manual_axisem1.1.tex
2 parents cbc40ea + c73403f commit edd15e0

File tree

10 files changed

+298
-422
lines changed

10 files changed

+298
-422
lines changed

SOLVER/UTILS/field_transform.F90

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ program field_transformation
4444
integer :: ncout_mesh_mpz_varid, ncin_mesh_mpz_varid
4545
integer :: ncout_surf_grpid, ncout_surfstrain_dimid, ncout_surf_dimid
4646
integer :: ncout_comp_dimid
47-
integer :: ncout_surf_varids(6), ncin_surf_grpid, ncin_surf_varids(6)
47+
integer :: ncout_surf_varids(7), ncin_surf_grpid, ncin_surf_varids(7)
4848

4949
integer :: nc_mesh_npol_dimid, nc_mesh_cntrlpts_dimid, &
5050
nc_mesh_elem_dimid
@@ -341,9 +341,10 @@ program field_transformation
341341
len = nsurfelem, &
342342
dimid = ncout_surf_dimid) )
343343

344-
allocate(varname_surf(6))
344+
allocate(varname_surf(7))
345345
varname_surf = ['elem_theta ', 'displacement ', 'velocity ', &
346-
'disp_src ', 'strain ', 'stf_dump ']
346+
'disp_src ', 'strain ', 'stf_dump ', &
347+
'stf_d_dump ']
347348
do ivar = 1, size(varname_surf)
348349
call check( nf90_inq_varid(ncid = ncin_surf_grpid, &
349350
varid = ncin_surf_varids(ivar), &
@@ -385,16 +386,18 @@ program field_transformation
385386
shuffle = 1, deflate = 1, &
386387
deflate_level = deflate_level) )
387388

388-
call check( nf90_def_var(ncid = ncout_surf_grpid, &
389-
name = varname_surf(6), &
390-
xtype = NF90_FLOAT, &
391-
dimids = [ncout_snap_dimid], &
392-
chunksizes = [nsnap], &
393-
varid = ncout_surf_varids(6)) )
394-
call check( nf90_def_var_deflate( ncid = ncout_surf_grpid, &
395-
varid = ncout_surf_varids(6), &
396-
shuffle = 1, deflate = 1, &
397-
deflate_level = deflate_level) )
389+
do ivar = 6, 7
390+
call check( nf90_def_var(ncid = ncout_surf_grpid, &
391+
name = varname_surf(ivar), &
392+
xtype = NF90_FLOAT, &
393+
dimids = [ncout_snap_dimid], &
394+
chunksizes = [nsnap], &
395+
varid = ncout_surf_varids(ivar)) )
396+
call check( nf90_def_var_deflate( ncid = ncout_surf_grpid, &
397+
varid = ncout_surf_varids(ivar), &
398+
shuffle = 1, deflate = 1, &
399+
deflate_level = deflate_level) )
400+
enddo
398401

399402
print *, 'Surface variables defined'
400403

@@ -608,16 +611,18 @@ program field_transformation
608611
deallocate(data_surf_3d)
609612

610613
allocate(data_surf_1d(nsnap))
611-
call check( nf90_get_var( ncid = ncin_surf_grpid, &
612-
varid = ncin_surf_varids(6), &
613-
start = [1], &
614-
count = [nsnap], &
615-
values = data_surf_1d) )
616-
call check( nf90_put_var( ncid = ncout_surf_grpid, &
617-
varid = ncout_surf_varids(6), &
618-
start = [1], &
619-
count = [nsnap], &
620-
values = data_surf_1d))
614+
do ivar = 6, 7
615+
call check( nf90_get_var( ncid = ncin_surf_grpid, &
616+
varid = ncin_surf_varids(ivar), &
617+
start = [1], &
618+
count = [nsnap], &
619+
values = data_surf_1d) )
620+
call check( nf90_put_var( ncid = ncout_surf_grpid, &
621+
varid = ncout_surf_varids(ivar), &
622+
start = [1], &
623+
count = [nsnap], &
624+
values = data_surf_1d))
625+
end do
621626
deallocate(data_surf_1d)
622627

623628

SOLVER/UTILS/post_processing.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ program post_processing_seis
282282
! define time series
283283
allocate(time(nt_seis), seis(nt_seis,3))
284284
do iseis=1, nt_seis
285-
time(iseis) = iseis * dt_seis
285+
time(iseis) = (iseis - 1) * dt_seis
286286
enddo
287287
allocate(seis_sglcomp(nt_seis,3))
288288

SOLVER/data_io.f90

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,16 @@ module data_io
3434
logical :: dump_snaps_glob
3535
logical :: dump_vtk
3636
logical :: dump_xdmf
37-
logical :: dump_snaps_solflu
38-
!> N.B. This is not wavefield snapshots, but kernel wavefields. Belongs to nstrain and
39-
!! istrain
4037
logical :: dump_wavefields
4138
logical :: checkpointing
4239
logical :: diagfiles !< Write diagnostic files (seismograms at antipodes,
4340
!! list of surface elements, blabla), default: false
4441

4542
logical :: need_fluid_displ
4643
real(kind=dp) :: strain_samp
47-
integer :: iseismo !< current seismogram sample
48-
integer :: istrain !< current kernel wavefield sample
49-
integer :: isnap !< current wavefield sample for movies
44+
!integer :: iseismo !< current seismogram sample
45+
!integer :: istrain !< current kernel wavefield sample
46+
!integer :: isnap !< current wavefield sample for movies
5047
integer :: nseismo !< Number of seismogram samples
5148
integer :: nstrain !< Number of wavefield dumps for kernels
5249
integer :: nsnap !< Number of wavefield snapshots for movies

SOLVER/meshes_io.F90

Lines changed: 69 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ module meshes_io
4040
public :: dump_wavefields_mesh_1d
4141
public :: dump_glob_grid_midpoint
4242
public :: dump_xdmf_grid
43-
public :: dump_solid_grid
44-
public :: dump_fluid_grid
43+
!public :: dump_solid_grid
44+
!public :: dump_fluid_grid
4545
public :: prepare_mesh_memoryvar_vtk
4646
public :: build_kwf_grid
4747
public :: dump_kwf_midpoint_xdmf
@@ -788,14 +788,21 @@ subroutine dump_kwf_grid()
788788

789789
points_mp = 0.
790790

791+
ct = 1
791792
do iel=1, nel_solid
792-
points_mp(iel,1) = scoord(npol/2,npol/2,ielsolid(iel))
793-
points_mp(iel,2) = zcoord(npol/2,npol/2,ielsolid(iel))
793+
if (kwf_mask(npol/2,jpol/2,iel)) then
794+
points_mp(ct,1) = scoord(npol/2,npol/2,ielsolid(iel))
795+
points_mp(ct,2) = zcoord(npol/2,npol/2,ielsolid(iel))
796+
ct = ct + 1
797+
endif
794798
enddo
795799

796800
do iel=1, nel_fluid
797-
points_mp(iel + nel_solid,1) = scoord(npol/2,npol/2,ielfluid(iel))
798-
points_mp(iel + nel_solid,2) = zcoord(npol/2,npol/2,ielfluid(iel))
801+
if (kwf_mask(npol/2,jpol/2,iel + nel_solid)) then
802+
points_mp(ct,1) = scoord(npol/2,npol/2,ielfluid(iel))
803+
points_mp(ct,2) = zcoord(npol/2,npol/2,ielfluid(iel))
804+
ct = ct + 1
805+
endif
799806
enddo
800807

801808
if (use_netcdf) then
@@ -1012,25 +1019,25 @@ subroutine dump_kwf_sem_xdmf(filename, npoints, nelem)
10121019
!> Dumps the mesh (s,z) [m] in ASCII format as needed to visualize snapshots
10131020
!! in the solid region only.
10141021
!! Convention for order in the file: First the fluid, then the solid domain.
1015-
subroutine dump_solid_grid(ibeg,iend,jbeg,jend)
1016-
1017-
1018-
integer, intent(in) :: ibeg,iend,jbeg,jend
1019-
integer :: iel, ipol,jpol
1020-
1021-
open(unit=2500+mynum,file=datapath(1:lfdata)//'/solid_grid_'&
1022-
//appmynum//'.dat')
1023-
do iel=1,nel_solid
1024-
do jpol=jbeg,jend
1025-
do ipol=ibeg,iend
1026-
write(2500+mynum,*)scoord(ipol,jpol,ielsolid(iel)), &
1027-
zcoord(ipol,jpol,ielsolid(iel))
1028-
enddo
1029-
enddo
1030-
enddo
1031-
close(2500+mynum)
1032-
1033-
end subroutine dump_solid_grid
1022+
!subroutine dump_solid_grid(ibeg,iend,jbeg,jend)
1023+
!
1024+
!
1025+
! integer, intent(in) :: ibeg,iend,jbeg,jend
1026+
! integer :: iel, ipol,jpol
1027+
!
1028+
! open(unit=2500+mynum,file=datapath(1:lfdata)//'/solid_grid_'&
1029+
! //appmynum//'.dat')
1030+
! do iel=1,nel_solid
1031+
! do jpol=jbeg,jend
1032+
! do ipol=ibeg,iend
1033+
! write(2500+mynum,*)scoord(ipol,jpol,ielsolid(iel)), &
1034+
! zcoord(ipol,jpol,ielsolid(iel))
1035+
! enddo
1036+
! enddo
1037+
! enddo
1038+
! close(2500+mynum)
1039+
!
1040+
!end subroutine dump_solid_grid
10341041
!-----------------------------------------------------------------------------------------
10351042

10361043
!-----------------------------------------------------------------------------------------
@@ -1040,43 +1047,43 @@ end subroutine dump_solid_grid
10401047
!! When reading the fluid wavefield, one therefore needs to multiply all
10411048
!! components with inv_rho_fluid and the phi component with one/scoord!
10421049
!! Convention for order in the file: First the fluid, then the solid domain.
1043-
subroutine dump_fluid_grid(ibeg,iend,jbeg,jend)
1044-
1045-
use data_pointwise, only : inv_rho_fluid
1046-
1047-
1048-
integer, intent(in) :: ibeg,iend,jbeg,jend
1049-
integer :: iel, ipol,jpol
1050-
1051-
! When reading the fluid wavefield, one needs to multiply all components
1052-
! with inv_rho_fluid and the phi component with one/scoord!!
1053-
1054-
open(unit=2500+mynum,file=datapath(1:lfdata)//&
1055-
'/fluid_grid_'//appmynum//'.dat')
1056-
open(unit=2600+mynum,file=datapath(1:lfdata)//&
1057-
'/inv_rho_scoord_fluid_flusnaps_'&
1058-
//appmynum//'.dat', STATUS="REPLACE")
1059-
do iel=1,nel_fluid
1060-
do jpol=jbeg,jend
1061-
do ipol=ibeg,iend
1062-
write(2500+mynum,*)scoord(ipol,jpol,ielfluid(iel)), &
1063-
zcoord(ipol,jpol,ielfluid(iel))
1064-
if ( axis_fluid(iel) .and. ipol==0 ) then
1065-
! Axis s=0! write 1 instead of 1/s and then multiply
1066-
! with the correct factor dsdchi, obtained by L'Hospital's rule
1067-
! (see routine fluid_snapshot below).
1068-
write(2600+mynum,*)inv_rho_fluid(ipol,jpol,iel),one
1069-
else
1070-
write(2600+mynum,*)inv_rho_fluid(ipol,jpol,iel), &
1071-
one/scoord(ipol,jpol,ielfluid(iel))
1072-
endif
1073-
enddo
1074-
enddo
1075-
enddo
1076-
close(2500+mynum)
1077-
close(2600+mynum)
1078-
1079-
end subroutine dump_fluid_grid
1050+
!subroutine dump_fluid_grid(ibeg,iend,jbeg,jend)
1051+
!
1052+
! use data_pointwise, only : inv_rho_fluid
1053+
!
1054+
!
1055+
! integer, intent(in) :: ibeg,iend,jbeg,jend
1056+
! integer :: iel, ipol,jpol
1057+
!
1058+
! ! When reading the fluid wavefield, one needs to multiply all components
1059+
! ! with inv_rho_fluid and the phi component with one/scoord!!
1060+
!
1061+
! open(unit=2500+mynum,file=datapath(1:lfdata)//&
1062+
! '/fluid_grid_'//appmynum//'.dat')
1063+
! open(unit=2600+mynum,file=datapath(1:lfdata)//&
1064+
! '/inv_rho_scoord_fluid_flusnaps_'&
1065+
! //appmynum//'.dat', STATUS="REPLACE")
1066+
! do iel=1,nel_fluid
1067+
! do jpol=jbeg,jend
1068+
! do ipol=ibeg,iend
1069+
! write(2500+mynum,*)scoord(ipol,jpol,ielfluid(iel)), &
1070+
! zcoord(ipol,jpol,ielfluid(iel))
1071+
! if ( axis_fluid(iel) .and. ipol==0 ) then
1072+
! ! Axis s=0! write 1 instead of 1/s and then multiply
1073+
! ! with the correct factor dsdchi, obtained by L'Hospital's rule
1074+
! ! (see routine fluid_snapshot below).
1075+
! write(2600+mynum,*)inv_rho_fluid(ipol,jpol,iel),one
1076+
! else
1077+
! write(2600+mynum,*)inv_rho_fluid(ipol,jpol,iel), &
1078+
! one/scoord(ipol,jpol,ielfluid(iel))
1079+
! endif
1080+
! enddo
1081+
! enddo
1082+
! enddo
1083+
! close(2500+mynum)
1084+
! close(2600+mynum)
1085+
!
1086+
!end subroutine dump_fluid_grid
10801087
!-----------------------------------------------------------------------------------------
10811088

10821089
!-----------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)