Giter Club home page Giter Club logo

Comments (4)

kytrinyx avatar kytrinyx commented on September 24, 2024 1

Modern, FREE form.

It sounds like we should (if we can) enforce whatever minimal set of things that seem reasonable per modern, free form sensibilities here in the repository. For the people working through the track we should probably summarize what you wrote here: no broad consensus, some great suggestions, we recommend tending towards the modern style.

from fortran.

sentientmonkey avatar sentientmonkey commented on September 24, 2024

Still searching on linting for Fortran. There's nothing that I can tell that's inbuilt (other than the compiler itself), but there may be open source tools that can help here.

Style-wise, we'll likely stick to f90, free-form (vs. fixed), and a consistent spacing (probably 2 or 4 space indentation).

from fortran.

kytrinyx avatar kytrinyx commented on September 24, 2024

If there's no particular suggested library / best practice, I tend to recommend sticking with whatever small set of rules that seem to make sense. Your style-wise list sounds like a totally reasonable place to start.

from fortran.

zbeekman avatar zbeekman commented on September 24, 2024

Is there a style guide for Fortran?

No formalized or completely agreed upon convention. Some books have great suggestions though, like:

We sort of have a living document/discussion about "Best practices" at Fortran F/OSS Programmers: https://github.com/Fortran-FOSS-Programmers/Best_Practices. Also, Stefano, AKA @szahgi has one at: https://github.com/szaghi/zen-of-fortran
Here's yet another style guide: https://github.com/kramer314/fortran-style-guide

Are these styles encouraged or enforced?

Encourages... nothing is enforced. Tons of people still write in fixed format F77 😭

Are there any conventions that we should adopt on this track for the sake of consistency?

Modern, FREE form. I prefer 2 space indentation, but 4 is fine too. JUST DON'T USE TABS lol, no I'm not sure it matters, but I do need to go have a look at the standard again to see whether or not they are explicitly prohibited. I don't think they are but need to double check.

There are two tools that can do some style manipulation:

I haven't used them much.

Can we enforce these?

W/ GFortran you can get some style checking and linting with: -std=f2008 -W -Wall -Wextra -pedantic

Is there a linter? Are there many? Should we use one?

There are no good Free linters that I know of. The only one I can find that seems somewhat reasonable is https://github.com/ratnania/fortlint

Is there a common convention for filenames? If not, what should our convention be?

Standard is .f90 for free format and .f for fixed (or .F90 for files that need preprocessing, and .F for fixed files that need pre-processing. Unfortunately, however, there is not standardized pre-processor, so we should avoid all pre-processing.) Some people use .f03 or .f95 etc. but this enrages most other Fortran programmers.

from fortran.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.