-
Notifications
You must be signed in to change notification settings - Fork 4
Alpha beta rho #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alpha beta rho #41
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements alpha-beta-rho inversion capabilities, allowing the inversion to handle three separate parameters (Vp, Vs, and density) instead of just Vs with empirical relationships. Key changes include:
- Expansion of gradient and direction arrays from 3D to 4D to accommodate multiple kernel types
- Addition of new configuration options for alpha-beta-rho inversion with optional density scaling
- Extension of HDF5 interface to support 4D arrays
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
src/tomo.f90 | Main tomography module updated to handle 4D arrays and conditional alpha-beta-rho processing |
src/shared/shared_par.f90 | Added global parameters for number of kernels and alpha-beta-rho support |
src/shared/utils.f90 | Added transpose_4 function for 4D array transposition |
src/shared/hdf5_interface.f90 | Extended HDF5 interface with 4D array read/write capabilities |
src/para.f90 | Added configuration parameters for alpha-beta-rho inversion and density scaling |
src/optimize.f90 | Updated optimization routines to work with 4D gradient and model arrays |
src/model.f90 | Enhanced model output to include Vp and density when using alpha-beta-rho mode |
src/acqui.f90 | Modified kernel computation and storage to support multiple parameter types |
examples/ | Updated example configurations and scripts for new inversion options |
CMakeLists.txt | Version bump to 1.6.0 |
am%vp3d = empirical_vp(am%vs3d) | ||
am%rho3d = empirical_rho(am%vp3d) | ||
else | ||
am%vs3d = am%vs3d * (1 + gradient_s(1,:,:,:)) |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the steepest_descent subroutine, when use_alpha_beta_rho is false, line 233 applies gradient_s(1,:,:,:) to vs3d, but this should be just gradient_s since the original code (line 228) used gradient_s directly without indexing.
am%vs3d = am%vs3d * (1 + gradient_s(1,:,:,:)) | |
am%vs3d = am%vs3d * (1 + gradient_s) |
Copilot uses AI. Check for mistakes.
am%vs3d_opt = am%vs3d * (1 + gradient_ls(1,:,:,:)) | ||
am%vp3d_opt = empirical_vp(am%vs3d_opt) | ||
am%rho3d_opt = empirical_rho(am%vp3d_opt) | ||
endif |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an extra 'endif' statement that doesn't match any corresponding 'if' statement in the prepare_fwd_linesearch subroutine, creating unbalanced control flow.
endif |
Copilot uses AI. Check for mistakes.
! read vp model | ||
deallocate(tmp_model) | ||
write(key_name, '("/vp_",I3.3)') iter | ||
call h5read(model_fname, key_name, tmp_model) |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tmp_model should be transposed before assignment, similar to how it's done for model(1,:,:,:) on line 104. It should be: model(2,:,:,:) = transpose_3(tmp_model)
call h5read(model_fname, key_name, tmp_model) | |
call h5read(model_fname, key_name, tmp_model) | |
tmp_model = transpose_3(tmp_model) |
Copilot uses AI. Check for mistakes.
! read rho model | ||
deallocate(tmp_model) | ||
write(key_name, '("/rho_",I3.3)') iter | ||
call h5read(model_fname, key_name, tmp_model) |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tmp_model should be transposed before assignment, similar to how it's done for model(1,:,:,:) on line 104. It should be: model(3,:,:,:) = transpose_3(tmp_model)
call h5read(model_fname, key_name, tmp_model) | |
call h5read(model_fname, key_name, tmp_model) | |
tmp_model = transpose_3(tmp_model) |
Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This reverts commit 2e38dab.
No description provided.