4/29/2023 0 Comments Fortran double precision![]() ![]() I know it is used a lot, but I feel pain every time I see such solutions. ![]() Personally, I am an integralist of formalisms, and the fact that you are using some meta language to solve an issue with your selected language, well. The meta-language approach is another one. The tedious, formal one is the interface (which is a non solution, because you actually write a lot of identical code + boiler plate stuff for the interface). In the second case, of course, there is no chance to use the two previous approaches and you need a different route. Still, as I wrote, I would prefer the latter. In the first case it is possible to use both the compiler flags and the selected kinds approaches. It isn't clear if you want to be able to compile your code in both single and double precision versions or if you want to write a set of functions and/or subroutines for both. Honestly, it really depends from what you actually want to do. ![]() This is explained in this stackoverflow answer : We can #define MYTYPE and #include a template file which uses the MYTYPE macro. I found out a trick to remove repetition. Writing the interface becomes tedious due to the amount of repeated code. ![]() Switching between single and double precision in Fortran - CFD Online Discussion Forums ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |