From: Harald Anlauf <anlauf@gmx.de>
To: Paul Richard Thomas <paul.richard.thomas@gmail.com>
Cc: Alessandro Fanfarillo <alessandro.fanfarillo@gmail.com>,
Andrew Benson <abenson@carnegiescience.edu>,
"fortran@gcc.gnu.org" <fortran@gcc.gnu.org>
Subject: Re: [Patch, fortran] PR37336 (Finalization) - [F03] Finish derived-type finalization
Date: Thu, 17 Feb 2022 21:55:37 +0100 [thread overview]
Message-ID: <888688e4-5175-d37d-ff8c-3e3d267bb0a3@gmx.de> (raw)
In-Reply-To: <CAGkQGiL8tptn_PQCRebtEHkG3XhwSwBarU5oB4arm--S=OcxNw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 752 bytes --]
Hi Paul,
Am 16.02.22 um 19:49 schrieb Paul Richard Thomas via Fortran:
> Hi Harald and Jerry,
>
> I have gone back to the start and have gone through finalizable derived
> type assignments with the F2018 in hand. I have had a dreadful time with
> direct by reference function calls and still am struggling with assignment
> number 6 in the attached. I would be very grateful if you would run this
> testcase for the other brands.
please find attached the output of crayftn-12.0.3, NAG 7.0, and
Intel 2021.5.0, always both default optimization and -g.
The junk in the output for some brands is reproducible. :-(
> As soon as I fix the 6th assignment, I will get on to class assignments.
Good luck, then. ;-)
Cheers,
Harald
[-- Attachment #2: out.cray --]
[-- Type: text/plain, Size: 3675 bytes --]
finalize simple - ThyType%ind = 21
finalize simple - ThyType2%ind = 22
At start of program: final_count = 2
*******************************************************************
1st assignment: No finalization because MyType unallocated.
After 1st assignment(var not allocated): final_count = 2(0)
*******************************************************************
2nd assignment: MyType(=simple(1,MyType) finalized before assignment
finalize simple - Mytype2%ind = 1
After 2nd assignment(var allocated): final_count = 1(1)
*******************************************************************
3rd assignment: MyTypeArray(%ind = [41 42]) finalized before assignment
finalize simple(:) - MyTypeArray%ind= 42 43
finalize simple(:) - ThyType%ind= 21 22
After 3rd assignment(array var allocated): final_count = 2(1)
*******************************************************************
Deallocation generates final call with self = simple (21, ThyType)
4th assignment: MyTypeArray finalized before assignment
Mtype finalized before assignment with self = simple (11, MyType)
Function result finalized after assignment with self = simple (99, MyType)
finalize simple - ThyType%ind = 21
finalize simple - MyType%ind = 11
finalize simple - MyType%ind = 99
finalize simple - MyType%ind = 99
After 4th assignment(array var allocated) :final_count = 4(3)
*******************************************************************
5th assignment: MyTypeArray finalized before assignment
1] First finalization is of 'res' in constructor3 with:
Self = [complicated (-1, constructor3, 0.0), complicated (-1, ThyTypeArra1, 0.0)]
2] ThyTypeArray is finalized before assignment and after evaluation of constructor3
Self = [3 times complicated (-1, ThyTypeArra1,0.0)]
3] Function result finalized after assignment with
Self = [complicated (-1, ThyTypeArra2, 0.0), complicated (-1, ThyTypeArra2, 0.0)]
finalize complicated - ThyTypeArra1 = -1 0.00
finalize simple - ThyTypeArra1%ind = -1
constructor3: final_count = 2
finalize complicated(2) - constructor3 = 0 41 0.00 0.00
finalize simple(:) - constructor3%ind= 0 41
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
After 5th assignment(array var allocated): 8(6)
*******************************************************************
Deallocate ThyTypeArray.
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
*******************************************************************
6th assignment: A repeat of the previous with an allocatable function result.
This should give the same result as the 5th assignment.
finalize complicated - ThyTypeArra1 = -1 0.00
finalize simple - ThyTypeArra1%ind = -1
constructor4: final_count = 2
finalize complicated - constructor3 = 1 1.00
finalize simple - constructor3%ind = 1
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
After 6th assignment(array var allocated): 8(6)
*******************************************************************
Deallocations at end
finalize simple - MyType%ind = 99
After 1st deallocation: 1
finalize simple - ThyType2%ind = 22
After 2nd deallocation: 2
finalize simple(:) - ThyType%ind= 21 22
After 3rd deallocation: 3
[-- Attachment #3: out.intel --]
[-- Type: application/octet-stream, Size: 3808 bytes --]
[-- Attachment #4: out.nag --]
[-- Type: text/plain, Size: 3639 bytes --]
At start of program: final_count = 0
*******************************************************************
1st assignment: No finalization because MyType unallocated.
After 1st assignment(var not allocated): final_count = 0(0)
*******************************************************************
2nd assignment: MyType(=simple(1,MyType) finalized before assignment
finalize simple - Mytype2%ind = 1
After 2nd assignment(var allocated): final_count = 1(1)
*******************************************************************
3rd assignment: MyTypeArray(%ind = [41 42]) finalized before assignment
finalize simple(:) - MyTypeArray%ind= 42 43
After 3rd assignment(array var allocated): final_count = 1(1)
*******************************************************************
Deallocation generates final call with self = simple (21, ThyType)
4th assignment: MyTypeArray finalized before assignment
Mtype finalized before assignment with self = simple (11, MyType)
Function result finalized after assignment with self = simple (99, MyType)
finalize simple - ThyType%ind = 21
finalize simple - MyType%ind = 11
After 4th assignment(array var allocated) :final_count = 2(3)
*******************************************************************
5th assignment: MyTypeArray finalized before assignment
1] First finalization is of 'res' in constructor3 with:
Self = [complicated (-1, constructor3, 0.0), complicated (-1, ThyTypeArra1, 0.0)]
2] ThyTypeArray is finalized before assignment and after evaluation of constructor3
Self = [3 times complicated (-1, ThyTypeArra1,0.0)]
3] Function result finalized after assignment with
Self = [complicated (-1, ThyTypeArra2, 0.0), complicated (-1, ThyTypeArra2, 0.0)]
constructor3: final_count = 0
finalize complicated(2) - constructor3 = 0 0 0.00 0.00
finalize simple(:) - constructor3%ind= 0 0
finalize complicated(3) - ThyTypeArra1 = -1 -1 -1 0.00 0.00 0.00
finalize simple(:) - ThyTypeArra1%ind= -1 -1 -1
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
finalize complicated(2) - ª\x7f\0\0ypeArra2 = **** 3 2.00 4.00
finalize simple(:) - ª\x7f\0\0ypeArra2%ind= **** 3
finalize complicated(2) - ª\x7f\0\0ypeArra2 = **** 3 2.00 4.00
finalize simple(:) - ª\x7f\0\0ypeArra2%ind= **** 3
After 5th assignment(array var allocated): 10(6)
*******************************************************************
Deallocate ThyTypeArray.
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
*******************************************************************
6th assignment: A repeat of the previous with an allocatable function result.
This should give the same result as the 5th assignment.
constructor4: final_count = 0
finalize complicated(2) - constructor4 = 1 1 1.00 1.00
finalize simple(:) - constructor4%ind= 1 1
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
finalize complicated(3) - ThyTypeArra1 = -1 -1 -1 0.00 0.00 0.00
finalize simple(:) - ThyTypeArra1%ind= -1 -1 -1
After 6th assignment(array var allocated): 6(6)
*******************************************************************
Deallocations at end
finalize simple - MyType%ind = 99
After 1st deallocation: 1
finalize simple - ThyType2%ind = 22
After 2nd deallocation: 2
finalize simple(:) - ThyType%ind= 21 22
After 3rd deallocation: 3
[-- Attachment #5: out.intel-g --]
[-- Type: application/octet-stream, Size: 3808 bytes --]
[-- Attachment #6: out.cray-g --]
[-- Type: text/plain, Size: 3675 bytes --]
finalize simple - ThyType%ind = 21
finalize simple - ThyType2%ind = 22
At start of program: final_count = 2
*******************************************************************
1st assignment: No finalization because MyType unallocated.
After 1st assignment(var not allocated): final_count = 2(0)
*******************************************************************
2nd assignment: MyType(=simple(1,MyType) finalized before assignment
finalize simple - Mytype2%ind = 1
After 2nd assignment(var allocated): final_count = 1(1)
*******************************************************************
3rd assignment: MyTypeArray(%ind = [41 42]) finalized before assignment
finalize simple(:) - MyTypeArray%ind= 42 43
finalize simple(:) - ThyType%ind= 21 22
After 3rd assignment(array var allocated): final_count = 2(1)
*******************************************************************
Deallocation generates final call with self = simple (21, ThyType)
4th assignment: MyTypeArray finalized before assignment
Mtype finalized before assignment with self = simple (11, MyType)
Function result finalized after assignment with self = simple (99, MyType)
finalize simple - ThyType%ind = 21
finalize simple - MyType%ind = 11
finalize simple - MyType%ind = 99
finalize simple - MyType%ind = 99
After 4th assignment(array var allocated) :final_count = 4(3)
*******************************************************************
5th assignment: MyTypeArray finalized before assignment
1] First finalization is of 'res' in constructor3 with:
Self = [complicated (-1, constructor3, 0.0), complicated (-1, ThyTypeArra1, 0.0)]
2] ThyTypeArray is finalized before assignment and after evaluation of constructor3
Self = [3 times complicated (-1, ThyTypeArra1,0.0)]
3] Function result finalized after assignment with
Self = [complicated (-1, ThyTypeArra2, 0.0), complicated (-1, ThyTypeArra2, 0.0)]
finalize complicated - ThyTypeArra1 = -1 0.00
finalize simple - ThyTypeArra1%ind = -1
constructor3: final_count = 2
finalize complicated(2) - constructor3 = ******** 0.00 0.00
finalize simple(:) - constructor3%ind= ********
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
After 5th assignment(array var allocated): 8(6)
*******************************************************************
Deallocate ThyTypeArray.
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
*******************************************************************
6th assignment: A repeat of the previous with an allocatable function result.
This should give the same result as the 5th assignment.
finalize complicated - ThyTypeArra1 = -1 0.00
finalize simple - ThyTypeArra1%ind = -1
constructor4: final_count = 2
finalize complicated - constructor3 = 1 1.00
finalize simple - constructor3%ind = 1
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
After 6th assignment(array var allocated): 8(6)
*******************************************************************
Deallocations at end
finalize simple - MyType%ind = 99
After 1st deallocation: 1
finalize simple - ThyType2%ind = 22
After 2nd deallocation: 2
finalize simple(:) - ThyType%ind= 21 22
After 3rd deallocation: 3
[-- Attachment #7: out.nag-g --]
[-- Type: text/plain, Size: 3565 bytes --]
At start of program: final_count = 0
*******************************************************************
1st assignment: No finalization because MyType unallocated.
After 1st assignment(var not allocated): final_count = 0(0)
*******************************************************************
2nd assignment: MyType(=simple(1,MyType) finalized before assignment
finalize simple - Mytype2%ind = 1
After 2nd assignment(var allocated): final_count = 1(1)
*******************************************************************
3rd assignment: MyTypeArray(%ind = [41 42]) finalized before assignment
finalize simple(:) - MyTypeArray%ind= 42 43
After 3rd assignment(array var allocated): final_count = 1(1)
*******************************************************************
Deallocation generates final call with self = simple (21, ThyType)
4th assignment: MyTypeArray finalized before assignment
Mtype finalized before assignment with self = simple (11, MyType)
Function result finalized after assignment with self = simple (99, MyType)
finalize simple - ThyType%ind = 21
finalize simple - MyType%ind = 11
After 4th assignment(array var allocated) :final_count = 2(3)
*******************************************************************
5th assignment: MyTypeArray finalized before assignment
1] First finalization is of 'res' in constructor3 with:
Self = [complicated (-1, constructor3, 0.0), complicated (-1, ThyTypeArra1, 0.0)]
2] ThyTypeArray is finalized before assignment and after evaluation of constructor3
Self = [3 times complicated (-1, ThyTypeArra1,0.0)]
3] Function result finalized after assignment with
Self = [complicated (-1, ThyTypeArra2, 0.0), complicated (-1, ThyTypeArra2, 0.0)]
constructor3: final_count = 0
finalize complicated(2) - constructor3 = 0 0 0.00 0.00
finalize simple(:) - constructor3%ind= 0 0
finalize complicated(3) - ThyTypeArra1 = -1 -1 -1 0.00 0.00 0.00
finalize simple(:) - ThyTypeArra1%ind= -1 -1 -1
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
finalize complicated(2) - .\x7f\0\0ypeArra2 = **** 3 2.00 4.00
finalize simple(:) - .\x7f\0\0ypeArra2%ind= **** 3
finalize complicated(2) - .\x7f\0\0ypeArra2 = **** 3 2.00 4.00
finalize simple(:) - .\x7f\0\0ypeArra2%ind= **** 3
After 5th assignment(array var allocated): 10(6)
*******************************************************************
Deallocate ThyTypeArray.
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
*******************************************************************
6th assignment: A repeat of the previous with an allocatable function result.
This should give the same result as the 5th assignment.
constructor4: final_count = 0
finalize complicated(2) - constructor4 = 1 1 1.00 1.00
finalize simple(:) - constructor4%ind= 1 1
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
finalize complicated(3) - ThyTypeArra1 = -1 -1 -1 0.00 0.00 0.00
finalize simple(:) - ThyTypeArra1%ind= -1 -1 -1
After 6th assignment(array var allocated): 6(6)
*******************************************************************
Deallocations at end
finalize simple - MyType%ind = 99
After 1st deallocation: 1
finalize simple - ThyType2%ind = 22
After 2nd deallocation: 2
finalize simple(:) - ThyType%ind= 21 22
After 3rd deallocation: 3
WARNING: multiple messages have this Message-ID
From: Harald Anlauf <anlauf@gmx.de>
To: fortran@gcc.gnu.org
Cc: Alessandro Fanfarillo <alessandro.fanfarillo@gmail.com>,
Andrew Benson <abenson@carnegiescience.edu>,
"fortran@gcc.gnu.org" <fortran@gcc.gnu.org>
Subject: Re: [Patch, fortran] PR37336 (Finalization) - [F03] Finish derived-type finalization
Date: Thu, 17 Feb 2022 21:55:37 +0100 [thread overview]
Message-ID: <888688e4-5175-d37d-ff8c-3e3d267bb0a3@gmx.de> (raw)
Message-ID: <20220217205537.M26DiHIatG0pqE44OQGcwK5sqj3GqBtLFfHOCmH-n18@z> (raw)
In-Reply-To: <CAGkQGiL8tptn_PQCRebtEHkG3XhwSwBarU5oB4arm--S=OcxNw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 730 bytes --]
Hi Paul,
Am 16.02.22 um 19:49 schrieb Paul Richard Thomas via Fortran:
> Hi Harald and Jerry,
>
> I have gone back to the start and have gone through finalizable derived
> type assignments with the F2018 in hand. I have had a dreadful time with
> direct by reference function calls and still am struggling with assignment
> number 6 in the attached. I would be very grateful if you would run this
> testcase for the other brands.
please find attached the output of crayftn-12.0.3, NAG 7.0, and
Intel 2021.5.0, always both default optimization and -g.
The junk in the output for some brands is reproducible. :-(
> As soon as I fix the 6th assignment, I will get on to class assignments.
Good luck, then. ;-)
Cheers,
Harald
[-- Attachment #2: out.cray --]
[-- Type: text/plain, Size: 3675 bytes --]
finalize simple - ThyType%ind = 21
finalize simple - ThyType2%ind = 22
At start of program: final_count = 2
*******************************************************************
1st assignment: No finalization because MyType unallocated.
After 1st assignment(var not allocated): final_count = 2(0)
*******************************************************************
2nd assignment: MyType(=simple(1,MyType) finalized before assignment
finalize simple - Mytype2%ind = 1
After 2nd assignment(var allocated): final_count = 1(1)
*******************************************************************
3rd assignment: MyTypeArray(%ind = [41 42]) finalized before assignment
finalize simple(:) - MyTypeArray%ind= 42 43
finalize simple(:) - ThyType%ind= 21 22
After 3rd assignment(array var allocated): final_count = 2(1)
*******************************************************************
Deallocation generates final call with self = simple (21, ThyType)
4th assignment: MyTypeArray finalized before assignment
Mtype finalized before assignment with self = simple (11, MyType)
Function result finalized after assignment with self = simple (99, MyType)
finalize simple - ThyType%ind = 21
finalize simple - MyType%ind = 11
finalize simple - MyType%ind = 99
finalize simple - MyType%ind = 99
After 4th assignment(array var allocated) :final_count = 4(3)
*******************************************************************
5th assignment: MyTypeArray finalized before assignment
1] First finalization is of 'res' in constructor3 with:
Self = [complicated (-1, constructor3, 0.0), complicated (-1, ThyTypeArra1, 0.0)]
2] ThyTypeArray is finalized before assignment and after evaluation of constructor3
Self = [3 times complicated (-1, ThyTypeArra1,0.0)]
3] Function result finalized after assignment with
Self = [complicated (-1, ThyTypeArra2, 0.0), complicated (-1, ThyTypeArra2, 0.0)]
finalize complicated - ThyTypeArra1 = -1 0.00
finalize simple - ThyTypeArra1%ind = -1
constructor3: final_count = 2
finalize complicated(2) - constructor3 = 0 41 0.00 0.00
finalize simple(:) - constructor3%ind= 0 41
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
After 5th assignment(array var allocated): 8(6)
*******************************************************************
Deallocate ThyTypeArray.
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
*******************************************************************
6th assignment: A repeat of the previous with an allocatable function result.
This should give the same result as the 5th assignment.
finalize complicated - ThyTypeArra1 = -1 0.00
finalize simple - ThyTypeArra1%ind = -1
constructor4: final_count = 2
finalize complicated - constructor3 = 1 1.00
finalize simple - constructor3%ind = 1
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
After 6th assignment(array var allocated): 8(6)
*******************************************************************
Deallocations at end
finalize simple - MyType%ind = 99
After 1st deallocation: 1
finalize simple - ThyType2%ind = 22
After 2nd deallocation: 2
finalize simple(:) - ThyType%ind= 21 22
After 3rd deallocation: 3
[-- Attachment #3: out.intel --]
[-- Type: application/octet-stream, Size: 3808 bytes --]
[-- Attachment #4: out.nag --]
[-- Type: text/plain, Size: 3639 bytes --]
At start of program: final_count = 0
*******************************************************************
1st assignment: No finalization because MyType unallocated.
After 1st assignment(var not allocated): final_count = 0(0)
*******************************************************************
2nd assignment: MyType(=simple(1,MyType) finalized before assignment
finalize simple - Mytype2%ind = 1
After 2nd assignment(var allocated): final_count = 1(1)
*******************************************************************
3rd assignment: MyTypeArray(%ind = [41 42]) finalized before assignment
finalize simple(:) - MyTypeArray%ind= 42 43
After 3rd assignment(array var allocated): final_count = 1(1)
*******************************************************************
Deallocation generates final call with self = simple (21, ThyType)
4th assignment: MyTypeArray finalized before assignment
Mtype finalized before assignment with self = simple (11, MyType)
Function result finalized after assignment with self = simple (99, MyType)
finalize simple - ThyType%ind = 21
finalize simple - MyType%ind = 11
After 4th assignment(array var allocated) :final_count = 2(3)
*******************************************************************
5th assignment: MyTypeArray finalized before assignment
1] First finalization is of 'res' in constructor3 with:
Self = [complicated (-1, constructor3, 0.0), complicated (-1, ThyTypeArra1, 0.0)]
2] ThyTypeArray is finalized before assignment and after evaluation of constructor3
Self = [3 times complicated (-1, ThyTypeArra1,0.0)]
3] Function result finalized after assignment with
Self = [complicated (-1, ThyTypeArra2, 0.0), complicated (-1, ThyTypeArra2, 0.0)]
constructor3: final_count = 0
finalize complicated(2) - constructor3 = 0 0 0.00 0.00
finalize simple(:) - constructor3%ind= 0 0
finalize complicated(3) - ThyTypeArra1 = -1 -1 -1 0.00 0.00 0.00
finalize simple(:) - ThyTypeArra1%ind= -1 -1 -1
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
finalize complicated(2) - ª\x7f\0\0ypeArra2 = **** 3 2.00 4.00
finalize simple(:) - ª\x7f\0\0ypeArra2%ind= **** 3
finalize complicated(2) - ª\x7f\0\0ypeArra2 = **** 3 2.00 4.00
finalize simple(:) - ª\x7f\0\0ypeArra2%ind= **** 3
After 5th assignment(array var allocated): 10(6)
*******************************************************************
Deallocate ThyTypeArray.
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
*******************************************************************
6th assignment: A repeat of the previous with an allocatable function result.
This should give the same result as the 5th assignment.
constructor4: final_count = 0
finalize complicated(2) - constructor4 = 1 1 1.00 1.00
finalize simple(:) - constructor4%ind= 1 1
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
finalize complicated(3) - ThyTypeArra1 = -1 -1 -1 0.00 0.00 0.00
finalize simple(:) - ThyTypeArra1%ind= -1 -1 -1
After 6th assignment(array var allocated): 6(6)
*******************************************************************
Deallocations at end
finalize simple - MyType%ind = 99
After 1st deallocation: 1
finalize simple - ThyType2%ind = 22
After 2nd deallocation: 2
finalize simple(:) - ThyType%ind= 21 22
After 3rd deallocation: 3
[-- Attachment #5: out.intel-g --]
[-- Type: application/octet-stream, Size: 3808 bytes --]
[-- Attachment #6: out.cray-g --]
[-- Type: text/plain, Size: 3675 bytes --]
finalize simple - ThyType%ind = 21
finalize simple - ThyType2%ind = 22
At start of program: final_count = 2
*******************************************************************
1st assignment: No finalization because MyType unallocated.
After 1st assignment(var not allocated): final_count = 2(0)
*******************************************************************
2nd assignment: MyType(=simple(1,MyType) finalized before assignment
finalize simple - Mytype2%ind = 1
After 2nd assignment(var allocated): final_count = 1(1)
*******************************************************************
3rd assignment: MyTypeArray(%ind = [41 42]) finalized before assignment
finalize simple(:) - MyTypeArray%ind= 42 43
finalize simple(:) - ThyType%ind= 21 22
After 3rd assignment(array var allocated): final_count = 2(1)
*******************************************************************
Deallocation generates final call with self = simple (21, ThyType)
4th assignment: MyTypeArray finalized before assignment
Mtype finalized before assignment with self = simple (11, MyType)
Function result finalized after assignment with self = simple (99, MyType)
finalize simple - ThyType%ind = 21
finalize simple - MyType%ind = 11
finalize simple - MyType%ind = 99
finalize simple - MyType%ind = 99
After 4th assignment(array var allocated) :final_count = 4(3)
*******************************************************************
5th assignment: MyTypeArray finalized before assignment
1] First finalization is of 'res' in constructor3 with:
Self = [complicated (-1, constructor3, 0.0), complicated (-1, ThyTypeArra1, 0.0)]
2] ThyTypeArray is finalized before assignment and after evaluation of constructor3
Self = [3 times complicated (-1, ThyTypeArra1,0.0)]
3] Function result finalized after assignment with
Self = [complicated (-1, ThyTypeArra2, 0.0), complicated (-1, ThyTypeArra2, 0.0)]
finalize complicated - ThyTypeArra1 = -1 0.00
finalize simple - ThyTypeArra1%ind = -1
constructor3: final_count = 2
finalize complicated(2) - constructor3 = ******** 0.00 0.00
finalize simple(:) - constructor3%ind= ********
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
After 5th assignment(array var allocated): 8(6)
*******************************************************************
Deallocate ThyTypeArray.
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
*******************************************************************
6th assignment: A repeat of the previous with an allocatable function result.
This should give the same result as the 5th assignment.
finalize complicated - ThyTypeArra1 = -1 0.00
finalize simple - ThyTypeArra1%ind = -1
constructor4: final_count = 2
finalize complicated - constructor3 = 1 1.00
finalize simple - constructor3%ind = 1
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
After 6th assignment(array var allocated): 8(6)
*******************************************************************
Deallocations at end
finalize simple - MyType%ind = 99
After 1st deallocation: 1
finalize simple - ThyType2%ind = 22
After 2nd deallocation: 2
finalize simple(:) - ThyType%ind= 21 22
After 3rd deallocation: 3
[-- Attachment #7: out.nag-g --]
[-- Type: text/plain, Size: 3565 bytes --]
At start of program: final_count = 0
*******************************************************************
1st assignment: No finalization because MyType unallocated.
After 1st assignment(var not allocated): final_count = 0(0)
*******************************************************************
2nd assignment: MyType(=simple(1,MyType) finalized before assignment
finalize simple - Mytype2%ind = 1
After 2nd assignment(var allocated): final_count = 1(1)
*******************************************************************
3rd assignment: MyTypeArray(%ind = [41 42]) finalized before assignment
finalize simple(:) - MyTypeArray%ind= 42 43
After 3rd assignment(array var allocated): final_count = 1(1)
*******************************************************************
Deallocation generates final call with self = simple (21, ThyType)
4th assignment: MyTypeArray finalized before assignment
Mtype finalized before assignment with self = simple (11, MyType)
Function result finalized after assignment with self = simple (99, MyType)
finalize simple - ThyType%ind = 21
finalize simple - MyType%ind = 11
After 4th assignment(array var allocated) :final_count = 2(3)
*******************************************************************
5th assignment: MyTypeArray finalized before assignment
1] First finalization is of 'res' in constructor3 with:
Self = [complicated (-1, constructor3, 0.0), complicated (-1, ThyTypeArra1, 0.0)]
2] ThyTypeArray is finalized before assignment and after evaluation of constructor3
Self = [3 times complicated (-1, ThyTypeArra1,0.0)]
3] Function result finalized after assignment with
Self = [complicated (-1, ThyTypeArra2, 0.0), complicated (-1, ThyTypeArra2, 0.0)]
constructor3: final_count = 0
finalize complicated(2) - constructor3 = 0 0 0.00 0.00
finalize simple(:) - constructor3%ind= 0 0
finalize complicated(3) - ThyTypeArra1 = -1 -1 -1 0.00 0.00 0.00
finalize simple(:) - ThyTypeArra1%ind= -1 -1 -1
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
finalize complicated(2) - .\x7f\0\0ypeArra2 = **** 3 2.00 4.00
finalize simple(:) - .\x7f\0\0ypeArra2%ind= **** 3
finalize complicated(2) - .\x7f\0\0ypeArra2 = **** 3 2.00 4.00
finalize simple(:) - .\x7f\0\0ypeArra2%ind= **** 3
After 5th assignment(array var allocated): 10(6)
*******************************************************************
Deallocate ThyTypeArray.
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
*******************************************************************
6th assignment: A repeat of the previous with an allocatable function result.
This should give the same result as the 5th assignment.
constructor4: final_count = 0
finalize complicated(2) - constructor4 = 1 1 1.00 1.00
finalize simple(:) - constructor4%ind= 1 1
finalize complicated(2) - ThyTypeArra2 = 1 3 2.00 4.00
finalize simple(:) - ThyTypeArra2%ind= 1 3
finalize complicated(3) - ThyTypeArra1 = -1 -1 -1 0.00 0.00 0.00
finalize simple(:) - ThyTypeArra1%ind= -1 -1 -1
After 6th assignment(array var allocated): 6(6)
*******************************************************************
Deallocations at end
finalize simple - MyType%ind = 99
After 1st deallocation: 1
finalize simple - ThyType2%ind = 22
After 2nd deallocation: 2
finalize simple(:) - ThyType%ind= 21 22
After 3rd deallocation: 3
next prev parent reply other threads:[~2022-02-17 20:55 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-03 17:14 Paul Richard Thomas
2022-02-07 21:09 ` Harald Anlauf
2022-02-07 21:09 ` Harald Anlauf
2022-02-08 11:22 ` Paul Richard Thomas
2022-02-08 18:29 ` Harald Anlauf
2022-02-08 18:29 ` Harald Anlauf
2022-02-09 2:35 ` Jerry D
2022-02-10 12:25 ` Paul Richard Thomas
2022-02-10 19:49 ` Harald Anlauf
2022-02-10 19:49 ` Harald Anlauf
2022-02-11 2:15 ` Jerry D
2022-02-11 9:08 ` Paul Richard Thomas
2022-02-11 21:08 ` Harald Anlauf
2022-02-11 21:08 ` Harald Anlauf
2022-02-11 21:59 ` Paul Richard Thomas
2022-02-16 18:49 ` Paul Richard Thomas
2022-02-17 20:55 ` Harald Anlauf [this message]
2022-02-17 20:55 ` Harald Anlauf
2022-02-17 21:23 ` Thomas Koenig
2022-02-18 18:06 ` Paul Richard Thomas
2023-01-02 13:15 ` Paul Richard Thomas
[not found] ` <trinity-a4069639-4079-4f60-b928-1fec82384b1e-1672953005015@3c-app-gmx-bap48>
2023-01-05 21:14 ` Fw: " Harald Anlauf
2023-01-06 3:08 ` Jerry D
2023-01-06 8:33 ` Harald Anlauf
2023-01-07 10:57 ` Paul Richard Thomas
2023-01-07 15:28 ` Thomas Koenig
2023-01-07 18:35 ` Paul Richard Thomas
2023-01-08 12:03 ` Thomas Koenig
2023-01-08 13:42 ` Paul Richard Thomas
2023-01-09 20:42 ` Aw: " Harald Anlauf
2023-01-11 20:56 ` Harald Anlauf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=888688e4-5175-d37d-ff8c-3e3d267bb0a3@gmx.de \
--to=anlauf@gmx.de \
--cc=abenson@carnegiescience.edu \
--cc=alessandro.fanfarillo@gmail.com \
--cc=fortran@gcc.gnu.org \
--cc=paul.richard.thomas@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).