Skip to content

Commit efb8ea7

Browse files
committed
updates storage and usage of rhostore
1 parent f9642ab commit efb8ea7

12 files changed

+111
-76
lines changed

src/generate_databases/save_arrays_solver.F90

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,11 @@ subroutine save_arrays_solver_mesh()
143143
write(IOUT) gammazstore
144144
write(IOUT) jacobianstore
145145

146+
! these arrays are needed for acoustic and elastic simulations (and ..)
147+
! thus we allocate it and read it in all cases (whether the simulation is acoustic, elastic, or acoustic/elastic, ..)
146148
write(IOUT) kappastore
147149
write(IOUT) mustore
150+
write(IOUT) rhostore
148151

149152
write(IOUT) ispec_is_acoustic
150153
write(IOUT) ispec_is_elastic
@@ -159,10 +162,6 @@ subroutine save_arrays_solver_mesh()
159162
write(IOUT) rmass_acoustic
160163
endif
161164

162-
! this array is needed for acoustic simulations but also for elastic simulations with CPML,
163-
! thus we allocate it and read it in all cases (whether the simulation is acoustic, elastic, or acoustic/elastic)
164-
write(IOUT) rhostore
165-
166165
! elastic
167166
if (ELASTIC_SIMULATION) then
168167
write(IOUT) rmass

src/generate_databases/save_arrays_solver_hdf5.F90

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,11 @@ subroutine save_arrays_solver_mesh_hdf5()
394394

395395
dset_name = "kappastore" ! 4 r (/0,0,0,offset_nspec/)
396396
call h5_create_dataset_gen(dset_name,(/NGLLX,NGLLY,NGLLZ,sum(offset_nspec(:))/), 4, CUSTOM_REAL)
397-
dset_name = "mustore" ! 4 r (/0,0,0,offset_nspec/)
397+
dset_name = "mustore" ! 4 r (/0,0,0,offset_nspec/)
398398
call h5_create_dataset_gen(dset_name,(/NGLLX,NGLLY,NGLLZ,sum(offset_nspec(:))/), 4, CUSTOM_REAL)
399+
dset_name = "rhostore" ! 4 r (/0,0,0,offset_nspec/)
400+
call h5_create_dataset_gen(dset_name,(/NGLLX,NGLLY,NGLLZ,sum(offset_nspec(:))/), 4, CUSTOM_REAL)
401+
399402
dset_name = "ispec_is_acoustic" ! 1 l (/0,0,0,offset_nspec/)
400403
call h5_create_dataset_gen(dset_name,(/sum(offset_nspec(:))/), 1, 0)
401404
dset_name = "ispec_is_elastic" ! 1 l (/0,0,0,offset_nspec/)
@@ -409,11 +412,6 @@ subroutine save_arrays_solver_mesh_hdf5()
409412
call h5_create_dataset_gen(dset_name,(/sum(offset_nglob(:))/), 1, CUSTOM_REAL)
410413
endif
411414

412-
! this array is needed for acoustic simulations but also for elastic simulations with CPML,
413-
! thus we allocate it and read it in all cases (whether the simulation is acoustic, elastic, or acoustic/elastic)
414-
dset_name = "rhostore" ! 4 r (/0,0,0,offset_nspec/)
415-
call h5_create_dataset_gen(dset_name,(/NGLLX,NGLLY,NGLLZ,sum(offset_nspec(:))/), 4, CUSTOM_REAL)
416-
417415
! elastic
418416
if (ELASTIC_SIMULATION) then
419417
dset_name = "rmass" ! 1 r (/offset_nglob/)
@@ -940,10 +938,14 @@ subroutine save_arrays_solver_mesh_hdf5()
940938
call h5_write_dataset_collect_hyperslab(dset_name,gammazstore,(/0,0,0,sum(offset_nspec_irregular(0:myrank-1))/),H5_COL)
941939
dset_name = "jacobianstore" ! 4 r (/0,0,0,offset_nspec_irregular = offset_nspec/)
942940
call h5_write_dataset_collect_hyperslab(dset_name,jacobianstore,(/0,0,0,sum(offset_nspec_irregular(0:myrank-1))/),H5_COL)
941+
943942
dset_name = "kappastore" ! 4 r (/0,0,0,offset_nspec/)
944943
call h5_write_dataset_collect_hyperslab(dset_name,kappastore,(/0,0,0,sum(offset_nspec(0:myrank-1))/),H5_COL)
945944
dset_name = "mustore" ! 4 r (/0,0,0,offset_nspec/)
946945
call h5_write_dataset_collect_hyperslab(dset_name,mustore,(/0,0,0,sum(offset_nspec(0:myrank-1))/),H5_COL)
946+
dset_name = "rhostore" ! 4 r (/0,0,0,offset_nspec/)
947+
call h5_write_dataset_collect_hyperslab(dset_name, rhostore, (/0,0,0,sum(offset_nspec(0:myrank-1))/),H5_COL)
948+
947949
dset_name = "ispec_is_acoustic" ! 1 l (/0,0,0,offset_nspec/)
948950
call h5_write_dataset_collect_hyperslab(dset_name, ispec_is_acoustic, (/sum(offset_nspec(0:myrank-1))/),H5_COL)
949951
dset_name = "ispec_is_elastic" ! 1 l (/0,0,0,offset_nspec/)
@@ -957,11 +959,6 @@ subroutine save_arrays_solver_mesh_hdf5()
957959
call h5_write_dataset_collect_hyperslab(dset_name, rmass_acoustic,(/sum(offset_nglob(0:myrank-1))/),H5_COL)
958960
endif
959961

