Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

select character type

Blane_J_
New Contributor I
128 Views

Here is the situation: I use unlimited polymorphic variable as dummy argument and in select section, how can I select character type with specified length(assume length 1) ? I've tried:

SELECT TYPE(var)
TYPE IS(CHARACTER(1))
   ....
TYPE IS(CHARACTER*1)
   ....
TYPE IS(CHARACTER(LEN=1))
   ....
END SELECT

But none of the above is correct. and only TYPE IS(CHARACTER(*)) can pass the compilation. Appreciate anyone can show me an example.

0 Kudos
1 Solution
Xiaoping_D_Intel
Employee
128 Views

It has been written in the compiler documentation "SELECT TYPE" description:

 

type

Is an intrinsic type specifier or a derived-type specifier. It must specify that each length type parameter is assumed. It cannot be a sequence derived type or a type with the BIND attribute

 

So only ""CHARACTER(*)" will be accepted by the compiler.

 

Thanks,

Xiaoping Duan

Intel Customer Support

View solution in original post

2 Replies
Xiaoping_D_Intel
Employee
129 Views

It has been written in the compiler documentation "SELECT TYPE" description:

 

type

Is an intrinsic type specifier or a derived-type specifier. It must specify that each length type parameter is assumed. It cannot be a sequence derived type or a type with the BIND attribute

 

So only ""CHARACTER(*)" will be accepted by the compiler.

 

Thanks,

Xiaoping Duan

Intel Customer Support

View solution in original post

Blane_J_
New Contributor I
128 Views

Oh, I see. Than additional tests should be made within TYPE IS block, thanks Xiaoping.

Reply