- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Can you have a look on the attached simplified program whose purpose is to highlight an abnormal behaviour when assigning one derived type to another, using the base type they have in common. If I make some change in the program, it becomes normal.
The different behaviours of the program can be reproduced thanks to the preprocessor options added in the program.
With no preprocessor option, the program ends abnormally with the runtime error : forrtl: severe (122): invalid attempt to assign into a pointer that is not associated:
~ > ifort -g -fpp -trace test_derived_type_assignment.f90
~ > ./a.out
before COPY_TYPE1_TO_TYPE2
forrtl: severe (122): invalid attempt to assign into a pointer that is not associated
Image PC Routine Line Source
a.out 0000000000406BC6 Unknown Unknown Unknown
a.out 0000000000403021 types_copy_mp_cop 136 test_derived_type_assignment.f90
a.out 000000000040324C MAIN__ 169 test_derived_type_assignment.f90
a.out 0000000000402AC2 Unknown Unknown Unknown
libc-2.27.so 00007F692F891B97 __libc_start_main Unknown Unknown
a.out 00000000004029AA Unknown Unknown Unknown
Adding assignment overloading makes the program normal:
~ > ifort -g -fpp -D__ASSIGN_OVERL__ -trace test_derived_type_assignment.f90
~ > ./a.out
before COPY_TYPE1_TO_TYPE2
after COPY_TYPE1_TO_TYPE2
Removing the allocatable component of the base type makes the program normal:
~ > ifort -g -fpp -D__REM_ALLOC_COMPO__ -trace test_derived_type_assignment.f90
~ > ./a.out
before COPY_TYPE1_TO_TYPE2
after COPY_TYPE1_TO_TYPE2
Removing the unused routine COPY_TYPE2_TO_TYPE1 from the module TYPES_COPY makes the program normal:
~ > ifort -g -fpp -D__REM_COPY_ROUT__ -trace test_derived_type_assignment.f90
~ > ./a.out
before COPY_TYPE1_TO_TYPE2
after COPY_TYPE1_TO_TYPE2
Merging the modules TYPES and TYPES_COPY makes the program normal:
~ > ifort -g -fpp -D__MODUL_MERGED__ -trace test_derived_type_assignment.f90
~ > ./a.out
before COPY_TYPE1_TO_TYPE2
after COPY_TYPE1_TO_TYPE2
Can you explain me what I'm doing wrong?
Best regards,
Olivier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please try the current compiler and report what it does.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't reproduce the error using the oneAPI (2021.1.2) compiler on Windows (I don't have Linux.) Which compiler version are you using?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use version ifort (IFORT) 19.1.1.217 20200306 on Linux.
Olivier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please try the current compiler and report what it does.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, but I don't have the last version... I cannot afford buying a new licence now...
If anybody can do the test and give the answer, it would be very nice !
Olivier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The current release of the compiler package (OneAPI) does not need a license fee to be paid or a license file to be installed. You may purchase a support contract if you wish. You may download the portions that you want, using these links.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much for your suggestions !
I have installed the new version of the compiler for free (thanks to Intel too) and it works fine: the anomally has disappeared.
Olivier

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page