Recursive Data Structures in Fortran

type :: domain
  type(domain), allocatable :: subdomains(:)
  ...
end type domain

is a common pattern in numerical weather prediction models that use nests to incrementally refine the grid resolution.

4 Likes