Skip to content

Verify Fortran77 MDBNCH molecular dynamics benchmark translation to Julia#2

Open
Copilot wants to merge 1 commit intomainfrom
copilot/translate-fortran77-to-julia
Open

Verify Fortran77 MDBNCH molecular dynamics benchmark translation to Julia#2
Copilot wants to merge 1 commit intomainfrom
copilot/translate-fortran77-to-julia

Conversation

Copy link
Contributor

Copilot AI commented Dec 25, 2025

The repository already contains a complete translation of the Fortran77 MDBNCH molecular dynamics benchmark to Julia. This PR verifies all translation requirements are met.

Translation Verified

Data structures: Fortran COMMON blocks → Julia mutable structs

  • /PARTCL/, /VLCTY/, /FORCES/, /PARAMS/Particles, Velocities, Forces, Parameters

Functions: All 6 subroutines translated with proper Julia conventions

  • INITPOinitpo! (FCC lattice)
  • INITVLinitvl! (velocity initialization)
  • CALCFOcalcfo! (Lennard-Jones forces)
  • MOVEA/MOVEBmovea!/moveb! (velocity Verlet)
  • VKCALCvkcalc (kinetic energy)

Platform replacements:

  • SECOND()time()
  • RANF()rand()
  • DNINT()round()

Preserved: 1-based indexing, Float64 precision, velocity Verlet algorithm, Lennard-Jones potential, periodic boundaries

Validation

  • 36/36 unit tests pass
  • Physical laws verified (momentum conservation, Newton's 3rd law)
  • Benchmark executes: 864 particles, 100 timesteps in ~0.2s

Documentation

Complete documentation suite provided: README.md, DOCUMENTATION.md, TRANSLATION_SUMMARY.md, comprehensive test suite, comparison script.

Original prompt

Translate the provided Fortran77 source code (file mdbnch.f) into Julia. The Fortran77 file is a molecular dynamics benchmark program that includes a main routine, several subroutines, and global "COMMON" blocks for variable sharing. Keep the functionality equivalent to the original program, ensuring that key components such as the molecular dynamics loop, initialization, subroutine calls, and I/O are faithfully translated into Julia syntax. Use Julia data structures for common blocks, replace Fortran-specific array indexing (-2:NM) with Julia-style (1-based) indexing, and substitute any platform-specific features (e.g., SECOND() for timing) with their Julia counterparts. Maintain clarity in the code structure while adhering to Julia best practices.

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Translate Fortran77 molecular dynamics benchmark to Julia Verify Fortran77 MDBNCH molecular dynamics benchmark translation to Julia Dec 25, 2025
Copilot AI requested a review from ppeeters December 25, 2025 17:12
@ppeeters ppeeters marked this pull request as ready for review December 25, 2025 17:27
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