Fortran/structures

Structures, structured types, or derived types(DT) were first introduced in Fortran 90. Structures allow the user to create data types that hold multiple different variables.

Derived types are often implemented within modules such that one can easily reuse them. They might also hold type-bound procedures which are intended to process the structure. The arguments  indicate whether the object should be passed as the first argument.

Similar to the  data type, structures can be parameterized by two different parameter types:. The  parameters must be known at compile type (consist of constants) whereas the   parameters can change at runtime.

Simple example
As an example, we can define a new structure type, 'Fruit' which stores some basic fruit variables:

We can declare two 'fruit' variables, and assign them values:

And we can then use the fruit variables and their child values in normal Fortran operations.