[J3] [EXTERNAL] please try running this program

Clune, Thomas L. (GSFC-6101) thomas.l.clune at nasa.gov
Mon Oct 24 12:41:54 UTC 2022


Bob,

After removing the erroneous RETURN statement, I got   2.0000 for both prints from all 3 compilers that I tried (NAG, Intel, GNU).


  *   Tom

From: J3 <j3-bounces at mailman.j3-fortran.org> on behalf of j3 <j3 at mailman.j3-fortran.org>
Reply-To: j3 <j3 at mailman.j3-fortran.org>
Date: Monday, October 24, 2022 at 8:21 AM
To: J3 List <j3 at j3-fortran.org>
Cc: Robert Corbett <rpcorbett at att.net>
Subject: [EXTERNAL] [J3] please try running this program

      PROGRAM MAIN
        TYPE T
          INTEGER(KIND(X)) Y
        END TYPE T
        CALL SUBR1
        RETURN
      CONTAINS
        SUBROUTINE SUBR1
          X = 1
          CALL SUBR2
          PRINT *, X
        END SUBROUTINE SUBR1
        SUBROUTINE SUBR2
          X = 2
          PRINT *, X
        END SUBROUTINE SUBR2
      END

The scope rules for implicit declarations
between Fortran 2008 with Corrigendum 1
and Fortran 2018.  This program determines
which scope rules are used.

Robert Corbett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20221024/3be6c1cb/attachment-0002.htm>


More information about the J3 mailing list