From owner-sc22wg5+sc22wg5-dom9=www.open-std.org@open-std.org  Wed Sep 18 10:50:03 2024
Return-Path: <owner-sc22wg5+sc22wg5-dom9=www.open-std.org@open-std.org>
X-Original-To: sc22wg5-dom9
Delivered-To: sc22wg5-dom9@www.open-std.org
Received: by www.open-std.org (Postfix, from userid 521)
	id 98C3F357038; Wed, 18 Sep 2024 10:50:03 +0200 (CEST)
Delivered-To: sc22wg5@open-std.org
X-Greylist: delayed 487 seconds by postgrey-1.34 at www5.open-std.org; Wed, 18 Sep 2024 10:50:03 CEST
Received: from smtp-out-2.talktalk.net (smtp-out-2.talktalk.net [62.24.135.66])
	by www.open-std.org (Postfix) with ESMTP id 4907D356F3A
	for <sc22wg5@open-std.org>; Wed, 18 Sep 2024 10:50:03 +0200 (CEST)
Received: from [10.197.1.247] ([2.100.204.175])
	by smtp.talktalk.net with SMTP
	id qqG2sEy1MvjStqqG2s3dAf; Wed, 18 Sep 2024 09:41:54 +0100
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=talktalk.net;
	s=cmr1711; t=1726648914;
	bh=KmBVisZwBizjRSULSVGsRGlV/JrNWZ7zYubpjG8ZLA4=;
	h=Subject:To:Cc:References:From:Date:In-Reply-To;
	b=Q/UAB8YLmM5LplTXfGnbt7vqUbSC43syRc0H8UtGFza+KhnW0kS3At7LawLeTgoyK
	 qPsjdUjS4COXK3dAJRtPMhcf6avrtsfJyeViHzRFRpwI32sWVNREpHv7fPnXa3ewD3
	 +9MIAPyDf1e0I92u2U9S3mufyEn+sycMjXXCPtLw=
X-Originating-IP: [2.100.204.175]
X-Spam: 0
X-OAuthority: v=2.3 cv=eLBtc0h1 c=1 sm=1 tr=0 a=+/t99oqttpv9cEP1OHanYg==:117
 a=+/t99oqttpv9cEP1OHanYg==:17 a=r77TgQKjGQsHNAKrUKIA:9
 a=Hx9PlwantLrzTkxAA2AA:9 a=pILNOxqGKmIA:10 a=UqCG9HQmAAAA:8
 a=_ROoWiHXCZnawuxITIwA:9 a=jBqxQTjWAyjFwtEB:21 a=UiCQ7L4-1S4A:10
 a=hTZeC7Yk6K0A:10 a=frz4AuCg-hUA:10 a=_W_S_7VecoQA:10
Subject: Re: [J3] [SC22WG5.6604] intent(in) and value
To: WG5 <sc22wg5@open-std.org>
Cc: Jeff Hammond <jehammond@nvidia.com>
References: <LV3PR12MB90956B210D8135B74A486302CB622@LV3PR12MB9095.namprd12.prod.outlook.com>
From: John Reid <john.reid9@talktalk.net>
Message-ID: <790a0022-0776-e9ac-7715-bcd42b5e4f9f@talktalk.net>
Date: Wed, 18 Sep 2024 09:41:54 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:91.0) Gecko/20100101
 Firefox/91.0 SeaMonkey/2.53.19
MIME-Version: 1.0
In-Reply-To: <LV3PR12MB90956B210D8135B74A486302CB622@LV3PR12MB9095.namprd12.prod.outlook.com>
Content-Type: multipart/alternative;
 boundary="------------79224159BBD06B528077719F"
X-CMAE-Envelope: MS4wfM/ASXNy31w+PIZFX+IsD8iocU+79WGav9Vmkq+XDrLJ487pacVsPbPrwuSoqlpdocR8bC3F/XTMvYDpq4SXk6J8iFp91Vj7a/6Wg+uW6wmHqdlr5miG
 wl3GOgm17qPy4KGPnDsWEA0vnuSy9Isl3dTAkHLugihs8OiFYjoLDqWeZnfS61qpCDXa1ga1X80cgzYCl6nIjiQh6Bsj8+LG1loWTt5viJ36JAXolpSncQ10
 d6mrDyZMDCARRHtVd6Bvnw==
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

