Skip to content

Commit

Permalink
eliminate compiler warnings on hdf5 side
Browse files Browse the repository at this point in the history
  • Loading branch information
mnagaso committed Nov 5, 2024
1 parent 02860b5 commit 794973b
Show file tree
Hide file tree
Showing 7 changed files with 829 additions and 422 deletions.
138 changes: 92 additions & 46 deletions src/meshfem3D/save_arrays_solver_hdf5.F90

Large diffs are not rendered by default.

231 changes: 154 additions & 77 deletions src/specfem3D/read_arrays_solver_hdf5.F90

Large diffs are not rendered by default.

198 changes: 132 additions & 66 deletions src/specfem3D/read_forward_arrays_hdf5.F90

Large diffs are not rendered by default.

294 changes: 196 additions & 98 deletions src/specfem3D/save_forward_arrays_hdf5.F90

Large diffs are not rendered by default.

152 changes: 99 additions & 53 deletions src/specfem3D/save_kernels_hdf5.F90
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ subroutine write_kernels_strength_noise_hdf5()
call h5_open_file_p_collect(file_name)

! write data
call h5_write_dataset_collect_hyperslab('sigma_kernel', sigma_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('sigma_kernel', sigma_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

! close hdf5
call h5_close_file_p()
Expand Down Expand Up @@ -220,42 +221,68 @@ subroutine write_kernels_cm_ani_hdf5(alphav_kl_crust_mantle,alphah_kl_crust_mant

! write data
if (SAVE_TRANSVERSE_KL_ONLY) then
call h5_write_dataset_collect_hyperslab('alphav_kernel', alphav_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('alphah_kernel', alphah_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('betav_kernel', betav_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('betah_kernel', betah_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('eta_kernel', eta_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('rho_kernel', rho_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

call h5_write_dataset_collect_hyperslab('bulk_c_kernel', bulk_c_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('bulk_betav_kernel', bulk_betav_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('bulk_betah_kernel', bulk_betah_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

call h5_write_dataset_collect_hyperslab('alpha_kernel', alpha_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('beta_kernel', beta_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('bulk_beta_kernel', bulk_beta_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('alphav_kernel', alphav_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('alphah_kernel', alphah_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('betav_kernel', betav_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('betah_kernel', betah_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('eta_kernel', eta_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('rho_kernel', rho_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

call h5_write_dataset_collect_hyperslab('bulk_c_kernel', bulk_c_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('bulk_betav_kernel', bulk_betav_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('bulk_betah_kernel', bulk_betah_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

call h5_write_dataset_collect_hyperslab('alpha_kernel', alpha_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('beta_kernel', beta_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('bulk_beta_kernel', bulk_beta_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

else if (SAVE_AZIMUTHAL_ANISO_KL_ONLY) then
call h5_write_dataset_collect_hyperslab('alphav_kernel', alphav_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('alphah_kernel', alphah_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('betav_kernel', betav_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('betah_kernel', betah_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

call h5_write_dataset_collect_hyperslab('bulk_c_kernel', bulk_c_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('bulk_betav_kernel', bulk_betav_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('bulk_betah_kernel', bulk_betah_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

call h5_write_dataset_collect_hyperslab('eta_kernel', eta_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('rho_kernel', rho_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

call h5_write_dataset_collect_hyperslab('Gc_prime_kernel', Gc_prime_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('Gs_prime_kernel', Gs_prime_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('alphav_kernel', alphav_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('alphah_kernel', alphah_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('betav_kernel', betav_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('betah_kernel', betah_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

call h5_write_dataset_collect_hyperslab('bulk_c_kernel', bulk_c_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('bulk_betav_kernel', bulk_betav_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('bulk_betah_kernel', bulk_betah_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

call h5_write_dataset_collect_hyperslab('eta_kernel', eta_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('rho_kernel', rho_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

call h5_write_dataset_collect_hyperslab('Gc_prime_kernel', Gc_prime_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('Gs_prime_kernel', Gs_prime_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

! check isotropic kernel
if (.false.) then
call h5_write_dataset_collect_hyperslab('alpha_kernel', alpha_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('beta_kernel', beta_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('bulk_beta_kernel', bulk_beta_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('alpha_kernel', alpha_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('beta_kernel', beta_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('bulk_beta_kernel', bulk_beta_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
endif

! check anisotropic kernels
Expand All @@ -279,8 +306,10 @@ subroutine write_kernels_cm_ani_hdf5(alphav_kl_crust_mantle,alphah_kl_crust_mant
else

! fully anisotropic kernels
call h5_write_dataset_collect_hyperslab('rho_kernel', rho_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('cijkl_kernel', cijkl_kl_crust_mantle, (/0,0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('rho_kernel', rho_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('cijkl_kernel', cijkl_kl_crust_mantle, &
(/0,0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

endif

Expand Down Expand Up @@ -362,16 +391,24 @@ subroutine write_kernels_cm_iso_hdf5(mu_kl_crust_mantle, kappa_kl_crust_mantle,
call h5_open_file_p_collect(file_name)

! write data
call h5_write_dataset_collect_hyperslab('rhonotprime_kernel', rhonotprime_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('kappa_kernel', kappa_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('mu_kernel', mu_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

call h5_write_dataset_collect_hyperslab('rho_kernel', rho_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('alpha_kernel', alpha_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('beta_kernel', beta_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

call h5_write_dataset_collect_hyperslab('bulk_c_kernel', bulk_c_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('bulk_beta_kernel', bulk_beta_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('rhonotprime_kernel', rhonotprime_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('kappa_kernel', kappa_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('mu_kernel', mu_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

call h5_write_dataset_collect_hyperslab('rho_kernel', rho_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('alpha_kernel', alpha_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('beta_kernel', beta_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

call h5_write_dataset_collect_hyperslab('bulk_c_kernel', bulk_c_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('bulk_beta_kernel', bulk_beta_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

! close hdf5
call h5_close_file_p()
Expand Down Expand Up @@ -433,8 +470,10 @@ subroutine write_kernels_oc_hdf5()
call h5_open_file_p_collect(file_name)

! write data
call h5_write_dataset_collect_hyperslab('rho_kernel', rho_kl_outer_core, (/0,0,0,sum(offset_nspec_oc_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('alpha_kernel', alpha_kl_outer_core, (/0,0,0,sum(offset_nspec_oc_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('rho_kernel', rho_kl_outer_core, &
(/0,0,0,sum(offset_nspec_oc_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('alpha_kernel', alpha_kl_outer_core, &
(/0,0,0,sum(offset_nspec_oc_adj(0:myrank-1))/), H5_COL)

! close hdf5
call h5_close_file_p()
Expand Down Expand Up @@ -497,9 +536,12 @@ subroutine write_kernels_ic_hdf5()
call h5_open_file_p_collect(file_name)

! write data
call h5_write_dataset_collect_hyperslab('rho_kernel', rho_kl_inner_core, (/0,0,0,sum(offset_nspec_ic_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('alpha_kernel', alpha_kl_inner_core, (/0,0,0,sum(offset_nspec_ic_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('beta_kernel', beta_kl_inner_core, (/0,0,0,sum(offset_nspec_ic_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('rho_kernel', rho_kl_inner_core, &
(/0,0,0,sum(offset_nspec_ic_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('alpha_kernel', alpha_kl_inner_core, &
(/0,0,0,sum(offset_nspec_ic_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('beta_kernel', beta_kl_inner_core, &
(/0,0,0,sum(offset_nspec_ic_adj(0:myrank-1))/), H5_COL)

! close hdf5
call h5_close_file_p()
Expand Down Expand Up @@ -649,10 +691,14 @@ subroutine write_kernels_Hessian_hdf5()
call h5_open_file_p_collect(file_name)

! write data
call h5_write_dataset_collect_hyperslab('hess_kernel', hess_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('hess_rho_kernel', hess_rho_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('hess_kappa_kernel', hess_kappa_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('hess_mu_kernel', hess_mu_kl_crust_mantle, (/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('hess_kernel', hess_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('hess_rho_kernel', hess_rho_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('hess_kappa_kernel', hess_kappa_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)
call h5_write_dataset_collect_hyperslab('hess_mu_kernel', hess_mu_kl_crust_mantle, &
(/0,0,0,sum(offset_nspec_cm_adj(0:myrank-1))/), H5_COL)

! close hdf5
call h5_close_file_p()
Expand Down
Loading

0 comments on commit 794973b

Please sign in to comment.