163 ,lg_boundary_absorption&
173 real :: dt_stable_all_cpu
175 real,
dimension(ig_nhexa) :: hexa_dt_stable
179 real :: igll_corner_x
180 real :: igll_corner_y
181 real :: igll_corner_z
192 real :: igll_corner_vp
206 integer :: igll_corner
216 if(lg_boundary_absorption)
then
227 do ihexa = 1,ig_nhexa
229 hexa_dt_stable(ihexa) = huge(c_max)
231 do kgll = 1,ig_ngll,ig_ngll-1
233 kshift = kgll - 1 + 2*mod(kgll,ig_ngll)
235 do lgll = 1,ig_ngll,ig_ngll-1
237 lshift = lgll - 1 + 2*mod(lgll,ig_ngll)
239 do mgll = 1,ig_ngll,ig_ngll-1
241 mshift = mgll - 1 + 2*mod(mgll,ig_ngll)
243 igll_corner = ig_hexa_gll_glonum(mgll ,lgll ,kgll ,ihexa)
244 igll_k = ig_hexa_gll_glonum(mgll ,lgll ,kshift,ihexa)
245 igll_l = ig_hexa_gll_glonum(mgll ,lshift,kgll ,ihexa)
246 igll_m = ig_hexa_gll_glonum(mshift,lgll ,kgll ,ihexa)
250 igll_corner_x = rg_gll_coordinate(1,igll_corner)
251 igll_corner_y = rg_gll_coordinate(2,igll_corner)
252 igll_corner_z = rg_gll_coordinate(3,igll_corner)
256 igll_m_x = rg_gll_coordinate(1,igll_m)
257 igll_m_y = rg_gll_coordinate(2,igll_m)
258 igll_m_z = rg_gll_coordinate(3,igll_m)
260 igll_dist_m = sqrt((igll_corner_x-igll_m_x)**2 + (igll_corner_y-igll_m_y)**2 + (igll_corner_z-igll_m_z)**2)
264 igll_l_x = rg_gll_coordinate(1,igll_l)
265 igll_l_y = rg_gll_coordinate(2,igll_l)
266 igll_l_z = rg_gll_coordinate(3,igll_l)
268 igll_dist_l = sqrt((igll_corner_x-igll_l_x)**2 +(igll_corner_y-igll_l_y)**2 + (igll_corner_z-igll_l_z)**2)
272 igll_k_x = rg_gll_coordinate(1,igll_k)
273 igll_k_y = rg_gll_coordinate(2,igll_k)
274 igll_k_z = rg_gll_coordinate(3,igll_k)
276 igll_dist_k = sqrt((igll_corner_x-igll_k_x)**2 +(igll_corner_y-igll_k_y)**2 + (igll_corner_z-igll_k_z)**2)
280 igll_corner_vp = sqrt(rg_hexa_gll_rhovp2(mgll ,lgll ,kgll ,ihexa)/rg_hexa_gll_rho(mgll ,lgll ,kgll ,ihexa))
281 igll_k_vp = sqrt(rg_hexa_gll_rhovp2(mgll ,lgll ,kshift,ihexa)/rg_hexa_gll_rho(mgll ,lgll ,kshift,ihexa))
282 igll_l_vp = sqrt(rg_hexa_gll_rhovp2(mgll ,lshift,kgll ,ihexa)/rg_hexa_gll_rho(mgll ,lshift,kgll ,ihexa))
283 igll_m_vp = sqrt(rg_hexa_gll_rhovp2(mshift,lgll ,kgll ,ihexa)/rg_hexa_gll_rho(mshift,lgll ,kgll ,ihexa))
287 m_vp_max = max(igll_corner_vp,igll_m_vp)
288 l_vp_max = max(igll_corner_vp,igll_l_vp)
289 k_vp_max = max(igll_corner_vp,igll_k_vp)
291 hexa_dt_stable(ihexa) = min(hexa_dt_stable(ihexa),c_max * igll_dist_k / igll_k_vp , c_max * igll_dist_l / igll_l_vp , c_max * igll_dist_m / igll_m_vp)
299 dt_stable = minval(hexa_dt_stable)
303 call mpi_allreduce(dt_stable,dt_stable_all_cpu,1,mpi_real,mpi_min,mpi_comm_world,ios)
305 if ( (rg_dt <= tiny_real) .or. (rg_dt > dt_stable_all_cpu) )
then
307 rg_dt = dt_stable_all_cpu
336 real,
intent(inout) :: x
347 if ( (10.0*m - floor(10.0*m)) >= 0.5 )
then
349 x = ((floor(10.0*m)+0.5)/10.0)*10.0**(e)
353 x = ((floor(10.0*m))/10.0)*10.0**(e)
374 real ,
intent(in ) :: x
375 integer,
intent(out) :: e
376 real ,
intent(out) :: m
385 m = - xx * 1.0e1 ** (-e)
387 elseif (x > 0.0)
then
391 m = x * 1.0e1 ** (-e)
subroutine, public init_time_step()
This subroutine returns the time step mod_global_variables::rg_dt that makes the simulation stable...
subroutine, private round_time_step(x)
This subroutine rounds down the mantissa of the scientific notation of a real number to ...
subroutine, public write_cfl_condition_ok(dt)
subroutine that writes valid CFL condition in the listing file (*.lst).
This module defines all global variables of EFISPEC3D. Scalar variables are initialized directly in t...
subroutine, public init_temporal_saving(ndt)
This subroutine set saving information for receivers and snapshots.
This module contains subroutines to initialize some global variable vectors and matrices.
subroutine, public write_cfl_condition_ko(dt)
subroutine that writes invalid CFL condition in the listing file (*.lst).
This module contains subroutines to write information in the listing file *.lst.
subroutine, private manexp(x, m, e)
This subroutine returns the mantissa and the exponent of the exponential notation of a real number...
subroutine, public init_temporal_domain(t, dt)
This subroutine initializes the number of time step of the simulation and the squared time step...
This module contains subroutines to initialize the time step of the simulation.