960-
! this array is needed for acoustic simulations but also for elastic simulations with CPML,
961-
! thus we allocate it and read it in all cases (whether the simulation is acoustic, elastic, or acoustic/elastic)
962-
dset_name = "rhostore" ! 4 r (/0,0,0,offset_nspec/)
963-
call h5_write_dataset_collect_hyperslab(dset_name, rhostore, (/0,0,0,sum(offset_nspec(0:myrank-1))/),H5_COL)
964-
965962
! elastic
966963
if (ELASTIC_SIMULATION) then
967964
dset_name = "rmass" ! 1 r (/offset_nglob/)

src/generate_databases/setup_color_perm.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,12 +631,12 @@ subroutine setup_permutation(myrank,nspec,nglob,ibool,ANISOTROPY,perm,SAVE_MESH_
631631

632632
call permute_elements_real(kappastore,temp_array_real,perm,nspec)
633633
call permute_elements_real(mustore,temp_array_real,perm,nspec)
634+
call permute_elements_real(rhostore,temp_array_real,perm,nspec)
634635

635636
if (ATTENUATION) then
636637
call permute_elements_real(qmu_attenuation_store,temp_array_real,perm,nspec)
637638
call permute_elements_real(qkappa_attenuation_store,temp_array_real,perm,nspec)
638639
endif
639-
call permute_elements_real(rhostore,temp_array_real,perm,nspec)
640640

641641
! elastic arrays
642642
if (ELASTIC_SIMULATION) then

src/shared/define_mass_matrices.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,9 @@ subroutine define_mass_matrices_Stacey_elastic(nglob,nspec,DT,ibool,rho_vp,rho_v
418418
ny = abs_boundary_normal(2,igll,iface)
419419
nz = abs_boundary_normal(3,igll,iface)
420420

421-
vn = deltatover2*(nx+ny+nz)
421+
vn = deltatover2 * (nx+ny+nz)
422422

423-
! C*deltat/2 contributions
423+
! C * DT/2 contributions
424424
tx = rho_vp(i,j,k,ispec)*vn*nx + rho_vs(i,j,k,ispec)*(deltatover2-vn*nx)
425425
ty = rho_vp(i,j,k,ispec)*vn*ny + rho_vs(i,j,k,ispec)*(deltatover2-vn*ny)
426426
tz = rho_vp(i,j,k,ispec)*vn*nz + rho_vs(i,j,k,ispec)*(deltatover2-vn*nz)
@@ -506,7 +506,7 @@ subroutine define_mass_matrices_Stacey_acoustic(nglob,nspec,DT,ibool,rho_vp, &
506506
k = abs_boundary_ijk(3,igll,iface)
507507

508508
! C * DT/2 contribution
509-
sn = deltatover2/rho_vp(i,j,k,ispec)
509+
sn = deltatover2 / rho_vp(i,j,k,ispec)
510510

511511
! gets associated, weighted jacobian
512512
jacobianw = abs_boundary_jacobian2Dw(igll,iface)

src/specfem3D/compute_boundary_kernel.f90

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ subroutine compute_boundary_kernel()
5858

5959
! computes contribution from top element
6060
call compute_boundary_kernel_elem(kernel_moho_top, &
61-
mustore(i,j,k,ispec_top), &
62-
kappastore(i,j,k,ispec_top),rho_vs(i,j,k,ispec_top), &
61+
mustore(i,j,k,ispec_top),kappastore(i,j,k,ispec_top),rhostore(i,j,k,ispec_top), &
6362
accel(:,iglob_top),b_displ(:,iglob_top), &
6463
dsdx_top(:,:,i,j,k,ispec2D),b_dsdx_top(:,:,i,j,k,ispec2D), &
6564
normal_moho_top(:,igll,ispec2D) )
@@ -76,12 +75,11 @@ subroutine compute_boundary_kernel()
7675
! iglob_top == iglob_bot!
7776

7877
! computes contribution from bottom element
79-
call compute_boundary_kernel_elem( kernel_moho_bot, &
80-
mustore(i,j,k,ispec_bot), &
81-
kappastore(i,j,k,ispec_bot),rho_vs(i,j,k,ispec_bot), &
82-
accel(:,iglob_bot),b_displ(:,iglob_bot), &
83-
dsdx_bot(:,:,i,j,k,ispec2D),b_dsdx_bot(:,:,i,j,k,ispec2D), &
84-
normal_moho_bot(:,jgll,ispec2D) )
78+
call compute_boundary_kernel_elem(kernel_moho_bot, &
79+
mustore(i,j,k,ispec_bot),kappastore(i,j,k,ispec_bot),rhostore(i,j,k,ispec_bot), &
80+
accel(:,iglob_bot),b_displ(:,iglob_bot), &
81+
dsdx_bot(:,:,i,j,k,ispec2D),b_dsdx_bot(:,:,i,j,k,ispec2D), &
82+
normal_moho_bot(:,jgll,ispec2D) )
8583

8684
! note: kernel point position: indices given by ijk_moho_top(:,igll,ispec2D)
8785
moho_kl(igll,ispec2D) = moho_kl(igll,ispec2D) &
@@ -114,12 +112,11 @@ subroutine compute_boundary_kernel()
114112
iglob_top = ibool(i,j,k,ispec_top)
115113

116114
! computes contribution from top element
117-
call compute_boundary_kernel_elem( kernel_moho_top, &
118-
mustore(i,j,k,ispec_top), &
119-
kappastore(i,j,k,ispec_top),rho_vs(i,j,k,ispec_top), &
120-
accel(:,iglob_top),b_displ(:,iglob_top), &
121-
dsdx_top(:,:,i,j,k,ispec2D),b_dsdx_top(:,:,i,j,k,ispec2D), &
122-
normal_moho_top(:,igll,ispec2D) )
115+
call compute_boundary_kernel_elem(kernel_moho_top, &
116+
mustore(i,j,k,ispec_top),kappastore(i,j,k,ispec_top),rhostore(i,j,k,ispec_top), &
117+
accel(:,iglob_top),b_displ(:,iglob_top), &
118+
dsdx_top(:,:,i,j,k,ispec2D),b_dsdx_top(:,:,i,j,k,ispec2D), &
119+
normal_moho_top(:,igll,ispec2D) )
123120

124121
! note: kernel point position igll: indices given by ijk_moho_top(:,igll,ispec2D)
125122
moho_kl(igll,ispec2D) = moho_kl(igll,ispec2D) + kernel_moho_top * deltat
@@ -131,12 +128,11 @@ subroutine compute_boundary_kernel()
131128
iglob_bot = ibool(i,j,k,ispec_bot)
132129

133130
! computes contribution from bottom element
134-
call compute_boundary_kernel_elem( kernel_moho_bot, &
135-
mustore(i,j,k,ispec_bot), &
136-
kappastore(i,j,k,ispec_bot),rho_vs(i,j,k,ispec_bot), &
137-
accel(:,iglob_bot),b_displ(:,iglob_bot), &
138-
dsdx_bot(:,:,i,j,k,ispec2D),b_dsdx_bot(:,:,i,j,k,ispec2D), &
139-
normal_moho_bot(:,igll,ispec2D) )
131+
call compute_boundary_kernel_elem(kernel_moho_bot, &
132+
mustore(i,j,k,ispec_bot),kappastore(i,j,k,ispec_bot),rhostore(i,j,k,ispec_bot), &
133+
accel(:,iglob_bot),b_displ(:,iglob_bot), &
134+
dsdx_bot(:,:,i,j,k,ispec2D),b_dsdx_bot(:,:,i,j,k,ispec2D), &
135+
normal_moho_bot(:,igll,ispec2D) )
140136

141137
! note: kernel point position igll: indices given by ijk_moho_bot(:,igll,ispec2D)
142138
moho_kl(igll,ispec2D) = moho_kl(igll,ispec2D) - kernel_moho_bot * deltat
@@ -153,24 +149,27 @@ end subroutine compute_boundary_kernel
153149
!-------------------------------------------------------------------------------------------------
154150
!
155151

156-
subroutine compute_boundary_kernel_elem(kernel, mul, kappal, rho_vsl, &
152+
subroutine compute_boundary_kernel_elem(kernel, mul, kappal, rhol, &
157153
accel, b_displ, ds, b_ds, norm)
158154

159155
! compute the boundary kernel contribution from one side of the boundary
160156
! see e.g.: Tromp et al. (2005), eq. (25), or Liu & Tromp (2008), eq. (65)
161157

162-
use constants
158+
use constants, only: CUSTOM_REAL,NDIM,ONE
163159

164160
implicit none
165161

166-
real(kind=CUSTOM_REAL) kernel, mul, kappal, rho_vsl
167-
real(kind=CUSTOM_REAL) :: accel(NDIM), b_displ(NDIM), ds(NDIM,NDIM), b_ds(NDIM,NDIM), norm(NDIM)
162+
real(kind=CUSTOM_REAL), intent(inout) :: kernel
163+
real(kind=CUSTOM_REAL), intent(in) :: mul, kappal, rhol
164+
real(kind=CUSTOM_REAL), intent(in) :: accel(NDIM), b_displ(NDIM)
165+
real(kind=CUSTOM_REAL), intent(in) :: ds(NDIM,NDIM), b_ds(NDIM,NDIM), norm(NDIM)
168166

167+
! local parameters
169168
real(kind=CUSTOM_REAL) :: eps3, eps(NDIM,NDIM), epsdev(NDIM,NDIM), normal(NDIM,1)
170169
real(kind=CUSTOM_REAL) :: b_eps3, b_eps(NDIM,NDIM), b_epsdev(NDIM,NDIM)
171-
real(kind=CUSTOM_REAL) :: temp1(NDIM,NDIM), rhol, kl(1,1), one_matrix(1,1)
172-
170+
real(kind=CUSTOM_REAL) :: temp1(NDIM,NDIM), kl(1,1), one_matrix(1,1)
173171

172+
! initializes
174173
normal(:,1) = norm
175174
one_matrix(1,1) = ONE
176175

@@ -194,7 +193,6 @@ subroutine compute_boundary_kernel_elem(kernel, mul, kappal, rho_vsl, &
194193
epsdev(2,2) = eps(2,2) - eps3 / 3
195194
epsdev(3,3) = eps(3,3) - eps3 / 3
196195

197-
198196
! backward/reconstructed-forward strain (epsilon) trace
199197
b_eps3 = b_ds(1,1) + b_ds(2,2) + b_ds(3,3)
200198

@@ -218,9 +216,6 @@ subroutine compute_boundary_kernel_elem(kernel, mul, kappal, rho_vsl, &
218216
! matrix multiplication
219217
temp1 = matmul(epsdev,b_epsdev)
220218

221-
! density value
222-
rhol = rho_vsl ** 2 / mul
223-
224219
! isotropic kernel value
225220
! see e.g.: Tromp et al. (2005), eq. (25), or Liu & Tromp 2008, eq. (65)
226221
kl = ( rhol * dot_product(accel(:), b_displ(:)) + kappal * eps3 * b_eps3 &

src/specfem3D/finalize_simulation.f90

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ subroutine finalize_simulation_cleanup()
142142
use fault_solver_kinematic, only: SIMULATION_TYPE_KIN,BC_KINFLT_free
143143

144144
!! solving wavefield discontinuity problem with non-split-node scheme
145-
use wavefield_discontinuity_solver, only: &
146-
finalize_wavefield_discontinuity
145+
use wavefield_discontinuity_solver, only: finalize_wavefield_discontinuity
147146

148147
implicit none
149148

@@ -233,6 +232,56 @@ subroutine finalize_simulation_cleanup()
233232
deallocate(kappastore,mustore,rhostore)
234233
deallocate(ispec_is_acoustic,ispec_is_elastic,ispec_is_poroelastic)
235234

235+
if (ELASTIC_SIMULATION) then
236+
if (allocated(rho_vp)) deallocate(rho_vp)
237+
if (allocated(rho_vs)) deallocate(rho_vs)
238+
endif
239+
240+
! kernels
241+
if (SIMULATION_TYPE == 3) then
242+
! acoustic
243+
if (allocated(rho_ac_kl)) deallocate(rho_ac_kl)
244+
if (allocated(kappa_ac_kl)) deallocate(kappa_ac_kl)
245+
if (allocated(rhop_ac_kl)) deallocate(rhop_ac_kl)
246+
if (allocated(alpha_ac_kl)) deallocate(alpha_ac_kl)
247+
! elastic
248+
if (allocated(rho_kl)) deallocate(rho_kl)
249+
if (allocated(mu_kl)) deallocate(mu_kl)
250+
if (allocated(kappa_kl)) deallocate(kappa_kl)
251+
if (allocated(cijkl_kl)) deallocate(cijkl_kl)
252+
! poroelastic
253+
if (allocated(rhot_kl)) deallocate(rhot_kl)
254+
if (allocated(rhof_kl)) deallocate(rhof_kl)
255+
if (allocated(sm_kl)) deallocate(sm_kl)
256+
if (allocated(eta_kl)) deallocate(eta_kl)
257+
if (allocated(mufr_kl)) deallocate(mufr_kl)
258+
if (allocated(B_kl)) deallocate(B_kl)
259+
if (allocated(C_kl)) deallocate(C_kl)
260+
if (allocated(M_kl)) deallocate(M_kl)
261+
if (allocated(rhob_kl)) deallocate(rhob_kl)
262+
if (allocated(rhofb_kl)) deallocate(rhofb_kl)
263+
if (allocated(Bb_kl)) deallocate(Bb_kl)
264+
if (allocated(Cb_kl)) deallocate(Cb_kl)
265+
if (allocated(Mb_kl)) deallocate(Mb_kl)
266+
if (allocated(mufrb_kl)) deallocate(mufrb_kl)
267+
if (allocated(phi_kl)) deallocate(phi_kl)
268+
if (allocated(rhobb_kl)) deallocate(rhobb_kl)
269+
if (allocated(rhofbb_kl)) deallocate(rhofbb_kl)
270+
if (allocated(phib_kl)) deallocate(phib_kl)
271+
if (allocated(ratio_kl)) deallocate(ratio_kl)
272+
if (allocated(cs_kl)) deallocate(cs_kl)
273+
if (allocated(cpI_kl)) deallocate(cpI_kl)
274+
if (allocated(cpII_kl)) deallocate(cpII_kl)
275+
! hessians
276+
if (allocated(hess_ac_kl)) deallocate(hess_ac_kl)
277+
if (allocated(hess_rho_ac_kl)) deallocate(hess_rho_ac_kl)
278+
if (allocated(hess_kappa_ac_kl)) deallocate(hess_kappa_ac_kl)
279+
if (allocated(hess_kl)) deallocate(hess_kl)
280+
if (allocated(hess_rho_kl)) deallocate(hess_rho_kl)
281+
if (allocated(hess_kappa_kl)) deallocate(hess_kappa_kl)
282+
if (allocated(hess_mu_kl)) deallocate(hess_mu_kl)
283+
endif
284+
236285
! faults
237286
if (SIMULATION_TYPE_DYN) call BC_DYNFLT_free()
238287
if (SIMULATION_TYPE_KIN) call BC_KINFLT_free()

src/specfem3D/gravity_perturbation.f90

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,13 @@ subroutine gravity_init()
6161

6262
use constants, only: IMAIN,IIN_G,myrank,NGLLX,NGLLY,NGLLZ
6363

64-
use specfem_par, only: NGLOB_AB, NSTEP, NSPEC_AB, mustore, &
64+
use specfem_par, only: NGLOB_AB, NSTEP, NSPEC_AB, &
65+
rhostore, &
6566
xstore, ystore, zstore, &
6667
xigll, yigll, zigll, &
6768
wxgll, wygll, wzgll, &
6869
NGNOD, ibool
6970

70-
use specfem_par_elastic, only: rho_vs
71-
7271
implicit none
7372

7473
! local parameters
@@ -174,7 +173,7 @@ subroutine gravity_init()
174173

175174
do ispec = 1,NSPEC_AB
176175

177-
rho_elem = rho_vs(:,:,:,ispec)*rho_vs(:,:,:,ispec)/mustore(:,:,:,ispec)
176+
rho_elem = rhostore(:,:,:,ispec)
178177

179178
do ia = 1,NGNOD
180179
iglob = ibool(iax(ia),iay(ia),iaz(ia),ispec)

src/specfem3D/read_mesh_databases.F90

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ subroutine read_mesh_databases()
182182

183183
read(IIN) kappastore
184184
read(IIN) mustore
185+
read(IIN) rhostore
185186

186187
read(IIN) ispec_is_acoustic
187188
read(IIN) ispec_is_elastic
@@ -220,6 +221,7 @@ subroutine read_mesh_databases()
220221

221222
call bcast_all_cr_for_database(kappastore(1,1,1,1), size(kappastore,kind=4))
222223
call bcast_all_cr_for_database(mustore(1,1,1,1), size(mustore,kind=4))
224+
call bcast_all_cr_for_database(rhostore(1,1,1,1), size(rhostore,kind=4))
223225

224226
call bcast_all_l_for_database(ispec_is_acoustic(1), size(ispec_is_acoustic,kind=4))
225227
call bcast_all_l_for_database(ispec_is_elastic(1), size(ispec_is_elastic,kind=4))
@@ -289,11 +291,6 @@ subroutine read_mesh_databases()
289291
rmassz_acoustic(:) = 0.0_CUSTOM_REAL
290292
endif
291293

292-
! rho array is needed for acoustic simulations but also for elastic simulations with CPML,
293-
! read it in all cases (whether the simulation is acoustic, elastic, or acoustic/elastic)
294-
if (I_should_read_the_database) read(IIN) rhostore
295-
call bcast_all_cr_for_database(rhostore(1,1,1,1), size(rhostore,kind=4))
296-
297294
! elastic simulation
298295
if (ELASTIC_SIMULATION) then
299296
! checks

src/specfem3D/read_mesh_databases_hdf5.F90

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ subroutine read_mesh_databases_hdf5()
265265
call h5_read_dataset_collect_hyperslab(dsetname,kappastore,(/0,0,0,sum(offset_nspec(0:myrank-1))/),H5_COL)
266266
dsetname = "mustore"
267267
call h5_read_dataset_collect_hyperslab(dsetname,mustore,(/0,0,0,sum(offset_nspec(0:myrank-1))/),H5_COL)
268+
dsetname = "rhostore"
269+
call h5_read_dataset_collect_hyperslab(dsetname, rhostore, (/0,0,0,sum(offset_nspec(0:myrank-1))/),H5_COL)
268270
endif
269271

270272
! note: the size(..) function returns either integer(kind=4) or integer(kind=8)
@@ -295,6 +297,7 @@ subroutine read_mesh_databases_hdf5()
295297

296298
call bcast_all_cr_for_database(kappastore(1,1,1,1), size(kappastore,kind=4))
297299
call bcast_all_cr_for_database(mustore(1,1,1,1), size(mustore,kind=4))
300+
call bcast_all_cr_for_database(rhostore(1,1,1,1), size(rhostore,kind=4))
298301

299302
if (size(ispec_is_acoustic) > 0) &
300303
call bcast_all_l_for_database(ispec_is_acoustic(1), size(ispec_is_acoustic,kind=4))
@@ -369,15 +372,6 @@ subroutine read_mesh_databases_hdf5()
369372
rmassz_acoustic(:) = 0.0_CUSTOM_REAL
370373
endif
371374

372-
! rho array is needed for acoustic simulations but also for elastic simulations with CPML,
373-
! read it in all cases (whether the simulation is acoustic, elastic, or acoustic/elastic)
374-
if (I_should_read_the_database) then
375-
dsetname = "rhostore"
376-
!call h5_read_dataset_p(dsetname, rhostore)
377-
call h5_read_dataset_collect_hyperslab(dsetname, rhostore, (/0,0,0,sum(offset_nspec(0:myrank-1))/),H5_COL)
378-
endif
379-
call bcast_all_cr_for_database(rhostore(1,1,1,1), size(rhostore,kind=4))
380-
381375
! elastic simulation
382376
if (ELASTIC_SIMULATION) then
383377
! checks

0 commit comments

Comments
 (0)