Conditional compilation

Conditional compilation was an optional module in the Fortran 95 standard and was mentioned in the 2003 and 2008 standards. I couldn’t find it in F2018. Has it really vanished?

Yes. No vendor (that I know of) implemented it. Many users have just used a Fortran-aware version of the C pre-processor. Generally just name your file with a capital “F” extension, as in myfile.F90 instead of myfile.f90.

Also look at fypp (Fypp documentation — Fypp 3.2 documentation). It is very handy, and much more powerful than coco was and the C pre-processor is.