137 ,rg_simu_current_time&
147 ,ig_nreceiver_snapshot&
148 ,ig_receiver_saving_incr&
159 ,lg_boundary_absorption&
203 double precision,
allocatable,
dimension(:) :: buffer_double
204 double precision,
allocatable,
dimension(:) :: buffer_double_all_cpu
206 double precision :: start_time
207 double precision :: end_time
209 double precision :: dltim1
210 double precision :: dltim2
212 double precision :: time_init_mesh
213 double precision :: time_init_gll
214 double precision :: time_init_mpi_buffers
215 double precision :: time_init_medium
216 double precision :: time_init_time_step
217 double precision :: time_init_source
218 double precision :: time_init_receiver
219 double precision :: time_init_jacobian
220 double precision :: time_init_mass_matrix
221 double precision :: time_compute_dcsource
222 double precision :: time_init_snapshot
223 double precision :: time_memory_consumption
225 double precision :: t_tloop
226 double precision :: t_newmark
227 double precision :: t_forext
228 double precision :: t_forabs
229 double precision :: t_forint_inner
230 double precision :: t_forint_outer
231 double precision :: t_resol
232 double precision :: t_snafsu
233 double precision :: t_outavd
234 double precision :: t_linkfo
235 double precision :: t_link_init
237 integer,
parameter :: ntime_init=12
238 integer,
allocatable,
dimension(:) :: buffer_integer
244 character(len= 95) :: myfmt
245 character(len=255) :: info
260 start_time = mpi_wtime()
274 time_init_mesh = mpi_wtime()
278 time_init_mesh = mpi_wtime() - time_init_mesh
285 time_init_gll = mpi_wtime()
290 time_init_gll = mpi_wtime() - time_init_gll
297 time_init_mpi_buffers = mpi_wtime()
301 time_init_mpi_buffers = mpi_wtime() - time_init_mpi_buffers
308 time_init_medium = mpi_wtime()
310 if (ig_medium_type == 0)
then
312 if (ig_myrank == 0)
write(ig_lst_unit,
'(" ",/,a)')
"generating medium with constant mechanical properties per hexa"
317 write(info,
'(a)')
"error in efispec: illegal medium type"
318 call error_stop(info)
324 time_init_medium = mpi_wtime() - time_init_medium
330 time_init_time_step = mpi_wtime()
334 time_init_time_step = mpi_wtime() - time_init_time_step
341 time_init_source = mpi_wtime()
346 time_init_source = mpi_wtime() - time_init_source
353 time_init_receiver = mpi_wtime()
358 time_init_receiver = mpi_wtime() - time_init_receiver
365 time_init_jacobian = mpi_wtime()
370 time_init_jacobian = mpi_wtime() - time_init_jacobian
377 time_init_mass_matrix = mpi_wtime()
381 time_init_mass_matrix = mpi_wtime() - time_init_mass_matrix
388 time_compute_dcsource = mpi_wtime()
392 time_compute_dcsource = mpi_wtime() - time_compute_dcsource
399 time_init_snapshot = mpi_wtime()
405 time_init_snapshot = mpi_wtime() - time_init_snapshot
412 time_memory_consumption = mpi_wtime()
416 time_memory_consumption = mpi_wtime() - time_memory_consumption
420 end_time = (mpi_wtime() - start_time)
422 call mpi_reduce(end_time,dltim1,1,mpi_double_precision,mpi_max,0,mpi_comm_world,ios)
430 allocate(buffer_double(ntime_init))
432 allocate(buffer_double_all_cpu(ntime_init*ig_ncpu))
434 buffer_double( 1) = time_init_mesh
435 buffer_double( 2) = time_init_gll
436 buffer_double( 3) = time_init_mpi_buffers
437 buffer_double( 4) = time_init_medium
438 buffer_double( 5) = time_init_source
439 buffer_double( 6) = time_init_receiver
440 buffer_double( 7) = time_init_jacobian
441 buffer_double( 8) = time_init_mass_matrix
442 buffer_double( 9) = time_compute_dcsource
443 buffer_double(10) = time_init_snapshot
444 buffer_double(11) = time_memory_consumption
445 buffer_double(12) = time_init_time_step
447 call mpi_gather(buffer_double,ntime_init,mpi_double_precision,buffer_double_all_cpu,ntime_init,mpi_double_precision,0,mpi_comm_world,ios)
449 if (ig_myrank == 0)
then
451 write(myfmt,
'(i)') ntime_init
452 myfmt =
"(a,i6,1x,"//trim(adjustl(myfmt))//
"(e14.7,1x))"
454 write(unit=ig_lst_unit,fmt=
'(" ",/,a)')
"elapsed time for initialization"
455 write(unit=ig_lst_unit,fmt=
'( a)')
" init_mesh init_gll_nodes init_mpi_buff init_medium init_source init_receiver init_jaco init_mass init_dcs init_snapshot init_memory init_time_step"
458 write(unit=ig_lst_unit,fmt=trim(myfmt))
"cpu ",icpu,(buffer_double_all_cpu((icpu-1)*ntime_init+itime),itime=1,ntime_init)
463 deallocate(buffer_double)
464 deallocate(buffer_double_all_cpu)
473 call mpi_barrier(mpi_comm_world,ios)
475 start_time = mpi_wtime()
477 if (lg_output_cputime)
then
478 open(unit=get_newunit(unit_time),file=trim(cg_prefix)//
".time.cpu."//trim(cg_myrank),status=
'replace')
481 if (ig_myrank == 0)
then
482 write(ig_lst_unit,
'(" ",/,a)')
"starting time loop"
483 write(ig_lst_unit,
'(" ",/,a)')
" -->time of simulation"
493 rg_simu_current_time = (ig_idt-1)*rg_dt
500 if ( (ig_myrank == 0) .and. mod(ig_idt-1,1000) == 0 )
then
501 write(ig_lst_unit,
'(7X,E14.7)') rg_simu_current_time
502 call flush(ig_lst_unit)
510 if (lg_output_cputime)
then
511 t_tloop = mpi_wtime()
519 if (lg_output_cputime)
then
520 t_newmark = mpi_wtime()
525 if (lg_output_cputime)
then
526 t_newmark = mpi_wtime() - t_newmark
534 if (lg_output_cputime)
then
535 t_forext = mpi_wtime()
540 if (lg_output_cputime)
then
541 t_forext = mpi_wtime() - t_forext
549 if (lg_output_cputime)
then
550 t_forabs = mpi_wtime()
555 if (lg_output_cputime)
then
556 t_forabs = mpi_wtime() - t_forabs
564 if (lg_output_cputime)
then
565 t_forint_outer = mpi_wtime()
572 if (lg_output_cputime)
then
573 t_forint_outer = mpi_wtime() - t_forint_outer
576 if (lg_output_cputime)
then
577 t_link_init = mpi_wtime()
582 if (lg_output_cputime)
then
583 t_link_init = mpi_wtime() - t_link_init
586 if (lg_output_cputime)
then
587 t_forint_inner = mpi_wtime()
594 if (lg_output_cputime)
then
595 t_forint_inner = mpi_wtime() - t_forint_inner
603 if (lg_output_cputime)
then
604 t_linkfo = mpi_wtime()
607 if (lg_async_mpi_comm)
then
613 if (lg_output_cputime)
then
614 t_linkfo = mpi_wtime() - t_linkfo
622 if (lg_output_cputime)
then
623 t_resol = mpi_wtime()
628 if (lg_output_cputime)
then
629 t_resol = mpi_wtime() - t_resol
637 if (lg_output_cputime)
then
638 t_snafsu = mpi_wtime()
645 if (lg_output_cputime)
then
646 t_snafsu = mpi_wtime() - t_snafsu
654 if (lg_output_cputime)
then
655 t_outavd = mpi_wtime()
658 if ( (ig_idt == 1) .or. mod((ig_idt-1),ig_receiver_saving_incr) == 0 )
then
664 if (lg_output_cputime)
then
665 t_outavd = mpi_wtime() - t_outavd
673 if (lg_output_cputime)
then
675 t_tloop = mpi_wtime() - t_tloop
677 write(unit_time,
'(i10,1x,11(e22.15,1x))') ig_idt &
690 call flush(unit_time)
704 if (lg_snapshot)
then
723 if (lg_snapshot_volume)
then
729 if (lg_output_cputime)
then
738 end_time = (mpi_wtime() - start_time)
739 call mpi_reduce(end_time,dltim2,1,mpi_double_precision,mpi_max,0,mpi_comm_world,ios)
746 allocate(buffer_double_all_cpu(ig_ncpu))
747 call mpi_gather(end_time,1,mpi_double_precision,buffer_double_all_cpu,1,mpi_double_precision,0,mpi_comm_world,ios)
754 allocate(buffer_integer(ig_ncpu))
755 call mpi_gather(ig_nhexa,1,mpi_integer,buffer_integer,1,mpi_integer,0,mpi_comm_world,ios)
762 if (ig_myrank == 0)
then
763 write(ig_lst_unit,
'(" ",/,a,e15.7,a)')
"elapsed time for initialization = ",dltim1,
" s"
764 write(ig_lst_unit,
'(a,e15.7,a)')
"elapsed time for time loop computation = ",dltim2,
" s"
765 write(ig_lst_unit,
'(a,e15.7,a)')
"total elapsed time for computation = ",dltim1+dltim2,
" s"
767 write(ig_lst_unit,
'("",/,a,i0,a)' )
"average time per time step and per hexa (order ",ig_lagrange_order,
") for the simulation"
769 write(ig_lst_unit,
'(a,i8,1x,e15.7,a)')
" -->cpu ",icpu-1,buffer_double_all_cpu(icpu)/(dble(ig_ndt)*dble(buffer_integer(icpu))),
" s"
773 call mpi_finalize(ios)
subroutine, public init_input_variables()
This subroutine initializes the simulation by writing header of listing file *.lst and reading variab...
This module contains subroutines to read mesh files and creates GLL nodes global numbering in cpu myr...
This module contains subroutines to allocate arrays and to compute an approximation of the total RAM ...
This module contains subroutines to compute information about receivers and to write receivers' time ...
subroutine, public compute_external_force()
This subroutine sets external forces of the system for double couple and single force point sources...
subroutine, public compute_internal_forces_order5(elt_start, elt_end)
This subroutine computes internal forces for spectral-elements of order 5. Stress-strain relationshi...
subroutine, public init_gll_nodes()
This subroutine computes GLL nodes abscissa and weight in the reference domain [-1:1] as well as deri...
subroutine, public init_mpi()
This subroutine initializes MPI.
This module contains subroutines to initialize medium for hexahedron and quadrangle elements...
subroutine, public init_time_step()
This subroutine returns the time step mod_global_variables::rg_dt that makes the simulation stable...
This module contains subroutines to compute Newmark explicit time marching scheme, external forces , internal forces and boundary traction forces of the system .
subroutine, public init_quadp_medium()
This subroutine fills medium properties at GLL nodes of paraxial quadrangle elements (i...
This module contains subroutines to compute and write snapshots of a mesh composed by hexahedron elem...
subroutine, public assemble_force_async_comm_end()
subroutine to finalize forces assembly between connected cpus by MPI asynchrone communications.
subroutine, public assemble_force_sync_comm()
subroutine to assemble forces between connected cpus by MPI synchrone communications.
subroutine, public init_mpi_buffers()
This subroutine searches for common GLL nodes between cpu myrank and its neighbor cpus...
This module defines all global variables of EFISPEC3D. Scalar variables are initialized directly in t...
subroutine, public init_jacobian_matrix_quad()
This subroutine computes the determinant of Jacobian matrix and normal unit vector of quadrangle elem...
subroutine, public init_snapshot_surface()
This subroutine generates a structured grid of receivers on the free surface.
subroutine, public init_quad_receiver()
This subroutine reads all receivers in file *.fsr; determines to which cpu they belong; computes thei...
subroutine, public compute_internal_forces_order4(elt_start, elt_end)
This subroutine computes internal forces for spectral-elements of order 4. Stress-strain relationshi...
subroutine, public memory_consumption()
Subroutine to compute an approximation of total RAM used by global variables of EFISPEC3D. See module mod_global_variables.
subroutine, public compute_double_couple_source()
This subroutine pre-computes all double couple point sources defined by type mod_global_variables::ty...
This module contains subroutines to initialize some global variable vectors and matrices.
subroutine, public init_double_couple_source()
This subroutine reads all double couple point sources in file *.dcs; sets double couple point sources...
subroutine, public init_gll_nodes_coordinates()
This subroutine computes GLL nodes -coordinates in the physical domain, cartesian right-handed coordi...
This module contains subroutines to compute information about sources.
subroutine, public init_single_force_source()
This subroutine reads all single force point sources in file *.sfs; determines to which cpu belong si...
subroutine, public init_mesh()
This subroutine reads mesh files *.inp for cpu myrank and creates GLL numbering of hexahedron and qua...
subroutine, public init_hexa_receiver()
This subroutine reads all receivers in file *.vor; determines to which cpu they belong; computes thei...
subroutine, public write_peak_ground_motion()
This subroutine writes peak ground motions files in GMT or VTK formats.
subroutine, public write_collection_vtk_vol()
This subroutine selects which ParaView collection files should be written (displacement, velocity and/or acceleration collections) depending on value of variables mod_global_variables::lg_snapshot_volume_displacement, mod_global_variables::lg_snapshot_volume_velocity and mod_global_variables::lg_snapshot_volume_acceleration.
subroutine, public write_receiver_output()
This subroutine writes -displacements, velocities and accelerations at receivers. ...
subroutine, public write_collection_vtk_surf()
This subroutine selects which ParaView collection files should be written (displacement, velocity and/or acceleration collections) depending on value of variables mod_global_variables::lg_snapshot_displacement, mod_global_variables::lg_snapshot_velocity and mod_global_variables::lg_snapshot_acceleration.
This module contains subroutines to initialize MPI buffers between cpu myrank and its neighbor cpus...
subroutine, public compute_absorption_forces()
This subroutine computes absorption forces for any spectral-elements order. A so-called 'P1' explici...
subroutine, public init_snapshot_volume()
This subroutine intializes the VTK mesh used for volume snapshots by calling 'get_efi_hexa' and 'init...
This module contains subroutines to initialize the time step of the simulation.
This module contains subroutines to assemble forces between cpu myrank and its neighbor cpus by synch...
subroutine, public init_hexa_medium()
This subroutine fills medium properties (elastic or viscoelastic) at GLL nodes of hexahedron elements...
This module contains subroutines to compute and write snapshots of the free surface (either in GMT or...
subroutine, public compute_internal_forces_order6(elt_start, elt_end)
This subroutine computes internal forces for spectral-elements of order 6. Stress-strain relationshi...
subroutine, public init_mass_matrix()
This subroutine computes and assembles the mass matrix of the system .
subroutine, public newmark_end()
This subroutine finalizes Newmark time marching scheme at step n+1.
subroutine, public assemble_force_async_comm_init()
subroutine to initialize forces assembly between connected cpus by MPI asynchrone communications...
subroutine, public init_jacobian_matrix_hexa()
This subroutine computes Jacobian matrix and its determinant for hexahedron elements.
subroutine, public write_snapshot_surface()
This subroutine computes and writes -displacements, velocities and accelerations at receivers used fo...
subroutine, public write_snapshot_volume()
This subroutine manages output format for volume snapshot. For now, only VTK format is available...
subroutine, public newmark_ini()
This subroutine initializes Newmark time marching scheme at step n+1.