2 ! Structure constructor with default initialization.
7 ! Type with all default values
9 CHARACTER(len=5) :: greeting = "hello"
12 ! Structure of basic data types
16 COMPLEX :: c = (0., 1.)
19 TYPE(quasiempty_t) :: empty
20 TYPE(basics_t) :: basics
22 empty = quasiempty_t ()
23 IF (empty%greeting /= "hello") THEN
27 basics = basics_t (r = 1.5)
28 IF (basics%i /= 42 .OR. basics%r /= 1.5 .OR. basics%c /= (0., 1.)) THEN
32 basics%c = (0., 0.) ! So we see it's surely gotten re-initialized
33 basics = basics_t (1, 5.1)
34 IF (basics%i /= 1 .OR. basics%r /= 5.1 .OR. basics%c /= (0., 1.)) THEN