0

I have a question about creating a linked list in FORTRAN. I hope some one has some ideas for me! I want to create a list which contain some nodes and every node has one function. Is it possible to do this or not? And can I use linked list for this purpose?

TYPE NODE
     INTEGER                 :: handle
     DOUBLE PRECISION, FUNCTION      :: A
     TYPE(NODE) , POINTER    :: NEXT
END TYPE NOD
Victor Sigler
  • 23,243
  • 14
  • 88
  • 105
Hana
  • 101
  • 2
  • 2
    To store different functions inside your user-defined type, you probably want procedure/function pointers. See http://stackoverflow.com/questions/8612466/how-to-alias-a-function-name-in-fortran for an example. – M. S. B. Jan 31 '14 at 18:15
  • This is a great pdf about making a linked list in Fortran http://www.iag.uni-stuttgart.de/IAG/institut/abteilungen/numerik/images/4/4c/Pointer_Introduction.pdf – Fraser Feb 05 '14 at 09:04

0 Answers0