141 logical,
parameter :: LG_VISCO = .false.
144 logical,
parameter :: LG_SNAPSHOT_VTK = .false.
147 logical,
parameter :: LG_SNAPSHOT_GMT = .true.
150 logical,
parameter :: LG_OUTPUT_MEDIUM_VTK = .false.
153 integer,
parameter :: IG_LAGRANGE_ORDER = 4
156 integer,
parameter :: IG_NGLL = IG_LAGRANGE_ORDER + 1
159 integer,
parameter :: IG_LST_UNIT = 10
162 integer,
parameter :: IG_NDOF = 3
165 integer,
parameter :: IG_NRELAX = 8
168 real ,
parameter :: RG_NEWMARK_GAMMA = 0.5
171 real ,
parameter :: RG_PI = 3.141592654
174 real ,
parameter :: EPSILON_MACHINE = epsilon(EPSILON_MACHINE)
177 real ,
parameter :: TINY_REAL = tiny(TINY_REAL)
180 logical,
parameter :: LG_ASYNC_MPI_COMM = .false.
183 logical,
parameter :: LG_OUTPUT_CPUTIME = .false.
186 logical,
parameter :: LG_OUTPUT_DEBUG_FILE = .false.
195 real,
dimension(:,:,:,:,:),
allocatable :: rg_dcsource_gll_force
198 real,
dimension(:,:,:,:),
allocatable :: rg_hexa_gll_jacobian_det
201 real,
dimension(:,:,:,:),
allocatable :: rg_hexa_gll_dxidx
204 real,
dimension(:,:,:,:),
allocatable :: rg_hexa_gll_dxidy
207 real,
dimension(:,:,:,:),
allocatable :: rg_hexa_gll_dxidz
210 real,
dimension(:,:,:,:),
allocatable :: rg_hexa_gll_detdx
213 real,
dimension(:,:,:,:),
allocatable :: rg_hexa_gll_detdy
216 real,
dimension(:,:,:,:),
allocatable :: rg_hexa_gll_detdz
219 real,
dimension(:,:,:,:),
allocatable :: rg_hexa_gll_dzedx
222 real,
dimension(:,:,:,:),
allocatable :: rg_hexa_gll_dzedy
225 real,
dimension(:,:,:,:),
allocatable :: rg_hexa_gll_dzedz
228 real,
dimension(:,:,:,:),
allocatable :: rg_hexa_gll_rho
231 real,
dimension(:,:,:,:),
allocatable :: rg_hexa_gll_rhovs2
234 real,
dimension(:,:,:,:),
allocatable :: rg_hexa_gll_rhovp2
237 real,
dimension(:,:,:),
allocatable :: rg_quadp_gll_rhovs
240 real,
dimension(:,:,:),
allocatable :: rg_quadp_gll_rhovp
243 real,
dimension(:,:,:),
allocatable :: rg_quadp_gll_jaco_det
246 real,
dimension(:,:,:,:),
allocatable :: rg_quadp_gll_normal
249 real,
dimension(:,:,:,:,:),
allocatable :: rg_hexa_gll_wkqs
252 real,
dimension(:,:,:,:,:),
allocatable :: rg_hexa_gll_wkqp
255 real,
dimension(:,:,:,:,:),
allocatable :: rg_hexa_gll_ksixx
258 real,
dimension(:,:,:,:,:),
allocatable :: rg_hexa_gll_ksiyy
261 real,
dimension(:,:,:,:,:),
allocatable :: rg_hexa_gll_ksizz
264 real,
dimension(:,:,:,:,:),
allocatable :: rg_hexa_gll_ksixy
267 real,
dimension(:,:,:,:,:),
allocatable :: rg_hexa_gll_ksixz
270 real,
dimension(:,:,:,:,:),
allocatable :: rg_hexa_gll_ksiyz
273 real,
dimension(IG_NRELAX,3),
parameter :: RG_RELAX_COEFF = [ &
301 real,
dimension(IG_NRELAX) :: rg_mem_var_exp
304 real,
dimension(:,:),
allocatable :: rg_gll_displacement
307 real,
dimension(:,:),
allocatable :: rg_gll_velocity
310 real,
dimension(:,:),
allocatable :: rg_gll_acceleration
313 real,
dimension(:),
allocatable :: rg_gnode_abscissa
316 real,
dimension(:,:),
allocatable :: rg_gnode_abscissa_dist
319 real,
dimension(:),
allocatable :: rg_gll_mass_matrix
322 real,
dimension(:),
allocatable :: rg_gnode_x
325 real,
dimension(:),
allocatable :: rg_gnode_y
328 real,
dimension(:),
allocatable :: rg_gnode_z
331 real,
dimension(:),
allocatable :: rg_receiver_snapshot_z
334 integer,
dimension(:),
allocatable :: ig_receiver_snapshot_locnum
337 real,
dimension(:),
allocatable :: rg_dcsource_user_func
340 real,
dimension(:),
allocatable :: rg_sfsource_user_func
343 real,
dimension(:),
allocatable :: rg_mpi_buffer_send
346 real,
dimension(:),
allocatable :: rg_mpi_buffer_recv
355 real :: rg_simu_current_time = 0.0
358 real :: rg_simu_total_time = 0.0
361 real :: rg_mesh_xmax = 0.0
364 real :: rg_mesh_xmin = 0.0
367 real :: rg_mesh_ymax = 0.0
370 real :: rg_mesh_ymin = 0.0
373 real :: rg_mesh_zmax = 0.0
376 real :: rg_mesh_zmin = 0.0
379 real :: rg_receiver_snapshot_dxdy = 0.0
382 real :: rg_receiver_snapshot_dx = 0.0
385 real :: rg_receiver_snapshot_dy = 0.0
388 integer :: ig_receiver_snapshot_nx = 0
391 integer :: ig_receiver_snapshot_ny = 0
394 integer,
target,
dimension(:,:,:,:),
allocatable :: ig_hexa_gll_glonum
397 integer,
dimension(:,:,:),
allocatable :: ig_quadp_gll_glonum
400 integer,
dimension(:,:,:),
allocatable :: ig_quadf_gll_glonum
403 integer,
dimension(:,:),
allocatable :: ig_hexa_gnode_glonum
406 integer,
dimension(:,:),
allocatable :: ig_quadp_gnode_glonum
409 integer,
dimension(:,:),
allocatable :: ig_quadf_gnode_glonum
412 integer,
dimension(:),
allocatable :: ig_hexa_gnode_xiloc
415 integer,
dimension(:),
allocatable :: ig_hexa_gnode_etloc
418 integer,
dimension(:),
allocatable :: ig_hexa_gnode_zeloc
421 integer,
dimension(:),
allocatable :: ig_quad_gnode_xiloc
424 integer,
dimension(:),
allocatable :: ig_quad_gnode_etloc
427 integer,
dimension(:),
allocatable :: ig_hexa_receiver_unit
430 integer,
dimension(:),
allocatable :: ig_quad_receiver_unit
433 integer :: ig_mpi_buffer_sizemax = 0
436 integer,
dimension(:),
allocatable :: ig_mpi_request_send
439 integer,
dimension(:),
allocatable :: ig_mpi_request_recv
442 integer,
dimension(:),
allocatable :: ig_mpi_buffer_offset
445 integer,
dimension(:),
allocatable :: ig_hexa_material_number
448 integer(kind=1) ,
dimension(:),
allocatable :: ig_material_type
451 integer,
dimension(:),
allocatable :: ig_receiver_snapshot_glonum
454 integer,
dimension(:),
allocatable :: ig_receiver_snapshot_mpi_shift
457 integer,
dimension(:),
allocatable :: ig_receiver_snapshot_total_number
460 integer :: ig_ncpu = 0
463 integer :: ig_myrank = 0
466 integer :: ig_ncpu_neighbor = 0
469 integer,
dimension(:,:),
allocatable :: ig_cpu_neighbor_info
472 integer :: ig_nhexa = 0
475 integer :: ig_nhexa_outer = 0
478 integer :: ig_nhexa_inner = 0
481 integer :: ig_nquad_parax = 0
484 integer :: ig_nquad_fsurf = 0
487 integer :: ig_mesh_nnode = 0
490 integer :: ig_hexa_nnode = 0
493 integer :: ig_quad_nnode = 0
496 integer :: ig_line_nnode = 0
499 integer,
dimension(3,8) :: ig_hexa_node2gll
502 integer :: ig_ndt = 0
505 integer :: ig_idt = 0
508 integer :: ig_receiver_saving_incr = 1
511 integer :: ig_snapshot_saving_incr = 0
514 integer :: ig_snapshot_volume_saving_incr = 0
517 logical :: lg_boundary_absorption = .true.
520 integer :: ig_ndcsource = 0
523 integer :: ig_nsfsource = 0
526 integer :: ig_nreceiver_hexa = 0
529 integer :: ig_nreceiver_quad = 0
532 integer :: ig_nreceiver_snapshot = 0
535 integer :: ig_medium_type = 0
538 integer :: ig_nmaterial = 0
541 integer,
dimension(:),
allocatable :: ig_quadp_neighbor_hexa
544 integer,
dimension(:),
allocatable :: ig_quadp_neighbor_hexaface
547 integer :: ig_nneighbor_all_kind = 0
550 integer :: ig_cpu_name_len = 0
553 character(len=MPI_MAX_PROCESSOR_NAME) :: cg_cpu_name
556 character(len=92) :: cg_prefix
559 character(len= 6) :: cg_myrank
562 character(len= 6) :: cg_ncpu
565 logical :: lg_snapshot = .false.
568 logical :: lg_snapshot_displacement = .false.
571 logical :: lg_snapshot_velocity = .false.
574 logical :: lg_snapshot_acceleration = .false.
577 logical :: lg_snapshot_volume = .false.
580 logical :: lg_snapshot_volume_displacement = .false.
583 logical :: lg_snapshot_volume_velocity = .false.
586 logical :: lg_snapshot_volume_acceleration = .false.
589 real,
dimension(:,:),
allocatable :: rg_gll_coordinate
592 real,
dimension(IG_NGLL) :: rg_gll_weight
595 real,
dimension(IG_NGLL) :: rg_gll_abscissa
598 real,
dimension(IG_NGLL,IG_NGLL) :: rg_gll_lagrange_deriv
601 real,
dimension(IG_NGLL,IG_NGLL) :: rg_gll_abscissa_dist
604 integer :: ig_ngll_total = 0
607 integer,
dimension(:),
allocatable :: ig_hexa_snapshot
610 integer,
dimension(:),
allocatable :: ig_vtk_hexa_conn_snapshot
613 integer,
dimension(:),
allocatable :: ig_vtk_node_gll_glonum_snapshot
616 real,
dimension(:),
allocatable :: rg_vtk_node_x_snapshot
619 real,
dimension(:),
allocatable :: rg_vtk_node_y_snapshot
622 real,
dimension(:),
allocatable :: rg_vtk_node_z_snapshot
625 integer(kind=1),
dimension(:),
allocatable :: ig_vtk_cell_type_snapshot
628 integer,
dimension(:),
allocatable :: ig_vtk_offset_snapshot
631 integer :: ig_vtk_nhexa_snapshot
634 integer :: ig_vtk_nnode_snapshot
637 real :: rg_snapshot_volume_xmin
640 real :: rg_snapshot_volume_xmax
643 real :: rg_snapshot_volume_ymin
646 real :: rg_snapshot_volume_ymax
649 real :: rg_snapshot_volume_zmin
652 real :: rg_snapshot_volume_zmax
734 real ,
dimension(IG_NGLL,IG_NGLL,IG_NGLL) :: lag
735 integer,
dimension(IG_NGLL,IG_NGLL,IG_NGLL) :: gll
760 real ,
dimension(IG_NGLL,IG_NGLL) :: lag
771 integer,
dimension(IG_NGLL,IG_NGLL) :: gll
793 integer,
allocatable,
dimension(:) :: gll_send
794 integer,
allocatable,
dimension(:) :: gll_recv
834 real,
dimension(:),
allocatable :: wkqs
835 real,
dimension(:),
allocatable :: wkqp
846 public :: get_newunit
848 public :: info_all_cpu
849 public :: sweep_blanks
865 integer function get_newunit(myunit)
870 integer,
intent(out),
optional :: myunit
871 integer,
parameter :: lun_min=101
872 integer,
parameter :: lun_max=20101
877 do lun=lun_min,lun_max
878 inquire(unit=lun,opened=is_opened)
879 if (.not. is_opened)
then
884 if (present(myunit)) myunit=get_newunit
887 end function get_newunit
895 subroutine error_stop(info,r)
902 character(len=*),
intent(in) :: info
903 real ,
intent(in),
optional :: r
907 write(*,
'(a,i5,1x,a,E14.7)')
"cpu ",ig_myrank,trim(adjustl(info))//
" ",r
909 write(*,
'(a,i5,1x,a)')
"cpu ",ig_myrank,trim(adjustl(info))
912 call mpi_abort(mpi_comm_world,100,ios)
916 end subroutine error_stop
925 subroutine info_all_cpu(i,info)
932 integer ,
intent(in) :: i
933 character(len=255),
intent(in) :: info
935 integer,
dimension(ig_ncpu) :: buffer
938 integer(kind=8) :: isum
942 call mpi_gather(i,1,mpi_integer,buffer,1,mpi_integer,0,mpi_comm_world,ios)
944 if (ig_myrank == 0)
then
946 write(ig_lst_unit,
'(a)')
" "
949 write(ig_lst_unit,
'(a,i6,a,i12,1x,a)')
"cpu ",icpu-1,
" computes ",buffer(icpu),trim(info)
950 isum = isum + buffer(icpu)
953 write(ig_lst_unit,
'(" -----------------------",/,a,i29)')
"total = ",isum
959 end subroutine info_all_cpu
967 character(len=100) function sweep_blanks(in_str)
972 character(len=100),
intent(in) :: in_str
973 character(len=100) :: out_str
974 character(len=1) :: ch
978 do j=1, len_trim(in_str)
983 if (ch .ne.
" ")
then
984 out_str = trim(out_str) // ch
986 sweep_blanks = out_str
989 end function sweep_blanks
997 function strupcase (input_string) result (output_string)
1002 character(len=*),
parameter :: lower_case =
'abcdefghijklmnopqrstuvwxyz'
1003 character(len=*),
parameter :: upper_case =
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
1005 character(len=*),
intent( in ) :: input_string
1006 character(len=len(input_string)) :: output_string
1011 output_string = input_string
1013 do i = 1,len(output_string)
1014 n = index(lower_case,output_string(i:i))
1015 if (n /= 0) output_string(i:i) = upper_case(n:n)
1019 end function strupcase
1027 function strlowcase (input_string) result (output_string)
1032 character(len=*),
parameter :: lower_case =
'abcdefghijklmnopqrstuvwxyz'
1033 character(len=*),
parameter :: upper_case =
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
1035 character(len=*),
intent(in) :: input_string
1036 character(len=len(input_string)) :: output_string
1041 output_string = input_string
1043 do i = 1,len(output_string)
1044 n = index(upper_case,output_string(i:i))
1045 if (n /= 0) output_string(i:i) = lower_case(n:n)
1049 end function strlowcase
type that gathers information about cpus connected to cpu myrank (cpus not connected to cpu myrank ar...
type for receivers (i.e., stations) located inside quadrangle elements
This module defines all global variables of EFISPEC3D. Scalar variables are initialized directly in t...
type for viscoelastic properties of materials
type for single force point sources
type for receivers (i.e., stations) located inside hexahedron elements
type for double couple point sources
type for linear elastic properties of materials