Is it possible to write generic Fortran containers (e.g. a list or a binary tree) with a Fortran preprocessor such as fypp, similar to C++ templates? If so, how would that work?
Asked
Active
Viewed 65 times
1
-
Welcome, please take the [tour] and read [ask]. Yes it is certainly possible. I suppose there is an example in the manual but it is also probably possible to show something short here. CP2K seems to be using exactly that https://www.cp2k.org/dev:templates https://tcevents.chem.uzh.ch/event/12/contributions/57/attachments/36/106/presentation.pdf (slide 9) – Vladimir F Героям слава Jan 17 '22 at 21:18
-
Actually, I found a question that asks the same thing. I even provided a short FYPP example there some time ago. I linked some more questions that show related options. I suggest to always search first. – Vladimir F Героям слава Jan 17 '22 at 21:25
-
Thank you, looks like that's what I was looking for. – SarahJuliet1510 Jan 17 '22 at 22:35
-
If you have some specific problem when implementing the stuff in fypp, feel welcome to ask a question. – Vladimir F Героям слава Jan 18 '22 at 08:30