Skip to content

Fortran pre processing

urbanjost edited this page Jun 14, 2021 · 1 revision

Welcome to the prep wiki!

There is no standard preprocessor for Fortran (although there was one for a while). Regarding what is available see the Fortran Wiki section on preprocessors, and note compilers often provide some support for preprocessing.

My primary need for preprocessing is a desire to maintain my documentation easily within a single file along with the occasional system-dependent or compiler-dependent conditional compilation in a compiler-independent fashion. I found over an extended period of time using various other methods that nothing quite fit my needs so I made my own. I also wanted something that would only depend on having a Fortran compiler available and would take only a few minutes to master the basic usage of, for the benefit of others working with the same code base. In particular I needed something likely to be maintainable for a long time.

For others that prefer that model I selected several features from my previous preprocessors that are portable (the others call a lot of POSIX routines that are not available on several common platforms) and created prep(1). While I rework the code (some of it dates back a ways) I hope that others will find the results useful.

Any feedback is appreciated from letting me know if you find it useful to suggestions on what you liked or disliked to describing what solutions you use to providing coding improvements...

So feel free to drop a note here, (or update the Fortran Wiki discussion on preprocessing)!

Clone this wiki locally