Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Progress means replacing a theory that is wrong with one more subtly wrong.


devel / comp.lang.fortran / Deallocate problem

SubjectAuthor
* Deallocate problemdb
+- Re: Deallocate problemJohn
+* Re: Deallocate problemRobin Vowels
|`* Re: Deallocate problemdb
| +- Re: Deallocate problemgah4
| `* Re: Deallocate problemRobin Vowels
|  `* Re: Deallocate problemdb
|   +* Re: Deallocate problemRon Shepard
|   |`* Re: Deallocate problemgah4
|   | `* Re: Deallocate problemRobin Vowels
|   |  `* Re: Deallocate problemjfh
|   |   +- Re: Deallocate problemgah4
|   |   `* Re: Deallocate problemRobin Vowels
|   |    +* Re: Deallocate problemRon Shepard
|   |    |+- Re: Deallocate problemGary Scott
|   |    |`* Re: Deallocate problemRobin Vowels
|   |    | `* Re: Deallocate problemjfh
|   |    |  `* Re: Deallocate problemgah4
|   |    |   `* Re: Deallocate problemThomas Koenig
|   |    |    `- Re: Deallocate problemRobin Vowels
|   |    +* Re: Deallocate problemjfh
|   |    |`- Re: Deallocate problemjfh
|   |    `- Re: Deallocate problemgah4
|   `* Re: Deallocate problemLouis Krupp
|    `* Re: Deallocate problemdb
|     `- Re: Deallocate problemLouis Krupp
+- Re: Deallocate problemFortranFan
`- Re: Deallocate problemLouis Krupp

Pages:12
Deallocate problem

<tfkp70$1ucf3$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2866&group=comp.lang.fortran#2866

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dieterhansbritz@gmail.com (db)
Newsgroups: comp.lang.fortran
Subject: Deallocate problem
Date: Sun, 11 Sep 2022 15:52:32 +0200
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <tfkp70$1ucf3$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 11 Sep 2022 13:52:32 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="7fac1e0b75d147f3685e55d67f0029a9";
logging-data="2044387"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19TpsS0gCbs0XAp+aWEE4+AxgCnDJVC19I="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:+HQ8EITIVYl63s5t7PCTvVeRWd0=
Content-Language: en-US
 by: db - Sun, 11 Sep 2022 13:52 UTC

In a Fortran program I have these lines

....
print '(" ALLOCATED C:", l4)', ALLOCATED (C)
print '(" ALLOCATED X:", l4)', ALLOCATED (X)
print '(" ALLOCATED Z:", l4)', ALLOCATED (Z)
print '(" ALLOCATED p:", l4)', ALLOCATED (p)
print '(" ALLOCATED r:", l4)', ALLOCATED (r)
DEALLOCATE (C, X, Z, p, r,stat=i)
print '(" DEALLOCATE status =", i4)', i
....

When I run the program, this produces

ALLOCATED C: T
ALLOCATED X: T
ALLOCATED Z: T
ALLOCATED p: T
ALLOCATED r: T
munmap_chunk(): invalid pointer

It is the DEALLOCATE statement where it happens. Any idea why?

Re: Deallocate problem

<6f51042d-715a-46f4-9ebf-4573ce62de40n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2867&group=comp.lang.fortran#2867

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ad4:4ea7:0:b0:4ac:9b61:414a with SMTP id ed7-20020ad44ea7000000b004ac9b61414amr5427701qvb.29.1662907024804;
Sun, 11 Sep 2022 07:37:04 -0700 (PDT)
X-Received: by 2002:a05:6214:20e2:b0:4ac:b800:d280 with SMTP id
2-20020a05621420e200b004acb800d280mr470844qvk.52.1662907024706; Sun, 11 Sep
2022 07:37:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sun, 11 Sep 2022 07:37:04 -0700 (PDT)
In-Reply-To: <tfkp70$1ucf3$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:546:300:4c20:c142:770a:b4a1:6275;
posting-account=7tVJUQoAAACymEG6aShD5R0lhHCm_A0r
NNTP-Posting-Host: 2601:546:300:4c20:c142:770a:b4a1:6275
References: <tfkp70$1ucf3$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6f51042d-715a-46f4-9ebf-4573ce62de40n@googlegroups.com>
Subject: Re: Deallocate problem
From: urbanjost@comcast.net (John)
Injection-Date: Sun, 11 Sep 2022 14:37:04 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1505
 by: John - Sun, 11 Sep 2022 14:37 UTC

Are some of the values pointers? For example, if p and r are pointers to the same target,
deallocating a pointer target causes the pointer association status of any other pointer that is associated with the target or a portion of the target to become undefined. So once p is deallocated r is indefined. That is just one possibility.

How are the values defined and what declaration do they have?

Re: Deallocate problem

<a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2868&group=comp.lang.fortran#2868

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:622a:586:b0:344:a739:e98a with SMTP id c6-20020a05622a058600b00344a739e98amr19777510qtb.258.1662914679734;
Sun, 11 Sep 2022 09:44:39 -0700 (PDT)
X-Received: by 2002:ac8:7089:0:b0:35b:b5fa:5e35 with SMTP id
y9-20020ac87089000000b0035bb5fa5e35mr187607qto.449.1662914679403; Sun, 11 Sep
2022 09:44:39 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sun, 11 Sep 2022 09:44:39 -0700 (PDT)
In-Reply-To: <tfkp70$1ucf3$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <tfkp70$1ucf3$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
Subject: Re: Deallocate problem
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Sun, 11 Sep 2022 16:44:39 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1826
 by: Robin Vowels - Sun, 11 Sep 2022 16:44 UTC

On Sunday, September 11, 2022 at 11:52:36 PM UTC+10, db wrote:
> In a Fortran program I have these lines
>
> ...
> print '(" ALLOCATED C:", l4)', ALLOCATED (C)
> print '(" ALLOCATED X:", l4)', ALLOCATED (X)
> print '(" ALLOCATED Z:", l4)', ALLOCATED (Z)
> print '(" ALLOCATED p:", l4)', ALLOCATED (p)
> print '(" ALLOCATED r:", l4)', ALLOCATED (r)
> DEALLOCATE (C, X, Z, p, r,stat=i)
> print '(" DEALLOCATE status =", i4)', i
> ...
>
> When I run the program, this produces
>
> ALLOCATED C: T
> ALLOCATED X: T
> ALLOCATED Z: T
> ALLOCATED p: T
> ALLOCATED r: T
> munmap_chunk(): invalid pointer
>
> It is the DEALLOCATE statement where it happens. Any idea why?
..
You could try deallocating each one separately.

Re: Deallocate problem

<cda44bd2-a539-4da2-9c26-01d7a72780ebn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2869&group=comp.lang.fortran#2869

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:f6d:b0:4ac:a1ca:9de4 with SMTP id iy13-20020a0562140f6d00b004aca1ca9de4mr5469122qvb.62.1662923812621;
Sun, 11 Sep 2022 12:16:52 -0700 (PDT)
X-Received: by 2002:ac8:5dd3:0:b0:344:94e6:d667 with SMTP id
e19-20020ac85dd3000000b0034494e6d667mr21484874qtx.409.1662923812458; Sun, 11
Sep 2022 12:16:52 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sun, 11 Sep 2022 12:16:52 -0700 (PDT)
In-Reply-To: <tfkp70$1ucf3$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=165.225.39.91; posting-account=ZZXq9AoAAAAQEcA7zKAGm0UFQh4gMBv7
NNTP-Posting-Host: 165.225.39.91
References: <tfkp70$1ucf3$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cda44bd2-a539-4da2-9c26-01d7a72780ebn@googlegroups.com>
Subject: Re: Deallocate problem
From: parekhvs@gmail.com (FortranFan)
Injection-Date: Sun, 11 Sep 2022 19:16:52 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1788
 by: FortranFan - Sun, 11 Sep 2022 19:16 UTC

