Skip to content

Pad nz for free surface boundary condition - #129

Open
lispandfound wants to merge 1 commit into
pegasusfrom
nz_check
Open

Pad nz for free surface boundary condition#129
lispandfound wants to merge 1 commit into
pegasusfrom
nz_check

Conversation

@lispandfound

Copy link
Copy Markdown
Contributor

Complement to the velocity modelling PR: ucgmsim/velocity_modelling#59

Copilot AI review requested due to automatic review settings July 31, 2026 03:11
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates EMOD3D parameter generation to account for an extra free-surface padding layer in the velocity model grid (by increasing nz), and adds a pre-write validation that the referenced velocity model files match the expected (nx, ny, nz)-derived file sizes.

Changes:

  • Pad nz by +1 when generating EMOD3D domain parameters.
  • Add check_domain_against_velocity_model() to validate pmodfile/smodfile/dmodfile sizes and invoke it during create_e3d_par.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +282 to +294
try:
for filename in [parameters.pmodfile, parameters.smodfile, parameters.dmodfile]:
velocity_model_file = velocity_model_ffp / filename
file_size = velocity_model_file.stat().st_size
if file_size != expected_file_size:
raise RuntimeError(
f"Velocity model file {velocity_model_file} does not have the expected size (expected: {expected_file_size}, found: {file_size})"
)

except (OSError, FileNotFoundError) as e:
print(
f"WARNING: could not validate domain parameters against velocity model supplied:\n{e}"
)
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