I hope most readers will agree this is matter of style with Fortran. Were I to “code in anger,” I would
- align
CONTAINSwith(SUB)MODULE, - indent the body of all the major
constructsincludingASSOCIATE,BLOCK,IF, etc. and alsoFUNCTIONandSUBROUTINE - use 3 spaces for indentation; two spaces appears too low but four spaces is too wide for me,
- Have a space between
END,ELSE, etc. and following clause -END IF,ELSE IF,END ASSOCIATE, etc. - Limit uppercase letters to named constants,
To each their own!!
What I am waiting for (or planning to look into options for) is a “View” mode in IDEs where one can define/pick a style and Fortran code can then simply be viewed in that style regardless of how it is in the actual source content.