Skip to content

Commit 12c913a

Browse files
authored
Merge pull request #1246 from danielpeter/devel
2 parents 0f7caa5 + 3ceb1a5 commit 12c913a

File tree

7 files changed

+115
-52
lines changed

7 files changed

+115
-52
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ compiler: gcc
1717
# deprecated
1818
#sudo: required
1919

20+
# turns off submodule fetching by default
21+
git:
22+
submodules: false
23+
2024
env:
2125
global:
2226
- FC=gfortran

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ involved in the community and keep them in the specfem3d github wiki:
6060
[specfem3d wiki](https://github.com/SPECFEM/specfem3d/wiki)
6161

6262

63+
## Our contributors :sparkles:
64+
65+
[![SPECFEM2D contributors](https://contrib.rocks/image?repo=SPECFEM/specfem2d)](https://github.com/SPECFEM/specfem2d/graphs/contributors)
66+
67+
6368
## Computational Infrastructure for Geodynamics (CIG)
6469

6570
SPECFEM2D is part of the software that is hosted by the Computational Infrastructure for Geodynamics (CIG). It is available on the CIG website [here (SPECFEM2D)](https://geodynamics.org/resources/specfem2d).

m4

Submodule m4 updated 1 file

src/meshfem2D/repartition_coupling.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ subroutine periodic_edges_repartitioning(elmnts_l,nnodes,nodes_coords,PERIODIC_H
433433
! user output
434434
write(IMAIN,*) 'done detecting points for periodic boundary conditions.'
435435
write(IMAIN,*) 'number of periodic elements found and grouped in the same partition: ',count(is_periodic)
436+
write(IMAIN,*)
436437
call flush_IMAIN()
437438

438439
! loop on all the elements to find the first partition that contains a periodic element

src/specfem2D/plot_post.F90

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ subroutine plot_post()
5757
fluid_solid_acoustic_ispec,fluid_solid_acoustic_iedge,num_fluid_solid_edges, &
5858
fluid_poro_acoustic_ispec,fluid_poro_acoustic_iedge,num_fluid_poro_edges, &
5959
solid_poro_poroelastic_ispec,solid_poro_poroelastic_iedge,num_solid_poro_edges, &
60-
myrank,NPROC
60+
myrank,NPROC, &
61+
P_SV
6162

6263
use shared_parameters, only: subsamp_postscript,imagetype_postscript,interpol, &
6364
meshvect,modelvect, &
@@ -192,7 +193,12 @@ subroutine plot_post()
192193
ratio_page = min(rpercentz*sizez/(zmax-zmin),rpercentx*sizex/(xmax-xmin)) / 100.d0
193194

194195
! compute the maximum of the norm of the vector
195-
dispmax = maxval(sqrt(vector_field_display(1,:)**2 + vector_field_display(2,:)**2))
196+
if (P_SV) then
197+
dispmax = maxval(sqrt(vector_field_display(1,:)**2 + vector_field_display(2,:)**2))
198+
else
199+
! SH (membrane) waves, plot y-component
200+
dispmax = maxval(abs(vector_field_display(1,:)))
201+
endif
196202

197203
call max_all_all_dp(dispmax, dispmax_glob)
198204
dispmax = dispmax_glob
@@ -1516,22 +1522,39 @@ subroutine plot_post()
15161522
Uxinterp(i,j) = 0.d0
15171523
Uzinterp(i,j) = 0.d0
15181524

1519-
do k = 1,NGLLX
1520-
do l= 1,NGLLX
1521-
if (AXISYM) then
1522-
if (is_on_the_axis(ispec)) then
1523-
Uxinterp(i,j) = Uxinterp(i,j) + vector_field_display(1,ibool(k,l,ispec))*flagrange_GLJ(k,i)*flagrange_GLJ(l,j)
1524-
Uzinterp(i,j) = Uzinterp(i,j) + vector_field_display(2,ibool(k,l,ispec))*flagrange_GLJ(k,i)*flagrange_GLJ(l,j)
1525+
if (P_SV) then
1526+
do k = 1,NGLLX
1527+
do l= 1,NGLLX
1528+
if (AXISYM) then
1529+
if (is_on_the_axis(ispec)) then
1530+
Uxinterp(i,j) = Uxinterp(i,j) + vector_field_display(1,ibool(k,l,ispec))*flagrange_GLJ(k,i)*flagrange_GLJ(l,j)
1531+
Uzinterp(i,j) = Uzinterp(i,j) + vector_field_display(2,ibool(k,l,ispec))*flagrange_GLJ(k,i)*flagrange_GLJ(l,j)
1532+
else
1533+
Uxinterp(i,j) = Uxinterp(i,j) + vector_field_display(1,ibool(k,l,ispec))*flagrange(k,i)*flagrange(l,j)
1534+
Uzinterp(i,j) = Uzinterp(i,j) + vector_field_display(2,ibool(k,l,ispec))*flagrange(k,i)*flagrange(l,j)
1535+
endif
15251536
else
15261537
Uxinterp(i,j) = Uxinterp(i,j) + vector_field_display(1,ibool(k,l,ispec))*flagrange(k,i)*flagrange(l,j)
15271538
Uzinterp(i,j) = Uzinterp(i,j) + vector_field_display(2,ibool(k,l,ispec))*flagrange(k,i)*flagrange(l,j)
15281539
endif
1529-
else
1530-
Uxinterp(i,j) = Uxinterp(i,j) + vector_field_display(1,ibool(k,l,ispec))*flagrange(k,i)*flagrange(l,j)
1531-
Uzinterp(i,j) = Uzinterp(i,j) + vector_field_display(2,ibool(k,l,ispec))*flagrange(k,i)*flagrange(l,j)
1532-
endif
1540+
enddo
15331541
enddo
1534-
enddo
1542+
else
1543+
! SH (membrane) waves, plot y-component
1544+
do k = 1,NGLLX
1545+
do l= 1,NGLLX
1546+
if (AXISYM) then
1547+
if (is_on_the_axis(ispec)) then
1548+
Uxinterp(i,j) = Uxinterp(i,j) + vector_field_display(1,ibool(k,l,ispec))*flagrange_GLJ(k,i)*flagrange_GLJ(l,j)
1549+
else
1550+
Uxinterp(i,j) = Uxinterp(i,j) + vector_field_display(1,ibool(k,l,ispec))*flagrange(k,i)*flagrange(l,j)
1551+
endif
1552+
else
1553+
Uxinterp(i,j) = Uxinterp(i,j) + vector_field_display(1,ibool(k,l,ispec))*flagrange(k,i)*flagrange(l,j)
1554+
endif
1555+
enddo
1556+
enddo
1557+
endif
15351558

15361559
x1 =(xinterp(i,j)-xmin)*ratio_page
15371560
z1 =(zinterp(i,j)-zmin)*ratio_page
@@ -1672,8 +1695,14 @@ subroutine plot_post()
16721695
z1 =(coord(2,ipoin)-zmin)*ratio_page
16731696

16741697
if (dispmax > 0.d0) then
1675-
x2 = vector_field_display(1,ipoin)*sizemax_arrows/dispmax
1676-
z2 = vector_field_display(2,ipoin)*sizemax_arrows/dispmax
1698+
if (P_SV) then
1699+
x2 = vector_field_display(1,ipoin)*sizemax_arrows/dispmax
1700+
z2 = vector_field_display(2,ipoin)*sizemax_arrows/dispmax
1701+
else
1702+
! SH (membrane) waves, plot y-component
1703+
x2 = vector_field_display(1,ipoin)*sizemax_arrows/dispmax
1704+
z2 = 0.d0
1705+
endif
16771706
else
16781707
x2 = 0.d0
16791708
z2 = 0.d0

src/specfem2D/setup_mesh.F90

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ subroutine setup_mesh_numbering()
134134
#else
135135
write(IMAIN,*) 'Exact total number of grid points in the mesh: ',nglob_total
136136
#endif
137+
write(IMAIN,*)
137138

138139
! percentage of elements with 2 degrees of freedom per point
139140
ratio_2DOFs = (nspec_total - nspec_acoustic_total) / dble(nspec_total)
@@ -145,7 +146,6 @@ subroutine setup_mesh_numbering()
145146
nb_elastic_DOFs = nint(nglob_total*ratio_2DOFs*2)
146147

147148
if (P_SV) then
148-
write(IMAIN,*)
149149
write(IMAIN,*) 'Approximate number of acoustic degrees of freedom in the mesh: ',nb_acoustic_DOFs
150150
write(IMAIN,*) 'Approximate number of elastic degrees of freedom in the mesh: ',nb_elastic_DOFs
151151
write(IMAIN,*) ' (there are 2 degrees of freedom per point for elastic elements)'
@@ -350,7 +350,7 @@ subroutine setup_mesh_periodic_edges()
350350
! local parameters
351351
integer :: ispec,i,j,iglob,iglob2,ier
352352
double precision :: xmaxval,xminval,ymaxval,yminval,xtol,xtypdist
353-
integer :: counter
353+
integer :: counter,counter_all
354354

355355
! allocate an array to make sure that an acoustic free surface is not enforced on periodic edges
356356
allocate(this_ibool_is_a_periodic_edge(NGLOB),stat=ier)
@@ -362,19 +362,20 @@ subroutine setup_mesh_periodic_edges()
362362
if (ADD_PERIODIC_CONDITIONS) then
363363
! user output
364364
if (myrank == 0) then
365-
write(IMAIN,*)
366-
write(IMAIN,*) 'implementing periodic boundary conditions'
367-
write(IMAIN,*) 'in the horizontal direction with a periodicity distance of ',PERIODIC_HORIZ_DIST,' m'
365+
write(IMAIN,*) 'Periodic boundary conditions:'
366+
write(IMAIN,*) ' implementing periodic boundary conditions'
367+
write(IMAIN,*) ' in the horizontal direction with a periodicity distance of ',sngl(PERIODIC_HORIZ_DIST),' m'
368368
if (PERIODIC_HORIZ_DIST <= 0.d0) call stop_the_code( &
369369
'PERIODIC_HORIZ_DIST should be greater than zero when using ADD_PERIODIC_CONDITIONS')
370370
write(IMAIN,*)
371-
write(IMAIN,*) '*****************************************************************'
372-
write(IMAIN,*) '*****************************************************************'
373-
write(IMAIN,*) '**** BEWARE: because of periodic conditions, values computed ****'
374-
write(IMAIN,*) '**** by check_grid() below will not be reliable ****'
375-
write(IMAIN,*) '*****************************************************************'
376-
write(IMAIN,*) '*****************************************************************'
371+
write(IMAIN,*) ' *****************************************************************'
372+
write(IMAIN,*) ' *****************************************************************'
373+
write(IMAIN,*) ' **** BEWARE: because of periodic conditions, values computed ****'
374+
write(IMAIN,*) ' **** by check_grid() below will not be reliable ****'
375+
write(IMAIN,*) ' *****************************************************************'
376+
write(IMAIN,*) ' *****************************************************************'
377377
write(IMAIN,*)
378+
call flush_IMAIN()
378379
endif
379380

380381
! set up a local geometric tolerance
@@ -419,8 +420,9 @@ subroutine setup_mesh_periodic_edges()
419420
! (as implemented in routine createnum_fast() elsewhere in the code). This could be done one day if needed instead
420421
! of the very simple double loop below.
421422
if (myrank == 0) then
422-
write(IMAIN,*) 'start detecting points for periodic boundary conditions '// &
423+
write(IMAIN,*) ' start detecting points for periodic boundary conditions '// &
423424
'(the current algorithm can be slow and could be improved)...'
425+
call flush_IMAIN()
424426
endif
425427

426428
counter = 0
@@ -447,9 +449,31 @@ subroutine setup_mesh_periodic_edges()
447449
enddo
448450
enddo
449451

450-
if (myrank == 0) write(IMAIN,*) 'done detecting points for periodic boundary conditions.'
452+
if (myrank == 0) then
453+
write(IMAIN,*) ' done detecting points for periodic boundary conditions.'
454+
write(IMAIN,*)
455+
call flush_IMAIN()
456+
endif
451457

452-
if (counter > 0) write(IMAIN,*) 'implemented periodic conditions on ',counter,' grid points on proc ',myrank
458+
if (counter > 0) then
459+
write(IMAIN,*) ' implemented periodic conditions on ',counter,' grid points on proc ',myrank
460+
endif
461+
462+
! check if any points found
463+
call sum_all_i(counter,counter_all)
464+
465+
if (myrank == 0) then
466+
write(IMAIN,*) ' total number of grid points found for periodic conditions = ',counter_all
467+
write(IMAIN,*)
468+
if (counter_all == 0) then
469+
write(IMAIN,*) ' No grid points found for periodic conditions.'
470+
write(IMAIN,*) ' Detection uses a typical element size ',xtypdist,'and position tolerance ',xtol
471+
write(IMAIN,*) ' Please check if periodic horizontal distance ',sngl(PERIODIC_HORIZ_DIST), &
472+
'is coherent with mesh dimensions'
473+
write(IMAIN,*)
474+
endif
475+
call flush_IMAIN()
476+
endif
453477

454478
endif ! of if (ADD_PERIODIC_CONDITIONS)
455479

src/specfem2D/write_postscript_snapshot.f90

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,31 +52,31 @@ subroutine write_postscript_snapshot()
5252
endif
5353

5454
! determines postscript output type
55-
if (P_SV) then
56-
select case (imagetype_postscript)
57-
case (1)
58-
! displacement
59-
if (myrank == 0) write(IMAIN,*) 'drawing displacement vector as small arrows...'
60-
call compute_vector_whole_medium(potential_acoustic,displ_elastic,displs_poroelastic)
61-
case (2)
62-
! velocity
63-
if (myrank == 0) write(IMAIN,*) 'drawing velocity vector as small arrows...'
64-
call compute_vector_whole_medium(potential_dot_acoustic,veloc_elastic,velocs_poroelastic)
65-
case (3)
66-
! acceleration
67-
if (myrank == 0) write(IMAIN,*) 'drawing acceleration vector as small arrows...'
68-
call compute_vector_whole_medium(potential_dot_dot_acoustic,accel_elastic,accels_poroelastic)
69-
case default
70-
call exit_MPI(myrank,'wrong type for PostScript snapshots')
71-
end select
55+
select case (imagetype_postscript)
56+
case (1)
57+
! displacement
58+
if (myrank == 0) write(IMAIN,*) 'drawing displacement vector as small arrows...'
59+
call compute_vector_whole_medium(potential_acoustic,displ_elastic,displs_poroelastic)
60+
case (2)
61+
! velocity
62+
if (myrank == 0) write(IMAIN,*) 'drawing velocity vector as small arrows...'
63+
call compute_vector_whole_medium(potential_dot_acoustic,veloc_elastic,velocs_poroelastic)
64+
case (3)
65+
! acceleration
66+
if (myrank == 0) write(IMAIN,*) 'drawing acceleration vector as small arrows...'
67+
call compute_vector_whole_medium(potential_dot_dot_acoustic,accel_elastic,accels_poroelastic)
68+
case default
69+
call exit_MPI(myrank,'wrong type for PostScript snapshots')
70+
end select
7271

73-
! postscript plotting
74-
call plot_post()
75-
76-
else
77-
call exit_MPI(myrank,'cannot draw a SH scalar field as a vector plot, turn PostScript plots off')
72+
! info for SH simulations
73+
if (.not. P_SV) then
74+
write(IMAIN,*) 'drawing a SH scalar field as a vector plot oriented along x-direction'
7875
endif
7976

77+
! postscript plotting
78+
call plot_post()
79+
8080
! user output
8181
if (myrank == 0) then
8282
write(IMAIN,*) 'PostScript file written'

0 commit comments

Comments
 (0)