Skip to content

CMT + point force simulation at the same time.#1828

Merged
danielpeter merged 5 commits intoSPECFEM:develfrom
nqdu:devel
Aug 28, 2025
Merged

CMT + point force simulation at the same time.#1828
danielpeter merged 5 commits intoSPECFEM:develfrom
nqdu:devel

Conversation

@nqdu
Copy link

@nqdu nqdu commented Aug 28, 2025

Summary

This change lets simulations include both CMT sources and point-force sources at the same time. Previously the runtime enforced a single-source-type restriction. Two new tags are added to Par_file. If they do not exist, both will default to .false.

Changes

  • Add a new Par_file tag: USE_CMT_AND_FORCE_SOURCE. When set to .true., the solver reads both CMTSOLUTION and FORCESOLUTION. Default is .false. (backwards compatible).
  • Introduce a binary source file format for scaling to millions of events, toggled with USE_BINARY_SOURCE_FILE (default .false.). The binary file encapsulates all source metadata, including external source-time functions (if used). When enabled, the array user_source_time_function(:,:) stores only the STFs local to the current MPI slice, rather than the full global set. This is implemented by first locating sources within each MPI slice, then reading the corresponding source time functions. See EXAMPLES/application/cmt_force_hybrid/write_binary_source.f90 for the reference writer and format details.
  • Add GPU support for USE_BINARY_SOURCE_FILE.

Example

see EXAMPLES/application/cmt_force_hybrid/, run from step 1 to step 4.

Performance

USE_BINARY_SOURCE_FILE significantly reduces memory usage when thousands of events use distinct external source time functions (e.g., in simulations that rely on representation theorem).

@codecov
Copy link

codecov bot commented Aug 28, 2025

Codecov Report

❌ Patch coverage is 41.53355% with 183 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.72%. Comparing base (a53177b) to head (4e379b9).

Files with missing lines Patch % Lines
src/specfem3D/get_cmt.f90 0.00% 88 Missing ⚠️
src/specfem3D/locate_source.F90 58.90% 30 Missing ⚠️
src/shared/count_number_of_sources.f90 54.34% 21 Missing ⚠️
src/shared/read_parameter_file.F90 56.25% 14 Missing ⚠️
src/specfem3D/setup_sources_receivers.f90 70.73% 12 Missing ⚠️
src/specfem3D/compute_add_sources_acoustic.f90 14.28% 6 Missing ⚠️
src/specfem3D/compute_add_sources_viscoelastic.F90 14.28% 6 Missing ⚠️
src/generate_databases/read_parameters.f90 63.63% 4 Missing ⚠️
src/specfem3D/comp_source_time_function.f90 66.66% 1 Missing ⚠️
src/specfem3D/compute_add_sources_poroelastic.f90 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #1828      +/-   ##
==========================================
- Coverage   48.82%   48.72%   -0.10%     
==========================================
  Files         273      273              
  Lines       64785    65040     +255     
==========================================
+ Hits        31629    31693      +64     
- Misses      33156    33347     +191     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@danielpeter danielpeter merged commit 5b67787 into SPECFEM:devel Aug 28, 2025
42 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants