# Step 7: fortran-implementation ## Read First - `/AGENTS.md` - `/docs/ABAQUS_SUBROUTINE_AGENT_DESIGN.md` - `/docs/ARCHITECTURE.md` - `/docs/ADR.md` - `/.codex/skills/abaqus-fortran-tdd/SKILL.md` - `/docs/requirements/uel-3d-euler-beam.md` - `/docs/research/uel-3d-euler-beam-research.md` - `/docs/formulations/uel-3d-euler-beam.md` - `/docs/numerical-reviews/uel-3d-euler-beam.md` - `/docs/io-definitions/uel-3d-euler-beam.md` - `/docs/reference-models/uel-3d-euler-beam.md` - `/docs/build-test-reports/uel-3d-euler-beam-red.md` - `/tests/fortran/manifest.json` ## Task Implement the minimum Fortran production code needed to make the approved no-Abaqus tests pass. Use the production source layout approved in `/docs/reference-models/uel-3d-euler-beam.md`. If the layout is missing, prefer: - `/src/fortran/kernels/uel_3d_euler_beam_kernel.f90` for testable calculation logic. - `/src/fortran/abaqus/UEL_3D_EULER_BEAM.for` for the thin Abaqus `UEL` wrapper. Implementation scope: - Build the 3D Euler-Bernoulli local stiffness matrix. - Build and validate the local-to-global transformation. - Compute static internal force/residual contribution according to the approved Abaqus `UEL` sign convention. - Fill `AMATRX` and `RHS` for the supported `LFLAGS` subset. - Validate element length, orientation, and material/section properties. - Keep `SVARS` and `ENERGY` behavior consistent with the approved interface contract. - Keep Abaqus ABI wrapper thin; testable logic belongs in the kernel or no-Abaqus driver layer. Follow RED -> GREEN -> VERIFY. Do not change the approved tests unless the upstream contract is objectively wrong; in that case mark the step `blocked` and explain which upstream document must change. After GREEN evidence, create `/docs/build-test-reports/uel-3d-euler-beam-green.md` with commands, compiler mode, and summarized results. ## Tests To Write First - Tests were written in step 6 and must already exist. - Add only narrowly scoped additional no-Abaqus tests if implementation uncovers an untested requirement. If added, run RED for the new test before code changes. ## Acceptance Criteria ```bash python -m unittest discover -s scripts -p "test_*.py" python scripts/validate_fortran.py python scripts/validate_reference_artifacts.py python scripts/validate_workspace.py ``` The step is complete only when the no-Abaqus Fortran validation passes, or the step is marked `blocked` with concrete environment evidence such as missing Intel Fortran compiler. ## Validation Notes - Do not create or modify external reference CSVs in this implementation step. - Update `/phases/uel-3d-euler-beam/index.json` step 7 with `completed`, `error`, or `blocked` and a concrete summary or reason. ## Forbidden - Do not add JavaScript/TypeScript/npm fallback. - Do not run Abaqus analyses from this project. - Do not generate reference CSVs. - Do not bypass or weaken TDD guard behavior. - Do not break existing tests.