MODULE link_type IMPLICIT NONE TYPE link CHARACTER :: c TYPE (link), POINTER :: next => null() END TYPE link END MODULE link_type PROGRAM sll USE link_type, ONLY: link IMPLICIT NONE TYPE (link), POINTER :: root, current INTEGER :: ios = 0 ALLOCATE (root) current => root PRINT *, 'Enter your data here (end with EOD character);' DO WHILE (ASSOCIATED (current)) READ (UNIT=*, FMT='(A)', ADVANCE='NO', IOSTAT=ios) current%c IF (ios /= -1) THEN ALLOCATE (current%next) END IF current => current%next END DO current => root DO WHILE (ASSOCIATED (current%next)) PRINT *, current%c current => current%next END DO END PROGRAM sll