Code in this disscussion: https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/518263
Tested compilers:
- gfortran 4.8.4 (failed, gfortran has problem with the allocatable attribute for character).
- Intel Fortran 2018 Composer Edition for Linux (passed). This shows that Intel Fortran has better implementation of OOP features of Fortran 2003 standard.