This is a multi-part message in MIME format.
--------------79224159BBD06B528077719F
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit

Jeff,

Dummy arguments without an INTENT are just that. It is what we had in 
Fortran 77. They are not required to be definable, as is the case for 
INTENT(INOUT) (see 8.5.10, para 4).

Cheers,

John.


Jeff Hammond via J3 wrote:
>
> 8.5.10 R828 says that INTENT is IN, OUT or INOUT.
>
> 8.5.19 C868 says that VALUE cannot be INTENT(OUT) or INTENT(INOUT)
>
> Should I understand that dummy arguments without an INTENT do not have 
> an implicit intent corresponding to any of the explicit INTENT types?  
> I have always assumed that the default INTENT was INOUT, but that 
> cannot be true since that would conflict with VALUE in the example 
> below.  It seems the default INTENT is “INOUT, unless VALUE, in which 
> case it’s IN-but-also-assignable”.
>
> subroutine foo(a,b)
>
>     implicit none
>
>     integer, value, intent(in) :: a
>
>     integer, value :: b
>
>     ! integer, value, intent(inout) :: c ! not allowed
>
>     ! integer, value, intent(out) :: d ! not allowed
>
>     ! a = 21 ! can't assign because intent(in)
>
>     b = 23 ! can assign
>
> end subroutine foo
>
> Thanks
>
> Jeff
>


--------------79224159BBD06B528077719F
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Jeff,<br>
      <br>
      Dummy arguments without an INTENT are just that. It is what we had
      in Fortran 77. They are not required to be definable, as is the
      case for INTENT(INOUT) (see 8.5.10, para 4). <br>
      <br>
      Cheers,<br>
      <br>
      John. <br>
      <br>
      <br>
      Jeff Hammond via J3 wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:LV3PR12MB90956B210D8135B74A486302CB622@LV3PR12MB9095.namprd12.prod.outlook.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Aptos;
	panose-1:2 11 0 4 2 2 2 2 2 4;}
@font-face
	{font-family:"Times New Roman \(Body CS\)";
	panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	font-size:12.0pt;
	font-family:"Aptos",sans-serif;
	mso-ligatures:standardcontextual;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Aptos",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style>
      <div class="WordSection1">
        <p class="MsoNormal">8.5.10 R828 says that INTENT is IN, OUT or
          INOUT.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">8.5.19 C868 says that VALUE cannot be
          INTENT(OUT) or INTENT(INOUT)<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Should I understand that dummy arguments
          without an INTENT do not have an implicit intent corresponding
          to any of the explicit INTENT types?  I have always assumed
          that the default INTENT was INOUT, but that cannot be true
          since that would conflict with VALUE in the example below.  It
          seems the default INTENT is “INOUT, unless VALUE, in which
          case it’s IN-but-also-assignable”.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">subroutine foo(a,b)<o:p></o:p></p>
        <p class="MsoNormal">    implicit none<o:p></o:p></p>
        <p class="MsoNormal">    integer, value, intent(in) :: a<o:p></o:p></p>
        <p class="MsoNormal">    integer, value :: b<o:p></o:p></p>
        <p class="MsoNormal">    ! integer, value, intent(inout) :: c !
          not allowed<o:p></o:p></p>
        <p class="MsoNormal">    ! integer, value, intent(out) :: d !
          not allowed<o:p></o:p></p>
        <p class="MsoNormal">    ! a = 21 ! can't assign because
          intent(in)<o:p></o:p></p>
        <p class="MsoNormal">    b = 23 ! can assign<o:p></o:p></p>
        <p class="MsoNormal">end subroutine foo<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Thanks<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Jeff<o:p></o:p></p>
      </div>
    </blockquote>
    <br>
  </body>
</html>

--------------79224159BBD06B528077719F--