On Sunday, September 11, 2022 at 9:52:36 AM UTC-4, db wrote:
>..
> DEALLOCATE (C, X, Z, p, r,stat=i)
> print '(" DEALLOCATE status =", i4)', i
> ...
>
> When I run the program, this produces
> ..
> munmap_chunk(): invalid pointer
>
> It is the DEALLOCATE statement where it happens. Any idea why?

@db,

Re: "Any idea why?," you can best answer the question by yourself.

If you have a processor supporting Fortran 2003 or newer version of the standard, you can try introducing the ERRMSG= argument to your DEALLOCATE statement and check the message to see if that helps you figure out the problem.

You can also try to deallocate the objects one by one with the ERRMSG= option and see if that helps.

Re: Deallocate problem

<rCqTK.47196$SMP5.36008@fx05.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2870&group=comp.lang.fortran#2870

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx05.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
Subject: Re: Deallocate problem
Content-Language: en-US
Newsgroups: comp.lang.fortran
References: <tfkp70$1ucf3$1@dont-email.me>
From: lkrupp@invalid.pssw.com.invalid (Louis Krupp)
In-Reply-To: <tfkp70$1ucf3$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 27
Message-ID: <rCqTK.47196$SMP5.36008@fx05.iad>
X-Complaints-To: abuse(at)newshosting.com
NNTP-Posting-Date: Sun, 11 Sep 2022 19:25:11 UTC
Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com
Date: Sun, 11 Sep 2022 13:25:12 -0600
X-Received-Bytes: 1538
 by: Louis Krupp - Sun, 11 Sep 2022 19:25 UTC

On 9/11/2022 7:52 AM, db wrote:
> In a Fortran program I have these lines
>
> ...
> print '(" ALLOCATED C:", l4)', ALLOCATED (C)
> print '(" ALLOCATED X:", l4)', ALLOCATED (X)
> print '(" ALLOCATED Z:", l4)', ALLOCATED (Z)
> print '(" ALLOCATED p:", l4)', ALLOCATED (p)
> print '(" ALLOCATED r:", l4)', ALLOCATED (r)
>   DEALLOCATE (C, X, Z, p, r,stat=i)
> print '(" DEALLOCATE status =", i4)', i
> ...
>
> When I run the program, this produces
>
>  ALLOCATED C:   T
>  ALLOCATED X:   T
>  ALLOCATED Z:   T
>  ALLOCATED p:   T
>  ALLOCATED r:   T
> munmap_chunk(): invalid pointer
>
> It is the DEALLOCATE statement where it happens. Any idea why?

Can you post a small, complete program that reproduces the problem?

Louis

Re: Deallocate problem

<tfnd1h$291l0$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2871&group=comp.lang.fortran#2871

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dieterhansbritz@gmail.com (db)
Newsgroups: comp.lang.fortran
Subject: Re: Deallocate problem
Date: Mon, 12 Sep 2022 15:43:12 +0200
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <tfnd1h$291l0$1@dont-email.me>
References: <tfkp70$1ucf3$1@dont-email.me>
<a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 12 Sep 2022 13:43:13 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="ae112607470c51fa9481f3fdf8849e68";
logging-data="2393760"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/CtXYX8ZI2jvpv163bpEYA6whp6ExWbvE="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:N+XQoASXxWCY9ZJ930PvQgusoqA=
In-Reply-To: <a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
Content-Language: en-US
 by: db - Mon, 12 Sep 2022 13:43 UTC

On 11.09.2022 18.44, Robin Vowels wrote:
> On Sunday, September 11, 2022 at 11:52:36 PM UTC+10, db wrote:
>> In a Fortran program I have these lines
>>
>> ...
>> print '(" ALLOCATED C:", l4)', ALLOCATED (C)
>> print '(" ALLOCATED X:", l4)', ALLOCATED (X)
>> print '(" ALLOCATED Z:", l4)', ALLOCATED (Z)
>> print '(" ALLOCATED p:", l4)', ALLOCATED (p)
>> print '(" ALLOCATED r:", l4)', ALLOCATED (r)
>> DEALLOCATE (C, X, Z, p, r,stat=i)
>> print '(" DEALLOCATE status =", i4)', i
>> ...
>>
>> When I run the program, this produces
>>
>> ALLOCATED C: T
>> ALLOCATED X: T
>> ALLOCATED Z: T
>> ALLOCATED p: T
>> ALLOCATED r: T
>> munmap_chunk(): invalid pointer
>>
>> It is the DEALLOCATE statement where it happens. Any idea why?
> .
> You could try deallocating each one separately.

