- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Consider the following code that attempts to create a coarray derived type containing an array of variable-length allocatable character types.
program testCoarrayJaggedArray implicit none integer :: i type :: CharVec_type character(:), allocatable :: record end type type :: List_type type(CharVec_type), allocatable :: Item(:) end type type(List_type) :: List
write(*,*) this_image(), List%Item(i)%record
end do end if end program testCoarrayJaggedArray
Intel's ifort 2018 in debug mode, shared-memory coarray, complains about several aspects of this code. Here is the first one:
ifort /debug /Qcoarray=shared /standard-semantics /traceback /gen-interfaces /check /fpe:0 main.f90 -o run.exe Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.2.185 Build 20180210 Copyright (C) 1985-2018 Intel Corporation. All rights reserved. main.f90(30): error #6457: This derived type name has not been declared. [CHARACTER] allocate( character( len(List[1]%Item(i)%record) ) :: List%Item(i)%record ) ------------------^ main.f90(30): error #8235: If type specification appears, the type and kind type parameters of each object being allocated must be the same as type and kind type parameters of the type specification. [RECORD] allocate( character( len(List[1]%Item(i)%record) ) :: List%Item(i)%record ) ---------------------------------------------------------------------------^ compilation aborted for main.f90 (code 1)
Is this code non-standard Fortran? In particular the line that allocates a character type using the length of the corresponding character on the first image:
allocate( character( len(List[1]%Item(i)%record) ) :: List%Item(i)%record )
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The syntax appears to be confusing the compiler. I suggest you lodge a ticket.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The syntax appears to be confusing the compiler. I suggest you lodge a ticket.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page