@@ -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/)
0 commit comments