From owner-sc22wg5+sc22wg5-dom9=www.open-std.org@open-std.org  Sun Feb 18 22:35:40 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 03842356D0B; Sun, 18 Feb 2024 22:35:40 +0100 (CET)
Delivered-To: sc22wg5@open-std.org
Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174])
	by www.open-std.org (Postfix) with ESMTP id 8EB69356CDB
	for <sc22wg5@open-std.org>; Sun, 18 Feb 2024 22:35:39 +0100 (CET)
Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-607f8894550so16666547b3.1
        for <sc22wg5@open-std.org>; Sun, 18 Feb 2024 13:35:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=stevelionel.com; s=google; t=1708292138; x=1708896938; darn=open-std.org;
        h=in-reply-to:from:references:to:content-language:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to;
        bh=mJBj4bgPD6d+TFQeX1MPoUutaHDj1ws6YkjDBz5RjiQ=;
        b=Ug1KIMTJ3Uq8SsSLKQRqw/TNztEXhh3E1smPiJ3Ha6fyajxfC7ZT9ef1MjkpzK2hSh
         RYQgd3otRmY0rnlMC0AKh52+PCwY6E8+dmy6lneYHi9ZMUVzSZUJCh5l1TS3KF+wqr1/
         dy8ZAP2lI5MK0bS05ECgdfLhzo8F7dVRedqWA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1708292138; x=1708896938;
        h=in-reply-to:from:references:to:content-language:subject:user-agent
         :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to;
        bh=mJBj4bgPD6d+TFQeX1MPoUutaHDj1ws6YkjDBz5RjiQ=;
        b=u1SsFmKsCGZASVaAvOaI84zTddrvCXIbZk3fknk2LN6yHMWFs5Q4yaZLGQNwe4Bhgz
         XpS1wbwJPRK2PhzqyJfdqgyzLYsBlQpB0zem+AiFV5F/p1vHBU3v7/3NAtN9Fcmeb5HD
         VTzTBHtwT8YOB+1JTgmByvlMrRwk14OvoIk+GKtT4+oS04owvZ8lo+VDIkztWCiJv6Ye
         GaFVVz/no8bX1ZtExnPXBkQNBW1ebwKnJ6dHZFLUUZFO0uuheX2huxoyHhJiMgVivx5h
         Nj09Ty0LdaxFisQUGoO/mKX7tUW7XR3h46nWm8VLaVTYiyBwWhTVBGtVGSdAhY/yXdxR
         xIRw==
X-Gm-Message-State: AOJu0YydIy7aORUbL3U4B1jOCNWHQRcZbMLA/KRGne6mAKcQ+A5UpjUf
	hhxJznhQ0EFhJt5CeW2zXUI9Dai9IqIxCprqjn5C4QSznf7J/i4bE5jEnJA+Z4IxlSwfehwzm7D
	80lo=
X-Google-Smtp-Source: AGHT+IFK3EcWq0bFz6fxfFbroG3aNyvWwLlGIGCignrzVY0Ohpcj2Juh4nycri7osRU2S5slpfpZPw==
X-Received: by 2002:a81:ae4d:0:b0:607:f50f:3770 with SMTP id g13-20020a81ae4d000000b00607f50f3770mr7205484ywk.41.1708292137910;
        Sun, 18 Feb 2024 13:35:37 -0800 (PST)
Received: from [192.168.1.203] ([216.212.3.233])
        by smtp.gmail.com with ESMTPSA id d5-20020ac84e25000000b0042de98f38f3sm1940632qtw.63.2024.02.18.13.35.37
        for <sc22wg5@open-std.org>
        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
        Sun, 18 Feb 2024 13:35:37 -0800 (PST)
Content-Type: multipart/alternative;
 boundary="------------TMkiqL7hyOJtO0H9Vo7ULn7B"
Message-ID: <77dd9a36-9cda-444a-a03b-7580a081cc82@stevelionel.com>
Date: Sun, 18 Feb 2024 16:35:36 -0500
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [J3] [SC22WG5.6544] Why can't USE come after IMPLICIT NONE?
Content-Language: en-US
To: WG5 List <sc22wg5@open-std.org>
References: <20240218203142.DE815356D03@www.open-std.org>
From: Steve Lionel <steve@stevelionel.com>
X-Clacks-Overhead: GNU Terry Pratchett
In-Reply-To: <20240218203142.DE815356D03@www.open-std.org>
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

This is a multi-part message in MIME format.
--------------TMkiqL7hyOJtO0H9Vo7ULn7B
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

This of course dates back to Fortran 90, long before I was on the 
committee, but perhaps it was done to prevent confusion as to whether 
IMPLICIT would have an effect on the USE that follows. It wouldn't, 
because any implicit typing is resolved when the module is compiled, 
thus an IMPLICIT in the host scope would not affect any use-associated 
entities.

I see Van has made a better observation.

Even if this rule were relaxed, though, it would not help you. Consider:

program main
implicit none
real :: foo
include 'mpif.h'
...

I'm skeptical that having mpif.h be a use mpi would work for everyone 
regardless, as there wold be scoping rule differences.

On 2/18/2024 3:31 PM, Jeff Hammond via J3 wrote:
> Can someone explain to me why the following is illegal?  Is there a risk
>   that someone defines implicit variables in a module and that effect
> being invisible to the user?  Would it not have been better to exclude
> implicit variable declaration in modules?

Steve

--------------TMkiqL7hyOJtO0H9Vo7ULn7B
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">This of course dates back to Fortran
      90, long before I was on the committee, but perhaps it was done to
      prevent confusion as to whether IMPLICIT would have an effect on
      the USE that follows. It wouldn't, because any implicit typing is
      resolved when the module is compiled, thus an IMPLICIT in the host
      scope would not affect any use-associated entities. <br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">I see Van has made a better
      observation.<br>
    </div>
    <p>Even if this rule were relaxed, though, it would not help you.
      Consider:</p>
    <p><font face="monospace">program main<br>
        implicit none<br>
        real :: foo<br>
        include 'mpif.h'<br>
        ...</font></p>
    <p>I'm skeptical that having mpif.h be a <font face="monospace">use
        mpi</font> would work for everyone regardless, as there wold be
      scoping rule differences.<br>
    </p>
    <div class="moz-cite-prefix">On 2/18/2024 3:31 PM, Jeff Hammond via
      J3 wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:20240218203142.DE815356D03@www.open-std.org">
      <pre>Can someone explain to me why the following is illegal?  Is there a risk
 that someone defines implicit variables in a module and that effect 
being invisible to the user?  Would it not have been better to exclude 
implicit variable declaration in modules?
</pre>
    </blockquote>
    <p>Steve<br>
    </p>
  </body>
</html>

--------------TMkiqL7hyOJtO0H9Vo7ULn7B--
