# Fortran

> Fortran for scientific and numerical computing. Use for .f90 files.

- Skill: `g1joshi/fortran` (Agent Skill)
- Install (CLI): `npx skillmds@latest add g1joshi/fortran`
- Raw SKILL.md: https://api.skillmd.com/api/skills/g1joshi/fortran/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: G1Joshi (https://skillmd.com/u/g1joshi)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/g1joshi/fortran

---


# Fortran

Fortran is not dead; it drives global weather forecasting and computational physics (MPI). **Fortran 2023** adds better C-interop and conditional expressions.

## When to Use

- **HPC**: High Performance Computing on supercomputers.
- **Legacy**: 50 years of tested scientific libraries (LAPACK, BLAS).
- **Arrays**: Native multi-dimensional array slicing is superior to C.

## Core Concepts

### Modules

Modern encapsulation. `USE my_module`.

### Coarrays

Native parallel programming syntax created for supercomputers.

### Implicit None

Always required to disable legacy variable typing.

## Best Practices (2025)

**Do**:

- **Use `fpm`**: The Fortran Package Manager (modern tooling!).
- **Use `iso_c_binding`**: To call Fortran from C/Python.
- **Use `do concurrent`**: To hint optimizations to the compiler.

**Don't**:

- **Don't use fixed form**: No `.f` (77). Use `.f90` (free form).

## References

- [Fortran Lang](https://fortran-lang.org/)

