(j3.2006) IMPLICIT NONE in BLOCK

Bill Long longb
Fri Feb 23 15:34:26 EST 2018


> On Feb 23, 2018, at 3:45 AM, Van Snyder <van.snyder at jpl.nasa.gov> wrote:
> 
> 
> I haven't been able to ask any processors what they think about
> 
> program foo
>  block
>    import, none
>    x = 42
>    print *, x
>  end block
> end program foo

I tried this program with a compiler I have available and

> ftn test2.f90
> ./a.out
 42.


Seems to work. One would hope, since the x = 42 is immediately before the print *, x.  I suspect the compiler optimized this to print *, 42.

Cheers,
Bill



Bill Long                                                                       longb at cray.com
Principal Engineer, Fortran Technical Support &   voice:  651-605-9024
Bioinformatics Software Development                      fax:  651-605-9143
Cray Inc./ 2131 Lindau Lane/  Suite 1000/  Bloomington, MN  55425





More information about the J3 mailing list