Appendices

Syntax cheat sheet, keywords & statements, frequently used intrinsics by category, format descriptor quick reference, learning resources and suggested study plan (12 weeks).

Appendices

41.1 Syntax cheat sheet 41.2 Keywords & statements abstract allocatable allocate assign associate asynchronous backspace bind block call case class close codimension common contains contiguous continue critical cycle data deallocate deferred dimension do concurrent elemental else elsewhere end endfile entry enum enumerator equivalence error event exit extends external final flush forall format function generic goto if implicit import impure include inquire intent interface intrinsic kind len lock logical module namelist non_overridable nopass nullify only open operator optional parameter pass pause pointer print private procedure program protected public pure read recursive result return rewind save select sequence stop submodule subroutine sync target then type unlock use value volatile wait where while write (Fortran has no reserved words — keywords are recognized by context — but never use them as names.)

41.3 Frequently used intrinsics by category abs sqrt exp log log10 sin cos tan asin acos atan atan2 sinh cosh tanh gamma erf hypot norm2 mod modulo sign max min

int nint real dble cmplx floor ceiling aint anint achar iachar char ichar transfer

size shape lbound ubound sum product maxval minval maxloc minloc findloc count any all matmul dot_product transpose reshape spread pack unpack merge cshift eoshift

len len_trim trim adjustl adjustr index scan verify repeat new_line lge lgt lle llt

allocated associated present kind huge tiny epsilon precision range digits storage_size is_contiguous rank

iand ior ieor not ishft ishftc btest ibset ibclr popcnt leadz trailz shiftl shiftr

cpu_time system_clock date_and_time random_number random_seed random_init get_command_argument command_argument_count get_environment_variable execute_command_line move_alloc c_loc c_f_pointer

this_image num_images co_sum co_min co_max co_broadcast co_reduce 41.4 Format descriptor quick reference

I, F, E, ES, EN, G, G0, L, A, B, O, Z, X, T, /, :, *( ), SP, SS, DT — see §19.

41.5 Learning resources Official & community: fortran-lang.org (tutorials, "Fortran Best Practices", compiler list, package index), Fortran Discourse (fortran-lang.discourse.group), fortran-lang/stdlib, fpm, LFortran

*Modern Fortran Explained: Incorporating Fortran 2023* — Metcalf, Reid, Cohen

*Modern Fortran: Building Efficient Parallel Applications* — Milan Curcic

*Fortran for Scientists and Engineers* — Stephen Chapman *Modern Fortran in Practice* — Arjen Markus

*Introduction to Programming with Fortran* — Chivers & Sleightholme

*Scientific Software Design: The Object-Oriented Way* — Rouson, Xia, Xu

*Numerical Recipes in Fortran 90* — Press et al. (classic algorithms)

*Parallel Programming in OpenMP* / *Using MPI* — Chandra et al. / Gropp et al.

Online: gfortran manual, Intel Fortran Developer Guide, NVIDIA HPC SDK docs, OpenMP & MPI specifications, Exercism Fortran track, Compiler Explorer

Community: Fortran Discourse, FortranCon, J3/WG5 standards committee papers, r/fortran 41.6 Suggested study plan (12 weeks)

History, compilers, program structure, types & kinds Operators, intrinsics, basic I/O, control flow — Part I exercises Arrays, array intrinsics, strings

Procedures, advanced procedure features, modules — Project 1

Derived types, pointers & linked structures File I/O, formats, error handling, legacy code — Part II exercises, Project 2

OOP, generics & operators, PDTs & submodules — Project 3 C & Python interoperability, IEEE arithmetic

Coarrays, do concurrent, GPUs, numerical libraries — Project 4

Performance, testing, build systems, newest standards Numerical methods, case studies, best practices — Project 5, 7 or 8 🎓 Final Words

You've journeyed from print *, "Hello" to object-oriented design, C/Python interoperability, OpenMP, MPI, coarrays, and GPU offloading. Fortran remains the backbone of high-performance scientific computing — and modern Fortran is a clean, expressive language. Write implicit none, use modules and kinds, test your numerics, join the fortran-lang community, and build the capstone projects. Happy computing! 🚀

program main
  use, intrinsic :: iso_fortran_env, only: dp => real64
  implicit none
  integer :: i, n = 10
  real(dp) :: x = 1.0_dp
  real(dp), allocatable :: v(:)
  character(len=:), allocatable :: s
  logical :: ok = .true.

  allocate(v(n)); v = [(real(i, dp), i = 1, n)]
  s = "Fortran" // " rocks"

  if (x > 0) then; print *, "pos"; else if (x < 0) then; print *, "neg"; else; print *, "zero"; end if
  select case (n); case (1:5); print *, "small"; case default; print *, "big"; end select
  do i = 1, n, 2; if (i == 7) exit; end do
  do while (x < 100.0_dp); x = x * 2; end do
  where (v > 5) v = 0
  print '(a, i0, f8.3)', "n, x:", n, x
  write(*, '(*(g0, 1x))') v
  call sub(v)
contains
  subroutine sub(a)
    real(dp), intent(inout) :: a(:)
    a = a * 2
  end subroutine sub
  pure real(dp) function f(y)
    real(dp), intent(in) :: y
    f = y**2
  end function f
end program main

module m
  implicit none
  private; public :: t
  type :: t
    real :: x
  contains
    procedure :: show
  end type t
contains
  subroutine show(self); class(t), intent(in) :: self; print *, self%x; end subroutine
end module m