cc: @Jamie , @epagone @Beliavsky
Please note the bit about current standard revision in my description. The code I showed upthread indeed conforms to the current Fortran standard. If your basis is gfortran which has gaps relative to current standard and has outstanding support requests with Bugzilla among other things with Fortran 2003 and 2008 features, please work with what is supported by that compiler while you take note the current standard may have other facilities.