Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Parameterized Derived Types

Aaron_Schutte
Beginner
911 Views
Will ifort be supporting parameterized derived types any time soon? It seems this is one of the last major F2003 functionalities currently not supported by ifort.
0 Kudos
5 Replies
Steven_L_Intel1
Employee
911 Views
"Soon"? No. This and User-defined derived type I/O are the two big things not yet done. Is this something you're looking for specifically? We will do it eventually, I am sure.
0 Kudos
Aaron_Schutte
Beginner
911 Views
Yes, I am specifically looking for this so that I can implement C++ template style algorithms into my code.
0 Kudos
weymouth_mit
Beginner
911 Views

Any update on this? I would like to use this for setting the 'len' parameters of a derived type. Rather than put allocatable arrays in types, this seems cleaner (the array size would be fixed automatically) and safer (the compiler could tell you if you try to add two different sized pieces for instance). 

0 Kudos
jimdempseyatthecove
Honored Contributor III
911 Views

Additionaly you would not have an issue with reallocate left hand side.

The initial poster indicated that he wanted to use a derived type as a parameter (whole object is const)

Weymouth is asking for something more like a template. Where instance of the template results in an object with fixed layout based on a flexible template. In the requested case, a fixed array size based on template arguments. You might be able to finess some of this with FPP.

Jim Dempsey

0 Kudos
Izaak_Beekman
New Contributor II
911 Views

There is also an open source preprocessor implemented in python called BlockIt/PyF95++ which implements templating and an STL of sorts.

http://sourceforge.net/apps/mediawiki/blockit/index.php?title=Main_Page

A few articles have been posted to ACM Fortran Forum about this (and other) preprocessors.

0 Kudos
Reply