[Patch][Fortran] On unformatted read, convert != 0 logical to 1

Thomas Koenig tkoenig@netcologne.de
Tue Jan 28 20:38:00 GMT 2020


Hi Jerry,

> I think we should have (for the logical, but also all types)
> 
> transfer_logical()          ====> The simplest and most direct read
> 
> transfer_logical_async()     =====> Call the async wrapper as needed.
> 
> transfer_logical_convert ()    =====> Call the simple and then convert
> 
> transfer_logical_convert_async () ====> Call the async and then convert

I think convert needs to be handled in the library - it is not known at
compile time because this might be influenced by an OPEN somewhere
in the program or an enviroment variable.

ASYNC is different, that needs to be a compile-time constant, so the
front end could translate this to a different library call.

If we want to gain a benefit from this, we probably need to wait
for an ABI change - there would be little use to call
transfer_logical which would then have to check for async
to maintain backward compatibility.

As far as dealing with non-standard logical variables - another
possibility would be to issue an error message (under a flag) for
any value except 0 or 1.

Regards

	Thomas



More information about the Fortran mailing list