That was the way to the solution. I found that C, X and Z were fine
but it baulked at p. So I looked further and found that although I
had allocated p and r as p(3,NX) and r(3,NZ), in a routine I assigned
values to (p(0,i) and r(0,i), so I overwrote something. When I removed
that, the problem went away. A hard one.

Thank you all.

--
Dieter Britz

Re: Deallocate problem

<f5813623-8f51-449a-aa9f-b9e69e88cbcfn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2872&group=comp.lang.fortran#2872

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:622a:205:b0:343:282:3d0e with SMTP id b5-20020a05622a020500b0034302823d0emr23911881qtx.436.1663000182290;
Mon, 12 Sep 2022 09:29:42 -0700 (PDT)
X-Received: by 2002:a05:620a:1914:b0:6ce:5ac8:3b4f with SMTP id
bj20-20020a05620a191400b006ce5ac83b4fmr1566317qkb.627.1663000182131; Mon, 12
Sep 2022 09:29:42 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Mon, 12 Sep 2022 09:29:41 -0700 (PDT)
In-Reply-To: <tfnd1h$291l0$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:64fe:6d60:9e23:6310;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:64fe:6d60:9e23:6310
References: <tfkp70$1ucf3$1@dont-email.me> <a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f5813623-8f51-449a-aa9f-b9e69e88cbcfn@googlegroups.com>
Subject: Re: Deallocate problem
From: gah4@u.washington.edu (gah4)
Injection-Date: Mon, 12 Sep 2022 16:29:42 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2137
 by: gah4 - Mon, 12 Sep 2022 16:29 UTC

On Monday, September 12, 2022 at 6:43:16 AM UTC-7, db wrote:

(snip, someone wrote)
> > You could try deallocating each one separately.

> That was the way to the solution. I found that C, X and Z were fine
> but it baulked at p. So I looked further and found that although I
> had allocated p and r as p(3,NX) and r(3,NZ), in a routine I assigned
> values to (p(0,i) and r(0,i), so I overwrote something. When I removed
> that, the problem went away. A hard one.
The C deallocation funtion, free(), does not need to be told how long the
variable being deallocated is. A popular implementation puts just before
the actual array. Assigning one or two elements before the start of the
array destroys that, or sometimes the address of the next array, and
so free() fails in some bad ways.

Random stores outside the array are less likely to cause this, though that
means easier to miss during debugging.

Re: Deallocate problem

<54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2876&group=comp.lang.fortran#2876

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:28c5:b0:6bb:b0c9:3053 with SMTP id l5-20020a05620a28c500b006bbb0c93053mr22641984qkp.674.1663074663788;
Tue, 13 Sep 2022 06:11:03 -0700 (PDT)
X-Received: by 2002:ac8:57c7:0:b0:344:55d9:dcd7 with SMTP id
w7-20020ac857c7000000b0034455d9dcd7mr27997695qta.162.1663074663533; Tue, 13
Sep 2022 06:11:03 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Tue, 13 Sep 2022 06:11:03 -0700 (PDT)
In-Reply-To: <tfnd1h$291l0$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <tfkp70$1ucf3$1@dont-email.me> <a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
Subject: Re: Deallocate problem
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Tue, 13 Sep 2022 13:11:03 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2489
 by: Robin Vowels - Tue, 13 Sep 2022 13:11 UTC

On Monday, September 12, 2022 at 11:43:16 PM UTC+10, db wrote:
> On 11.09.2022 18.44, Robin Vowels wrote:
> > On Sunday, September 11, 2022 at 11:52:36 PM UTC+10, db wrote:
> >> In a Fortran program I have these lines
> >>
> >> ...
> >> print '(" ALLOCATED C:", l4)', ALLOCATED (C)
> >> print '(" ALLOCATED X:", l4)', ALLOCATED (X)
> >> print '(" ALLOCATED Z:", l4)', ALLOCATED (Z)
> >> print '(" ALLOCATED p:", l4)', ALLOCATED (p)
> >> print '(" ALLOCATED r:", l4)', ALLOCATED (r)
> >> DEALLOCATE (C, X, Z, p, r,stat=i)
> >> print '(" DEALLOCATE status =", i4)', i
> >> ...
> >>
> >> When I run the program, this produces
> >>
> >> ALLOCATED C: T
> >> ALLOCATED X: T
> >> ALLOCATED Z: T
> >> ALLOCATED p: T
> >> ALLOCATED r: T
> >> munmap_chunk(): invalid pointer
> >>
> >> It is the DEALLOCATE statement where it happens. Any idea why?
> > .
> > You could try deallocating each one separately.
> That was the way to the solution. I found that C, X and Z were fine
> but it baulked at p. So I looked further and found that although I
> had allocated p and r as p(3,NX) and r(3,NZ), in a routine I assigned
> values to (p(0,i) and r(0,i), so I overwrote something. When I removed
> that, the problem went away. A hard one.
..
You hadn't used array bounds checking?

Re: Deallocate problem

<tfsc4a$2ten9$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2878&group=comp.lang.fortran#2878

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!paganini.bofh.team!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dieterhansbritz@gmail.com (db)
Newsgroups: comp.lang.fortran
Subject: Re: Deallocate problem
Date: Wed, 14 Sep 2022 12:58:18 +0200
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <tfsc4a$2ten9$1@dont-email.me>
References: <tfkp70$1ucf3$1@dont-email.me>
<a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me>
<54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 14 Sep 2022 10:58:18 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="57c7eb0401806a9abff8d56f3bffe078";
logging-data="3062505"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+cppFkOPsYXEI8Ep6haCyD1+NtigMfqVY="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:lU6/QPVwqcj03cCH9Qpck/xuUSI=
In-Reply-To: <54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
Content-Language: en-US
 by: db - Wed, 14 Sep 2022 10:58 UTC

On 13.09.2022 15.11, Robin Vowels wrote:
[...]
>>> .
>>> You could try deallocating each one separately.
>> That was the way to the solution. I found that C, X and Z were fine
>> but it baulked at p. So I looked further and found that although I
>> had allocated p and r as p(3,NX) and r(3,NZ), in a routine I assigned
>> values to (p(0,i) and r(0,i), so I overwrote something. When I removed
>> that, the problem went away. A hard one.
> .
> You hadn't used array bounds checking?

I thought I did:

gfortran -o expexpsor.out -g -fcheck=bounds \

....

--
Dieter Britz

Re: Deallocate problem

<1EmUK.25619$0qy7.14525@fx40.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2883&group=comp.lang.fortran#2883

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx40.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:102.0)
Gecko/20100101 Thunderbird/102.2.2
Subject: Re: Deallocate problem
Content-Language: en-US
Newsgroups: comp.lang.fortran
References: <tfkp70$1ucf3$1@dont-email.me>
<a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me>
<54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
<tfsc4a$2ten9$1@dont-email.me>
From: nospam@nowhere.org (Ron Shepard)
In-Reply-To: <tfsc4a$2ten9$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 25
Message-ID: <1EmUK.25619$0qy7.14525@fx40.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Wed, 14 Sep 2022 10:42:52 -0500
X-Received-Bytes: 1744
 by: Ron Shepard - Wed, 14 Sep 2022 15:42 UTC

On 9/14/22 5:58 AM, db wrote:
> On 13.09.2022 15.11, Robin Vowels wrote:
> [...]
>>>> .
>>>> You could try deallocating each one separately.
>>> That was the way to the solution. I found that C, X and Z were fine
>>> but it baulked at p. So I looked further and found that although I
>>> had allocated p and r as p(3,NX) and r(3,NZ), in a routine I assigned
>>> values to (p(0,i) and r(0,i), so I overwrote something. When I removed
>>> that, the problem went away. A hard one.
>> .
>> You hadn't used array bounds checking?
>
> I thought I did:
>
> gfortran -o expexpsor.out -g -fcheck=bounds \
>
> ...

It might be worth the effort to understand why the compiler did not
catch that array bounds mistake immediately.

$.02 -Ron Shepard

Re: Deallocate problem

<c0bf1204-f374-429c-8f0a-699f05eb8bfdn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2884&group=comp.lang.fortran#2884

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:622a:15d4:b0:344:6a92:d8dc with SMTP id d20-20020a05622a15d400b003446a92d8dcmr32833520qty.114.1663172264343;
Wed, 14 Sep 2022 09:17:44 -0700 (PDT)
X-Received: by 2002:ad4:5bc7:0:b0:4ac:b800:d285 with SMTP id
t7-20020ad45bc7000000b004acb800d285mr13066472qvt.20.1663172264197; Wed, 14
Sep 2022 09:17:44 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 14 Sep 2022 09:17:44 -0700 (PDT)
In-Reply-To: <1EmUK.25619$0qy7.14525@fx40.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:149e:38ef:4709:6b03;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:149e:38ef:4709:6b03
References: <tfkp70$1ucf3$1@dont-email.me> <a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me> <54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
<tfsc4a$2ten9$1@dont-email.me> <1EmUK.25619$0qy7.14525@fx40.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c0bf1204-f374-429c-8f0a-699f05eb8bfdn@googlegroups.com>
Subject: Re: Deallocate problem
From: gah4@u.washington.edu (gah4)
Injection-Date: Wed, 14 Sep 2022 16:17:44 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2010
 by: gah4 - Wed, 14 Sep 2022 16:17 UTC

On Wednesday, September 14, 2022 at 8:42:56 AM UTC-7, Ron Shepard wrote:
> On 9/14/22 5:58 AM, db wrote:

(snip)

> > gfortran -o expexpsor.out -g -fcheck=bounds \
> It might be worth the effort to understand why the compiler did not
> catch that array bounds mistake immediately.

I agree.

There are a number of ways to trick the bounds-check system.

Assumed size arrays can't check the upper bound, but even for them,
I think it still checks the lower bound.

If you do separate compilation, you need bounds check on all.

It seems that it should either find a compiler bug, or some
unusual trick done by the program, that could cause problems.

Re: Deallocate problem

<m5oUK.284288$wLZ8.132681@fx18.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2885&group=comp.lang.fortran#2885

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx18.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.2.2
Subject: Re: Deallocate problem
Newsgroups: comp.lang.fortran
References: <tfkp70$1ucf3$1@dont-email.me>
<a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me>
<54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
<tfsc4a$2ten9$1@dont-email.me>
Content-Language: en-US
From: lkrupp@invalid.pssw.com.invalid (Louis Krupp)
In-Reply-To: <tfsc4a$2ten9$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 26
Message-ID: <m5oUK.284288$wLZ8.132681@fx18.iad>
X-Complaints-To: abuse(at)newshosting.com
NNTP-Posting-Date: Wed, 14 Sep 2022 17:22:26 UTC
Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com
Date: Wed, 14 Sep 2022 11:22:25 -0600
X-Received-Bytes: 1733
 by: Louis Krupp - Wed, 14 Sep 2022 17:22 UTC

On 9/14/2022 4:58 AM, db wrote:
> On 13.09.2022 15.11, Robin Vowels wrote:
> [...]
>>>> .
>>>> You could try deallocating each one separately.
>>> That was the way to the solution. I found that C, X and Z were fine
>>> but it baulked at p. So I looked further and found that although I
>>> had allocated p and r as p(3,NX) and r(3,NZ), in a routine I assigned
>>> values to (p(0,i) and r(0,i), so I overwrote something. When I removed
>>> that, the problem went away. A hard one.
>> .
>> You hadn't used array bounds checking?
>
> I thought I did:
>
> gfortran -o expexpsor.out -g -fcheck=bounds \
>
> ...
>
>

That's why it's good to post a small program that reproduces the
problem; it helps everyone else see exactly what you're seeing.

Louis

Re: Deallocate problem

<68aee1d5-33f4-417f-bece-5fbc2dc488c7n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2886&group=comp.lang.fortran#2886

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ac8:5acc:0:b0:35b:b658:4af8 with SMTP id d12-20020ac85acc000000b0035bb6584af8mr13868067qtd.625.1663180605378;
Wed, 14 Sep 2022 11:36:45 -0700 (PDT)
X-Received: by 2002:a05:620a:108d:b0:6ce:612b:7075 with SMTP id
g13-20020a05620a108d00b006ce612b7075mr7745598qkk.162.1663180605178; Wed, 14
Sep 2022 11:36:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 14 Sep 2022 11:36:44 -0700 (PDT)
In-Reply-To: <c0bf1204-f374-429c-8f0a-699f05eb8bfdn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <tfkp70$1ucf3$1@dont-email.me> <a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me> <54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
<tfsc4a$2ten9$1@dont-email.me> <1EmUK.25619$0qy7.14525@fx40.iad> <c0bf1204-f374-429c-8f0a-699f05eb8bfdn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <68aee1d5-33f4-417f-bece-5fbc2dc488c7n@googlegroups.com>
Subject: Re: Deallocate problem
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Wed, 14 Sep 2022 18:36:45 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2199
 by: Robin Vowels - Wed, 14 Sep 2022 18:36 UTC

On Thursday, September 15, 2022 at 2:17:46 AM UTC+10, gah4 wrote:
> On Wednesday, September 14, 2022 at 8:42:56 AM UTC-7, Ron Shepard wrote:
> > On 9/14/22 5:58 AM, db wrote:
> (snip)
> > > gfortran -o expexpsor.out -g -fcheck=bounds \
> > It might be worth the effort to understand why the compiler did not
> > catch that array bounds mistake immediately.
> I agree.
>
> There are a number of ways to trick the bounds-check system.
>
> Assumed size arrays can't check the upper bound,
..
Silverfrost F95 checks bounds for these arrays.
..
> but even for them,
> I think it still checks the lower bound.
>
> If you do separate compilation, you need bounds check on all.
>
> It seems that it should either find a compiler bug, or some
> unusual trick done by the program, that could cause problems.

Re: Deallocate problem

<tg4ape$5bka$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2901&group=comp.lang.fortran#2901

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dieterhansbritz@gmail.com (db)
Newsgroups: comp.lang.fortran
Subject: Re: Deallocate problem
Date: Sat, 17 Sep 2022 13:24:29 +0200
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <tg4ape$5bka$1@dont-email.me>
References: <tfkp70$1ucf3$1@dont-email.me>
<a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me>
<54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
<tfsc4a$2ten9$1@dont-email.me> <m5oUK.284288$wLZ8.132681@fx18.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 17 Sep 2022 11:24:30 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="30846ea3ae22621c459b5b837184fcbf";
logging-data="175754"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18wV6tgBMnIePgqHjc2QglShKmF3nmOOwY="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:lZ9BSWuCQ803ZXw4Jf0nE0jzqzU=
In-Reply-To: <m5oUK.284288$wLZ8.132681@fx18.iad>
Content-Language: en-US
 by: db - Sat, 17 Sep 2022 11:24 UTC

On 14.09.2022 19.22, Louis Krupp wrote:
> On 9/14/2022 4:58 AM, db wrote:
>> On 13.09.2022 15.11, Robin Vowels wrote:
>> [...]
>>>>> .
>>>>> You could try deallocating each one separately.
>>>> That was the way to the solution. I found that C, X and Z were fine
>>>> but it baulked at p. So I looked further and found that although I
>>>> had allocated p and r as p(3,NX) and r(3,NZ), in a routine I assigned
>>>> values to (p(0,i) and r(0,i), so I overwrote something. When I removed
>>>> that, the problem went away. A hard one.
>>> .
>>> You hadn't used array bounds checking?
>>
>> I thought I did:
>>
>> gfortran -o expexpsor.out -g -fcheck=bounds \
>>
>> ...
>>
>>
>
> That's why it's good to post a small program that reproduces the
> problem; it helps everyone else see exactly what you're seeing.
>
> Louis
>

You are right. But before I found the error I didn't know how to produce
a small program that caused it; and now that I know what did, it seems
pointless. I doubt that it woulkd explain why the bounds check didn't
complain. I use gfortran btw.

--
Dieter Britz

Re: Deallocate problem

<324e6283-0f52-43bd-8fe9-09c95fed3412n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2906&group=comp.lang.fortran#2906

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:622a:189d:b0:35b:c3f7:495e with SMTP id v29-20020a05622a189d00b0035bc3f7495emr10256453qtc.416.1663473946876;
Sat, 17 Sep 2022 21:05:46 -0700 (PDT)
X-Received: by 2002:ad4:5b8b:0:b0:4ad:2b21:3390 with SMTP id
11-20020ad45b8b000000b004ad2b213390mr2917224qvp.20.1663473946711; Sat, 17 Sep
2022 21:05:46 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sat, 17 Sep 2022 21:05:46 -0700 (PDT)
In-Reply-To: <68aee1d5-33f4-417f-bece-5fbc2dc488c7n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=115.189.83.30; posting-account=KnYfEgoAAAD1tUJTvdAUZ3XojNa5tezZ
NNTP-Posting-Host: 115.189.83.30
References: <tfkp70$1ucf3$1@dont-email.me> <a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me> <54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
<tfsc4a$2ten9$1@dont-email.me> <1EmUK.25619$0qy7.14525@fx40.iad>
<c0bf1204-f374-429c-8f0a-699f05eb8bfdn@googlegroups.com> <68aee1d5-33f4-417f-bece-5fbc2dc488c7n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <324e6283-0f52-43bd-8fe9-09c95fed3412n@googlegroups.com>
Subject: Re: Deallocate problem
From: harperjf2@gmail.com (jfh)
Injection-Date: Sun, 18 Sep 2022 04:05:46 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2596
 by: jfh - Sun, 18 Sep 2022 04:05 UTC

On Thursday, September 15, 2022 at 6:36:47 AM UTC+12, Robin Vowels wrote:
> On Thursday, September 15, 2022 at 2:17:46 AM UTC+10, gah4 wrote: h
> > On Wednesday, September 14, 2022 at 8:42:56 AM UTC-7, Ron Shepard wrote:
> > > On 9/14/22 5:58 AM, db wrote:
> > (snip)
> > > > gfortran -o expexpsor.out -g -fcheck=bounds \
> > > It might be worth the effort to understand why the compiler did not
> > > catch that array bounds mistake immediately.
> > I agree.
> >
> > There are a number of ways to trick the bounds-check system.
> >
> > Assumed size arrays can't check the upper bound,
> .
> Silverfrost F95 checks bounds for these arrays.

Someone trying one of my programs with Silverfrost told me years ago that it wouldn't compile because i had tried to declare an integer variable with the smallest number of bits with selected-int-kind(0) . Gfortran, ifort and g95 all accepted ithat. Does Silverfrost still have that bug/feature? Of course I changed my program to use selected_int_kind(1), but
I don't think selected-int-kind(0) should have been disallowed.

Re: Deallocate problem

<df2baeda-18a3-4418-bbbe-5891be127583n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2907&group=comp.lang.fortran#2907

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:2892:b0:6c4:79ac:d804 with SMTP id j18-20020a05620a289200b006c479acd804mr9330295qkp.697.1663475483506;
Sat, 17 Sep 2022 21:31:23 -0700 (PDT)
X-Received: by 2002:a05:620a:1721:b0:6ce:78a7:daca with SMTP id
az33-20020a05620a172100b006ce78a7dacamr9339341qkb.487.1663475483374; Sat, 17
Sep 2022 21:31:23 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sat, 17 Sep 2022 21:31:23 -0700 (PDT)
In-Reply-To: <324e6283-0f52-43bd-8fe9-09c95fed3412n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:1881:a979:1418:8806;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:1881:a979:1418:8806
References: <tfkp70$1ucf3$1@dont-email.me> <a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me> <54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
<tfsc4a$2ten9$1@dont-email.me> <1EmUK.25619$0qy7.14525@fx40.iad>
<c0bf1204-f374-429c-8f0a-699f05eb8bfdn@googlegroups.com> <68aee1d5-33f4-417f-bece-5fbc2dc488c7n@googlegroups.com>
<324e6283-0f52-43bd-8fe9-09c95fed3412n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <df2baeda-18a3-4418-bbbe-5891be127583n@googlegroups.com>
Subject: Re: Deallocate problem
From: gah4@u.washington.edu (gah4)
Injection-Date: Sun, 18 Sep 2022 04:31:23 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2152
 by: gah4 - Sun, 18 Sep 2022 04:31 UTC

On Saturday, September 17, 2022 at 9:05:48 PM UTC-7, jfh wrote:

(snip)

> Someone trying one of my programs with Silverfrost told me years ago
> that it wouldn't compile because i had tried to declare an integer variable
> with the smallest number of bits with selected-int-kind(0). Gfortran,
> ifort and g95 all accepted ithat. Does Silverfrost still have that bug/feature?
> Of course I changed my program to use selected_int_kind(1), but
> I don't think selected-int-kind(0) should have been disallowed.

I suppose I believe that negative ones shouldn't be allowed, but zero
seems like it should work.

Re: Deallocate problem

<A_AVK.381718$6Il8.241688@fx14.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2908&group=comp.lang.fortran#2908

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx14.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.2.2
Subject: Re: Deallocate problem
Content-Language: en-US
Newsgroups: comp.lang.fortran
References: <tfkp70$1ucf3$1@dont-email.me>
<a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me>
<54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
<tfsc4a$2ten9$1@dont-email.me> <m5oUK.284288$wLZ8.132681@fx18.iad>
<tg4ape$5bka$1@dont-email.me>
From: lkrupp@invalid.pssw.com.invalid (Louis Krupp)
In-Reply-To: <tg4ape$5bka$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 41
Message-ID: <A_AVK.381718$6Il8.241688@fx14.iad>
X-Complaints-To: abuse(at)newshosting.com
NNTP-Posting-Date: Sun, 18 Sep 2022 08:51:44 UTC
Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com
Date: Sun, 18 Sep 2022 02:51:45 -0600
X-Received-Bytes: 2314
 by: Louis Krupp - Sun, 18 Sep 2022 08:51 UTC

On 9/17/2022 5:24 AM, db wrote:
> On 14.09.2022 19.22, Louis Krupp wrote:
>> On 9/14/2022 4:58 AM, db wrote:
>>> On 13.09.2022 15.11, Robin Vowels wrote:
>>> [...]
>>>>>> .
>>>>>> You could try deallocating each one separately.
>>>>> That was the way to the solution. I found that C, X and Z were fine
>>>>> but it baulked at p. So I looked further and found that although I
>>>>> had allocated p and r as p(3,NX) and r(3,NZ), in a routine I assigned
>>>>> values to (p(0,i) and r(0,i), so I overwrote something. When I
>>>>> removed
>>>>> that, the problem went away. A hard one.
>>>> .
>>>> You hadn't used array bounds checking?
>>>
>>> I thought I did:
>>>
>>> gfortran -o expexpsor.out -g -fcheck=bounds \
>>>
>>> ...
>>>
>>>
>>
>> That's why it's good to post a small program that reproduces the
>> problem; it helps everyone else see exactly what you're seeing.
>>
>> Louis
>>
>
> You are right. But before I found the error I didn't know how to produce
> a small program that caused it; and now that I know what did, it seems
> pointless. I doubt that it woulkd explain why the bounds check didn't
> complain. I use gfortran btw.
>

Having an example where bounds checking apparently failed might be
interesting. You never know.

Louis

Re: Deallocate problem

<fe18dcad-4382-435f-8cc5-015352b9a9b4n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2909&group=comp.lang.fortran#2909

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:622a:1441:b0:35c:da34:d5dc with SMTP id v1-20020a05622a144100b0035cda34d5dcmr6175409qtx.338.1663493289580;
Sun, 18 Sep 2022 02:28:09 -0700 (PDT)
X-Received: by 2002:a05:620a:108d:b0:6ce:612b:7075 with SMTP id
g13-20020a05620a108d00b006ce612b7075mr9236195qkk.162.1663493289425; Sun, 18
Sep 2022 02:28:09 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sun, 18 Sep 2022 02:28:09 -0700 (PDT)
In-Reply-To: <324e6283-0f52-43bd-8fe9-09c95fed3412n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <tfkp70$1ucf3$1@dont-email.me> <a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me> <54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
<tfsc4a$2ten9$1@dont-email.me> <1EmUK.25619$0qy7.14525@fx40.iad>
<c0bf1204-f374-429c-8f0a-699f05eb8bfdn@googlegroups.com> <68aee1d5-33f4-417f-bece-5fbc2dc488c7n@googlegroups.com>
<324e6283-0f52-43bd-8fe9-09c95fed3412n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fe18dcad-4382-435f-8cc5-015352b9a9b4n@googlegroups.com>
Subject: Re: Deallocate problem
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Sun, 18 Sep 2022 09:28:09 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1994
 by: Robin Vowels - Sun, 18 Sep 2022 09:28 UTC

On Sunday, September 18, 2022 at 2:05:48 PM UTC+10, jfh wrote:

> Someone trying one of my programs with Silverfrost told me years ago that it wouldn't compile because i had tried to declare an integer variable with the smallest number of bits with selected-int-kind(0) .
You mean, selected_int_kind(0).
..
You wanted an integer variable capable of storing values between -1 and +1 ?
In other words, you wanted an integer variable capable of storing the value 0 [i.e., zero].
You have to be joking.

Re: Deallocate problem

<QCHVK.444040$Ny99.120267@fx16.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2910&group=comp.lang.fortran#2910

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx16.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:102.0)
Gecko/20100101 Thunderbird/102.2.2
Subject: Re: Deallocate problem
Content-Language: en-US
Newsgroups: comp.lang.fortran
References: <tfkp70$1ucf3$1@dont-email.me>
<a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me>
<54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
<tfsc4a$2ten9$1@dont-email.me> <1EmUK.25619$0qy7.14525@fx40.iad>
<c0bf1204-f374-429c-8f0a-699f05eb8bfdn@googlegroups.com>
<68aee1d5-33f4-417f-bece-5fbc2dc488c7n@googlegroups.com>
<324e6283-0f52-43bd-8fe9-09c95fed3412n@googlegroups.com>
<fe18dcad-4382-435f-8cc5-015352b9a9b4n@googlegroups.com>
From: nospam@nowhere.org (Ron Shepard)
In-Reply-To: <fe18dcad-4382-435f-8cc5-015352b9a9b4n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 19
Message-ID: <QCHVK.444040$Ny99.120267@fx16.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Sun, 18 Sep 2022 11:24:16 -0500
X-Received-Bytes: 2300
 by: Ron Shepard - Sun, 18 Sep 2022 16:24 UTC

On 9/18/22 4:28 AM, Robin Vowels wrote:
> On Sunday, September 18, 2022 at 2:05:48 PM UTC+10, jfh wrote:
>
>> Someone trying one of my programs with Silverfrost told me years ago that it wouldn't compile because i had tried to declare an integer variable with the smallest number of bits with selected-int-kind(0) .
> You mean, selected_int_kind(0).
> .
> You wanted an integer variable capable of storing values between -1 and +1 ?
> In other words, you wanted an integer variable capable of storing the value 0 [i.e., zero].
> You have to be joking.

If there were ever a 1-bit integer kind introduced into the language,
then how would it be specified? selected_int_kind(1) would require at
least 5 bits, rounded up to 8-bits on most modern computers. So unless
the selected_int_kind() function is changed somehow (e.g. to specify
directly the minimum number of bits), asking for 0 decimal digits might
be the only way -- you ask for 0-bits and it would get rounded up to 1-bit.

$.02 -Ron Shepard

Re: Deallocate problem

<tg7usl$n661$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2911&group=comp.lang.fortran#2911

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: garylscott@sbcglobal.net (Gary Scott)
Newsgroups: comp.lang.fortran
Subject: Re: Deallocate problem
Date: Sun, 18 Sep 2022 15:25:57 -0500
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <tg7usl$n661$1@dont-email.me>
References: <tfkp70$1ucf3$1@dont-email.me>
<a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me>
<54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
<tfsc4a$2ten9$1@dont-email.me> <1EmUK.25619$0qy7.14525@fx40.iad>
<c0bf1204-f374-429c-8f0a-699f05eb8bfdn@googlegroups.com>
<68aee1d5-33f4-417f-bece-5fbc2dc488c7n@googlegroups.com>
<324e6283-0f52-43bd-8fe9-09c95fed3412n@googlegroups.com>
<fe18dcad-4382-435f-8cc5-015352b9a9b4n@googlegroups.com>
<QCHVK.444040$Ny99.120267@fx16.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 18 Sep 2022 20:25:57 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="edef8cc7a2fda02ae4c18ed337830d5b";
logging-data="760001"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/wBWnJpXPZXyCcylD7tVdO5gXD4semcBM="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.2.2
Cancel-Lock: sha1:OMMhhvmOr7CLWe19CcgE2x6ZG4I=
Content-Language: en-US
In-Reply-To: <QCHVK.444040$Ny99.120267@fx16.iad>
 by: Gary Scott - Sun, 18 Sep 2022 20:25 UTC

On 9/18/2022 11:24 AM, Ron Shepard wrote:
> On 9/18/22 4:28 AM, Robin Vowels wrote:
>> On Sunday, September 18, 2022 at 2:05:48 PM UTC+10, jfh wrote:
>>
>>> Someone trying one of my programs with Silverfrost told me years ago
>>> that it wouldn't compile because i had tried to declare an integer
>>> variable with the smallest number of bits with selected-int-kind(0) .
>> You mean, selected_int_kind(0).
>> .
>> You wanted an integer variable capable of storing values between -1
>> and +1 ?
>> In other words, you wanted an integer variable capable of storing the
>> value 0 [i.e., zero].
>> You have to be joking.
>
> If there were ever a 1-bit integer kind introduced into the language,
> then how would it be specified? selected_int_kind(1) would require at
> least 5 bits, rounded up to 8-bits on most modern computers. So unless
> the selected_int_kind() function is changed somehow (e.g. to specify
> directly the minimum number of bits), asking for 0 decimal digits might
> be the only way -- you ask for 0-bits and it would get rounded up to 1-bit.
>
> $.02 -Ron Shepard
>
Careful, bit strings will raise its ugly head again...

Re: Deallocate problem

<d9a68077-9ea9-4041-9cf0-ba62716e561fn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2912&group=comp.lang.fortran#2912

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ac8:5d91:0:b0:35c:dfee:b28b with SMTP id d17-20020ac85d91000000b0035cdfeeb28bmr5877284qtx.459.1663543710155;
Sun, 18 Sep 2022 16:28:30 -0700 (PDT)
X-Received: by 2002:a05:620a:29c5:b0:6ce:b03d:2a06 with SMTP id
s5-20020a05620a29c500b006ceb03d2a06mr11381206qkp.552.1663543709982; Sun, 18
Sep 2022 16:28:29 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sun, 18 Sep 2022 16:28:29 -0700 (PDT)
In-Reply-To: <fe18dcad-4382-435f-8cc5-015352b9a9b4n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2404:2000:2000:8:9b4c:c054:f0ea:7123;
posting-account=KnYfEgoAAAD1tUJTvdAUZ3XojNa5tezZ
NNTP-Posting-Host: 2404:2000:2000:8:9b4c:c054:f0ea:7123
References: <tfkp70$1ucf3$1@dont-email.me> <a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me> <54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
<tfsc4a$2ten9$1@dont-email.me> <1EmUK.25619$0qy7.14525@fx40.iad>
<c0bf1204-f374-429c-8f0a-699f05eb8bfdn@googlegroups.com> <68aee1d5-33f4-417f-bece-5fbc2dc488c7n@googlegroups.com>
<324e6283-0f52-43bd-8fe9-09c95fed3412n@googlegroups.com> <fe18dcad-4382-435f-8cc5-015352b9a9b4n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d9a68077-9ea9-4041-9cf0-ba62716e561fn@googlegroups.com>
Subject: Re: Deallocate problem
From: harperjf2@gmail.com (jfh)
Injection-Date: Sun, 18 Sep 2022 23:28:30 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2801
 by: jfh - Sun, 18 Sep 2022 23:28 UTC

On Sunday, September 18, 2022 at 9:28:11 PM UTC+12, Robin Vowels wrote:
> On Sunday, September 18, 2022 at 2:05:48 PM UTC+10, jfh wrote:
>
> > Someone trying one of my programs with Silverfrost told me years ago that it wouldn't compile because i had tried to declare an integer variable with the smallest number of bits with selected-int-kind(0) .
> You mean, selected_int_kind(0).
> .
> You wanted an integer variable capable of storing values between -1 and +1 ?
> In other words, you wanted an integer variable capable of storing the value 0 [i.e., zero].
> You have to be joking.

I was not joking because selected_int_kind(1) requires all 19 integers n in the range -10 < n < +10 to be available. If there was a compiler allowing 4-bit integers, hence 16 different possible values, then selected_int_kind(0) would be a way to get them. I note that the f2018 standard does not say that r has to be non-negative. And indeed the program below prints 127 with g95 and gfortran, showing that their lowest integer kind has 8 bits. (I don't have access to a computer with ifort this morning to test what it would do.)

Re: Deallocate problem

<4e1c5862-fd93-4c0f-a3fb-d9423403a0aen@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2913&group=comp.lang.fortran#2913

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ac8:5705:0:b0:35c:d722:175d with SMTP id 5-20020ac85705000000b0035cd722175dmr9773876qtw.192.1663544940665;
Sun, 18 Sep 2022 16:49:00 -0700 (PDT)
X-Received: by 2002:ac8:7089:0:b0:35b:b5fa:5e35 with SMTP id
y9-20020ac87089000000b0035bb5fa5e35mr12780576qto.449.1663544940485; Sun, 18
Sep 2022 16:49:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sun, 18 Sep 2022 16:49:00 -0700 (PDT)
In-Reply-To: <d9a68077-9ea9-4041-9cf0-ba62716e561fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2404:2000:2000:8:9b4c:c054:f0ea:7123;
posting-account=KnYfEgoAAAD1tUJTvdAUZ3XojNa5tezZ
NNTP-Posting-Host: 2404:2000:2000:8:9b4c:c054:f0ea:7123
References: <tfkp70$1ucf3$1@dont-email.me> <a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me> <54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
<tfsc4a$2ten9$1@dont-email.me> <1EmUK.25619$0qy7.14525@fx40.iad>
<c0bf1204-f374-429c-8f0a-699f05eb8bfdn@googlegroups.com> <68aee1d5-33f4-417f-bece-5fbc2dc488c7n@googlegroups.com>
<324e6283-0f52-43bd-8fe9-09c95fed3412n@googlegroups.com> <fe18dcad-4382-435f-8cc5-015352b9a9b4n@googlegroups.com>
<d9a68077-9ea9-4041-9cf0-ba62716e561fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4e1c5862-fd93-4c0f-a3fb-d9423403a0aen@googlegroups.com>
Subject: Re: Deallocate problem
From: harperjf2@gmail.com (jfh)
Injection-Date: Sun, 18 Sep 2022 23:49:00 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3105
 by: jfh - Sun, 18 Sep 2022 23:49 UTC

On Monday, September 19, 2022 at 11:28:31 AM UTC+12, jfh wrote:
> On Sunday, September 18, 2022 at 9:28:11 PM UTC+12, Robin Vowels wrote:
> > On Sunday, September 18, 2022 at 2:05:48 PM UTC+10, jfh wrote:
> >
> > > Someone trying one of my programs with Silverfrost told me years ago that it wouldn't compile because i had tried to declare an integer variable with the smallest number of bits with selected-int-kind(0) .
> > You mean, selected_int_kind(0).
> > .
> > You wanted an integer variable capable of storing values between -1 and +1 ?
> > In other words, you wanted an integer variable capable of storing the value 0 [i.e., zero].
> > You have to be joking.
> I was not joking because selected_int_kind(1) requires all 19 integers n in the range -10 < n < +10 to be available. If there was a compiler allowing 4-bit integers, hence 16 different possible values, then selected_int_kind(0) would be a way to get them. I note that the f2018 standard does not say that r has to be non-negative. And indeed the program below prints 127 with g95 and gfortran, showing that their lowest integer kind has 8 bits. (I don't have access to a computer with ifort this morning to test what it would do.)

Sorry, I forgot to provide the 3-line program:

integer, parameter:: ifew = selected_int_kind(-1)
print *, huge(0_ifew)
end program

Re: Deallocate problem

<dcab170e-97c8-4b9f-9a4e-4ef70750937en@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2914&group=comp.lang.fortran#2914

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:4729:b0:6ce:e55:b6ab with SMTP id bs41-20020a05620a472900b006ce0e55b6abmr11254608qkb.36.1663553398913;
Sun, 18 Sep 2022 19:09:58 -0700 (PDT)
X-Received: by 2002:ae9:df01:0:b0:6bb:4e95:6a59 with SMTP id
t1-20020ae9df01000000b006bb4e956a59mr11780022qkf.339.1663553398750; Sun, 18
Sep 2022 19:09:58 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sun, 18 Sep 2022 19:09:58 -0700 (PDT)
In-Reply-To: <QCHVK.444040$Ny99.120267@fx16.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <tfkp70$1ucf3$1@dont-email.me> <a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me> <54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
<tfsc4a$2ten9$1@dont-email.me> <1EmUK.25619$0qy7.14525@fx40.iad>
<c0bf1204-f374-429c-8f0a-699f05eb8bfdn@googlegroups.com> <68aee1d5-33f4-417f-bece-5fbc2dc488c7n@googlegroups.com>
<324e6283-0f52-43bd-8fe9-09c95fed3412n@googlegroups.com> <fe18dcad-4382-435f-8cc5-015352b9a9b4n@googlegroups.com>
<QCHVK.444040$Ny99.120267@fx16.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <dcab170e-97c8-4b9f-9a4e-4ef70750937en@googlegroups.com>
Subject: Re: Deallocate problem
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Mon, 19 Sep 2022 02:09:58 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2855
 by: Robin Vowels - Mon, 19 Sep 2022 02:09 UTC

On Monday, September 19, 2022 at 2:24:21 AM UTC+10, Ron Shepard wrote:
> On 9/18/22 4:28 AM, Robin Vowels wrote:
> > On Sunday, September 18, 2022 at 2:05:48 PM UTC+10, jfh wrote:
> >
> >> Someone trying one of my programs with Silverfrost told me years ago that it wouldn't compile because i had tried to declare an integer variable with the smallest number of bits with selected-int-kind(0) .
> > You mean, selected_int_kind(0).
> > .
> > You wanted an integer variable capable of storing values between -1 and +1 ?
> > In other words, you wanted an integer variable capable of storing the value 0 [i.e., zero].
> > You have to be joking.
..
> If there were ever a 1-bit integer kind introduced into the language,
> then how would it be specified?
..
Well, selected_int_kind(0) won't do it, because the only value that
could be stored is '0'. And maybe -1 if 2 bits are allocated.
..
Might need a BIT type for that.
..
> selected_int_kind(1) would require at
> least 5 bits, rounded up to 8-bits on most modern computers. So unless
> the selected_int_kind() function is changed somehow (e.g. to specify
> directly the minimum number of bits), asking for 0 decimal digits might
> be the only way -- you ask for 0-bits and it would get rounded up to 1-bit.

Re: Deallocate problem

<0dc8f118-801f-4f21-861e-d312499634ddn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2915&group=comp.lang.fortran#2915

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a0c:a90a:0:b0:4ad:715:897 with SMTP id y10-20020a0ca90a000000b004ad07150897mr13319316qva.114.1663565366527;
Sun, 18 Sep 2022 22:29:26 -0700 (PDT)
X-Received: by 2002:a05:622a:15c4:b0:35b:b493:f8fb with SMTP id
d4-20020a05622a15c400b0035bb493f8fbmr13811010qty.300.1663565366395; Sun, 18
Sep 2022 22:29:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sun, 18 Sep 2022 22:29:26 -0700 (PDT)
In-Reply-To: <fe18dcad-4382-435f-8cc5-015352b9a9b4n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:871:6a3c:c79b:784d;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:871:6a3c:c79b:784d
References: <tfkp70$1ucf3$1@dont-email.me> <a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me> <54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
<tfsc4a$2ten9$1@dont-email.me> <1EmUK.25619$0qy7.14525@fx40.iad>
<c0bf1204-f374-429c-8f0a-699f05eb8bfdn@googlegroups.com> <68aee1d5-33f4-417f-bece-5fbc2dc488c7n@googlegroups.com>
<324e6283-0f52-43bd-8fe9-09c95fed3412n@googlegroups.com> <fe18dcad-4382-435f-8cc5-015352b9a9b4n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0dc8f118-801f-4f21-861e-d312499634ddn@googlegroups.com>
Subject: Re: Deallocate problem
From: gah4@u.washington.edu (gah4)
Injection-Date: Mon, 19 Sep 2022 05:29:26 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2112
 by: gah4 - Mon, 19 Sep 2022 05:29 UTC

On Sunday, September 18, 2022 at 2:28:11 AM UTC-7, Robin Vowels wrote:

(snip)

> You mean, selected_int_kind(0).
> You wanted an integer variable capable of storing values between -1 and +1 ?
> In other words, you wanted an integer variable capable of storing the value 0 [i.e., zero].
> You have to be joking.

No. It is supposed to be a kind that can hold at least that many digits.

But okay, a selected_int_kind(1) should hold at least between -9 and +9.

Selected_int_kind(0) could be less, or maybe not.

Re: Deallocate problem

<ced0fa6e-b483-466f-a62a-4d737f772397n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2916&group=comp.lang.fortran#2916

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:424c:b0:6be:78d5:ec73 with SMTP id w12-20020a05620a424c00b006be78d5ec73mr11747914qko.579.1663566214432;
Sun, 18 Sep 2022 22:43:34 -0700 (PDT)
X-Received: by 2002:ac8:578c:0:b0:35c:d9fe:98f7 with SMTP id
v12-20020ac8578c000000b0035cd9fe98f7mr9102821qta.360.1663566214221; Sun, 18
Sep 2022 22:43:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sun, 18 Sep 2022 22:43:34 -0700 (PDT)
In-Reply-To: <dcab170e-97c8-4b9f-9a4e-4ef70750937en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=115.189.86.170; posting-account=KnYfEgoAAAD1tUJTvdAUZ3XojNa5tezZ
NNTP-Posting-Host: 115.189.86.170
References: <tfkp70$1ucf3$1@dont-email.me> <a1aa6852-cdd1-4b09-84d4-18a6e63bffcbn@googlegroups.com>
<tfnd1h$291l0$1@dont-email.me> <54ea6c9c-48b1-4e7f-8a80-a07366a6d812n@googlegroups.com>
<tfsc4a$2ten9$1@dont-email.me> <1EmUK.25619$0qy7.14525@fx40.iad>
<c0bf1204-f374-429c-8f0a-699f05eb8bfdn@googlegroups.com> <68aee1d5-33f4-417f-bece-5fbc2dc488c7n@googlegroups.com>
<324e6283-0f52-43bd-8fe9-09c95fed3412n@googlegroups.com> <fe18dcad-4382-435f-8cc5-015352b9a9b4n@googlegroups.com>
<QCHVK.444040$Ny99.120267@fx16.iad> <dcab170e-97c8-4b9f-9a4e-4ef70750937en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ced0fa6e-b483-466f-a62a-4d737f772397n@googlegroups.com>
Subject: Re: Deallocate problem
From: harperjf2@gmail.com (jfh)
Injection-Date: Mon, 19 Sep 2022 05:43:34 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4169
 by: jfh - Mon, 19 Sep 2022 05:43 UTC

On Monday, September 19, 2022 at 2:10:00 PM UTC+12, Robin Vowels wrote:
> On Monday, September 19, 2022 at 2:24:21 AM UTC+10, Ron Shepard wrote:
> > On 9/18/22 4:28 AM, Robin Vowels wrote: am
> > > On Sunday, September 18, 2022 at 2:05:48 PM UTC+10, jfh wrote:
> > >
> > >> Someone trying one of my programs with Silverfrost told me years ago that it wouldn't compile because i had tried to declare an integer variable with the smallest number of bits with selected-int-kind(0) .
> > > You mean, selected_int_kind(0).
> > > .
> > > You wanted an integer variable capable of storing values between -1 and +1 ?
> > > In other words, you wanted an integer variable capable of storing the value 0 [i.e., zero].
> > > You have to be joking.
> .
> > If there were ever a 1-bit integer kind introduced into the language,
> > then how would it be specified?
> .
> Well, selected_int_kind(0) won't do it, because the only value that
> could be stored is '0'. And maybe -1 if 2 bits are allocated.
> .
> Might need a BIT type for that.
> .
> > selected_int_kind(1) would require at
> > least 5 bits, rounded up to 8-bits on most modern compute

s. So unless
> > the selected_int_kind() function is changed somehow (e.g. to specify
> > directly the minimum number of bits), asking for 0 decimal digits might
> > be the only way -- you ask for 0-bits and it would get rounded up to 1-bit.

Robin Vowels seems to assume that selected_int_kind(0) is asking for an integer kind that can only provide integers n such that -1 < n < 1. It is not.. It is asking for the integer kind with the least decimal exponent range that includes 0. I have now found that ifort agrees with gfortran and g95 by giving 8-bit integers with huge = 127. If Robin were right then selected_int_kind(1) would give an integer type that allows -10 < n < 10 but not one that allows -100 < n < 100. I was not surprised that all three of those compilers print 127 four times with this program, and they are standard-conforming in that respect because none of those compilers has a 4-bit integer type. My revised 4-line program:

integer, parameter:: ineg = selected_int_kind(-1), i0 = selected_int_kind(0),&
i1 = selected_int_kind(1), i2 = selected_int_kind(2)
print *, huge(0_ineg),huge(0_i0),huge(0_i1),huge(0_i2)
end program

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor