Skip to content

[SCAFFOLD] AMReX shim for PPM_reconstruction_x#22

Merged
johnmauff merged 7 commits into
TURBO-ESM:dev/turbo-debugfrom
johnmauff:continuity04
May 23, 2026
Merged

[SCAFFOLD] AMReX shim for PPM_reconstruction_x#22
johnmauff merged 7 commits into
TURBO-ESM:dev/turbo-debugfrom
johnmauff:continuity04

Conversation

@johnmauff
Copy link
Copy Markdown

@johnmauff johnmauff commented May 5, 2026

This PR converts PPM_reconstruction_x from MOM6-style Fortran to AMReX-style Fortran. The AMReX-style Fortran takes advantage of the RealArray_t array containers and the Box_t data structure to make it simpler to convert to AMReX. In addition, a Fortran shim for the function was created to allow different execution paths, one for data capture, one for execution by AMReX, in addition to the original Fortran version.

@johnmauff johnmauff marked this pull request as ready for review May 5, 2026 19:30
Copy link
Copy Markdown

Copilot AI left a 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 adds TIM/AMReX dispatch support for the zonal PPM reconstruction path in MOM_continuity_PPM, including a C-interop bridge interface and a Fortran shim that can route execution to either the Fortran implementation or an AMReX implementation (plus optional capture/debug output).

Changes:

  • Added a bind(C) interface for turbotmp_ppm_reconstruction_x_bridge and a new shim PPM_reconstruction_x that selects between capture / AMReX / Fortran execution modes.
  • Updated zonal_edge_thickness to use RealArray_t containers for PPM reconstruction and copy results back to Fortran arrays.
  • Refactored the original PPM_reconstruction_x implementation into PPM_reconstruction_x_fortran and switched the slope array to an allocatable array sized from container bounds.

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

Comment thread src/core/MOM_continuity_PPM.F90
Comment thread src/core/MOM_continuity_PPM.F90 Outdated
@johnmauff johnmauff changed the title AMReX implementation of PPM_reconstruction_x [SCAFFOLD] AMReX implementation of PPM_reconstruction_x May 15, 2026
@johnmauff johnmauff changed the title [SCAFFOLD] AMReX implementation of PPM_reconstruction_x [SCAFFOLD] AMReX shim for PPM_reconstruction_x May 15, 2026
@johnmauff johnmauff self-assigned this May 20, 2026
Copy link
Copy Markdown

@alperaltuntas alperaltuntas left a comment

Choose a reason for hiding this comment

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

Similar to the comment I left in Pr #22, I believe this PR will need to be rebased after PR #27 gets merged.

@johnmauff johnmauff merged commit 0c27bd6 into TURBO-ESM:dev/turbo-debug May 23, 2026
51 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.

3 participants